BB2 C port
API reference: Blitz libraries in C and the shared code
Loading...
Searching...
No Matches
rigtmenulib.c File Reference
#include "blitzlib.h"
#include "blitzexec.h"
#include <exec/memory.h>
#include <intuition/intuition.h>
#include <libraries/gadtools.h>
#include <proto/gadtools.h>
#include <proto/intuition.h>

Data Structures

struct  gtmenulist
struct  gtentry

Macros

#define __NOLIBBASE__
#define GADTOOLS_BASE_NAME   gtbase
#define INTUITION_BASE_NAME   intuibase
#define W   BL_WORD
#define S   BL_STRING
#define LG   BL_LONG
#define TITLESIZE   12
#define ITEMSIZE   30
#define HEAD(head)
#define FLAGS_HI(f)
#define FLAGS_LO(f)
#define gtitem   do_gtitem
#define ITEMARGS
#define SUBARGS
#define MENU(obj, menu)
#define SUBITEM(mi, subno)
#define CHKARGS   ULONG menu BL_REG(d1), ULONG itemno BL_REG(d2), ULONG subno BL_REG(d3)

Functions

void _CreateMenuStrip (void)
void _setmenu (void)
void _gtunsetmenu (void)
void _gtmenutitle (void)
void _gtmenuitem2 (void)
void _gtmenuitem3 (void)
void _gtmenuitem (void)
void _gtmenuitem4 (void)
void _gtmenuitem5 (void)
void rigtmenulib_domenustate (void)
void rigtmenulib_domenustate2 (void)
void rigtmenulib_domenustate3 (void)
void rigtmenulib_domenustate4 (void)
void _gtsubitem2 (void)
void _gtsubitem3 (void)
void _gtsubitem (void)
void _gtsubitem4 (void)
void _gtsubitem5 (void)
void rigtmenulib_domenuchecked (void)
void rigtmenulib_domenuchecked2 (void)
void setmenuchecked (void)
void setmenuchecked2 (void)
void _freetitle (void)
void _freeitem (void)
void _freesubitem (void)
void _GetUserData (void)
void _GetUserData2 (void)
void rigtmenulib_libinit (void)
void rigtmenulib_libfinit (void)
void freemenu (void)
void createchk (void)
void setchk (void)
void rigtmenulib_statechk2 (void)
void rigtmenulib_statechk3 (void)
void rigtmenulib_statechk4 (void)
void rigtmenulib_chkchk3 (void)
void rigtmenulib_chkchk4 (void)
void chkchk5 (void)
void rigtmenulib_freechk (void)
static ULONG galloc (ULONG size, ULONG fl)
static void gfree (APTR mem, ULONG size)
static ULONG allocst (ULONG s, ULONG len)
static void freest (ULONG s)
static APTR walk (APTR *slot, UWORD n)
static void libinit_c (void)
 init: open gadtools.library (any version).
static void libfinit_c (void)
 finit: close gadtools.library.
static struct NewMenu * makearray (struct gtmenulist *obj)
static BB_BOOL createmenustrip (struct gtmenulist *obj, struct Screen **scr)
static BB_BOOL createmenustrip_c (struct Screen **scr, struct gtmenulist *obj)
 CreateMenuStrip GTMenuList#: make the menu strip of the object's lists (gadtools CreateMenusA, LayoutMenusA with new look menus).
static void setmenu_c (struct Screen **scr, struct Window **win, struct gtmenulist *obj, struct Library *intui)
 GTSetMenu GTMenuList#: attach the object's menu strip to the used window.
static void gtunsetmenu_c (struct Window **win, struct Library *intui)
 GTUnSetMenu: remove the menu strip from the used window (if it has one).
static void gtmenutitle_c (ULONG menu, ULONG text, const ULONG *args, struct gtmenulist *obj)
 GTMenuTitle GTMenuList#,menu,title$: insert a menu title as title menu of the list.
static void additem (struct gtmenulist *obj, struct gtentry *link, UWORD n, int sub, ULONG text, ULONG sc, const ULONG *sp)
static void do_gtitem (ULONG itemflags, ULONG menu, ULONG itemno, ULONG text, ULONG shortcut, const ULONG *sp, struct gtmenulist *obj)
static void gtmenuitem2_c (ULONG itemflags, ULONG menu, ULONG itemno, ULONG text, ULONG shortcut, ULONG exclude, const ULONG *stack, struct gtmenulist *obj)
 GTMenuItem GTMenuList#,flags,menu,item: insert a bar label (NM_BARLABEL) as item item of title menu.
static void gtmenuitem3_c (ULONG itemflags, ULONG menu, ULONG itemno, ULONG text, ULONG shortcut, ULONG exclude, const ULONG *stack, struct gtmenulist *obj)
 GTMenuItem GTMenuList#,flags,menu,item,itemtext$: insert an item without a shortcut.
