menubar.c File Reference

#include "frontier.h"
#include "standard.h"
#include "cursor.h"
#include "memory.h"
#include "kb.h"
#include "launch.h"
#include "menu.h"
#include "ops.h"
#include "strings.h"
#include "shellmenu.h"
#include "menubar.h"
#include "process.h"
#include "meprograms.h"

Include dependency graph for menubar.c:

Go to the source code of this file.

Defines

#define ctmenubarglobalsstack   3

Functions

boolean pushmenubarglobals (hdlmenubarstack hstack)
boolean popmenubarglobals (void)
static boolean pushmenubarlist (hdlmenubarstack hstack)
static boolean popmenubarlist (hdlmenubarstack hstack)
static boolean meallocmenuid (short *id)
static void mefreemenuid (short id)
static void meremovemenu (const tymenubarstackelement *menuinfo)
static short medeletemenu (hdlmenubarstack hstack, short ix, boolean flactive)
static void medeletemenubarentry (short ix)
static boolean mepushmenubarstack (const tymenubarstackelement *pitem)
void medirtymenubar (void)
void meupdatemenubar (void)
void mecheckmenubar (void)
static boolean mefindinmenubar (hdlheadrecord hnode, boolean flfindtitle, short *ixstack, short *itemnumber)
static boolean mebuildmenu (hdlheadrecord, boolean, tymenubarstackelement *, boolean)
static void meactivatemenus (hdlmenubarstack hstack, boolean flactivate)
static void medisposemenus (hdlmenubarstack hstack)
static boolean memainmenunode (hdlheadrecord hnode)
static byte mecmdkey (hdlheadrecord hnode)
static boolean melinkparentitem (hdlheadrecord hnode, hdlmenu hsubmenu, short idsubmenu)
static boolean meshouldhavemenu (hdlheadrecord hnode)
static boolean megetmenuinfo (hdlheadrecord hnode, tymenubarstackelement *menuinfo)
void mereducemenucodes (bigstring bs, boolean *flenabled, boolean *flchecked)
boolean mereduceformula (bigstring bs)
static boolean meinsertmenuitem (hdlmenu hmenu, short itemnumber, hdlheadrecord h, boolean flrecurse)
static boolean getmenutobuild (bigstring bsmenu, boolean flhierarchic, short *id, hdlmenu *hmenu, boolean *flbuiltin)
boolean newmenubarlist (hdlmenubarlist *hlist)
void setcurrentmenubarlist (hdlmenubarlist hlist)
boolean activatemenubarlist (hdlmenubarlist hlist, boolean flactivate)
boolean disposemenubarlist (hdlmenubarlist hmenubarlist)
boolean medisposemenubar (hdlmenubarstack hstack)
boolean menewmenubar (hdloutlinerecord houtline, hdlmenubarstack *hstack)
boolean mebuildmenubar (hdlmenubarstack hstack)
static boolean meinsertmenu (const tymenubarstackelement *menuinfo)
boolean memenuitemchanged (hdlmenubarstack hstack, hdlheadrecord hnode)
static short megetmenuindex (hdlmenu hmenu)
static void medeleteallmenubarentries (short ixstack)
short mecheckdeletedmenu (short ixstack, boolean fldrawmenubar)
static boolean mefindvisit (hdlheadrecord h, ptrvoid refcon)
boolean memenuitemadded (hdlmenubarstack hstack, hdlheadrecord hnode)
boolean memenuitemdeleted (hdlmenubarstack hstack, hdlheadrecord hnode)
boolean meinsertmenubar (hdlmenubarstack hstack)
boolean medeletemenubar (hdlmenubarstack hstack)
boolean purgefrommenubarlist (long refcon)
boolean rebuildmenubarlist (void)
boolean melocatemenubarnode (hdlheadrecord hnode, hdloutlinerecord *houtline)
boolean mecheckformulas (short ixstack)
boolean memenuhit (short idmenu, short ixmenu, hdlheadrecord *hnode)
boolean memenu (short idmenu, short ixmenu)
static unsigned char menullchar (hdlheadrecord hn)
void menubarinit (void)

Variables

