menubar.h

Go to the documentation of this file.
00001 
00002 /*  $Id: menubar.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 menubarinclude
00029 
00030 
00031 #ifndef shelltypesinclude
00032     
00033     #include "shelltypes.h"
00034 
00035 #endif
00036 
00037 
00038 #ifndef opinclude
00039 
00040     #include "op.h"
00041 
00042 #endif
00043 
00044 
00045 /*types*/
00046 
00047 #define maxmenus 96 /*maximum number of user-defined menus for each menu list*/
00048 
00049 #define ctmenubarstack 50 /*maximum number of menus stacked in each menubar outline*/
00050 
00051 
00052 typedef struct tymenubarstackelement {
00053 
00054     hdlmenu hmenu; /*the menu data structure itself*/
00055     
00056     short idmenu; /*Menu Manager id of this menu*/
00057     
00058     hdlheadrecord hnode; /*the structure that created this menu*/
00059 
00060     boolean flhierarchic; /*is it a sub-menu?*/
00061     
00062     boolean flenabled; /*is it enabled?*/
00063     
00064     boolean flbuiltin; /*does menu belong to the Frontier app?*/
00065     
00066     short ctbaseitems; /*if flbuiltin, number of items that were already there*/
00067     } tymenubarstackelement;
00068 
00069 
00070 typedef struct tymenubarstack {
00071     
00072     struct tymenubarstack **hnext; /*linked list of these*/
00073     
00074     hdloutlinerecord menubaroutline; /*the outline that is at one w/the menubar structure*/
00075     
00076     boolean flactive: 1;
00077     
00078     boolean flclientowned: 1; /*actual menus owned by menu sharing client?*/
00079     
00080     short ixdeletedmenu; /*for rebuilding menu bar*/
00081     
00082     short topstack;
00083     
00084     long refcon;
00085     
00086     tymenubarstackelement stack [ctmenubarstack];
00087     } tymenubarstack, *ptrmenubarstack, **hdlmenubarstack;
00088 
00089 
00090 typedef struct tymenubarlist {
00091     
00092     hdlmenubarstack hfirst; /*linked list of these*/
00093     
00094     boolean flactive: 1; /*is this the active menubar?*/
00095     
00096     short basemenuid;
00097     
00098     byte menubitmap [(maxmenus / 8) + 1]; /*assume eight bits per byte*/
00099     } tymenubarlist, *ptrmenubarlist, **hdlmenubarlist;
00100 
00101 
00102 typedef boolean (*menubarchangedcallback)(hdloutlinerecord);
00103 
00104 typedef byte (*menubarcmdkeycallback)(hdlheadrecord);
00105 
00106 typedef struct tymenubarcallbacks {
00107     
00108     menubarchangedcallback menubarchangedroutine;
00109     
00110     menubarcmdkeycallback getcmdkeyroutine;
00111     } tymenubarcallbacks;
00112 
00113 
00114 /*globals*/
00115 
00116 extern hdlmenubarlist menubarlist;
00117 
00118 extern tymenubarcallbacks menubarcallbacks;
00119 
00120     
00121 /*prototypes*/
00122 
00123 extern boolean pushmenubarglobals (hdlmenubarstack);
00124 
00125 extern boolean popmenubarglobals (void);
00126 
00127 extern boolean newmenubarlist (hdlmenubarlist *);
00128 
00129 extern void setcurrentmenubarlist (hdlmenubarlist);
00130 
00131 extern boolean activatemenubarlist (hdlmenubarlist, boolean);
00132 
00133 extern boolean disposemenubarlist (hdlmenubarlist);
00134 
00135 extern void medirtymenubar (void);
00136 
00137 extern void meupdatemenubar (void);
00138 
00139 extern void mecheckmenubar (void);
00140 
00141 extern boolean medisposemenubar (hdlmenubarstack);
00142 
00143 extern boolean menewmenubar (hdloutlinerecord, hdlmenubarstack *);
00144 
00145 extern boolean mebuildmenubar (hdlmenubarstack);
00146 
00147 extern boolean memenuitemchanged (hdlmenubarstack, hdlheadrecord);
00148 
00149 extern short mecheckdeletedmenu (short, boolean);
00150 
00151 extern boolean memenuitemadded (hdlmenubarstack, hdlheadrecord);
00152 
00153 extern boolean memenuitemdeleted (hdlmenubarstack, hdlheadrecord);
00154 
00155 extern boolean meinsertmenubar (hdlmenubarstack);
00156 
00157 extern boolean medeletemenubar (hdlmenubarstack);
00158 
00159 extern boolean purgefrommenubarlist (long);
00160 
00161 extern boolean rebuildmenubarlist (void);
00162 
00163 extern boolean melocatemenubarnode (hdlheadrecord, hdloutlinerecord *);
00164 
00165 extern boolean mecheckformulas (short);
00166 
00167 extern boolean memenuhit (short, short, hdlheadrecord *);
00168 
00169 extern boolean memenu (short, short);
00170 
00171 extern void menubarinit (void);
00172 
00173 extern boolean mereduceformula (bigstring bs); /*7.0b12 PBS: used by oppopup.c*/
00174 
00175 extern void mereducemenucodes (bigstring bs, boolean *flenabled, boolean *flchecked); /*7.0b23 PBS: used by oppopup.c*/
00176 
00177 
00178 
00179 

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