static void gtmenuitem_c (ULONG itemflags, ULONG menu, ULONG itemno, ULONG text, ULONG shortcut, ULONG exclude, const ULONG *stack, struct gtmenulist *obj)
 GTMenuItem GTMenuList#,flags,menu,item,itemtext$,shortcut$: insert an item with a shortcut.
static void gtmenuitem4_c (ULONG itemflags, ULONG menu, ULONG itemno, ULONG text, ULONG shortcut, ULONG exclude, const ULONG *stack, struct gtmenulist *obj)
 GTMenuItem ...,itemtext$,shortcut$,mutualexclude: insert an item with a mutual exclude mask.
static void gtmenuitem5_c (ULONG itemflags, ULONG menu, ULONG itemno, ULONG text, ULONG shortcut, ULONG exclude, const ULONG *stack, struct gtmenulist *obj)
 GTMenuItem ...,itemtext$,shortcut$,mutualexclude,UserData: insert an item with UserData.
static void do_gtsubitem (ULONG itemflags, ULONG menu, ULONG itemno, ULONG subno, ULONG text, ULONG shortcut, const ULONG *sp, struct gtmenulist *obj)
static void gtsubitem2_c (ULONG itemflags, ULONG menu, ULONG itemno, ULONG subno, ULONG text, ULONG shortcut, const ULONG *stack, struct gtmenulist *obj)
 GTSubItem GTMenuList#,flags,menu,item,subitem: insert a bar label as sub item subitem of item item of title menu.
static void gtsubitem3_c (ULONG itemflags, ULONG menu, ULONG itemno, ULONG subno, ULONG text, ULONG shortcut, const ULONG *stack, struct gtmenulist *obj)
 GTSubItem GTMenuList#,flags,menu,item,subitem,itemtext$: insert a sub item without a shortcut.
static void gtsubitem_c (ULONG itemflags, ULONG menu, ULONG itemno, ULONG subno, ULONG text, ULONG shortcut, const ULONG *stack, struct gtmenulist *obj)
 GTSubItem ...,itemtext$,shortcut$: insert a sub item with a shortcut.
static void gtsubitem4_c (ULONG itemflags, ULONG menu, ULONG itemno, ULONG subno, ULONG text, ULONG shortcut, const ULONG *stack, struct gtmenulist *obj)
 GTSubItem ...,itemtext$,shortcut$,mutualexclude: insert a sub item with a mutual exclude mask.
static void gtsubitem5_c (ULONG itemflags, ULONG menu, ULONG itemno, ULONG subno, ULONG text, ULONG shortcut, const ULONG *stack, struct gtmenulist *obj)
 GTSubItem ...,itemtext$,shortcut$,mutualexclude,UserData: insert a sub item with a mutual exclude mask and UserData.
static void freeitemlist (struct gtentry *it, ULONG n)
static void freetitle (struct gtentry *title)
static void freemenu_c (struct gtmenulist *obj)
 The free routine of a GTMenuList object: the menu strip, the titles and their items.
static struct gtentry * finditem (struct gtmenulist *obj, ULONG menu, ULONG itemno, ULONG subno, struct gtentry **prev)
static void freetitle_c (ULONG menu, struct gtmenulist *obj)
 GTFreeMenu GTMenuList#,menu: remove a title with its items from the list.
static void freeitem_c (ULONG menu, ULONG itemno, struct gtmenulist *obj)
 GTFreeMenu GTMenuList#,menu,item: remove an item with its sub items and strings from the list.
static void freesubitem_c (ULONG menu, ULONG itemno, ULONG subno, struct gtmenulist *obj)
 GTFreeMenu GTMenuList#,menu,item,subitem: remove a sub item with its strings from the list.
static struct MenuItem * item (struct gtmenulist *obj, UWORD menu, UWORD itemno)
static void changestate (struct Menu *m, UWORD on, UBYTE bit)
static void domenustate_c (ULONG on, struct gtmenulist *obj)
 GTMenuState GTMenuList#,On|Off: enable or disable every menu of the strip (MENUENABLED).
static void domenustate2_c (ULONG menu, ULONG on, struct gtmenulist *obj)
 GTMenuState GTMenuList#,menu,On|Off: enable or disable a menu (MENUENABLED).
static void domenustate3_c (ULONG menu, ULONG itemno, ULONG on, struct gtmenulist *obj)
 GTMenuState GTMenuList#,menu,item,On|Off: enable or disable an item (ITEMENABLED, bit 4 of the low byte of Flags).
static void domenustate4_c (ULONG menu, ULONG itemno, ULONG subno, ULONG on, struct gtmenulist *obj)
 GTMenuState GTMenuList#,menu,item,subitem,On|Off: enable or disable a sub item (ITEMENABLED).
