NetSurf
Macros | Enumerations | Functions
gui_menu.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define AMI_HOTLIST_ITEMS   200
 Maximum number of hotlist items (somewhat arbitrary value) More...
 
#define AMI_MENU_AREXX_ITEMS   20
 Maximum number of ARexx menu items (somewhat arbitrary value) More...
 
#define AMI_MENU_MAX   AMI_MENU_AREXX
 

Enumerations

enum  {
  M_PROJECT = 0 , M_NEWWIN , M_NEWTAB , M_BAR_P1 ,
  M_OPEN , M_SAVEAS , M_SAVESRC , M_SAVETXT ,
  M_SAVECOMP , M_SAVEIFF , M_BAR_P2 , M_PRINT ,
  M_BAR_P3 , M_CLOSETAB , M_CLOSEWIN , M_BAR_P4 ,
  M_ABOUT , M_BAR_P5 , M_QUIT , M_EDIT ,
  M_CUT , M_COPY , M_PASTE , M_BAR_E1 ,
  M_SELALL , M_CLEAR , M_BAR_E2 , M_UNDO ,
  M_REDO , M_BROWSER , M_FIND , M_BAR_B1 ,
  M_HISTLOCL , M_HISTGLBL , M_BAR_B2 , M_COOKIES ,
  M_BAR_B3 , M_SCALE , M_SCALEDEC , M_SCALENRM ,
  M_SCALEINC , M_IMAGES , M_IMGFORE , M_IMGBACK ,
  M_JS , M_CSS , M_BAR_B4 , M_REDRAW ,
  M_HOTLIST , M_HLADD , M_HLSHOW , M_BAR_H1 ,
  AMI_MENU_HOTLIST , AMI_MENU_HOTLIST_MAX = AMI_MENU_HOTLIST + AMI_HOTLIST_ITEMS , M_PREFS , M_PREDIT ,
  M_BAR_S1 , M_SNAPSHOT , M_PRSAVE , M_AREXX ,
  M_AREXXEX , M_BAR_A1 , AMI_MENU_AREXX , AMI_MENU_AREXX_MAX = AMI_MENU_AREXX + AMI_MENU_AREXX_ITEMS
}
 enum menu structure, has to be here as we need it below. More...
 

Functions

ULONG ami_gui_menu_number (int item)
 
struct Menu * ami_gui_menu_create (struct gui_window_2 *gwin)
 
void ami_gui_menu_free (struct gui_window_2 *gwin)
 
void ami_gui_menu_update_checked (struct gui_window_2 *gwin)
 
void ami_gui_menu_update_disabled (struct gui_window *g, struct hlcache_handle *c)
 
void ami_gui_menu_set_check_toggled (void)
 Sets that an item linked to a toggle menu item has been changed. More...
 
bool ami_gui_menu_get_check_toggled (void)
 Gets if the menu needs updating because an item linked to a toggle menu item has been changed. More...
 
void ami_gui_menu_set_checked (struct Menu *menu, int item, bool check)
 Set checked state of a menu item almost generic, but not quite. More...
 
void ami_gui_menu_set_disabled (struct Window *win, struct Menu *menu, int item, bool disable)
 Set disabled state of a menu item almost generic, but not quite. More...
 
void ami_gui_menu_refresh_hotlist (void)
 Refresh the Hotlist menu. More...
 
bool ami_gui_menu_quit_selected (void)
 Gets if NetSurf has been quit from the menu. More...
 
void ami_gui_menu_freemenus (struct Menu *menu, struct ami_menu_data **md)
 Frees a menu. More...
 

Macro Definition Documentation

◆ AMI_HOTLIST_ITEMS

#define AMI_HOTLIST_ITEMS   200

Maximum number of hotlist items (somewhat arbitrary value)

Definition at line 23 of file gui_menu.h.

◆ AMI_MENU_AREXX_ITEMS

#define AMI_MENU_AREXX_ITEMS   20

Maximum number of ARexx menu items (somewhat arbitrary value)

Definition at line 26 of file gui_menu.h.

◆ AMI_MENU_MAX

#define AMI_MENU_MAX   AMI_MENU_AREXX

Definition at line 107 of file gui_menu.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

enum menu structure, has to be here as we need it below.

Enumerator
M_PROJECT 
M_NEWWIN 
M_NEWTAB 
M_BAR_P1 
M_OPEN 
M_SAVEAS 
M_SAVESRC 
M_SAVETXT 
M_SAVECOMP 
M_SAVEIFF 
M_BAR_P2 
M_PRINT 
M_BAR_P3 
M_CLOSETAB 
M_CLOSEWIN 
M_BAR_P4 
M_ABOUT 
M_BAR_P5 
M_QUIT 
M_EDIT 
M_CUT 
M_COPY 
M_PASTE 
M_BAR_E1 
M_SELALL 
M_CLEAR 
M_BAR_E2 
M_UNDO 
M_REDO 
M_BROWSER 
M_FIND 
M_BAR_B1 
M_HISTLOCL 
M_HISTGLBL 
M_BAR_B2 
M_COOKIES 
M_BAR_B3 
M_SCALE 
M_SCALEDEC 
M_SCALENRM 
M_SCALEINC 
M_IMAGES 
M_IMGFORE 
M_IMGBACK 
M_JS 
M_CSS 
M_BAR_B4 
M_REDRAW 
M_HOTLIST 
M_HLADD 
M_HLSHOW 
M_BAR_H1 
AMI_MENU_HOTLIST 
AMI_MENU_HOTLIST_MAX 
M_PREFS 
M_PREDIT 
M_BAR_S1 
M_SNAPSHOT 
M_PRSAVE 
M_AREXX 
M_AREXXEX 
M_BAR_A1 
AMI_MENU_AREXX 
AMI_MENU_AREXX_MAX 

