shellmenu.h

Go to the documentation of this file.
00001 
00002 /*  $Id: shellmenu.h 594 2006-02-26 09:20:45Z 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 #ifndef shellmenuinclude
00029 #define shellmenuinclude /*so other includes can tell if we've been loaded*/
00030 
00031 
00032 #ifdef MACVERSION
00033 
00034     /*
00035     2006-02-25 aradke: must keep in sync with SHELL.R
00036     */
00037 
00038     #define mainmenuincrement       1
00039     #define hiermenuincrement       1
00040 
00041     #define applemenu               1
00042     #define filemenu                2
00043     #define editmenu                3
00044     #define windowsmenu             4
00045 
00046     #define firstmainmenu           applemenu
00047     #define lastmainmenu            windowsmenu
00048 
00049     #define fontmenu                128
00050     #define stylemenu               129
00051     #define sizemenu                130
00052     #define leadingmenu             131
00053     #define justifymenu             132
00054     #define findandreplacemenu      133
00055     #define commonstylesmenu        134
00056     #define newobjectmenu           135
00057     #define virtualmenu             136 /* never appears in user interface -- used for extended keyboard */
00058     #define openrecentmenu          137
00059 
00060     #define firsthiermenu           fontmenu
00061     #define lasthiermenu            openrecentmenu
00062     
00063 #endif //MACVERSION
00064 
00065 
00066 #ifdef WIN95VERSION 
00067 
00068     /*
00069     2006-02-25 aradke: must keep in sync with WinLand.rc
00070     
00071     2006-02-25 aradke: undefine menus for Pike and OPML Editor that aren't actually used by the app
00072         in order to avoid picking up their keyboard shortcuts at runtime
00073     */
00074 
00075     #define mainmenuincrement   1000
00076     #define hiermenuincrement   100
00077 
00078     #define applemenu           1000
00079     #define filemenu            2000
00080     #define editmenu            3000
00081     #define windowsmenu         4000
00082     #define helpmenu            5000
00083 
00084     #define firstmainmenu       filemenu
00085     #define lastmainmenu        helpmenu
00086 
00087     #ifdef PIKE
00088         #undef stylemenu
00089         #undef leadingmenu
00090         #undef justifymenu
00091         #undef newobjectmenu
00092         #undef openrecentmenu
00093 
00094         #define virtualmenu         5100    /* 2006-02-25 aradke: never actually displayed */
00095         #define fontmenu            5200
00096         #define sizemenu            5300
00097         #define findandreplacemenu  5400
00098         #define commonstylesmenu    5500    /*7.0b26 PBS*/
00099 
00100         #define firsthiermenu       fontmenu
00101         #define lasthiermenu        commonstylesmenu
00102     #else 
00103         #define virtualmenu         5100    /* 2006-02-25 aradke: never actually displayed */
00104         #define fontmenu            5200
00105         #define stylemenu           5300
00106         #define sizemenu            5400
00107         #define leadingmenu         5500
00108         #define justifymenu         5600
00109         #define findandreplacemenu  5700
00110         #define commonstylesmenu    5800    /*7.0b26 PBS*/
00111         #define newobjectmenu       5900
00112         #define openrecentmenu      6000    /* 2006-02-05 aradke */
00113 
00114         #define firsthiermenu       fontmenu
00115         #define lasthiermenu        openrecentmenu
00116 
00117     #endif 
00118 
00119 #endif //WIN95VERSION
00120 
00121 
00122 #define aboutitem 1
00123 
00124 #ifdef PIKE
00125 #ifndef OPMLEDITOR
00126     // #define filemenu (applemenu + mainmenuincrement)
00127 
00128     /*PBS 07/22/00: Pike's File menu has been revised --
00129     the number, order, and names of items have changed.
00130 
00131     7.0d10 PBS: Radio UserLand has an Update Radio.root...
00132     command in the File menu.*/
00133 
00134     #define newitem 1
00135     #define openitem 2
00136     #define openurlitem 3 /*7.0b17 PBS: Open URL... command*/
00137     #define openmanilasiteitem 4
00138     #define closeitem 5
00139     #define saveitem 7
00140     #define saveasitem 8
00141     #define saveashtmlitem 9 /*7.0b32 PBS: Save As HTML... command*/
00142     #define saveasplaintextitem 10 /*7.0b32 PBS: Save As Plain Text... command*/
00143     #define revertitem 11
00144     #define changetitleitem 8
00145     #define viewinbrowseritem 13
00146     #define updateradiorootitem 15
00147     #define workofflineitem 16 /*7.0b25 PBS: Work Offline*/
00148     #define quititem 18
00149 #else //OPMLEDITOR
00150     #define newitem 1
00151     #define openitem 2
00152     #define openurlitem 3 /*7.0b17 PBS: Open URL... command*/
00153 //  #define openmanilasiteitem 4
00154     #define closeitem 4
00155     #define saveitem 6
00156     #define saveasitem 7
00157 //  #define saveashtmlitem 9 /*7.0b32 PBS: Save As HTML... command*/
00158 //  #define saveasplaintextitem 10 /*7.0b32 PBS: Save As Plain Text... command*/
00159     #define revertitem 8
00160     #define changetitleitem 5
00161     #define viewinbrowseritem 10
00162     #define updateradiorootitem 12
00163     #define workofflineitem 13 /*7.0b25 PBS: Work Offline*/
00164     #define quititem 15
00165 #endif // OPMLEDITOR
00166 
00167 #else
00168 
00169     // #define filemenu (applemenu + mainmenuincrement)
00170     #define newitem     1
00171     #define openitem        2
00172     #define openrecentitem  3
00173     #define closeitem       5
00174     #define saveitem        6
00175     #define saverunnableitem    7
00176     #define saveasitem      8
00177     #define revertitem      9
00178 
00179     //#define expertitem 10
00180 
00181     #define pagesetupitem   11
00182     #define printitem       12
00183     #define quititem        14
00184 
00185 #endif
00186 
00187 // #define editmenu (filemenu + mainmenuincrement)
00188 
00189 #define windowsitem             -1
00190 
00191 #ifdef PIKE
00192 
00193     #define undoitem            1
00194     #define cutitem             3
00195     #define copyitem            4
00196     #define pasteitem           5
00197     #define clearitem           6
00198     #define selectallitem           8
00199     #define findandreplaceitem  10
00200     #define commonstylesitem    11
00201     #define fontitem            13
00202     #define sizeitem            14
00203 #ifndef OPMLEDITOR
00204     #define opennotepaditem     16
00205     #define insertdatetimeitem  17
00206 #else // OPMLEDITOR
00207     #define insertdatetimeitem  16
00208 #endif //OPMLEDITOR
00209 
00210     #define styleitem           -1
00211     #define leadingitem         -1
00212     #define justifyitem         -1
00213 
00214 #else
00215 
00216     #define undoitem            1
00217     #define cutitem             3
00218     #define copyitem            4
00219     #define pasteitem           5
00220     #define clearitem           6
00221     #define selectallitem           8
00222     #define findandreplaceitem  10
00223     #define fontitem            12
00224     #define sizeitem            13
00225     #define styleitem           14
00226     #define leadingitem         15
00227     #define justifyitem         16
00228     #define commonstylesitem    17
00229     #define insertdatetimeitem  19
00230 
00231 #endif
00232 
00233 
00234 // #define windowsmenu (editmenu + mainmenuincrement)
00235 #define hidewindowitem 1
00236 #if TARGET_API_MAC_CARBON == 1
00237     #define minimizewindowitem 2
00238     #define bringalltofrontwindowitem 4
00239 #endif
00240 
00241 // #define helpmenu (windowsmenu + mainmenuincrement)
00242 #define aboutitem 1
00243 
00244 // #define stylemenu (fontmenu + hiermenuincrement)
00245 #define plainitem 1
00246 #define bolditem 3
00247 #define italicitem 4
00248 #define underlineitem 5
00249 #define outlineitem 6
00250 #define shadowitem 7
00251 /*
00252 #define condenseditem 8
00253 */
00254 #define superscriptitem 8
00255 #define subscriptitem 9
00256 
00257 // #define sizemenu (stylemenu + hiermenuincrement)
00258 #define point9item 1
00259 #define point10item 2
00260 #define point12item 3
00261 #define point14item 4
00262 #define point18item 5
00263 #define point24item 6
00264 #define pointupitem 8
00265 #define pointdownitem 9
00266 #define pointcustomitem 11
00267 
00268 // #define leadingmenu (sizemenu + hiermenuincrement)
00269 #define leading0item 1
00270 #define leading1item 3
00271 #define leading2item 4
00272 #define leading3item 5
00273 #define leading4item 6
00274 #define leading5item 7
00275 #define leadingcustomitem 9
00276 
00277 // #define justifymenu (leadingmenu + hiermenuincrement)
00278 #define leftjustifyitem 1
00279 #define rightjustifyitem 2
00280 #define centerjustifyitem 3
00281 #define fulljustifyitem 4
00282 
00283 // #define virtualmenu (justifymenu + hiermenuincrement) /*never appears in user interface -- used for externed keyboard*/
00284 #define helpitem 1
00285 #define homeitem 2
00286 #define enditem 3
00287 #define pageupitem 4
00288 #define pagedownitem 5
00289 #define moveupitem 6
00290 #define movedownitem 7
00291 #define moveleftitem 8
00292 #define moverightitem 9
00293 
00294 // #define openrecentmenu (virtualmenu + hiermenuincrement)
00295 #define clearrecentmenuitem 2
00296 
00297 
00298 #if !defined(REZ) && !defined(RC_INVOKED)
00299 
00300 #include "shelltypes.h"
00301 
00302 //#define ctmenustack (lastmainmenu - firstmainmenu + lasthiermenu - firsthiermenu + 2)
00303 #define ctmenustack ( (lastmainmenu - firstmainmenu) / mainmenuincrement \
00304                     + (lasthiermenu - firsthiermenu) / hiermenuincrement \
00305                     + 2)
00306 
00307 typedef struct tymenuinfo {
00308     
00309     short idmenu; /*the resource id / menu id of this menu*/
00310     hdlmenu macmenu; /*a handle to the menu manager's data structure for the menu*/
00311     } tymenuinfo;
00312 
00313 extern tymenuinfo menustack [ctmenustack];
00314 
00315 extern short topmenustack;
00316 
00317 
00318 typedef enum tyeditcommand {
00319     
00320     undocommand, cutcommand = 2, copycommand, pastecommand, clearcommand, selectallcommand = 7
00321     
00322     } tyeditcommand;
00323     
00324 
00325 /*prototypes*/
00326 
00327 extern hdlmenu shellmenuhandle (short); /*shellmenu.c*/
00328 
00329 extern boolean shelltgetmainmenu (bigstring, hdlmenu *, short *);
00330 
00331 extern boolean shellinitmenus (void);
00332 
00333 extern void shellgetlastmenuid (short *);
00334 
00335 extern boolean shellapplemenu (bigstring);
00336 
00337 extern boolean shelleditcommand (tyeditcommand);
00338 
00339 extern void shellforcemenuadjust (void);
00340 
00341 extern void shellmodaldialogmenuadjust (void);
00342 
00343 extern void shellupdatemenus (void);
00344 
00345 extern boolean shellhandlemenu (long);
00346 
00347 extern void runfilemenuscript (short); /* 2005-09-15 creedon - all targets can now run a script associated with some of the file menu commands */
00348 
00349 extern void runeditmenuscript (short, short); /* 2005-09-25 creedon - all targets can now run a script associated with some of the edit menu commands */
00350 
00351 extern void getcommonstylesmenuitemtext (short, bigstring); /* 2005-09-25 creedon - all targets can now run a script associated with some of the edit menu commands */ 
00352 
00353 extern void getfilemenuitemidentifier (short, bigstring); /* 2005-09-15 creedon - all targets can now run a script associated with some of the file menu commands */
00354 
00355 extern void geteditmenuitemidentifier (short, short, bigstring); /* 2005-09-25 creedon - all targets can now run a script associated with some of the edit menu commands */
00356 
00357 extern void runopenrecentmenuscript (short); /* 2005-09-24 creedon */
00358 
00359 extern boolean shellupdatewindowmenu (void); /*shellwindowmenu.c*/
00360 
00361 extern void shellwindowmenuselect (short);
00362 
00363 extern void shelladjustundo (void); /*7.0fc1 PBS: no longer static*/
00364 
00365 extern boolean pikequit (void); /*7.0 PBS: called when the X in the frame window is clicked in Windows.*/
00366 
00367 extern void shellupdateopenrecentmenu (void); /* 2005-09-25 creedon */
00368 
00369 #endif 
00370 
00371 #endif //shellmenuinclude

Generated on Wed May 31 18:20:01 2006 for frontierkernel 10.1.10a by  doxygen 1.4.6