hdlmenubarlist menubarlist = nil
tymenubarcallbacks menubarcallbacks = {nil, nil}
static hdlmenubarstack menubardata = nil
static boolean fldirtymenubar = false
static short topmenubarglobals = 0
static hdlmenubarstack menubarglobalsstack [ctmenubarglobalsstack]


Define Documentation

#define ctmenubarglobalsstack   3
 

Definition at line 93 of file menubar.c.

Referenced by pushmenubarglobals().


Function Documentation

boolean activatemenubarlist hdlmenubarlist  hlist,
boolean  flactivate
 

Definition at line 919 of file menubar.c.

References meactivatemenus(), and nil.

Referenced by ccactivatemenubar().

Here is the call graph for this function:

boolean disposemenubarlist hdlmenubarlist  hmenubarlist  ) 
 

Definition at line 941 of file menubar.c.

References disposehandle(), h, tymenubarstack::hnext, medisposemenubar(), menubarlist, and nil.

Referenced by buildmenubarstack().

Here is the call graph for this function:

static boolean getmenutobuild bigstring  bsmenu,
boolean  flhierarchic,
short id,
hdlmenu *  hmenu,
boolean flbuiltin
[static]
 

Definition at line 758 of file menubar.c.

References aboutitem, deletemenuitem(), iscurrentapplication(), langipcself, meallocmenuid(), Newmenu(), nil, and shelltgetmainmenu().

Referenced by mebuildmenu().

Here is the call graph for this function:

static void meactivatemenus hdlmenubarstack  hstack,
boolean  flactivate
[static]
 

Definition at line 450 of file menubar.c.

References tymenubarstackelement::flbuiltin, tymenubarstackelement::flhierarchic, tymenubarstackelement::hmenu, tymenubarstackelement::hnode, hnode, i, tymenubarstackelement::idmenu, inserthierarchicmenu(), insertmenu(), mebuildmenu(), mefindinmenubar(), nil, opislastsubhead(), opoutermostsummit(), and pushmenubarglobals().

Referenced by activatemenubarlist(), medeletemenubar(), meinsertmenubar(), and rebuildmenubarlist().

Here is the call graph for this function:

static boolean meallocmenuid short id  )  [static]
 

Definition at line 189 of file menubar.c.

References i, maxmenus, menubarlist, MenuList, and nil.

Referenced by getmenutobuild().

static boolean mebuildmenu hdlheadrecord  ,
boolean  ,
tymenubarstackelement ,
boolean 
[static]
 

Definition at line 831 of file menubar.c.

References bigstring, clearbytes(), countmenuitems(), getheadstring, getmenutobuild(), hnode, meinsertmenuitem(), mereduceformula(), meshouldhavemenu(), opislastsubhead(), opnosubheads(), and rollbeachball().

Referenced by meactivatemenus(), mebuildmenubar(), meinsertmenuitem(), memenuitemadded(), and memenuitemchanged().

Here is the call graph for this function:

boolean mebuildmenubar hdlmenubarstack  hstack  ) 
 

Definition at line 1037 of file menubar.c.

References fl, h, hnode, tymenubarstackelement::idmenu, info, insertmenu(), mebuildmenu(), medirtymenubar(), medisposemenus(), mepushmenubarstack(), opislastsubhead(), opoutermostsummit(), popmenubarglobals(), pushmenubarglobals(), and shellmenuhandle().

Referenced by buildmenubarstack(), meinstallmenubar(), and rebuildmenubarlist().

Here is the call graph for this function:

short mecheckdeletedmenu short  ixstack,
boolean  fldrawmenubar
 

Definition at line 1341 of file menubar.c.

References tymenubarstack::ixdeletedmenu, medeleteallmenubarentries(), menubardata, meupdatemenubar(), and nil.

Referenced by meidle(), memenuhit(), memenuitemadded(), and memenuitemdeleted().

Here is the call graph for this function:

boolean mecheckformulas short  ixstack  ) 
 

Definition at line 1754 of file menubar.c.

References bigstring, checkmenuitem(), countmenuitems(), getheadstring, hnode, i, info, menubardata, mereduceformula(), mereducemenucodes(), ophassubheads(), setmenuitem(), and setmenuitemenable().

