menueditor.h

Go to the documentation of this file.
00001 
00002 /*  $Id: menueditor.h 355 2005-01-11 22:48:55Z andreradke $    */
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 #define menueditorinclude /*so other includes can tell if we've been loaded*/
00029 
00030 
00031 #ifndef shelltypesinclude
00032     
00033     #include "shelltypes.h"
00034 
00035 #endif
00036 
00037 
00038 #ifndef dbinclude
00039 
00040     #include "db.h"
00041 
00042 #endif
00043 
00044 
00045 #ifndef opinclude
00046 
00047     #include "op.h"
00048 
00049 #endif
00050 
00051 
00052 #ifndef menubarinclude
00053 
00054     #include "menubar.h"
00055 
00056 #endif
00057 
00058 
00059 #ifndef langexternalinclude
00060 
00061     #include "langexternal.h"
00062 
00063 #endif
00064 
00065 
00066 #define menuoutlineitem 1 /*the menubar outline*/
00067 
00068 #define menucmdkeypopupitem 2 /*popup menu with cmdkeys*/
00069 
00070 #define menumessageitem 3 /*where the message goes in this window*/
00071 
00072 #define menucmdkeyitem 4 /*displays cmd-key equiv for current menu item*/
00073 
00074 #define menuscriptitem 5 /*the script button*/
00075 
00076 #ifdef MACVERSION
00077     #if TARGET_API_MAC_CARBON == 1
00078         #define cmdkeypopupwidth 60
00079     #else
00080         #define cmdkeypopupwidth 50
00081     #endif
00082 #endif
00083 #ifdef WIN95VERSION
00084     #define cmdkeypopupwidth 60
00085 #endif
00086 
00087 typedef struct tysavedmenuinfo { 
00088     
00089     short versionnumber; /*this structure is saved on disk*/
00090     
00091     dbaddress adroutline; /*where the menubar outline is stored in the database*/
00092     
00093     short vertmin, vertmax, vertcurrent; /*remember the state of the scrollbar*/
00094     
00095     diskrect scriptwindowrect; /*the saved position for the script window*/
00096     
00097     short flags;
00098     
00099     short menuactivelayer;
00100     
00101     short lnumcursor;
00102     
00103     diskfontstring defaultscriptfontname; /*new scripts start in this font*/
00104     
00105     short defaultscriptfontsize; /*and this size*/ 
00106     
00107     diskrect menuwindowrect; /*the window size and position last time it was open*/
00108     
00109     char waste [42]; /*room to grow*/
00110     } tysavedmenuinfo;
00111 
00112 #ifdef MACVERSION
00113     #define flautosmash_mask 0x8000
00114 #endif
00115 
00116 #ifdef WIN95VERSION
00117     #define flautosmash_mask 0x0080
00118 #endif
00119 
00120 typedef struct tyOLD42savedmenuinfo { 
00121     
00122     short versionnumber; /*this structure is saved on disk*/
00123     
00124     dbaddress adroutline; /*where the menubar outline is stored in the database*/
00125     
00126     short vertmin, vertmax, vertcurrent; /*remember the state of the scrollbar*/
00127     
00128     diskrect scriptwindowrect; /*the saved position for the script window*/
00129     
00130     boolean flautosmash: 1;
00131     
00132     short menuactivelayer;
00133     
00134     short lnumcursor;
00135     
00136     diskfontstring defaultscriptfontname; /*new scripts start in this font*/
00137     
00138     short defaultscriptfontsize; /*and this size*/ 
00139     
00140     diskrect menuwindowrect; /*the window size and position last time it was open*/
00141     
00142     char waste [42]; /*room to grow*/
00143     } tyOLD42savedmenuinfo;
00144 
00145 
00146 #if flruntime
00147 
00148     typedef struct tymenurecord {
00149         
00150         hdloutlinerecord menuoutline; /*the display of the menubar structure*/
00151         
00152         tysavedmenuinfo menuinfo;
00153         } tymenurecord, *ptrmenurecord, **hdlmenurecord;
00154 
00155 #else
00156 
00157     typedef struct tymenurecord {
00158         
00159         hdloutlinerecord menuoutline; /*the display of the menubar structure*/
00160         
00161         dbaddress adroutline; /*where the menubar outline is stored in the database*/
00162         
00163         hdlmenubarstack hmenustack; /*menubar.c's data structure -- the user's menus*/
00164         
00165         Rect menuwindowrect; /*the window size and position last time it was open*/
00166         
00167         short menuactiveitem; /*which text item is the active one?*/
00168         
00169         short menuactivelayer; /*which layer is active?*/
00170         
00171         WindowPtr scriptwindow; /*the window that the script is displayed in, might be nil*/
00172         
00173         Rect scriptwindowrect; /*the saved window position for the script window*/
00174         
00175         Rect menuoutlinerect; /*the current menubar outline rect*/
00176         
00177         Rect cmdkeypopuprect; /*the cmdkey popup rect*/
00178         
00179         Rect iconrect; /*the script zoom icon button*/
00180         
00181         hdlheadrecord scriptnode; /*the node whose script is being displayed*/
00182         
00183         hdloutlinerecord scriptoutline; /*the outline record of the script being edited*/
00184         
00185         short defaultscriptfontnum, defaultscriptfontsize; /*font and size for new scripts*/
00186         
00187         short movecursorto; /*a signal between meload and meedit*/
00188         
00189         boolean fldirty; /*any changes since last save?*/
00190         
00191         boolean fllocked; /*are changes allowed to be made?*/
00192         
00193         boolean flwindowopen; /*is this menubar being edited now?*/
00194         
00195         boolean flactive;
00196         
00197         boolean flautosmash;
00198         
00199         boolean flinstalled; /*explicitly installed in menubar?*/
00200         
00201         boolean flcursormoved; /*do we need to check status of button, popup?*/
00202         
00203         /***boolean flpopupactive;*/
00204         
00205         /***boolean flzoomscriptwindow; /%zoom out the window in the next idle?*/
00206         
00207         long menurefcon; /*for use by application, menueditor doesn't touch it, but menuverbs does*/
00208         } tymenurecord, *ptrmenurecord, **hdlmenurecord;
00209     
00210 #endif
00211 
00212 typedef struct tylinkeditem {
00213     
00214     dbaddress adrlink;
00215     
00216     hdloutlinerecord houtline; /*kept in memory until it is saved*/
00217     } tylinkeditem;
00218 
00219 
00220 typedef struct tymenuiteminfo { /*linked into the refcon handle in each node*/
00221     
00222     byte cmdkey; 
00223     
00224     byte cmdmodifiers;
00225     
00226     tylinkeditem linkedscript;
00227     } tymenuiteminfo, *ptrmenuiteminfo, **hdlmenuiteminfo;
00228 
00229 
00230 /*globals*/
00231     
00232 extern hdlmenurecord menudata;
00233 
00234 extern WindowPtr menuwindow; 
00235 
00236 extern hdlwindowinfo menuwindowinfo; 
00237 
00238 
00239 /*prototypes*/
00240 
00241 extern boolean meloadoutline (dbaddress, hdloutlinerecord *); /*menueditor.c*/
00242 
00243 extern boolean mepackoutline (hdloutlinerecord, Handle *);
00244 
00245 extern boolean mesaveoutline (hdloutlinerecord, dbaddress *);
00246 
00247 extern boolean meloadscriptoutline (hdlmenurecord, hdlheadrecord, hdloutlinerecord *, boolean *);
00248 
00249 extern boolean mezoomscriptwindow (void);
00250 
00251 extern boolean mescriptwindowclosed (void);
00252 
00253 extern void mepostcursormove (void);
00254 
00255 extern void meexpandto (hdlheadrecord);
00256 
00257 extern void mesetcallbacks (hdloutlinerecord);
00258 
00259 extern boolean meeditmenurecord (void);
00260 
00261 extern boolean menewmenurecord (hdlmenurecord *);
00262 
00263 extern void medisposemenurecord (hdlmenurecord, boolean);
00264 
00265 extern boolean meinstallmenubar (hdlmenurecord);
00266 
00267 extern boolean meremovemenubar (hdlmenurecord);
00268 
00269 extern boolean meclearmenubar (void);
00270 
00271 #ifdef fldebug
00272 
00273     extern void mecheckglobals (void);
00274 
00275 #else
00276 
00277     #define mecheckglobals() ((void) 0)
00278 
00279 #endif
00280 
00281 extern boolean mesetglobals (void);
00282 
00283 extern hdldatabaserecord megetdatabase (hdlmenurecord);
00284 
00285 extern boolean mesetscriptoutline (hdlheadrecord, hdloutlinerecord);
00286 
00287 extern boolean mesomethingdirty (hdlmenurecord);
00288 
00289 extern void mesetcmdkey (byte, tykeyflags);
00290 
00291 extern void meupdate (void);
00292 
00293 extern void meactivate (boolean);
00294 
00295 extern boolean mescroll (tydirection, boolean, long);
00296 
00297 extern void megetscrollbarinfo (void);
00298 
00299 extern boolean megetundoglobals (long *);
00300 
00301 extern boolean mesetundoglobals (long, boolean);
00302 
00303 extern boolean memousedown (Point, tyclickflags);
00304 
00305 extern boolean mekeystroke (void);
00306 
00307 extern boolean mecmdkeyfilter (char);
00308 
00309 extern boolean mecut (void);
00310 
00311 extern boolean mecopy (void);
00312 
00313 extern boolean mepaste (void);
00314 
00315 extern boolean meclear (void);
00316 
00317 extern boolean meselectall (void);
00318 
00319 extern boolean medispose (void);
00320 
00321 extern boolean meclose (void);
00322 
00323 extern void meidle (void);
00324 
00325 extern boolean meadjustcursor (Point);
00326 
00327 extern boolean mesetprintinfo (void);
00328 
00329 extern boolean meprint (short);
00330 
00331 extern void meinit (void);
00332 
00333 
00334 extern boolean mecontinuesearch (hdlwindowinfo, hdlheadrecord); /*menufind.c*/
00335 
00336 extern boolean menuverbsearch (void);
00337 
00338 
00339 
00340 

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