[q-lang-cvs] qcalc calclib.q,1.48,1.49 qcalc.q,1.205,1.206
Brought to you by:
agraef
From: Albert G. <ag...@us...> - 2007-11-30 21:47:13
|
Update of /cvsroot/q-lang/qcalc In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv28523 Modified Files: calclib.q qcalc.q Log Message: bugfixes Index: qcalc.q =================================================================== RCS file: /cvsroot/q-lang/qcalc/qcalc.q,v retrieving revision 1.205 retrieving revision 1.206 diff -C2 -d -r1.205 -r1.206 *** qcalc.q 30 Nov 2007 13:42:15 -0000 1.205 --- qcalc.q 30 Nov 2007 21:47:07 -0000 1.206 *************** *** 2792,2795 **** --- 2792,2798 ---- private yywin KEY MSG; taskwindow_gui (I,J) () () + = local (mytaskwindow_gui (I,J)) if is_global; + = mytaskwindow_gui (I,J) otherwise; + mytaskwindow_gui (I,J) = qt X "setBackgroundMode" (qt_val "Qt" "PaletteBase") || send_expr '(yywin (I,J) ID) || Index: calclib.q =================================================================== RCS file: /cvsroot/q-lang/qcalc/calclib.q,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** calclib.q 30 Nov 2007 13:04:35 -0000 1.48 --- calclib.q 30 Nov 2007 21:47:07 -0000 1.49 *************** *** 87,90 **** --- 87,92 ---- var YYDATA = ref emptyhdict, YYKEY = ref (); + var YYTASKS = ref emptyhdict, YYTLD = ref emptyhdict; + public yymain, yyval KEY, yyset KEY VAL, yyclear KEY, yytask KEY MSG, yywin KEY MSG, yyaction KEY, yyclearaction KEY; *************** *** 92,101 **** private yyloop, yyout X, yyerror X; - private task_index; - /* index and friends. */ ! index = (I,J) where (I,J) = get YYKEY; ! = (I,J) where (I,J) = task_index; row = I where (I,J) = index; column = J where (I,J) = index; --- 94,101 ---- private yyloop, yyout X, yyerror X; /* index and friends. */ ! index = (I,J) where (I,J|_) = get YYTLD!thread_no this_thread; ! = (I,J) where (I,J) = get YYKEY; row = I where (I,J) = index; column = J where (I,J) = index; *************** *** 190,194 **** label (S:String,A:String) = printf "\f+++ Label: %s %s\n" (str (I,J),str (S,A)) || ! flush || yyset (I,J) S || S where (I,J) = get YYKEY; --- 190,194 ---- label (S:String,A:String) = printf "\f+++ Label: %s %s\n" (str (I,J),str (S,A)) || ! flush || yyset (I,J) S where (I,J) = get YYKEY; *************** *** 202,206 **** pixmap (S:String,A:String,B:Int) = printf "\f+++ Pixmap: %s %s\n" (str (I,J),str (S,A,B)) || ! flush || yyset (I,J) S || S where (I,J) = get YYKEY; --- 202,206 ---- pixmap (S:String,A:String,B:Int) = printf "\f+++ Pixmap: %s %s\n" (str (I,J),str (S,A,B)) || ! flush || yyset (I,J) S where (I,J) = get YYKEY; *************** *** 361,371 **** printf "\f+++ Actionbutton: %s %s\n" (str (I,J),str (S,ICON,str INIT)) || ! flush || yyset (I,J) INIT || INIT where (I,J) = get YYKEY; /* The task button. */ - var YYTASKS = ref emptyhdict, YYTLD = ref emptyhdict; - special task_expr_params ~Xs X; --- 361,369 ---- printf "\f+++ Actionbutton: %s %s\n" (str (I,J),str (S,ICON,str INIT)) || ! flush || yyset (I,J) INIT where (I,J) = get YYKEY; /* The task button. */ special task_expr_params ~Xs X; *************** *** 382,386 **** task_input = SEM where (I,J,SEM:Semaphore|_) = get YYTLD!thread_no this_thread; - task_index = (I,J) where (I,J|_) = get YYTLD!thread_no this_thread; private begin_task ARGS, end_task ARGS, fini_task X ARGS; --- 380,383 ---- *************** *** 390,393 **** --- 387,399 ---- = taskbutton (S,false) X; taskbutton (S:String,INIT:Bool) X + where (I,J|_) = get YYTLD!thread_no this_thread, + (H:Thread,SEM,'_) = get YYTASKS!(I,J): + // request by a task to replace itself with a new task + = // update the button + do (setval (I,J)) [S,INIT] || + // update the task data + YYTASKS := insert (get YYTASKS) (I,J;H,SEM,'X) || + // send the startup message and tail-execute the new thread + post SEM INIT || yyset (I,J) INIT || X; where (I,J) = get YYKEY: // update existing task *************** *** 395,400 **** // start up a new task = YYTASKS := insert (get YYTASKS) (I,J;H,SEM,'X) || ! post SEM INIT || ! yyset (I,J) INIT || INIT where SEM:Semaphore = semaphore, H:Thread = --- 401,405 ---- // start up a new task = YYTASKS := insert (get YYTASKS) (I,J;H,SEM,'X) || ! post SEM INIT || yyset (I,J) INIT where SEM:Semaphore = semaphore, H:Thread = *************** *** 403,415 **** thread (begin_task (I,J,SEM) || do_task X (I,J,SEM) || end_task (I,J,SEM)); - if active H where (I,J|_) = get YYTLD!thread_no this_thread, - (H:Thread,SEM,'_) = get YYTASKS!(I,J): - // request by a task to replace itself with a new task - = // update the button - do (setval (I,J)) [S,INIT] || - // update the task data - YYTASKS := insert (get YYTASKS) (I,J;H,SEM,'X) || - // send the startup message and tail-execute the new thread - post SEM INIT || yyset (I,J) INIT || X; /* Watchdogs for the beginning and end of a task. */ --- 408,411 ---- *************** *** 449,452 **** --- 445,451 ---- taskwindow X + where (I,J|_) = get YYTLD!thread_no this_thread: + // request by a task to replace itself with a new task + = yyset (I,J) () || X; where (I,J) = get YYKEY: // update existing task *************** *** 454,466 **** // start up a new task = YYTASKS := insert (get YYTASKS) (I,J;H,SEM) || ! yyset (I,J) () || () where SEM:Semaphore = semaphore, H:Thread = printf "\f+++ Taskwindow: %s\n" $ str (I,J) || thread (init_task (I,J,SEM) || do_task X (I,J,SEM)); - if active H where (I,J|_) = get YYTLD!thread_no this_thread, - (H:Thread,SEM) = get YYTASKS!(I,J): - // request by a task to replace itself with a new task - = yyset (I,J) () || X; /* Our actual window id is sent by the parent process via the SEM semaphore --- 453,461 ---- // start up a new task = YYTASKS := insert (get YYTASKS) (I,J;H,SEM) || ! yyset (I,J) () where SEM:Semaphore = semaphore, H:Thread = printf "\f+++ Taskwindow: %s\n" $ str (I,J) || thread (init_task (I,J,SEM) || do_task X (I,J,SEM)); /* Our actual window id is sent by the parent process via the SEM semaphore *************** *** 494,499 **** yyset KEY VAL = //printf "INTERP: SET %s := %s\n" (cellstr KEY,str VAL) || flush || ! YYDATA := insert (get YYDATA) (KEY,VAL) || YYKEY := () || VAL ! where VAL = YYKEY := KEY || VAL; yyclear KEY = //printf "INTERP: CLEAR %s\n" (cellstr KEY) || flush || --- 489,493 ---- yyset KEY VAL = //printf "INTERP: SET %s := %s\n" (cellstr KEY,str VAL) || flush || ! YYDATA := insert (get YYDATA) (KEY,VAL) || VAL; yyclear KEY = //printf "INTERP: CLEAR %s\n" (cellstr KEY) || flush || *************** *** 532,539 **** where (H,SEM,'X) = get YYTASKS!(I,J): // thread is still alive and kicking; pass the message ! = post SEM B if isthread H and then active H; // thread has terminated and is activated again, restart it = YYTASKS := insert (get YYTASKS) (I,J;H,SEM,'X) || ! post SEM B where SEM:Semaphore = semaphore, H:Thread = --- 526,533 ---- where (H,SEM,'X) = get YYTASKS!(I,J): // thread is still alive and kicking; pass the message ! = post SEM $ yyset (I,J) B if isthread H and then active H; // thread has terminated and is activated again, restart it = YYTASKS := insert (get YYTASKS) (I,J;H,SEM,'X) || ! post SEM $ yyset (I,J) B where SEM:Semaphore = semaphore, H:Thread = *************** *** 543,547 **** // thread has terminated and is deactivated, put it in limbo = YYTASKS := insert (get YYTASKS) (I,J;(),(),'X) || ! YYTLD := delete (get YYTLD) (thread_no H) if isthread H; --- 537,541 ---- // thread has terminated and is deactivated, put it in limbo = YYTASKS := insert (get YYTASKS) (I,J;(),(),'X) || ! YYTLD := delete (get YYTLD) (thread_no H) || yyset (I,J) B if isthread H; *************** *** 551,555 **** where (H,SEM,'_) = get YYTASKS!(I,J): // task is alive and kicking, update it with the new data ! = post SEM '(taskbutton (S,INIT) X) || INIT where 'X = subst 'X if isthread H and then active H; --- 545,549 ---- where (H,SEM,'_) = get YYTASKS!(I,J): // task is alive and kicking, update it with the new data ! = post SEM '(taskbutton (S,INIT) X) || yyset (I,J) INIT where 'X = subst 'X if isthread H and then active H; *************** *** 574,581 **** /* Process task window resize messages. */ ! yywin (I:Int,J:Int) (W:Int,H:Int) where (H,SEM) = get YYTASKS!(I,J): // thread is still alive and kicking; pass the message ! = post SEM (W,H) if isthread H and then active H; /* Update a task window with new data. */ --- 568,575 ---- /* Process task window resize messages. */ ! yywin (I:Int,J:Int) (WD:Int,HT:Int) where (H,SEM) = get YYTASKS!(I,J): // thread is still alive and kicking; pass the message ! = post SEM (WD,HT) if isthread H and then active H; /* Update a task window with new data. */ *************** *** 584,588 **** where (H,SEM) = get YYTASKS!(I,J): // task is alive and kicking, update it with the new data ! = post SEM '(taskwindow X) || () where 'X = subst 'X if isthread H and then active H; --- 578,582 ---- where (H,SEM) = get YYTASKS!(I,J): // task is alive and kicking, update it with the new data ! = post SEM '(taskwindow X) || yyset (I,J) () where 'X = subst 'X if isthread H and then active H; |