Referenced by langipccheckformulas(), and memenuhit().

Here is the call graph for this function:

void mecheckmenubar void   ) 
 

Definition at line 358 of file menubar.c.

References fldirtymenubar, and meupdatemenubar().

Referenced by memenu().

Here is the call graph for this function:

static byte mecmdkey hdlheadrecord  hnode  )  [static]
 

Definition at line 585 of file menubar.c.

References tymenubarcallbacks::getcmdkeyroutine, hnode, and menubarcallbacks.

Referenced by meinsertmenuitem(), melinkparentitem(), and memenuitemchanged().

static void medeleteallmenubarentries short  ixstack  )  [static]
 

Definition at line 1296 of file menubar.c.

References countmenuitems(), gethierarchicalmenuitem(), tymenubarstackelement::hmenu, megetmenuindex(), menubardata, and tymenubarstack::stack.

Referenced by mecheckdeletedmenu().

Here is the call graph for this function:

static short medeletemenu hdlmenubarstack  hstack,
short  ix,
boolean  flactive
[static]
 

Definition at line 270 of file menubar.c.

References disposemenu(), and meremovemenu().

Referenced by medeletemenubarentry(), medisposemenus(), and memenuitemchanged().

Here is the call graph for this function:

boolean medeletemenubar hdlmenubarstack  hstack  ) 
 

Definition at line 1638 of file menubar.c.

References meactivatemenus(), and popmenubarlist().

Referenced by meremovemenubar(), and purgefrommenubarlist().

Here is the call graph for this function:

static void medeletemenubarentry short  ix  )  [static]
 

Definition at line 302 of file menubar.c.

References i, medeletemenu(), mefreemenuid(), and menubardata.

Referenced by memenuitemadded(), and memenuitemdeleted().

Here is the call graph for this function:

void medirtymenubar void   ) 
 

Definition at line 342 of file menubar.c.

References fldirtymenubar, and shellforcemenuadjust().

Referenced by mebuildmenubar(), and medisposemenus().

Here is the call graph for this function:

boolean medisposemenubar hdlmenubarstack  hstack  ) 
 

Definition at line 970 of file menubar.c.

References disposehandle(), medisposemenus(), nil, and popmenubarlist().

Referenced by buildmenubarstack(), disposemenubarlist(), disposemenubarstack(), medisposemenurecord(), and menuverbclose().

Here is the call graph for this function:

static void medisposemenus hdlmenubarstack  hstack  )  [static]
 

Definition at line 526 of file menubar.c.

References tymenubarstack::flactive, i, medeletemenu(), medirtymenubar(), mefreemenuid(), and nil.

Referenced by mebuildmenubar(), and medisposemenubar().

Here is the call graph for this function:

static boolean mefindinmenubar hdlheadrecord  hnode,
boolean  flfindtitle,
short ixstack,
short itemnumber
[static]
 

Definition at line 365 of file menubar.c.

References ct, h, hnode, i, menubardata, and tymenubarstack::topstack.

Referenced by meactivatemenus(), megetmenuinfo(), melinkparentitem(), melocatemenubarnode(), memenuitemadded(), memenuitemchanged(), and memenuitemdeleted().

static boolean mefindvisit hdlheadrecord  h,
ptrvoid  refcon
[static]
 

Definition at line 1382 of file menubar.c.

References h.

Referenced by memenuitemadded().

static void mefreemenuid short  id  )  [static]
 

Definition at line 247 of file menubar.c.

References menubarlist, and nil.

Referenced by medeletemenubarentry(), medisposemenus(), and memenuitemchanged().

static short megetmenuindex hdlmenu  hmenu  )  [static]
 

Definition at line 1271 of file menubar.c.

References i, menubardata, and return().

Referenced by medeleteallmenubarentries().

Here is the call graph for this function:

static boolean megetmenuinfo hdlheadrecord  hnode,
tymenubarstackelement menuinfo
[static]
 

Definition at line 622 of file menubar.c.

References hnode, and mefindinmenubar().

