langerrorwindow.c

Go to the documentation of this file.
00001 
00002 /*  $Id: langerrorwindow.c 1199 2006-04-05 22:17:27Z karstenw $    */
00003 
00004 /******************************************************************************
00005 
00006     UserLand Frontier(tm) -- High performance Web content management,
00007     object database, system-level and Internet scripting environment,
00008     including source code editing and debugging.
00009 
00010     Copyright (C) 1992-2004 UserLand Software, Inc.
00011 
00012     This program is free software; you can redistribute it and/or modify
00013     it under the terms of the GNU General Public License as published by
00014     the Free Software Foundation; either version 2 of the License, or
00015     (at your option) any later version.
00016 
00017     This program is distributed in the hope that it will be useful,
00018     but WITHOUT ANY WARRANTY; without even the implied warranty of
00019     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00020     GNU General Public License for more details.
00021 
00022     You should have received a copy of the GNU General Public License
00023     along with this program; if not, write to the Free Software
00024     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00025 
00026 ******************************************************************************/
00027 
00028 #include "frontier.h"
00029 #include "standard.h"
00030 
00031 #include "bitmaps.h"
00032 #include "frontierconfig.h"
00033 #include "cursor.h"
00034 #include "font.h"
00035 #include "icon.h"
00036 #include "kb.h"
00037 #include "memory.h"
00038 #include "mouse.h"
00039 #include "ops.h"
00040 #include "popup.h"
00041 #include "resources.h"
00042 #include "quickdraw.h"
00043 #include "scrap.h"
00044 #include "strings.h"
00045 #include "textedit.h"
00046 #include "windowlayout.h"
00047 #include "frontierwindows.h"
00048 #include "shell.rsrc.h"
00049 #include "shellhooks.h"
00050 #include "lang.h"
00051 #include "langinternal.h"
00052 #include "cancoon.h"
00053 
00054 static void langerroractivate (boolean flactivate); /*forward*/
00055 
00056 typedef struct tylangerrorrecord {
00057     
00058     bigstring bserror; /*the error message*/
00059     
00060     bigstring bslocation; /*line number and character number of the error*/
00061     
00062     Rect iconrect; /*location of the icon, for mouse clicks, cursor adjustment*/
00063     
00064     Rect textrect; /*location of the error text, for updates, activates*/
00065     
00066     unsigned short lnum, cnum; /*location of error, passed to callback routine*/
00067     
00068     //callback errorcallback; /*routine to call when user hits script button*/
00069     
00070     //long errorrefcon; /*the info we pass him*/
00071     
00072     hdlerrorstack herrorstack;
00073     
00074     boolean flcallbackconsumed: 1; /*if true do nothing on script button hit*/
00075     
00076     boolean flactive: 1; /*determines whether message is drawn as active or inactive*/
00077     } tylangerrorrecord, *ptrlangerrorrecord, **hdllangerrorrecord;
00078     
00079 
00080 WindowPtr langerrorwindow = nil;
00081 
00082 hdlwindowinfo langerrorwindowinfo = nil;
00083 
00084 hdllangerrorrecord langerrordata = nil;
00085 
00086 static hdllangerrorrecord pendingerrordata = nil;
00087 
00088 static long inhibiterrorclear = 0; // 5.0.2b3
00089 
00090 
00091 
00092 static boolean langerrorgetwindowrect (Rect *rwindow) {
00093     
00094     return (ccgetwindowrect (ixlangerrorinfo, rwindow));
00095     } /*langerrorgetwindowrect*/
00096     
00097     
00098 static boolean langerrorclose (void) {
00099     
00100     ccsubwindowclose (langerrorwindowinfo, ixlangerrorinfo);
00101     
00102     return (true);  // even if we couldn't save our position
00103     } /*langerrorclose*/
00104 
00105 
00106 static boolean langerrorcopy (void) {
00107     
00108     /*
00109     9/11/92 dmb: users pointed out that this might be useful for reporting 
00110     bugs and problems...
00111     */
00112     
00113     bigstring bserror;
00114     Handle htext;
00115     
00116     copystring ((**langerrordata).bserror, bserror);
00117     
00118     if (!newtexthandle (bserror, &htext))
00119         return (false);
00120     
00121     return (shellsetscrap (htext, textscraptype, (shelldisposescrapcallback) disposehandle, nil));
00122     } /*langerrorcopy*/
00123 
00124 
00125 static boolean langerrornewwindow (void) {
00126     
00127     /*
00128     5.0.2b3 dmb: added inhibiterrorclear logic to make sure zooming doesn't 
00129     clear us
00130     
00131     6.2b6 AR: Extended inhibiterrorclear protection so that langerrorlcear doesn't interfer
00132     */
00133     
00134     hdlwindowinfo hw;
00135     WindowPtr w;
00136     bigstring bstitle;
00137     Rect rzoom, rwindow;
00138     hdlwindowinfo hparent;
00139     tylangerrorrecord **hdata;
00140     boolean fl = false;
00141     
00142     ++inhibiterrorclear; // protect us from other threads while we're still busy creating the window
00143     
00144     if (!shellgetfrontrootinfo (&hparent)) /*our parent is the frontmost root window*/
00145         goto exit;
00146             
00147     shellgetwindowcenter (hparent, &rzoom);
00148     
00149     if (pendingerrordata != nil) {
00150         
00151         hdata = pendingerrordata;
00152         
00153         pendingerrordata = nil;
00154         }
00155     else {
00156         
00157         if (!newclearhandle (sizeof (tylangerrorrecord), (Handle *) &hdata))
00158             goto exit;
00159         }
00160     
00161     langerrorgetwindowrect (&rwindow);
00162     
00163     getstringlist (langerrorlistnumber, langerrortitlestring, bstitle);
00164     
00165     if (!newchildwindow (idlangerrorconfig, hparent, &rwindow, &rzoom, bstitle, &w)) {
00166         
00167         disposehandle ((Handle) hdata);
00168         
00169         goto exit;
00170         }
00171         
00172     getwindowinfo (w, &hw);
00173     
00174     (**hw).hdata = (Handle) hdata;
00175     
00176     ccnewsubwindow (hw, ixlangerrorinfo);
00177     
00178     windowzoom (w);
00179 
00180     fl = true;
00181     
00182 exit:
00183     
00184     --inhibiterrorclear;
00185     
00186     return (fl);
00187     } /*langerrornewwindow*/
00188 
00189 
00190 static boolean langerrorsetrects (void) {
00191     
00192     register hdllangerrorrecord hle = langerrordata;
00193     Rect rcontent;
00194     Rect r;
00195     
00196     rcontent = (**langerrorwindowinfo).contentrect;
00197     
00198     r = rcontent;
00199     
00200     r.top = r.top + windowmargin;
00201     
00202     r.bottom = r.top + iconrectheight;
00203     
00204     r.right = r.right - windowmargin;
00205     
00206     r.left = r.right - iconrectwidth;
00207     
00208     (**hle).iconrect = r; 
00209     
00210     r.right = r.left - windowmargin;
00211     
00212     r.left = rcontent.left + windowmargin;
00213     
00214     r.bottom = rcontent.bottom - windowmargin;
00215     
00216     (**hle).textrect = r;
00217     
00218     return (true);
00219     } /*langerrorsetrects*/
00220 
00221 
00222 static void langerrordrawicon (boolean flpressed) {
00223     
00224     register hdllangerrorrecord hle = langerrordata;
00225     register boolean flenabled;
00226     bigstring bs;
00227     
00228     flenabled = (**hle).flactive && !(**hle).flcallbackconsumed;
00229     
00230     getstringlist (langerrorlistnumber, scripticonstring, bs);
00231     
00232     drawlabeledwindoidicon ((**hle).iconrect, bs, flenabled, flpressed);
00233     } /*langerrordrawicon*/
00234 
00235     
00236 static void langerrorframetext (void) {
00237     
00238     register hdllangerrorrecord hle = langerrordata;
00239     
00240     pushpen ();
00241     
00242     if (!(**hle).flactive) 
00243         setgraypen ();
00244     
00245     framerect ((**hle).textrect);
00246     
00247     poppen ();
00248     } /*langerrorframetext*/
00249 
00250 static void langerrordrawtext (boolean flbitmap) {
00251     
00252     /*
00253     4/18/91 dmb: straighten fancy quotes when displaying in geneva 9
00254     */
00255     
00256     register hdllangerrorrecord hle = langerrordata;
00257     register hdlwindowinfo hw = langerrorwindowinfo;
00258     Rect rbox;
00259     bigstring bserror;
00260     short font, size;
00261     
00262     copystring ((**hle).bserror, bserror);
00263     
00264     font = (**hw).defaultfont;
00265     
00266     size = (**hw).defaultsize;
00267     
00268     if ((font == geneva) && (size <= 9)) { /*get rid of fancy quotes; nasty in this font*/
00269         
00270         stringreplaceall ('', '\'', bserror); /*straighten contractions*/
00271         
00272         if (!stringfindchar ('"', bserror)) { /*don't already have straight quotes*/
00273             
00274             stringreplaceall ('', '"', bserror);
00275             
00276             stringreplaceall ('', '"', bserror);
00277             }
00278         }
00279     
00280     rbox = (**hle).textrect;
00281     
00282     insetrect (&rbox, 3, 3);
00283     
00284     if (flbitmap)
00285         flbitmap = openbitmap (rbox, langerrorwindow);
00286     
00287     edittwostringbox (bserror, zerostring, rbox, font, size);
00288     
00289     /*
00290     edittwostringbox (bserror, (**hle).bslocation, rbox, font, size);
00291     */
00292     
00293     if (flbitmap)
00294         closebitmap (langerrorwindow);
00295     } /*langerrordrawtext*/
00296 
00297 
00298 static void langerrorupdate (void) {
00299     
00300     langerrorsetrects ();
00301     
00302     /*
00303     eraserect ((**hw).contentrect);
00304     */
00305     #if TARGET_API_MAC_CARBON == 1
00306         drawthemeborder ((**langerrordata).textrect, (**langerrorwindowinfo).contentrect);
00307     #endif
00308 
00309     langerrordrawicon (false);
00310     
00311     #ifdef gray3Dlook
00312         pushbackcolor (&whitecolor);
00313 
00314         eraserect ((**langerrordata).textrect);
00315     #endif
00316     
00317 //  framerect ((**langerrordata).textrect);
00318     
00319     langerrorframetext ();
00320         
00321     langerrordrawtext (false);
00322 
00323     //Timothy Paustian 10/5/00
00324     //For some reason the buffer is not being flushed for this window.
00325     //This should fix it.
00326     #if TARGET_API_MAC_CARBON == 1
00327         QDFlushPortBuffer (GetWindowPort (langerrorwindow), nil);
00328     #endif
00329 
00330     #ifdef gray3Dlook
00331         popbackcolor ();
00332     #endif
00333     } /*langerrorupdate*/
00334 
00335 
00336 static void langerroractivate (boolean flactivate) {
00337     
00338     (**langerrordata).flactive = flactivate;
00339     
00340     /*
00341     return (langerrorupdate ());
00342     */
00343     
00344     langerrorsetrects ();
00345     
00346     langerrorframetext ();
00347     
00348     #if TARGET_API_MAC_CARBON == 1
00349         drawthemeborder ((**langerrordata).textrect, (**langerrorwindowinfo).contentrect);
00350     #endif
00351 
00352     langerrordrawicon (false);
00353     } /*langerroractivate*/
00354 
00355 
00356 static boolean langerrorfindwindow (WindowPtr *w, hdllangerrorrecord *hdata) {
00357     
00358     hdlwindowinfo hinfo;
00359     
00360     return (shellfindwindow (idlangerrorconfig, w, &hinfo, (Handle *) hdata));
00361     } /*langerrorfindwindow*/
00362 
00363 
00364 boolean clearlangerrordialog (void) {
00365     
00366     WindowPtr w;
00367     hdllangerrorrecord hle;
00368     
00369     if (inhibiterrorclear == 0)
00370         if (langerrorfindwindow (&w, &hle))
00371             shellclosewindow (w);
00372     
00373     return (true);
00374     } /*clearlangerrordialog*/
00375 
00376 
00377 static boolean langerrorset (bigstring bserror, bigstring bslocation) {
00378 #pragma unused (bslocation)
00379 
00380     /*
00381     2.1b2 dmb: if the langerror window isn't already there, don't try to 
00382     create it now -- the heap or stack may be dangerously low.  instead, 
00383     just build the data structure and wait for langerrorflush to be called
00384     */
00385     
00386     hdllangerrorrecord hle;
00387     boolean flalreadythere;
00388     hdlerrorstack herrorstack;
00389     register hdlerrorstack hs;
00390     register boolean flcallbackconsumed;
00391     WindowPtr w;
00392     
00393     flalreadythere = langerrorfindwindow (&w, &hle);
00394     
00395     if (flalreadythere) {
00396         
00397         ++inhibiterrorclear; /*6.1b18 AR: make sure other threads don't clear the error window while
00398                                             we release the thread globals (only relevant for Win32)*/
00399     
00400         shellpushglobals (w);  /*dmb 9/20/90: set langerror.c globals*/
00401         
00402         shellbringtofront (langerrorwindowinfo);
00403 
00404         --inhibiterrorclear;
00405         }
00406     else {
00407         
00408         if (!newclearhandle (sizeof (tylangerrorrecord), (Handle *) &pendingerrordata)) {
00409             
00410             sysbeep (); // some kind of feedback
00411             
00412             return (false);
00413             }
00414         
00415         hle = pendingerrordata;
00416         
00417         shellforcebackgroundtask (); /*mimimize delay before window opens*/
00418         }
00419     
00420     copystring (bserror, (**hle).bserror);
00421     
00422     /*
00423     copystring (bslocation, (**hle).bslocation);
00424     */
00425     
00426     copyhandle ((Handle) langcallbacks.scripterrorstack, (Handle *) &herrorstack);
00427     
00428     hs = herrorstack; /*copy into register*/
00429     
00430     disposehandle ((Handle) (**hle).herrorstack); /*toss old error info*/
00431     
00432     (**hle).herrorstack = hs;
00433     
00434     if ((hs == nil) || ((**hs).toperror == 0))
00435         flcallbackconsumed = true;
00436     else
00437         flcallbackconsumed = (**hs).stack [(**hs).toperror - 1].errorcallback == nil;
00438     
00439     (**hle).flcallbackconsumed = flcallbackconsumed;
00440     
00441     (**hle).lnum = ctscanlines;
00442     
00443     (**hle).cnum = ctscanchars;
00444     
00445     if (flalreadythere) {
00446         
00447         langerrorupdate ();
00448         
00449         shellpopglobals ();
00450         }
00451 
00452     return (true);
00453     } /*langerrorset*/
00454 
00455 
00456 static boolean langerrordispose (void) {
00457     
00458     /*
00459     11/21/91 dmb: fixed memory leak; must dispose herrorstack
00460     */
00461     
00462     register hdllangerrorrecord hle = langerrordata;
00463     
00464     disposehandle ((Handle) (**hle).herrorstack);
00465     
00466     disposehandle ((Handle) hle);
00467     
00468     return (true);
00469     } /*langerrordispose*/
00470     
00471 
00472 static boolean langerroradjustcursor (Point pt) {
00473         
00474     if (pointinrect (pt, (**langerrordata).iconrect)) {
00475         
00476         if (!(**langerrordata).flcallbackconsumed) {
00477         
00478             setcursortype (cursorisgo);
00479             
00480             return (true);
00481             }
00482         }
00483         
00484     setcursortype (cursorisarrow);
00485     
00486     return (true);
00487     } /*langerroradjustcursor*/
00488 
00489 
00490 static void langerrorbuttonhit (void) {
00491     
00492     register hdllangerrorrecord hle = langerrordata;
00493     register hdlerrorstack hs = (**hle).herrorstack;
00494     tyerrorrecord errorrecord = (**hs).stack [(**hs).toperror - 1];
00495     
00496     (*errorrecord.errorcallback) (errorrecord.errorrefcon, (**hle).lnum, (**hle).cnum, nil, nil);
00497     } /*langerrorbuttonhit*/
00498 
00499 
00500 #ifdef flnewfeatures    // flstacktrace
00501 
00502 static boolean langerrorpopupselect (hdlmenu hmenu, short itemselected) {
00503 #pragma unused (hmenu)
00504 
00505     register hdlerrorstack hs = (**langerrordata).herrorstack;
00506     short ix;
00507     tyerrorrecord *pe;
00508     
00509     if (hs == nil)
00510         return (false);
00511     
00512     ix = (**hs).toperror - itemselected;
00513     
00514     pe = &(**hs).stack [ix];
00515     
00516     return ((*(*pe).errorcallback) ((*pe).errorrefcon, (*pe).errorline, (*pe).errorchar, nil, nil));
00517     } /*langerrorpopupselect*/
00518 
00519 
00520 static boolean langerrorfillerrorpopup (hdlmenu hmenu, short *checkeditem) {
00521     
00522     register hdlerrorstack hs = (**langerrordata).herrorstack;
00523     register short ix;
00524     register short ixtop;
00525     hdlhashtable htable;
00526     bigstring bsname;
00527     boolean flenabled;
00528     
00529     if (hs == nil)
00530         return (false);
00531     
00532     ixtop = (**hs).toperror;
00533     
00534     for (ix = ixtop - 1; ix >= 0; --ix) {
00535         
00536         tyerrorrecord *pe = &(**hs).stack [ix];
00537         
00538         if ((*pe).errorcallback == nil ||
00539             !(*(*pe).errorcallback) ((*pe).errorrefcon, 0, 0, &htable, bsname)) {
00540         
00541             langgetstringlist (anomynousthreadstring, bsname); 
00542             
00543             flenabled = false;
00544             }
00545         else {
00546             flenabled = true;
00547             }
00548         
00549         if (!pushpopupitem (hmenu, bsname, flenabled, 0)) /*terminate visit on error*/
00550             return (false);
00551         }
00552     
00553     *checkeditem = -1;
00554     
00555     return (true);
00556     } /*langerrorfillerrorpopup*/
00557 
00558 static boolean langerrorpopupmenu (void) {
00559 
00560     /*
00561     we're called after a tracking delay. return true to indicate that 
00562     we've handled the mouse click
00563     */
00564     
00565     register hdllangerrorrecord hle = langerrordata;
00566     register hdlerrorstack hs = (**hle).herrorstack;
00567     Rect r;
00568     
00569     #ifdef flnewfeatures    // flstacktrace
00570         r = (**hle).iconrect;
00571         
00572         if (hs != nil /* && (**hs).toperror > 1*/) {
00573         
00574             r.top = r.bottom - 10;
00575             
00576             popupmenuhit (r, true, &langerrorfillerrorpopup, &langerrorpopupselect);
00577             }
00578     #endif
00579     
00580     return (true);
00581     } /*langerrorpopupmenu*/
00582 
00583 #endif
00584 
00585 
00586 static boolean langerrormousedown (Point pt, tyclickflags flags) {
00587 #pragma unused (flags)
00588 
00589     /*
00590     7/16/90 DW: wired off the consumption of the error callback, if you want
00591     it back on, just switch on the code that's commented out, and the script
00592     icon will go dim, the cursor adjustment won't happen, and no mouseclicks
00593     will be handled for clicking on the script button.
00594     
00595     4.1b4 dmb: use custom tracking code so we can popup a menu after mouse has
00596     been down a fraction of a second.
00597     */
00598     
00599     register hdllangerrorrecord hle = langerrordata;
00600     Rect r;
00601     boolean flinrectnow, flwasinrect;
00602     boolean flconsumed = false;
00603     unsigned long timemoved;
00604     short threshhold = getmousedoubleclicktime () * 2 / 3;
00605     
00606     if ((**hle).flcallbackconsumed)
00607         return (false);
00608     
00609     r = (**hle).iconrect;
00610     
00611     if (pointinrect (pt, r)) {
00612         
00613         setcursortype (cursorisarrow); /*get rid of funny appendage*/
00614         
00615         langerrordrawicon (true); /*show icon in depressed state*/
00616         
00617     //  if (!mousetrack (r, langerrordrawicon)) /*if false, mouse didn't stay in rectangle*/
00618     //      return (false);
00619         
00620         flwasinrect = true; /*at least for the first iteration of loop*/
00621         
00622         timemoved = gettickcount ();
00623         
00624         while (mousestilldown ()) { /*stay in holding pattern*/
00625         
00626             getmousepoint (&pt);
00627             
00628             flinrectnow = pointinrect (pt, r);
00629             
00630             if (flinrectnow != flwasinrect) {
00631             
00632                 langerrordrawicon (flinrectnow);
00633                 
00634                 timemoved = gettickcount ();
00635                 }
00636             else if (flinrectnow && gettickcount () - timemoved > (unsigned) threshhold) {
00637                 
00638                 langerrorpopupmenu ();
00639                 
00640                 flconsumed = true;
00641                 }
00642             
00643             flwasinrect = flinrectnow;
00644             } /*while*/
00645         
00646         if (flwasinrect) {
00647         
00648             langerrordrawicon (false); /*show icon in un-depressed state*/
00649             
00650             if (!flconsumed)
00651                 langerrorbuttonhit ();
00652             }
00653         }
00654     
00655     return (true);
00656     } /*langerrormousedown*/
00657 
00658 
00659 static boolean langerrorkeystroke (void) {
00660     
00661     /*
00662     handle the enter key to dispatch the error routine, if not consumed
00663     */
00664     
00665     register hdllangerrorrecord hle = langerrordata;
00666     
00667     if (keyboardstatus.chkb != chenter)
00668         return (false);
00669     
00670     if ((**hle).flcallbackconsumed)
00671         return (false);
00672     
00673     langerrordrawicon (true);
00674     
00675     delayticks (8); /*so you can actually see the button down*/
00676     
00677     langerrordrawicon (false);
00678     
00679     langerrorbuttonhit ();
00680     
00681     return (true);
00682     } /*langerrorkeystroke*/
00683 
00684 
00685 boolean langerrordialog (bigstring bsmsg, ptrvoid refcon) {
00686 #pragma unused (refcon)
00687 
00688     unsigned short savedlines, savedchars; 
00689     
00690     if (isemptystring (bsmsg)) /*don't post empty messages -- scipterrror ("") relies on this*/
00691         return (true);
00692     
00693     savedlines = ctscanlines; savedchars = ctscanchars; /*dialogs allow background tasks*/
00694     
00695     langerrorset (bsmsg, zerostring); /*bslocation*/
00696     
00697     ctscanlines = savedlines; ctscanchars = savedchars; /*restore*/
00698     
00699     return (true);
00700     } /*langerrordialog*/
00701 
00702 
00703 boolean langerrorflush (void) {
00704     
00705     /*
00706     if there's a lang error pending, show the window now
00707     
00708     2.1b2 dmb: added this routine along w/change in langerrorset to make 
00709     error reporting more reliable.
00710     */
00711     
00712     if (pendingerrordata == nil)
00713         return (false);
00714     
00715     return (langerrornewwindow ());
00716     } /*langerrorflush*/
00717 
00718 
00719 #ifdef flnewfeatures
00720 
00721 hdlerrorstack langerrorgetstack (void) {
00722     
00723     WindowPtr w;
00724     hdllangerrorrecord hle;
00725     
00726     if (!langerrorfindwindow (&w, &hle))
00727         return (nil);
00728     
00729     return ((**hle).herrorstack);
00730     } /*langerrorgetstack*/
00731 
00732 #endif
00733 
00734 
00735 static boolean langerrordirtyhook (void) {
00736     
00737     /*
00738     this is where we hook into events that dirty things.  if a langerror 
00739     window is open, we gray out its script button.  the theory is that we
00740     can't handle the world changing **that** much, and as soon as the user
00741     does some editing or cursor moving, we don't want to take any chances
00742     on the callback routine and the data linked into the langerror window.
00743     
00744     7/20/90 DW: it's important to keep the work to an absolute minimum 
00745     when the window is open because the system really bogs down if you
00746     constantly update the script icon in the langerror window.
00747     */
00748     
00749     WindowPtr w;
00750     hdllangerrorrecord hle;
00751     
00752     if (flscriptrunning) /*don't disable icon if dirtyness originates from a script*/
00753         return (true);
00754     
00755     if (langerrorfindwindow (&w, &hle)) { /*window is open, something to do*/
00756         
00757         if (!hle || (**hle).flcallbackconsumed) /*7/20/90 DW: quick exit*/
00758             return (true);
00759         
00760         shellpushglobals (w);
00761         
00762         (**langerrordata).flcallbackconsumed = true;
00763         
00764         /*
00765         langerrorupdate ();
00766         */
00767         
00768         langerrorsetrects ();
00769         
00770         langerrordrawicon (false);
00771         
00772         shellpopglobals ();
00773         }
00774     
00775     return (true);
00776     } /*langerrordirtyhook*/
00777     
00778 
00779 boolean langerrorstart (void) {
00780     
00781     /*
00782     set up callback routines record, and link our data into the shell's 
00783     data structure.
00784     */
00785     
00786     ptrcallbacks langerrorcallbacks;
00787     register ptrcallbacks cb;
00788     
00789     langcallbacks.errormessagecallback = &langerrordialog;
00790     
00791     langcallbacks.clearerrorcallback = &clearlangerrordialog;
00792     
00793     shellnewcallbacks (&langerrorcallbacks);
00794     
00795     cb = langerrorcallbacks; /*copy into register*/
00796     
00797     loadconfigresource (idlangerrorconfig, &(*cb).config);
00798     
00799     (*cb).configresnum = idlangerrorconfig;
00800     
00801     (*cb).windowholder = &langerrorwindow;
00802     
00803     (*cb).dataholder = (Handle *) &langerrordata;
00804     
00805     (*cb).infoholder = &langerrorwindowinfo;
00806     
00807     (*cb).updateroutine = &langerrorupdate;
00808     
00809     (*cb).activateroutine = &langerroractivate;
00810     
00811     (*cb).adjustcursorroutine = &langerroradjustcursor;
00812     
00813     (*cb).mouseroutine = &langerrormousedown;
00814     
00815     (*cb).keystrokeroutine = &langerrorkeystroke;
00816     
00817     (*cb).disposerecordroutine = &langerrordispose;
00818     
00819     (*cb).closeroutine = &langerrorclose;
00820     
00821     (*cb).cutroutine = &langerrorcopy;
00822     
00823     (*cb).copyroutine = &langerrorcopy;
00824     
00825     shellpushdirtyhook (&langerrordirtyhook);
00826     
00827     return (true);
00828     } /*langerrorstart*/
00829 
00830 
00831 
00832 

Generated on Wed May 31 18:19:51 2006 for frontierkernel 10.1.10a by  doxygen 1.4.6