NetSurf
|
#include <stdlib.h>
#include <stdbool.h>
#include <gdk/gdkkeysyms.h>
#include <gtk/gtk.h>
#include "utils/messages.h"
#include "gtk/compat.h"
#include "gtk/menu.h"
#include "gtk/warn.h"
#include "gtk/accelerator.h"
Go to the source code of this file.
Macros | |
#define | NEW_MENU(n, m) |
#define | IMAGE_ITEM(p, q, r, s, t) nsgtk_menu_add_image_item(s->p##_menu, &(s->q##_menuitem), #r, t) |
#define | CHECK_ITEM(p, q, r, s) |
#define | SET_SUBMENU(q, r) |
#define | ADD_NAMED_SEP(q, r, s) |
#define | ADD_SEP(q, r) |
#define | ATTACH_PARENT(parent, msgname, menuv, group) |
Functions | |
static bool | nsgtk_menu_add_image_item (GtkMenu *menu, GtkWidget **item_out, const char *message, GtkAccelGroup *group) |
Adds image menu item to a menu. More... | |
static struct nsgtk_export_submenu * | nsgtk_menu_export_submenu (GtkAccelGroup *group) |
creates an export submenu More... | |
static struct nsgtk_scaleview_submenu * | nsgtk_menu_scaleview_submenu (GtkAccelGroup *group) |
creates a scaleview submenu More... | |
static struct nsgtk_tabs_submenu * | nsgtk_menu_tabs_submenu (GtkAccelGroup *group) |
creates a tab navigation submenu More... | |
static struct nsgtk_toolbars_submenu * | nsgtk_menu_toolbars_submenu (GtkAccelGroup *group) |
creates a toolbars submenu More... | |
static struct nsgtk_developer_submenu * | nsgtk_menu_developer_submenu (GtkAccelGroup *group) |
creates a debugging submenu More... | |
static struct nsgtk_file_menu * | nsgtk_menu_file_submenu (GtkAccelGroup *group) |
creates the file menu More... | |
static struct nsgtk_edit_menu * | nsgtk_menu_edit_submenu (GtkAccelGroup *group) |
creates an edit menu More... | |
static struct nsgtk_view_menu * | nsgtk_menu_view_submenu (GtkAccelGroup *group) |
creates a view menu More... | |
static struct nsgtk_nav_menu * | nsgtk_menu_nav_submenu (GtkAccelGroup *group) |
creates a nav menu More... | |
static struct nsgtk_tools_menu * | nsgtk_menu_tools_submenu (GtkAccelGroup *group) |
creates the tools menu More... | |
static struct nsgtk_help_menu * | nsgtk_menu_help_submenu (GtkAccelGroup *group) |
creates a help menu More... | |
struct nsgtk_bar_submenu * | nsgtk_menu_bar_create (GtkMenuShell *menubar, GtkAccelGroup *group) |
Generate menubar menus. More... | |
struct nsgtk_burger_menu * | nsgtk_burger_menu_create (GtkAccelGroup *group) |
Generate burger menu. More... | |
struct nsgtk_popup_menu * | nsgtk_popup_menu_create (GtkAccelGroup *group) |
Generate right click popup menu. More... | |
struct nsgtk_link_menu * | nsgtk_link_menu_create (GtkAccelGroup *group) |
Generate context sensitive link popup menu. More... | |
nserror | nsgtk_menu_bar_destroy (struct nsgtk_bar_submenu *menu) |
destroy bar menu More... | |
nserror | nsgtk_burger_menu_destroy (struct nsgtk_burger_menu *menu) |
destroy burger menu More... | |
nserror | nsgtk_popup_menu_destroy (struct nsgtk_popup_menu *menu) |
destroy popup menu More... | |
nserror | nsgtk_link_menu_destroy (struct nsgtk_link_menu *menu) |
destroy link menu More... | |
#define ADD_NAMED_SEP | ( | q, | |
r, | |||
s | |||
) |
#define ADD_SEP | ( | q, | |
r | |||
) |
#define ATTACH_PARENT | ( | parent, | |
msgname, | |||
menuv, | |||
group | |||
) |
#define CHECK_ITEM | ( | p, | |
q, | |||
r, | |||
s | |||
) |
#define IMAGE_ITEM | ( | p, | |
q, | |||
r, | |||
s, | |||
t | |||
) | nsgtk_menu_add_image_item(s->p##_menu, &(s->q##_menuitem), #r, t) |
#define NEW_MENU | ( | n, | |
m | |||
) |
#define SET_SUBMENU | ( | q, | |
r | |||
) |
struct nsgtk_burger_menu * nsgtk_burger_menu_create | ( | GtkAccelGroup * | group | ) |
Generate burger menu.
accelerator | group to use with menu |
Definition at line 522 of file menu.c.
References IMAGE_ITEM, NEW_MENU, SET_SUBMENU, and view.
Referenced by create_scaffolding_burger_menu().
nserror nsgtk_burger_menu_destroy | ( | struct nsgtk_burger_menu * | menu | ) |
destroy burger menu
destroys the gtk widgets associated with menu and frees all storage.
menu | menu to destroy |
Definition at line 623 of file menu.c.
References nsgtk_burger_menu::burger_menu, nsgtk_tools_menu::developer_submenu, nsgtk_burger_menu::edit_submenu, nsgtk_file_menu::export_submenu, nsgtk_burger_menu::file_submenu, nsgtk_burger_menu::help_submenu, nsgtk_burger_menu::nav_submenu, NSERROR_OK, nsgtk_view_menu::scaleview_submenu, nsgtk_view_menu::tabs_submenu, nsgtk_view_menu::toolbars_submenu, nsgtk_burger_menu::tools_submenu, and nsgtk_burger_menu::view_submenu.
Referenced by scaffolding_window_destroy().
struct nsgtk_link_menu * nsgtk_link_menu_create | ( | GtkAccelGroup * | group | ) |
Generate context sensitive link popup menu.
accelerator | group to use with menu |
Definition at line 582 of file menu.c.
References ADD_SEP, IMAGE_ITEM, and NEW_MENU.
Referenced by create_scaffolding_link_menu().
nserror nsgtk_link_menu_destroy | ( | struct nsgtk_link_menu * | menu | ) |
destroy link menu
destroys the gtk widgets associated with menu and frees all storage.
menu | menu to destroy |
Definition at line 659 of file menu.c.
References nsgtk_link_menu::link_menu, and NSERROR_OK.
Referenced by scaffolding_window_destroy().
|
static |
Adds image menu item to a menu.
menu | the menu to add the item to |
item_out | a pointer to the item's location in the menu struct |
message | the menu item I18n lookup value |
group | the 'global' in a gtk sense accelerator group |
Definition at line 43 of file menu.c.
References messages_get(), nsgtk_accelerator_get_desc(), and nsgtk_image_menu_item_new_with_mnemonic().
struct nsgtk_bar_submenu * nsgtk_menu_bar_create | ( | GtkMenuShell * | menubar, |
GtkAccelGroup * | group | ||
) |
Generate menubar menus.
Create main menubar menu.
Generate the main menu structure and attach it to a menubar widget.
Definition at line 488 of file menu.c.
References ATTACH_PARENT, nsgtk_bar_submenu::bar_menu, nsgtk_edit_menu::edit, nsgtk_bar_submenu::edit_submenu, nsgtk_file_menu::file, nsgtk_bar_submenu::file_submenu, nsgtk_help_menu::help, nsgtk_bar_submenu::help_submenu, nsgtk_nav_menu::nav, nsgtk_bar_submenu::nav_submenu, nsgtk_menu_edit_submenu(), nsgtk_menu_file_submenu(), nsgtk_menu_help_submenu(), nsgtk_menu_nav_submenu(), nsgtk_menu_tools_submenu(), nsgtk_menu_view_submenu(), nsgtk_tools_menu::tools, nsgtk_bar_submenu::tools_submenu, nsgtk_view_menu::view, and nsgtk_bar_submenu::view_submenu.
Referenced by create_scaffolding_bar_menu().
nserror nsgtk_menu_bar_destroy | ( | struct nsgtk_bar_submenu * | menu | ) |
destroy bar menu
destroys the gtk widgets associated with menu and frees all storage.
menu | menu to destroy |
Definition at line 602 of file menu.c.
References nsgtk_bar_submenu::bar_menu, nsgtk_tools_menu::developer_submenu, nsgtk_bar_submenu::edit_submenu, nsgtk_file_menu::export_submenu, nsgtk_bar_submenu::file_submenu, nsgtk_bar_submenu::help_submenu, nsgtk_bar_submenu::nav_submenu, NSERROR_OK, nsgtk_view_menu::scaleview_submenu, nsgtk_view_menu::tabs_submenu, nsgtk_view_menu::toolbars_submenu, nsgtk_bar_submenu::tools_submenu, and nsgtk_bar_submenu::view_submenu.
Referenced by scaffolding_window_destroy().
|
static |
creates a debugging submenu
group | the 'global' in a gtk sense accelerator reference |
Definition at line 267 of file menu.c.
References nsgtk_developer_submenu::developer_menu, IMAGE_ITEM, messages_get(), and nsgtk_warning().
|
static |
creates an edit menu
group | the 'global' in a gtk sense accelerator reference |
Definition at line 334 of file menu.c.
References ADD_SEP, nsgtk_edit_menu::edit, nsgtk_edit_menu::edit_menu, IMAGE_ITEM, messages_get(), and nsgtk_warning().
Referenced by nsgtk_menu_bar_create().
|
static |
creates an export submenu
group | the 'global' in a gtk sense accelerator reference |
Definition at line 145 of file menu.c.
References nsgtk_export_submenu::export_menu, IMAGE_ITEM, messages_get(), and nsgtk_warning().
|
static |
creates the file menu
group | The gtk 'global' accelerator reference |
Definition at line 296 of file menu.c.
References ADD_SEP, nsgtk_file_menu::file, nsgtk_file_menu::file_menu, IMAGE_ITEM, messages_get(), nsgtk_warning(), and SET_SUBMENU.
Referenced by nsgtk_menu_bar_create().
|
static |
creates a help menu
group | the 'global' in a gtk sense accelerator reference |
Definition at line 459 of file menu.c.
References ADD_SEP, nsgtk_help_menu::help, nsgtk_help_menu::help_menu, IMAGE_ITEM, messages_get(), and nsgtk_warning().
Referenced by nsgtk_menu_bar_create().
|
static |
creates a nav menu
group | the 'global' in a gtk sense accelerator reference |
Definition at line 398 of file menu.c.
References ADD_SEP, IMAGE_ITEM, messages_get(), nsgtk_nav_menu::nav, nsgtk_nav_menu::nav_menu, nsgtk_warning(), and reload.
Referenced by nsgtk_menu_bar_create().
|
static |
creates a scaleview submenu
group | the 'global' in a gtk sense accelerator reference |
Definition at line 174 of file menu.c.
References IMAGE_ITEM, messages_get(), nsgtk_warning(), and nsgtk_scaleview_submenu::scaleview_menu.
|
static |
creates a tab navigation submenu
group | the 'global' in a gtk sense accelerator reference |
Definition at line 199 of file menu.c.
References IMAGE_ITEM, messages_get(), nsgtk_warning(), tabs, and nsgtk_tabs_submenu::tabs_menu.
|
static |
creates a toolbars submenu
group | the 'global' in a gtk sense accelerator reference |
Definition at line 227 of file menu.c.
References ADD_SEP, CHECK_ITEM, IMAGE_ITEM, nsgtk_toolbars_submenu::menubar_menuitem, messages_get(), nsgtk_warning(), nsgtk_toolbars_submenu::toolbar_menuitem, toolbars, and nsgtk_toolbars_submenu::toolbars_menu.
|
static |
creates the tools menu
group | the 'global' in a gtk sense accelerator reference |
Definition at line 433 of file menu.c.
References IMAGE_ITEM, messages_get(), nsgtk_warning(), SET_SUBMENU, nsgtk_tools_menu::tools, and nsgtk_tools_menu::tools_menu.
Referenced by nsgtk_menu_bar_create().
|
static |
creates a view menu
group | the 'global' in a gtk sense accelerator reference |
Definition at line 366 of file menu.c.
References ADD_SEP, IMAGE_ITEM, messages_get(), nsgtk_warning(), SET_SUBMENU, tabs, toolbars, view, and nsgtk_view_menu::view_menu.
Referenced by nsgtk_menu_bar_create().
struct nsgtk_popup_menu * nsgtk_popup_menu_create | ( | GtkAccelGroup * | group | ) |
Generate right click popup menu.
accelerator | group to use with menu |
Definition at line 551 of file menu.c.
References ADD_NAMED_SEP, IMAGE_ITEM, NEW_MENU, reload, SET_SUBMENU, and toolbars.
Referenced by create_scaffolding_popup_menu().
nserror nsgtk_popup_menu_destroy | ( | struct nsgtk_popup_menu * | menu | ) |
destroy popup menu
destroys the gtk widgets associated with menu and frees all storage.
menu | menu to destroy |
Definition at line 645 of file menu.c.
References nsgtk_tools_menu::developer_submenu, NSERROR_OK, nsgtk_popup_menu::popup_menu, nsgtk_popup_menu::toolbars_submenu, and nsgtk_popup_menu::tools_submenu.
Referenced by scaffolding_window_destroy().