Referenced by meinsertmenu(), and meinsertmenuitem().

Here is the call graph for this function:

static boolean meinsertmenu const tymenubarstackelement menuinfo  )  [static]
 

Definition at line 1115 of file menubar.c.

References tyheadrecord::headlinkdown, tymenubarstack::hnext, hnode, tymenubarstackelement::idmenu, insertmenu(), megetmenuinfo(), nil, opoutermostsummit(), popmenubarglobals(), pushmenubarglobals(), and short.

Referenced by memenuitemadded(), and memenuitemchanged().

Here is the call graph for this function:

boolean meinsertmenubar hdlmenubarstack  hstack  ) 
 

Definition at line 1623 of file menubar.c.

References meactivatemenus(), and pushmenubarlist().

Referenced by meinstallmenubar().

Here is the call graph for this function:

static boolean meinsertmenuitem hdlmenu  hmenu,
short  itemnumber,
hdlheadrecord  h,
boolean  flrecurse
[static]
 

Definition at line 693 of file menubar.c.

References bigstring, checkmenuitem(), disablemenuitem(), getheadstring, h, tymenubarstackelement::hmenu, tymenubarstackelement::idmenu, insertmenu(), Insertmenuitem(), insertsubmenu, mebuildmenu(), mecmdkey(), megetmenuinfo(), mepushmenubarstack(), mereduceformula(), mereducemenucodes(), ophassubheads(), sethierarchicalmenuitem(), and setmenuitemcommandkey().

Referenced by mebuildmenu(), and memenuitemadded().

Here is the call graph for this function:

static boolean melinkparentitem hdlheadrecord  hnode,
hdlmenu  hsubmenu,
short  idsubmenu
[static]
 

Definition at line 591 of file menubar.c.

References hnode, mecmdkey(), mefindinmenubar(), nil, sethierarchicalmenuitem(), and setmenuitemcommandkey().

Referenced by memenuitemadded(), and memenuitemdeleted().

Here is the call graph for this function:

boolean melocatemenubarnode hdlheadrecord  hnode,
hdloutlinerecord houtline
 

Definition at line 1713 of file menubar.c.

References hnode, mefindinmenubar(), menubarlist, nil, outlinedata, popmenubarglobals(), and pushmenubarglobals().

Referenced by mescripterrorroutine().

Here is the call graph for this function:

static boolean memainmenunode hdlheadrecord  hnode  )  [static]
 

Definition at line 564 of file menubar.c.

References hnode.

Referenced by memenuitemadded(), and meshouldhavemenu().

boolean memenu short  idmenu,
short  ixmenu
 

Definition at line 1898 of file menubar.c.

References tykeystrokerecord::floptionkey, h, hnode, keyboardstatus, mecheckmenubar(), memenuhit(), menubarlist, meshownode(), meuserselected(), nil, optionkeydown(), popmenubarglobals(), and pushmenubarglobals().

Referenced by ccmenuroutine().

Here is the call graph for this function:

boolean memenuhit short  idmenu,
short  ixmenu,
hdlheadrecord hnode
 

processbusy ()

Definition at line 1829 of file menubar.c.

References fldirtymenubar, getmenutitleenable(), i, mecheckdeletedmenu(), mecheckformulas(), and setmenutitleenable().

Referenced by langipcgetitemlangtext(), langipcrunitem(), and memenu().

Here is the call graph for this function:

boolean memenuitemadded hdlmenubarstack  hstack,
hdlheadrecord  hnode
 

Definition at line 1388 of file menubar.c.

References assert, fl, tymenubarstackelement::flhierarchic, hnode, tymenubarstackelement::idmenu, mebuildmenu(), mecheckdeletedmenu(), medeletemenubarentry(), mefindinmenubar(), mefindvisit(), meinsertmenu(), meinsertmenuitem(), melinkparentitem(), memainmenunode(), mepushmenubarstack(), meremovemenu(), meshouldhavemenu(), meupdatemenubar(), nil, ophassubheads(), opnosubheads(), opoutermostsummit(), opsiblingvisiter(), popmenubarglobals(), and pushmenubarglobals().

Referenced by meinsertlineroutine().