Definition at line 29 of file gui_menu.h.

Function Documentation

◆ ami_gui_menu_create()

struct Menu * ami_gui_menu_create ( struct gui_window_2 gwin)

Definition at line 1062 of file gui_menu.c.

References ami_gui2_get_menu_data(), ami_gui2_set_menu(), ami_init_menulabs(), AMI_MENU_AREXX_MAX, ami_menu_arexx_scan(), ami_menu_layout(), ami_menu_scan(), and LIB_IS_AT_LEAST.

Referenced by gui_window_create().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ami_gui_menu_free()

void ami_gui_menu_free ( struct gui_window_2 gwin)

Definition at line 1138 of file gui_menu.c.

References ami_free_menulabs(), ami_gui2_get_object(), ami_gui2_set_menu(), AMI_WIN_MAIN, and LIB_IS_AT_LEAST.

Referenced by gui_window_destroy().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ami_gui_menu_freemenus()

void ami_gui_menu_freemenus ( struct Menu *  menu,
struct ami_menu_data **  md 
)

Frees a menu.

Only used on OS3 and old OS4.

Definition at line 1127 of file gui_menu.c.

References ami_free_menulabs().

Referenced by ami_gui2_set_menu().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ami_gui_menu_get_check_toggled()

bool ami_gui_menu_get_check_toggled ( void  )

Gets if the menu needs updating because an item linked to a toggle menu item has been changed.

NB: This also clears the state

Returns
true if the menus need refreshing

Definition at line 818 of file gui_menu.c.

References ami_menu_check_toggled, and LIB_IS_AT_LEAST.

Referenced by ami_handle_msg().

Here is the caller graph for this function:

◆ ami_gui_menu_number()

ULONG ami_gui_menu_number ( int  item)

Definition at line 528 of file gui_menu.c.

References M_CLEAR, M_CLOSETAB, M_COPY, M_CSS, M_CUT, M_FIND, M_IMGBACK, M_IMGFORE, M_JS, M_PASTE, M_REDO, M_SAVECOMP, M_SAVEIFF, M_SAVETXT, M_SELALL, M_UNDO, and NSLOG.

Referenced by ami_gui_menu_set_checked_gt(), ami_gui_menu_set_disabled_gt(), and ami_gui_menu_update_checked().

Here is the caller graph for this function:

◆ ami_gui_menu_quit_selected()

bool ami_gui_menu_quit_selected ( void  )

Gets if NetSurf has been quit from the menu.

Returns
true if NetSurf has been quit

Definition at line 1158 of file gui_menu.c.

References menu_quit.

Referenced by ami_handle_msg().

Here is the caller graph for this function:

◆ ami_gui_menu_refresh_hotlist()

void ami_gui_menu_refresh_hotlist ( void  )

Refresh the Hotlist menu.

Definition at line 1163 of file gui_menu.c.

References AMI_MENU_HOTLIST_MAX, ami_menu_refresh(), ami_menu_scan(), and M_HOTLIST.

Referenced by ami_gui_hotlist_update_all().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ami_gui_menu_set_check_toggled()

void ami_gui_menu_set_check_toggled ( void  )

Sets that an item linked to a toggle menu item has been changed.

Definition at line 808 of file gui_menu.c.

References ami_menu_check_toggled, and LIB_IS_AT_LEAST.

Referenced by ami_gui_opts_use(), and HOOKF().

Here is the caller graph for this function:

◆ ami_gui_menu_set_checked()

void ami_gui_menu_set_checked ( struct Menu *  menu,
int  item,
bool  check 
)

Set checked state of a menu item almost generic, but not quite.

Definition at line 644 of file gui_menu.c.

References ami_gui_menu_set_checked_gt(), and LIB_IS_AT_LEAST.

Referenced by ami_gui_opts_use().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ami_gui_menu_set_disabled()

void ami_gui_menu_set_disabled ( struct Window *  win,
struct Menu *  menu,
int  item,
bool  disable 
)

Set disabled state of a menu item almost generic, but not quite.

Definition at line 679 of file gui_menu.c.

References ami_gui_menu_set_disabled_gt(), LIB_IS_AT_LEAST, and gui_window_2::win.

Referenced by ami_gui_menu_update_disabled(), ami_update_buttons(), gui_start_selection(), gui_window_place_caret(), and gui_window_remove_caret().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ami_gui_menu_update_checked()

void ami_gui_menu_update_checked ( struct gui_window_2 gwin)

Definition at line 691 of file gui_menu.c.

References ami_gui2_get_object(), ami_gui2_get_window(), ami_gui_menu_number(), AMI_WIN_MAIN, LIB_IS_AT_LEAST, M_CSS, M_IMGBACK, M_IMGFORE, M_JS, and nsoption_bool.

Referenced by ami_gui_menu_update_all().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ami_gui_menu_update_disabled()

void ami_gui_menu_update_disabled ( struct gui_window g,
struct hlcache_handle c 
)

Definition at line 735 of file gui_menu.c.

References ami_gui_get_browser_window(), ami_gui_get_menu(), ami_gui_get_window(), ami_gui_menu_set_disabled(), ami_mime_compare(), browser_window_get_editor_flags(), BW_EDITOR_CAN_COPY, BW_EDITOR_CAN_CUT, BW_EDITOR_CAN_PASTE, CONTENT_CSS, content_get_bitmap(), content_get_type(), M_CLEAR, M_COPY, M_CUT, M_FIND, M_PASTE, M_SAVECOMP, M_SAVEIFF, M_SAVETXT, M_SELALL, and nsoption_bool.

Referenced by ami_switch_tab(), and gui_window_new_content().

Here is the call graph for this function:
Here is the caller graph for this function: