pcb 4.1.1
An interactive printed circuit board layout editor.

ghid-main-menu.h File Reference

#include <glib.h>
#include <glib-object.h>
#include <gtk/gtk.h>
#include "ghid-layer-selector.h"
#include "ghid-route-style-selector.h"
#include "resource.h"
Include dependency graph for ghid-main-menu.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define GHID_MAIN_MENU_TYPE   (ghid_main_menu_get_type ())
#define GHID_MAIN_MENU(obj)   (G_TYPE_CHECK_INSTANCE_CAST ((obj), GHID_MAIN_MENU_TYPE, GHidMainMenu))
#define GHID_MAIN_MENU_CLASS(klass)   (G_TYPE_CHECK_CLASS_CAST ((klass), GHID_MAIN_MENU_TYPE, GHidMainMenuClass))
#define IS_GHID_MAIN_MENU(obj)   (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GHID_MAIN_MENU_TYPE))
#define IS_GHID_MAIN_MENU_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), GHID_MAIN_MENU_TYPE))

Typedefs

typedef struct _GHidMainMenu GHidMainMenu
typedef struct _GHidMainMenuClass GHidMainMenuClass

Functions

GType ghid_main_menu_get_type (void)
GtkWidget * ghid_main_menu_new (GCallback action_cb, void(*special_key_cb)(const char *accel, GtkAction *action, const Resource *node))
 Create a new GHidMainMenu.
void ghid_main_menu_add_resource (GHidMainMenu *menu, const Resource *res)
 Turn a pcb resource into the main menu.
GtkAccelGroup * ghid_main_menu_get_accel_group (GHidMainMenu *menu)
 Returns the menu bar's accelerator group.
void ghid_main_menu_update_toggle_state (GHidMainMenu *menu, void(*cb)(GtkAction *, const char *toggle_flag, const char *active_flag))
 Updates the toggle/active state of all items.
void ghid_main_menu_add_popup_resource (GHidMainMenu *menu, const char *name, const Resource *res)
 Turn a pcb resource into a popup menu.
GtkMenu * ghid_main_menu_get_popup (GHidMainMenu *menu, const char *name)
 Returns a registered popup menu by name.
void ghid_main_menu_install_layer_selector (GHidMainMenu *mm, GHidLayerSelector *ls)
 Installs or updates layer selector items.
void ghid_main_menu_install_route_style_selector (GHidMainMenu *mm, GHidRouteStyleSelector *rss)
 Installs or updates route style selector items.

Define Documentation

#define GHID_MAIN_MENU (   obj)    (G_TYPE_CHECK_INSTANCE_CAST ((obj), GHID_MAIN_MENU_TYPE, GHidMainMenu))
#define GHID_MAIN_MENU_CLASS (   klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GHID_MAIN_MENU_TYPE, GHidMainMenuClass))

Definition at line 16 of file ghid-main-menu.h.

#define GHID_MAIN_MENU_TYPE   (ghid_main_menu_get_type ())

Definition at line 14 of file ghid-main-menu.h.

Referenced by ghid_main_menu_new().

#define IS_GHID_MAIN_MENU (   obj)    (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GHID_MAIN_MENU_TYPE))

Definition at line 17 of file ghid-main-menu.h.

#define IS_GHID_MAIN_MENU_CLASS (   klass)    (G_TYPE_CHECK_CLASS_TYPE ((klass), GHID_MAIN_MENU_TYPE))

Definition at line 18 of file ghid-main-menu.h.


Typedef Documentation

typedef struct _GHidMainMenu GHidMainMenu

Definition at line 20 of file ghid-main-menu.h.

Definition at line 21 of file ghid-main-menu.h.


Function Documentation

void ghid_main_menu_add_popup_resource ( GHidMainMenu menu,
const char *  name,
const Resource res 
)

Turn a pcb resource into a popup menu.

Definition at line 520 of file ghid-main-menu.c.

References ghid_main_menu_real_add_resource(), and _GHidMainMenu::popup_table.

Referenced by ghid_load_menus().

Here is the call graph for this function:

void ghid_main_menu_add_resource ( GHidMainMenu menu,
const Resource res 
)

Turn a pcb resource into the main menu.

Definition at line 511 of file ghid-main-menu.c.

References ghid_main_menu_real_add_resource().

Referenced by ghid_load_menus().

Here is the call graph for this function:

GtkAccelGroup* ghid_main_menu_get_accel_group ( GHidMainMenu menu)

Returns the menu bar's accelerator group.

Definition at line 649 of file ghid-main-menu.c.

References _GHidMainMenu::accel_group.

Referenced by ghid_install_accel_groups(), and ghid_remove_accel_groups().

GtkMenu* ghid_main_menu_get_popup ( GHidMainMenu menu,
const char *  name 
)

Returns a registered popup menu by name.

Definition at line 534 of file ghid-main-menu.c.

References _GHidMainMenu::popup_table.

Referenced by Popup().

GType ghid_main_menu_get_type ( void  )

Definition at line 446 of file ghid-main-menu.c.

References ghid_main_menu_class_init(), and ghid_main_menu_init().

Here is the call graph for this function:

void ghid_main_menu_install_layer_selector ( GHidMainMenu mm,
GHidLayerSelector ls 
)
void ghid_main_menu_install_route_style_selector ( GHidMainMenu mm,
GHidRouteStyleSelector rss 
)

Installs or updates route style selector items.

Definition at line 623 of file ghid-main-menu.c.

References ghid_route_style_selector_install_items(), _GHidMainMenu::n_route_styles, _GHidMainMenu::route_style_pos, and _GHidMainMenu::route_style_shell.

Referenced by ghid_do_export(), make_route_style_buttons(), and route_styles_edited_cb().

Here is the call graph for this function:

void ghid_main_menu_update_toggle_state ( GHidMainMenu menu,
void(*)(GtkAction *, const char *toggle_flag, const char *active_flag)  cb 
)

Updates the toggle/active state of all items.

Loops through all actions, passing the action, its toggle flag (maybe NULL), and its active flag (maybe NULL), to a callback function. It is the responsibility of the function to actually change the state of the action.

Parameters:
[in]menuThe menu to be acted on.
[in]cbThe callback that toggles the actions.

Definition at line 552 of file ghid-main-menu.c.

References _GHidMainMenu::action_cb, and _GHidMainMenu::actions.

Referenced by ghid_update_toggle_flags().