Here is the call graph for this function:

boolean memenuitemchanged hdlmenubarstack  hstack,
hdlheadrecord  hnode
 

Definition at line 1166 of file menubar.c.

References assert, bigstring, checkmenuitem(), fl, tymenubarstackelement::flhierarchic, getheadstring, hnode, tymenubarstackelement::idmenu, mebuildmenu(), mecmdkey(), medeletemenu(), mefindinmenubar(), mefreemenuid(), meinsertmenu(), mereduceformula(), mereducemenucodes(), meupdatemenubar(), nil, popmenubarglobals(), pushmenubarglobals(), setmenuitem(), setmenuitemcommandkey(), and setmenuitemenable().

Referenced by mesetcmdkey(), and metextchangedroutine().

Here is the call graph for this function:

boolean memenuitemdeleted hdlmenubarstack  hstack,
hdlheadrecord  hnode
 

Definition at line 1563 of file menubar.c.

References countmenuitems(), deletemenuitem(), hnode, mecheckdeletedmenu(), medeletemenubarentry(), mefindinmenubar(), melinkparentitem(), nil, popmenubarglobals(), and pushmenubarglobals().

Referenced by medeletelineroutine().

Here is the call graph for this function:

boolean menewmenubar hdloutlinerecord  houtline,
hdlmenubarstack hstack
 

Definition at line 985 of file menubar.c.

References memoryerror(), tymenubarstack::menubaroutline, newclearhandle(), and nil.

Referenced by buildmenubarstack(), and meinstallmenubar().

Here is the call graph for this function:

void menubarinit void   ) 
 

Definition at line 1961 of file menubar.c.

References tymenubarcallbacks::getcmdkeyroutine, menubarcallbacks, tymenubarcallbacks::menubarchangedroutine, menullchar(), nil, and truenoop().

Referenced by meinit().

Here is the call graph for this function:

static unsigned char menullchar hdlheadrecord  hn  )  [static]
 

Definition at line 1954 of file menubar.c.

References chnul.

Referenced by menubarinit().

static boolean mepushmenubarstack const tymenubarstackelement pitem  )  [static]
 

Definition at line 329 of file menubar.c.

References ctmenubarstack, menubardata, and tymenubarstack::stack.

Referenced by mebuildmenubar(), meinsertmenuitem(), and memenuitemadded().

boolean mereduceformula bigstring  bs  ) 
 

Definition at line 673 of file menubar.c.

References fl, langreduceformula(), opsetoutline(), and outlinedata.

Referenced by dockmenuinsertmenuitem(), mebuildmenu(), mecheckformulas(), meinsertmenuitem(), memenuitemchanged(), and oppopupinsertmenuitem().

Here is the call graph for this function:

void mereducemenucodes bigstring  bs,
boolean flenabled,
boolean flchecked
 

Definition at line 642 of file menubar.c.

References deletestring(), and stringlength.

Referenced by dockmenuinsertmenuitem(), mecheckformulas(), meinsertmenuitem(), memenuitemchanged(), and oppopupinsertmenuitem().

Here is the call graph for this function:

static void meremovemenu const tymenubarstackelement menuinfo  )  [static]
 

Definition at line 260 of file menubar.c.

References deleteallmenuitems(), and removemenu().

Referenced by medeletemenu(), and memenuitemadded().

Here is the call graph for this function:

static boolean meshouldhavemenu hdlheadrecord  hnode  )  [static]
 

Definition at line 616 of file menubar.c.

References hnode, memainmenunode(), and ophassubheads().

Referenced by mebuildmenu(), and memenuitemadded().

Here is the call graph for this function:

void meupdatemenubar void   ) 
 

Definition at line 350 of file menubar.c.

References drawmenubar(), and fldirtymenubar.

Referenced by mecheckdeletedmenu(), mecheckmenubar(), memenuitemadded(), and memenuitemchanged().

Here is the call graph for this function:

boolean newmenubarlist hdlmenubarlist hlist  ) 
 

Definition at line 898 of file menubar.c.

References assert, longsizeof, maxmenus, and newclearhandle().

