pcb 4.1.1
An interactive printed circuit board layout editor.
|
#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"
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 GHID_MAIN_MENU | ( | obj | ) | (G_TYPE_CHECK_INSTANCE_CAST ((obj), GHID_MAIN_MENU_TYPE, GHidMainMenu)) |
Definition at line 15 of file ghid-main-menu.h.
Referenced by ghid_do_export(), ghid_install_accel_groups(), ghid_layer_buttons_update(), ghid_load_menus(), ghid_remove_accel_groups(), ghid_update_toggle_flags(), make_route_style_buttons(), Popup(), and route_styles_edited_cb().
#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 struct _GHidMainMenu GHidMainMenu |
Definition at line 20 of file ghid-main-menu.h.
typedef struct _GHidMainMenuClass GHidMainMenuClass |
Definition at line 21 of file ghid-main-menu.h.
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().
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().
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().
void ghid_main_menu_install_layer_selector | ( | GHidMainMenu * | mm, |
GHidLayerSelector * | ls | ||
) |
Installs or updates layer selector items.
Definition at line 577 of file ghid-main-menu.c.
References ghid_layer_selector_install_pick_items(), ghid_layer_selector_install_view_items(), _GHidMainMenu::layer_pick_pos, _GHidMainMenu::layer_pick_shell, _GHidMainMenu::layer_view_pos, _GHidMainMenu::layer_view_shell, _GHidMainMenu::n_layer_picks, and _GHidMainMenu::n_layer_views.
Referenced by ghid_layer_buttons_update().
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().
GtkWidget* ghid_main_menu_new | ( | GCallback | action_cb, |
void(*)(const char *accel, GtkAction *action, const Resource *node) | special_key_cb | ||
) |
Create a new GHidMainMenu.
Definition at line 479 of file ghid-main-menu.c.
References _GHidMainMenu::accel_group, _GHidMainMenu::action_cb, _GHidMainMenu::action_group, _GHidMainMenu::actions, GHID_MAIN_MENU_TYPE, _GHidMainMenu::layer_pick_pos, _GHidMainMenu::layer_pick_shell, _GHidMainMenu::layer_view_pos, _GHidMainMenu::layer_view_shell, _GHidMainMenu::n_layer_picks, _GHidMainMenu::n_layer_views, _GHidMainMenu::n_route_styles, _GHidMainMenu::popup_table, _GHidMainMenu::route_style_pos, _GHidMainMenu::route_style_shell, and _GHidMainMenu::special_key_cb.
Referenced by ghid_load_menus().
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.
[in] | menu | The menu to be acted on. |
[in] | cb | The 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().