From 7198105eceff39cb71cd432312e0e9c82139d7b1 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Thu, 4 Jun 2009 00:52:29 +0100 Subject: [PATCH] wip. before remove sigstop based thing which is mad --- pctb/database | 30 ++++++++++++++++++++++++++++++ pctb/ocr.c | 9 +++++---- pctb/show-thing.tcl | 33 +++++++++++++++++++++++++++++---- 3 files changed, 64 insertions(+), 8 deletions(-) diff --git a/pctb/database b/pctb/database index e69de29..d5e7803 100644 --- a/pctb/database +++ b/pctb/database @@ -0,0 +1,30 @@ +0 1 57 +5 +7e0 +800 +800 +400 +fe0 +0 1 76 +5 +27c0 +2820 +2820 +2420 +1fe0 +1 1 16 +6 +640 +920 +920 +920 +fc0 +800 +1 1 35 +6 +830 +848 +888 +888 +708 +8 diff --git a/pctb/ocr.c b/pctb/ocr.c index 87bf808..43636f2 100644 --- a/pctb/ocr.c +++ b/pctb/ocr.c @@ -88,7 +88,8 @@ static void ocr_readdb(void) { eassert(feof(db)); } -static void callout_unknown(int w, int h, Pixcol cols[], int unk_l, int unk_r, +static void callout_unknown(int w, int h, Pixcol cols[], + int unk_l, int unk_r, int unk_ctx, const OcrResultGlyph *sofar, int nsofar) { int pfd[2], c, r,i, x,y; const OcrResultGlyph *s; @@ -108,7 +109,7 @@ static void callout_unknown(int w, int h, Pixcol cols[], int unk_l, int unk_r, r= close(pfd[0]); eassert(!r); resolver= fdopen(pfd[1],"w"); eassert(resolver); } - fprintf(resolver,"%d %d",unk_l,unk_r); + fprintf(resolver,"%d %d %d",unk_l,unk_r,unk_ctx); for (i=0, s=sofar; il,s->r,s->ctx); for (p=s->s; (c= *p); p++) { @@ -245,10 +246,10 @@ OcrResultGlyph *ocr(int w, int h, Pixcol cols[]) { } else { int rx; fprintf(debug," UNKNOWN"); - for (rx=lx+1; rx {} +#---------- main progrm ---------- proc test_main {} { global glyphsdone unk_l unk_r unk_context @@ -427,7 +434,25 @@ proc test_main {} { startup_cursor } +proc required {} { + global glyphsdone unk_l unk_r unk_context + + if {[gets stdin l]<0} { + if {[eof stdin]} { fconfigure stdin -blocking yes; exit 0 } + return + } + init_widgets + manyset [lrange $l 0 3] unk_l unk_r unk_context + set glyphsdone [lrange $l 3 end] + puts "SHOW-THING GOT $l" + + fileevent stdin readable {} + + read_xpm stdin + draw_glyphsdone + startup_cursor +} + read_database -init_widgets -test_main -recursor +fconfigure stdin -blocking no +fileevent stdin readable required -- 2.30.2