static ULONG domenuchecked_c (ULONG result, ULONG menu, ULONG itemno, struct gtmenulist *obj)
 GTMenuChecked(GTMenuList#,Menu,Item): whether an item of the strip is checked (CHECKED, bit 0 of the high byte of Flags).
static ULONG domenuchecked2_c (ULONG result, ULONG menu, ULONG itemno, ULONG subno, struct gtmenulist *obj)
 GTMenuChecked(GTMenuList#,Menu,Item,Subitem): whether a sub item is checked.
static void setchecked (struct MenuItem *mi, UWORD on)
static void setmenuchecked_c (ULONG menu, ULONG itemno, ULONG on, struct gtmenulist *obj)
 GTSetMenuChecked GTMenuList#,Menu,Item,Off|On: check or uncheck an item of the strip (CHECKED).
static void setmenuchecked2_c (ULONG menu, ULONG itemno, ULONG subno, ULONG on, struct gtmenulist *obj)
 GTSetMenuChecked GTMenuList#,Menu,Item,Subitem,Off|On: check or uncheck a sub item.
static ULONG getuserdata (struct gtmenulist *obj, ULONG menu, ULONG itemno, ULONG subno)
static ULONG getuserdata_c (ULONG menu, ULONG itemno, struct gtmenulist *obj)
 GTGetUserData(GTMenuList#,Menu,Item): the UserData of an item of the strip (GadTools' long behind the MenuItem).
static ULONG getuserdata2_c (ULONG menu, ULONG itemno, ULONG subno, struct gtmenulist *obj)
 GTGetUserData(GTMenuList#,Menu,Item,Subitem): the UserData of a sub item (of the item if Subitem is negative as a word).
static void listchk_c (struct gtmenulist *obj)
static int existschk (APTR **slot, UWORD n)
static void statechk (struct gtmenulist *obj, int depth, UWORD menu, UWORD itemno, UWORD subno)
static void statechk2_c (CHKARGS, struct gtmenulist *obj)
static void statechk3_c (CHKARGS, struct gtmenulist *obj)
static void statechk4_c (CHKARGS, struct gtmenulist *obj)
static void chkchk3_c (CHKARGS, struct gtmenulist *obj)
static void chkchk4_c (CHKARGS, struct gtmenulist *obj)
static void chkchk5_c (CHKARGS, struct gtmenulist *obj)
static void freechk_c (ULONG itemno)

Variables

static struct Library * gtbase
static struct Library * intuibase
static ULONG me
static ULONG userdata
static UWORD flags
static ULONG marraysize
static struct NewMenu * marray
static APTR vi
static const char gtname [] = "gadtools.library"
static const struct TagItem taglist [] = { { GTMN_FullMenu, (ULONG)-1 }, { 0, 0 } }
static const struct TagItem tl_layout [] = { { GTMN_NewLookMenus, (ULONG)-1 }, { 0, 0 } }

Macro Definition Documentation

◆ __NOLIBBASE__

#define __NOLIBBASE__

◆ CHKARGS

#define CHKARGS   ULONG menu BL_REG(d1), ULONG itemno BL_REG(d2), ULONG subno BL_REG(d3)

◆ FLAGS_HI

#define FLAGS_HI ( f)
Value:
(((UBYTE *)&(f))[0])

◆ FLAGS_LO

#define FLAGS_LO ( f)
Value:
(((UBYTE *)&(f))[1])

◆ GADTOOLS_BASE_NAME

#define GADTOOLS_BASE_NAME   gtbase

◆ gtitem

#define gtitem   do_gtitem

◆ HEAD

#define HEAD ( head)
Value:
((struct gtentry *)&(head))
Definition rigtmenulib.c:261

◆ INTUITION_BASE_NAME

#define INTUITION_BASE_NAME   intuibase

◆ ITEMARGS

#define ITEMARGS
Value:
ULONG itemflags BL_REG(d1), ULONG menu BL_REG(d2), ULONG itemno BL_REG(d3), \
ULONG text BL_REG(d4), ULONG shortcut BL_REG(d5), ULONG exclude BL_REG(d6), \
const ULONG *stack BL_REG(a2), struct gtmenulist *obj BL_REG(a3)
#define BL_REG(r)
Definition blitzlib.h:280
static UBYTE shortcut
Definition menuslib.c:261
Definition rigtmenulib.c:251
Definition basictest_read.c:318

◆ ITEMSIZE

#define ITEMSIZE   30

◆ LG

#define LG   BL_LONG

◆ MENU

#define MENU ( obj,
menu )
Value:
((struct Menu *)walk((APTR *)&(obj)->strip, (menu)))
static UBYTE * walk(UBYTE *p, UWORD n)
Definition menuslib.c:324

◆ S

#define S   BL_STRING

◆ SUBARGS

#define SUBARGS
Value:
ULONG itemflags BL_REG(d1), ULONG menu BL_REG(d2), ULONG itemno BL_REG(d3), \
ULONG subno BL_REG(d4), ULONG text BL_REG(d5), ULONG shortcut BL_REG(d6), \
const ULONG *stack BL_REG(a2), struct gtmenulist *obj BL_REG(a3)

◆ SUBITEM

#define SUBITEM ( mi,
subno )
Value:
((struct MenuItem *)walk((APTR *)&(mi)->SubItem, (subno)))

◆ TITLESIZE

#define TITLESIZE   12

◆ W

#define W   BL_WORD

Function Documentation

◆ _CreateMenuStrip()

void _CreateMenuStrip ( void )

◆ _freeitem()

void _freeitem ( void )

◆ _freesubitem()

void _freesubitem ( void )

◆ _freetitle()

void _freetitle ( void )

◆ _GetUserData()

void _GetUserData ( void )

◆ _GetUserData2()

void _GetUserData2 ( void )

◆ _gtmenuitem()

void _gtmenuitem ( void )

◆ _gtmenuitem2()

void _gtmenuitem2 ( void )

◆ _gtmenuitem3()

void _gtmenuitem3 ( void )

◆ _gtmenuitem4()

void _gtmenuitem4 ( void )

◆ _gtmenuitem5()

void _gtmenuitem5 ( void )

◆ _gtmenutitle()

void _gtmenutitle ( void )

◆ _gtsubitem()

void _gtsubitem ( void )

◆ _gtsubitem2()

void _gtsubitem2 ( void )

◆ _gtsubitem3()

void _gtsubitem3 ( void )

◆ _gtsubitem4()

void _gtsubitem4 ( void )

◆ _gtsubitem5()

void _gtsubitem5 ( void )

◆ _gtunsetmenu()

void _gtunsetmenu ( void )

◆ _setmenu()

void _setmenu ( void )

◆ additem()

void additem ( struct gtmenulist * obj,
struct gtentry * link,
UWORD n,
int sub,
ULONG text,
ULONG sc,
const ULONG * sp )
static

◆ allocst()

ULONG allocst ( ULONG s,
ULONG len )
static

◆ changestate()

void changestate ( struct Menu * m,
UWORD on,
UBYTE bit )
static

◆ chkchk3_c()

void chkchk3_c ( CHKARGS ,
struct gtmenulist * obj )
static

◆ chkchk4_c()

void chkchk4_c ( CHKARGS ,
struct gtmenulist * obj )
static

◆ chkchk5()

void chkchk5 ( void )

◆ chkchk5_c()

void chkchk5_c ( CHKARGS ,
struct gtmenulist * obj )
static

◆ createchk()

void createchk ( void )

◆ createmenustrip()

BB_BOOL createmenustrip ( struct gtmenulist * obj,
struct Screen ** scr )
static

◆ createmenustrip_c()

BB_BOOL createmenustrip_c ( struct Screen ** scr,
struct gtmenulist * obj )
static

CreateMenuStrip GTMenuList#: make the menu strip of the object's lists (gadtools CreateMenusA, LayoutMenusA with new look menus).

An old strip is freed first. The NewMenu array ((count + 1) * 20 bytes, memlib) is freed again afterwards. Fixed (#689): a list without titles gives 0 and builds nothing: the old strip is freed, the object has none, a later GTSetMenu attaches nothing (the original frees the old strip too and reads the list at address 0); when CreateMenusA, GetVisualInfoA or LayoutMenusA fails, the strip is freed and the result is 0 (the original checks none of them and returns -1). Error check (createchk): "GTMenu has no data to build GTMenuList from!".

Parameters
scra0: the used screen object (screenslib), its first long the Screen
obja3: the GTMenuList object (ia3|pd0 of list#)
Returns
d0: BB_TRUE; BB_FALSE without gadtools.library, without titles, if the array could not be allocated or a gadtools call failed (then the object has no strip)

◆ do_gtitem()

void do_gtitem ( ULONG itemflags,
ULONG menu,
ULONG itemno,
ULONG text,
ULONG shortcut,
const ULONG * sp,
struct gtmenulist * obj )
static

◆ do_gtsubitem()

void do_gtsubitem ( ULONG itemflags,
ULONG menu,
ULONG itemno,
ULONG subno,
ULONG text,
ULONG shortcut,
const ULONG * sp,
struct gtmenulist * obj )
static

◆ domenuchecked2_c()

ULONG domenuchecked2_c ( ULONG result,
ULONG menu,
ULONG itemno,
ULONG subno,
struct gtmenulist * obj )
static

GTMenuChecked(GTMenuList#,Menu,Item,Subitem): whether a sub item is checked.

Not checked (error check chkchk4).

Parameters
resultd0: its upper word stays
menud1.w: the menu
itemnod2.w: the item
subnod3.w: the sub item
obja2: the GTMenuList object
Returns
d0.w: -1 if checked, else 0

◆ domenuchecked_c()

ULONG domenuchecked_c ( ULONG result,
ULONG menu,
ULONG itemno,
struct gtmenulist * obj )
static

GTMenuChecked(GTMenuList#,Menu,Item): whether an item of the strip is checked (CHECKED, bit 0 of the high byte of Flags).

Not checked (error check chkchk3).

Parameters
resultd0: its upper word stays (SNE:EXT.w, a word result)
menud1.w: the menu
itemnod2.w: the item
obja2: the GTMenuList object (0x1280: ia2)
Returns
d0.w: -1 if checked, else 0

◆ domenustate2_c()

void domenustate2_c ( ULONG menu,
ULONG on,
struct gtmenulist * obj )
static

GTMenuState GTMenuList#,menu,On|Off: enable or disable a menu (MENUENABLED).

The menu is not checked (a missing one reads address 0; error check statechk2: "Illegal Menu number"). Directly, as above (#693).

Parameters
menud1.w: the menu
ond2.w: 0 off, else on
obja3: the GTMenuList object

◆ domenustate3_c()

void domenustate3_c ( ULONG menu,
ULONG itemno,
ULONG on,
struct gtmenulist * obj )
static

GTMenuState GTMenuList#,menu,item,On|Off: enable or disable an item (ITEMENABLED, bit 4 of the low byte of Flags).

Not checked (error check statechk3); directly, as above (#693).

Parameters
menud1.w: the menu
itemnod2.w: the item
ond3.w: 0 off, else on
obja3: the GTMenuList object

◆ domenustate4_c()

void domenustate4_c ( ULONG menu,
ULONG itemno,
ULONG subno,
ULONG on,
struct gtmenulist * obj )
static

GTMenuState GTMenuList#,menu,item,subitem,On|Off: enable or disable a sub item (ITEMENABLED).

Not checked (error check statechk4); directly, as above (#693).

Parameters
menud1.w: the menu
itemnod2.w: the item
subnod3.w: the sub item
ond4.w: 0 off, else on
obja3: the GTMenuList object

◆ domenustate_c()

void domenustate_c ( ULONG on,
struct gtmenulist * obj )
static

GTMenuState GTMenuList#,On|Off: enable or disable every menu of the strip (MENUENABLED).

The flags are changed directly, also while the strip is attached to a window, as documented (no defect, #693).

Parameters
ond1.w: 0 off, else on
obja3: the GTMenuList object (0x1380: ia3)

◆ existschk()

int existschk ( APTR ** slot,
UWORD n )
static

◆ finditem()

struct gtentry * finditem ( struct gtmenulist * obj,
ULONG menu,
ULONG itemno,
ULONG subno,
struct gtentry ** prev )
static

◆ freechk_c()

void freechk_c ( ULONG itemno)
static

◆ freeitem_c()

void freeitem_c ( ULONG menu,
ULONG itemno,
struct gtmenulist * obj )
static

GTFreeMenu GTMenuList#,menu,item: remove an item with its sub items and strings from the list.

Fixed (#691): the item number is tested as a word; the original tests it as a long (TST.l), so the upper word of the word argument decided whether it is given. A negative item number frees the title (as an item); Fixed (#1089): the error check (freechk) refuses it, "Illegal Menu Item number" (the original has no check).

Parameters
menud1.w: the title
itemnod2.w: the item
obja3: the GTMenuList object

◆ freeitemlist()

void freeitemlist ( struct gtentry * it,
ULONG n )
static

◆ freemenu()

void freemenu ( void )

◆ freemenu_c()

void freemenu_c ( struct gtmenulist * obj)
static

The free routine of a GTMenuList object: the menu strip, the titles and their items.

FreeMenus with the gadtools base unchecked, like the original (a strip exists only if it was open). Fixed (#695): the title strings are freed too (the original: the nodes only). The object is cleared (+0, +4, the long at +8).

Parameters
obja3: the object

◆ freest()

void freest ( ULONG s)
static

◆ freesubitem_c()

void freesubitem_c ( ULONG menu,
ULONG itemno,
ULONG subno,
struct gtmenulist * obj )
static

GTFreeMenu GTMenuList#,menu,item,subitem: remove a sub item with its strings from the list.

Fixed (#691): the numbers are tested as words (the original: as longs, TST.l). Fixed (#1089): the error check (freechk) refuses a negative item number, "Illegal Menu Item number" (the original has no check; a negative item frees the title as an item). A negative sub item number frees the whole item, as in the original, also with the debugger.

Parameters
menud1.w: the title
itemnod2.w: the item
subnod3.w: the sub item
obja3: the GTMenuList object

◆ freetitle()

void freetitle ( struct gtentry * title)
static

◆ freetitle_c()

void freetitle_c ( ULONG menu,
struct gtmenulist * obj )
static

GTFreeMenu GTMenuList#,menu: remove a title with its items from the list.

Nothing without gadtools.library or if it is missing. Fixed (#695): its string is freed too (the original: it stays). The menu strip is not changed (it is made again by CreateMenuStrip).

Parameters
menud1.w: the title
obja3: the GTMenuList object

◆ galloc()

ULONG galloc ( ULONG size,
ULONG fl )
static

◆ getuserdata()

ULONG getuserdata ( struct gtmenulist * obj,
ULONG menu,
ULONG itemno,
ULONG subno )
static

◆ getuserdata2_c()

ULONG getuserdata2_c ( ULONG menu,
ULONG itemno,
ULONG subno,
struct gtmenulist * obj )
static

GTGetUserData(GTMenuList#,Menu,Item,Subitem): the UserData of a sub item (of the item if Subitem is negative as a word).

Not checked (error check chkchk5: as chkchk3 for Subitem -1).

Parameters
menud1.w: the menu
itemnod2.w: the item
subnod3.w: the sub item
obja2: the GTMenuList object
Returns
d0: the UserData

◆ getuserdata_c()

ULONG getuserdata_c ( ULONG menu,
ULONG itemno,
struct gtmenulist * obj )
static

GTGetUserData(GTMenuList#,Menu,Item): the UserData of an item of the strip (GadTools' long behind the MenuItem).

Not checked (error check chkchk3).

Parameters
menud1.w: the menu
itemnod2.w: the item
obja2: the GTMenuList object
Returns
d0: the UserData

◆ gfree()

void gfree ( APTR mem,
ULONG size )
static

◆ gtmenuitem2_c()

void gtmenuitem2_c ( ULONG itemflags,
ULONG menu,
ULONG itemno,
ULONG text,
ULONG shortcut,
ULONG exclude,
const ULONG * stack,
struct gtmenulist * obj )
static

GTMenuItem GTMenuList#,flags,menu,item: insert a bar label (NM_BARLABEL) as item item of title menu.

Mutual exclude and UserData 0. Nothing without gadtools.library or if the title or item - 1 is missing.

Parameters
itemflagsd1.w: the NewMenu flags
menud2.w: the title
itemnod3.w: the item's number
stacka2: the argument stack
obja3: the GTMenuList object

◆ gtmenuitem3_c()

void gtmenuitem3_c ( ULONG itemflags,
ULONG menu,
ULONG itemno,
ULONG text,
ULONG shortcut,
ULONG exclude,
const ULONG * stack,
struct gtmenulist * obj )
static

GTMenuItem GTMenuList#,flags,menu,item,itemtext$: insert an item without a shortcut.

As the form without text; the text is copied with AllocSt.

Parameters
itemflagsd1.w: the NewMenu flags
menud2.w: the title
itemnod3.w: the item's number
textd4: itemtext$
stacka2: the argument stack (the string lengths)
obja3: the GTMenuList object

◆ gtmenuitem4_c()

void gtmenuitem4_c ( ULONG itemflags,
ULONG menu,
ULONG itemno,
ULONG text,
ULONG shortcut,
ULONG exclude,
const ULONG * stack,
struct gtmenulist * obj )
static

GTMenuItem ...,itemtext$,shortcut$,mutualexclude: insert an item with a mutual exclude mask.

Parameters
itemflagsd1.w: the NewMenu flags
menud2.w: the title
itemnod3.w: the item's number
textd4: itemtext$
shortcutd5: shortcut$ (#694)
excluded6: the mutual exclude mask
stacka2: the argument stack (the string lengths)
obja3: the GTMenuList object

◆ gtmenuitem5_c()

void gtmenuitem5_c ( ULONG itemflags,
ULONG menu,
ULONG itemno,
ULONG text,
ULONG shortcut,
ULONG exclude,
const ULONG * stack,
struct gtmenulist * obj )
static

GTMenuItem ...,itemtext$,shortcut$,mutualexclude,UserData: insert an item with UserData.

Fixed (#692): the mutual exclude is taken from -12(a2), where the compiler pushes the 7th argument (from the 7th on the arguments are pushed, d6 holds the last one: here UserData). The original jumps past MOVE.l d6,me and keeps the mutual exclude of the GTMenuItem/GTSubItem before.

Parameters
itemflagsd1.w: the NewMenu flags
menud2.w: the title
itemnod3.w: the item's number
textd4: itemtext$
shortcutd5: shortcut$ (#694)
excluded6: UserData, the last argument (not used)
stacka2: the argument stack, the mutual exclude at -12(a2), UserData at -16(a2)
obja3: the GTMenuList object

◆ gtmenuitem_c()

void gtmenuitem_c ( ULONG itemflags,
ULONG menu,
ULONG itemno,
ULONG text,
ULONG shortcut,
ULONG exclude,
const ULONG * stack,
struct gtmenulist * obj )
static

GTMenuItem GTMenuList#,flags,menu,item,itemtext$,shortcut$: insert an item with a shortcut.

Fixed (#694): shortcut$ is tested by its whole address; the original tests its low word, a string at an address with low word 0 counted as none.

Parameters
itemflagsd1.w: the NewMenu flags
menud2.w: the title
itemnod3.w: the item's number
textd4: itemtext$
shortcutd5: shortcut$
stacka2: the argument stack (the string lengths)
obja3: the GTMenuList object

◆ gtmenutitle_c()

void gtmenutitle_c ( ULONG menu,
ULONG text,
const ULONG * args,
struct gtmenulist * obj )
static

GTMenuTitle GTMenuList#,menu,title$: insert a menu title as title menu of the list.

Nothing without gadtools.library or if title menu - 1 is missing. The title (12 bytes) is allocated uncleared (MEMF_PUBLIC; all its fields are written, no defect), the text copied with maxslib AllocSt.

Parameters
menud1.w: the title's number
textd2: title$
argsa2: the argument stack, -4(a2) the length of title$
obja3: the GTMenuList object

◆ gtsubitem2_c()

void gtsubitem2_c ( ULONG itemflags,
ULONG menu,
ULONG itemno,
ULONG subno,
ULONG text,
ULONG shortcut,
const ULONG * stack,
struct gtmenulist * obj )
static

GTSubItem GTMenuList#,flags,menu,item,subitem: insert a bar label as sub item subitem of item item of title menu.

Mutual exclude and UserData 0. Nothing without gadtools.library or if the title, the item or subitem - 1 is missing.

Parameters
itemflagsd1.w: the NewMenu flags
menud2.w: the title
itemnod3.w: the item
subnod4.w: the sub item's number
stacka2: the argument stack
obja3: the GTMenuList object

◆ gtsubitem3_c()

void gtsubitem3_c ( ULONG itemflags,
ULONG menu,
ULONG itemno,
ULONG subno,
ULONG text,
ULONG shortcut,
const ULONG * stack,
struct gtmenulist * obj )
static

GTSubItem GTMenuList#,flags,menu,item,subitem,itemtext$: insert a sub item without a shortcut.

Parameters
itemflagsd1.w: the NewMenu flags
menud2.w: the title
itemnod3.w: the item
subnod4.w: the sub item's number
textd5: itemtext$
stacka2: the argument stack (the string lengths)
obja3: the GTMenuList object

◆ gtsubitem4_c()

void gtsubitem4_c ( ULONG itemflags,
ULONG menu,
ULONG itemno,
ULONG subno,
ULONG text,
ULONG shortcut,
const ULONG * stack,
struct gtmenulist * obj )
static

GTSubItem ...,itemtext$,shortcut$,mutualexclude: insert a sub item with a mutual exclude mask.

Parameters
itemflagsd1.w: the NewMenu flags
menud2.w: the title
itemnod3.w: the item
subnod4.w: the sub item's number
textd5: itemtext$
shortcutd6: shortcut$ (#694)
stacka2: the argument stack, the mutual exclude at -16(a2)
obja3: the GTMenuList object

◆ gtsubitem5_c()

void gtsubitem5_c ( ULONG itemflags,
ULONG menu,
ULONG itemno,
ULONG subno,
ULONG text,
ULONG shortcut,
const ULONG * stack,
struct gtmenulist * obj )
static

GTSubItem ...,itemtext$,shortcut$,mutualexclude,UserData: insert a sub item with a mutual exclude mask and UserData.

Parameters
itemflagsd1.w: the NewMenu flags
menud2.w: the title
itemnod3.w: the item
subnod4.w: the sub item's number
textd5: itemtext$
shortcutd6: shortcut$ (#694)
stacka2: the argument stack, the mutual exclude at -16(a2), UserData at -20(a2)
obja3: the GTMenuList object

◆ gtsubitem_c()

void gtsubitem_c ( ULONG itemflags,
ULONG menu,
ULONG itemno,
ULONG subno,
ULONG text,
ULONG shortcut,
const ULONG * stack,
struct gtmenulist * obj )
static

GTSubItem ...,itemtext$,shortcut$: insert a sub item with a shortcut.

shortcut$ is a push argument: its address and length are taken from the a2 stack (the d6 value only decides whether there is one; fixed #694: the whole address, the original tests its low word).

Parameters
itemflagsd1.w: the NewMenu flags
menud2.w: the title
itemnod3.w: the item
subnod4.w: the sub item's number
textd5: itemtext$
shortcutd6: tested for 0
stacka2: the argument stack (the string lengths, the pushed shortcut$)
obja3: the GTMenuList object

◆ gtunsetmenu_c()

void gtunsetmenu_c ( struct Window ** win,
struct Library * intui )
static

GTUnSetMenu: remove the menu strip from the used window (if it has one).

Parameters
wina2: the used window object
intuia6: intuition.library

◆ item()

struct MenuItem * item ( struct gtmenulist * obj,
UWORD menu,
UWORD itemno )
static

◆ libfinit_c()

void libfinit_c ( void )
static

finit: close gadtools.library.

Fixed (#690): it closes the library if it is open; the original tests the base the wrong way round (TST.l:BNE 'ok) and so never closes it.

◆ libinit_c()

void libinit_c ( void )
static

init: open gadtools.library (any version).

Without it the list commands and CreateMenuStrip do nothing.

◆ listchk_c()

void listchk_c ( struct gtmenulist * obj)
static

◆ makearray()

struct NewMenu * makearray ( struct gtmenulist * obj)
static

◆ rigtmenulib_chkchk3()

void rigtmenulib_chkchk3 ( void )

◆ rigtmenulib_chkchk4()

void rigtmenulib_chkchk4 ( void )

◆ rigtmenulib_domenuchecked()

void rigtmenulib_domenuchecked ( void )

◆ rigtmenulib_domenuchecked2()

void rigtmenulib_domenuchecked2 ( void )

◆ rigtmenulib_domenustate()

void rigtmenulib_domenustate ( void )

◆ rigtmenulib_domenustate2()

void rigtmenulib_domenustate2 ( void )

◆ rigtmenulib_domenustate3()

void rigtmenulib_domenustate3 ( void )

◆ rigtmenulib_domenustate4()

void rigtmenulib_domenustate4 ( void )

◆ rigtmenulib_freechk()

void rigtmenulib_freechk ( void )

◆ rigtmenulib_libfinit()

void rigtmenulib_libfinit ( void )

◆ rigtmenulib_libinit()

void rigtmenulib_libinit ( void )

◆ rigtmenulib_statechk2()

void rigtmenulib_statechk2 ( void )

◆ rigtmenulib_statechk3()

void rigtmenulib_statechk3 ( void )

◆ rigtmenulib_statechk4()

void rigtmenulib_statechk4 ( void )

◆ setchecked()

void setchecked ( struct MenuItem * mi,
UWORD on )
static

◆ setchk()

void setchk ( void )

◆ setmenu_c()

void setmenu_c ( struct Screen ** scr,
struct Window ** win,
struct gtmenulist * obj,
struct Library * intui )
static

GTSetMenu GTMenuList#: attach the object's menu strip to the used window.

Without a strip, CreateMenuStrip makes it first (nothing if that fails); a strip already on the window is cleared first.

Parameters
scra0: the used screen object
wina1: the used window object, its first long the Window
obja3: the GTMenuList object
intuia6: intuition.library

◆ setmenuchecked()

void setmenuchecked ( void )

◆ setmenuchecked2()

void setmenuchecked2 ( void )

◆ setmenuchecked2_c()

void setmenuchecked2_c ( ULONG menu,
ULONG itemno,
ULONG subno,
ULONG on,
struct gtmenulist * obj )
static

GTSetMenuChecked GTMenuList#,Menu,Item,Subitem,Off|On: check or uncheck a sub item.

Not checked (error check chkchk4). Directly, as above (#693).

Parameters
menud1.w: the menu
itemnod2.w: the item
subnod3.w: the sub item
ond4.w: 0 off, else on
obja2: the GTMenuList object

◆ setmenuchecked_c()

void setmenuchecked_c ( ULONG menu,
ULONG itemno,
ULONG on,
struct gtmenulist * obj )
static

GTSetMenuChecked GTMenuList#,Menu,Item,Off|On: check or uncheck an item of the strip (CHECKED).

Not checked (error check chkchk3). Directly (no defect, #693), also while the strip is attached to a window.

Parameters
menud1.w: the menu
itemnod2.w: the item
ond3.w: 0 off, else on
obja2: the GTMenuList object

◆ statechk()

void statechk ( struct gtmenulist * obj,
int depth,
UWORD menu,
UWORD itemno,
UWORD subno )
static

◆ statechk2_c()

void statechk2_c ( CHKARGS ,
struct gtmenulist * obj )
static

◆ statechk3_c()

void statechk3_c ( CHKARGS ,
struct gtmenulist * obj )
static

◆ statechk4_c()

void statechk4_c ( CHKARGS ,
struct gtmenulist * obj )
static

◆ walk()

APTR walk ( APTR * slot,
UWORD n )
static

Variable Documentation

◆ flags

UWORD flags
static

◆ gtbase

struct Library* gtbase
static

◆ gtname

const char gtname[] = "gadtools.library"
static

◆ intuibase

struct Library * intuibase
static

◆ marray

struct NewMenu* marray
static

◆ marraysize

ULONG marraysize
static

◆ me

ULONG me
static

◆ taglist

const struct TagItem taglist[] = { { GTMN_FullMenu, (ULONG)-1 }, { 0, 0 } }
static

◆ tl_layout

const struct TagItem tl_layout[] = { { GTMN_NewLookMenus, (ULONG)-1 }, { 0, 0 } }
static

◆ userdata

ULONG userdata
static

◆ vi

APTR vi
static