Referenced by buildmenubarstack(), and newcancoonrecord().

Here is the call graph for this function:

boolean popmenubarglobals void   ) 
 

Definition at line 156 of file menubar.c.

References assert, menubardata, menubarglobalsstack, nil, oppopoutline(), and topmenubarglobals.

Referenced by langipccheckformulas(), langipcgetitemlangtext(), langipcrunitem(), mebuildmenubar(), meidle(), meinsertmenu(), melocatemenubarnode(), memenu(), memenuitemadded(), memenuitemchanged(), and memenuitemdeleted().

Here is the call graph for this function:

static boolean popmenubarlist hdlmenubarstack  hstack  )  [static]
 

Definition at line 179 of file menubar.c.

References listunlink(), and menubarlist.

Referenced by medeletemenubar(), and medisposemenubar().

Here is the call graph for this function:

boolean purgefrommenubarlist long  refcon  ) 
 

Definition at line 1653 of file menubar.c.

References tymenubarstack::hnext, medeletemenubar(), menubarlist, and nil.

Referenced by ccwindowdisposerecord().

Here is the call graph for this function:

boolean pushmenubarglobals hdlmenubarstack  hstack  ) 
 

Definition at line 130 of file menubar.c.

References assert, ctmenubarglobalsstack, menubardata, menubarglobalsstack, nil, oppushoutline(), and topmenubarglobals.

Referenced by langipccheckformulas(), langipcgetitemlangtext(), langipcrunitem(), meactivatemenus(), mebuildmenubar(), meidle(), meinsertmenu(), melocatemenubarnode(), memenu(), memenuitemadded(), memenuitemchanged(), and memenuitemdeleted().

Here is the call graph for this function:

static boolean pushmenubarlist hdlmenubarstack  hstack  )  [static]
 

Definition at line 169 of file menubar.c.

References listlink(), and menubarlist.

Referenced by meinsertmenubar().

Here is the call graph for this function:

boolean rebuildmenubarlist void   ) 
 

Definition at line 1681 of file menubar.c.

References fl, meactivatemenus(), mebuildmenubar(), menubarlist, and nil.

Referenced by menubuildverb().

Here is the call graph for this function:

void setcurrentmenubarlist hdlmenubarlist  hlist  ) 
 

Definition at line 913 of file menubar.c.

References menubarlist.

Referenced by ccinstallmenubar(), clearcancoonglobals(), and setcancoonglobals().


Variable Documentation

boolean fldirtymenubar = false [static]
 

Definition at line 90 of file menubar.c.

Referenced by mecheckmenubar(), medirtymenubar(), memenuhit(), and meupdatemenubar().

tymenubarcallbacks menubarcallbacks = {nil, nil}
 

Definition at line 85 of file menubar.c.

Referenced by langipcmenuinit(), mecmdkey(), meinit(), menubarchanged(), and menubarinit().

hdlmenubarstack menubardata = nil [static]
 

Definition at line 88 of file menubar.c.

Referenced by mecheckdeletedmenu(), mecheckformulas(), medeleteallmenubarentries(), medeletemenubarentry(), mefindinmenubar(), megetmenuindex(), mepushmenubarstack(), popmenubarglobals(), and pushmenubarglobals().

hdlmenubarstack menubarglobalsstack[ctmenubarglobalsstack] [static]
 

Definition at line 97 of file menubar.c.

Referenced by popmenubarglobals(), and pushmenubarglobals().

hdlmenubarlist menubarlist = nil
 

Definition at line 83 of file menubar.c.

Referenced by buildmenubarstack(), disposemenubarlist(), disposemenubarstack(), meallocmenuid(), meclearmenubar(), mefreemenuid(), melocatemenubarnode(), memenu(), popmenubarlist(), purgefrommenubarlist(), pushmenubarlist(), rebuildmenubarlist(), and setcurrentmenubarlist().

short topmenubarglobals = 0 [static]
 

Definition at line 95 of file menubar.c.

Referenced by popmenubarglobals(), and pushmenubarglobals().


Generated on Wed Jun 7 08:17:08 2006 for frontierkernel 10.1.10a by  doxygen 1.4.6