pcb 4.1.1
An interactive printed circuit board layout editor.
|
#include <glib.h>
#include <glib-object.h>
#include <gtk/gtk.h>
Go to the source code of this file.
Defines | |
#define | GHID_LAYER_SELECTOR_TYPE (ghid_layer_selector_get_type ()) |
#define | GHID_LAYER_SELECTOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GHID_LAYER_SELECTOR_TYPE, GHidLayerSelector)) |
#define | GHID_LAYER_SELECTOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GHID_LAYER_SELECTOR_TYPE, GHidLayerSelectorClass)) |
#define | IS_GHID_LAYER_SELECTOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GHID_LAYER_SELECTOR_TYPE)) |
#define | IS_GHID_LAYER_SELECTOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GHID_LAYER_SELECTOR_TYPE)) |
Typedefs | |
typedef struct _GHidLayerSelector | GHidLayerSelector |
typedef struct _GHidLayerSelectorClass | GHidLayerSelectorClass |
Functions | |
GType | ghid_layer_selector_get_type (void) |
GtkWidget * | ghid_layer_selector_new (void) |
Create a new GHidLayerSelector. | |
void | ghid_layer_selector_add_layer (GHidLayerSelector *ls, gint user_id, const gchar *name, const gchar *color_string, gboolean visible, gboolean selectable, gboolean renameable) |
Add a layer to a GHidLayerSelector. | |
gint | ghid_layer_selector_install_pick_items (GHidLayerSelector *ls, GtkMenuShell *shell, gint pos) |
Install the "Current Layer" menu items for a layer selector. | |
gint | ghid_layer_selector_install_view_items (GHidLayerSelector *ls, GtkMenuShell *shell, gint pos) |
Install the "Shown Layers" menu items for a layer selector. | |
GtkAccelGroup * | ghid_layer_selector_get_accel_group (GHidLayerSelector *ls) |
Returns the GtkAccelGroup of a layer selector. | |
void | ghid_layer_selector_toggle_layer (GHidLayerSelector *ls, gint user_id) |
Toggle a layer's visibility. | |
void | ghid_layer_selector_select_layer (GHidLayerSelector *ls, gint user_id) |
Select a layer. | |
gboolean | ghid_layer_selector_select_next_visible (GHidLayerSelector *ls) |
Selects the next visible layer. | |
void | ghid_layer_selector_make_selected_visible (GHidLayerSelector *ls) |
Makes the selected layer visible. | |
void | ghid_layer_selector_update_colors (GHidLayerSelector *ls, const gchar *(*callback)(int user_id)) |
Sets the colors of all layers in a layer-selector. | |
void | ghid_layer_selector_delete_layers (GHidLayerSelector *ls, gboolean(*callback)(int user_id)) |
Deletes layers from a layer selector. | |
void | ghid_layer_selector_show_layers (GHidLayerSelector *ls, gboolean(*callback)(int user_id)) |
Sets the visibility toggle-state of all layers. |
#define GHID_LAYER_SELECTOR | ( | obj | ) | (G_TYPE_CHECK_INSTANCE_CAST ((obj), GHID_LAYER_SELECTOR_TYPE, GHidLayerSelector)) |
Definition at line 11 of file ghid-layer-selector.h.
Referenced by ghid_install_accel_groups(), ghid_layer_buttons_color_update(), ghid_layer_buttons_update(), ghid_remove_accel_groups(), LayersChanged(), make_layer_buttons(), make_virtual_layer_buttons(), SelectLayer(), and ToggleView().
#define GHID_LAYER_SELECTOR_CLASS | ( | klass | ) | (G_TYPE_CHECK_CLASS_CAST ((klass), GHID_LAYER_SELECTOR_TYPE, GHidLayerSelectorClass)) |
Definition at line 12 of file ghid-layer-selector.h.
#define GHID_LAYER_SELECTOR_TYPE (ghid_layer_selector_get_type ()) |
Definition at line 10 of file ghid-layer-selector.h.
Referenced by ghid_layer_selector_new().
#define IS_GHID_LAYER_SELECTOR | ( | obj | ) | (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GHID_LAYER_SELECTOR_TYPE)) |
Definition at line 13 of file ghid-layer-selector.h.
#define IS_GHID_LAYER_SELECTOR_CLASS | ( | klass | ) | (G_TYPE_CHECK_CLASS_TYPE ((klass), GHID_LAYER_SELECTOR_TYPE)) |
Definition at line 14 of file ghid-layer-selector.h.
typedef struct _GHidLayerSelector GHidLayerSelector |
Definition at line 16 of file ghid-layer-selector.h.
typedef struct _GHidLayerSelectorClass GHidLayerSelectorClass |
Definition at line 17 of file ghid-layer-selector.h.
void ghid_layer_selector_add_layer | ( | GHidLayerSelector * | ls, |
gint | user_id, | ||
const gchar * | name, | ||
const gchar * | color_string, | ||
gboolean | visible, | ||
gboolean | selectable, | ||
gboolean | renameable | ||
) |
Add a layer to a GHidLayerSelector.
If the user_id passed already exists in the layer selector, that layer will have its data overwritten with the new stuff.
[in] | ls | The selector to be acted on |
[in] | user_id | An ID used to identify the layer; will be passed to selection/visibility callbacks |
[in] | name | The name of the layer; will be used on selector and menus |
[in] | color_string | The color of the layer on selector |
[in] | visibile | Whether the layer is visible |
[in] | selectable | Whether the layer appears in menus and can be selected |
[in] | renameable | Whether the layer is renameable |
Definition at line 582 of file ghid-layer-selector.c.
References _GHidLayerSelector::accel_available, _GHidLayerSelector::accel_group, _layer::accel_index, action, _GHidLayerSelector::action_group, COLOR_COL, EDITABLE_COL, FALSE, FONT_COL, free_ldata(), _GHidLayerSelector::list_store, menu_pick_cb(), menu_view_cb(), _GHidLayerSelector::n_actions, _layer::pick_action, _layer::pick_item, _GHidLayerSelector::radio_group, _layer::rref, SELECTABLE_COL, SEPARATOR_COL, STRUCT_COL, TEXT_COL, TRUE, USER_ID_COL, _layer::view_action, _layer::view_item, and VISIBLE_COL.
Referenced by make_layer_buttons(), and make_virtual_layer_buttons().
void ghid_layer_selector_delete_layers | ( | GHidLayerSelector * | ls, |
gboolean(*)(int user_id) | callback | ||
) |
Deletes layers from a layer selector.
Separators will be deleted if the layer AFTER them is deleted.
[in] | ls | The selector to be acted on |
[in] | callback | Takes the user_id of the layer and returns a boolean |
Definition at line 1022 of file ghid-layer-selector.c.
References callback(), FALSE, free_ldata(), _GHidLayerSelector::list_store, SEPARATOR_COL, STRUCT_COL, and USER_ID_COL.
Referenced by ghid_layer_buttons_update().
GtkAccelGroup* ghid_layer_selector_get_accel_group | ( | GHidLayerSelector * | ls | ) |
Returns the GtkAccelGroup of a layer selector.
[in] | ls | The selector to be acted on |
Definition at line 820 of file ghid-layer-selector.c.
References _GHidLayerSelector::accel_group.
Referenced by ghid_install_accel_groups(), and ghid_remove_accel_groups().
GType ghid_layer_selector_get_type | ( | void | ) |
Definition at line 525 of file ghid-layer-selector.c.
References ghid_layer_selector_class_init(), and ghid_layer_selector_init().
gint ghid_layer_selector_install_pick_items | ( | GHidLayerSelector * | ls, |
GtkMenuShell * | shell, | ||
gint | pos | ||
) |
Install the "Current Layer" menu items for a layer selector.
[in] | ls | The selector to be acted on |
[in] | shell | The menu to install the items in |
[in] | pos | The position in the menu to install items |
Definition at line 750 of file ghid-layer-selector.c.
References action, _GHidLayerSelector::list_store, n, _layer::pick_action, _layer::pick_item, and STRUCT_COL.
Referenced by ghid_main_menu_install_layer_selector().
gint ghid_layer_selector_install_view_items | ( | GHidLayerSelector * | ls, |
GtkMenuShell * | shell, | ||
gint | pos | ||
) |
Install the "Shown Layers" menu items for a layer selector.
[in] | ls | The selector to be acted on |
[in] | shell | The menu to install the items in |
[in] | pos | The position in the menu to install items |
Definition at line 787 of file ghid-layer-selector.c.
References action, _GHidLayerSelector::list_store, n, STRUCT_COL, _layer::view_action, and _layer::view_item.
Referenced by ghid_main_menu_install_layer_selector().
void ghid_layer_selector_make_selected_visible | ( | GHidLayerSelector * | ls | ) |
Makes the selected layer visible.
[in] | ls | The selector to be acted on |
Definition at line 967 of file ghid-layer-selector.c.
References FALSE, _GHidLayerSelector::list_store, _GHidLayerSelector::selection, toggle_visibility(), and VISIBLE_COL.
GtkWidget* ghid_layer_selector_new | ( | void | ) |
Create a new GHidLayerSelector.
Definition at line 558 of file ghid-layer-selector.c.
References GHID_LAYER_SELECTOR_TYPE.
Referenced by ghid_build_pcb_top_window().
void ghid_layer_selector_select_layer | ( | GHidLayerSelector * | ls, |
gint | user_id | ||
) |
Select a layer.
[in] | ls | The selector to be acted on |
[in] | user_id | The ID of the layer to be affected |
Definition at line 891 of file ghid-layer-selector.c.
References _GHidLayerSelector::list_store, layer_data::ls, select_foreach_func(), and layer_data::user_id.
Referenced by ghid_layer_buttons_update(), and SelectLayer().
gboolean ghid_layer_selector_select_next_visible | ( | GHidLayerSelector * | ls | ) |
Selects the next visible layer.
[in] | ls | The selector to be acted on |
Definition at line 914 of file ghid-layer-selector.c.
References FALSE, _GHidLayerSelector::list_store, SELECTABLE_COL, _GHidLayerSelector::selection, selection_changed_cb(), TRUE, and VISIBLE_COL.
Referenced by layer_selector_toggle_callback().
void ghid_layer_selector_show_layers | ( | GHidLayerSelector * | ls, |
gboolean(*)(int user_id) | callback | ||
) |
Sets the visibility toggle-state of all layers.
[in] | ls | The selector to be acted on |
[in] | callback | Takes the user_id of the layer and returns a boolean |
Definition at line 1075 of file ghid-layer-selector.c.
References callback(), _GHidLayerSelector::list_store, SEPARATOR_COL, set_visibility(), STRUCT_COL, and USER_ID_COL.
Referenced by LayersChanged().
void ghid_layer_selector_toggle_layer | ( | GHidLayerSelector * | ls, |
gint | user_id | ||
) |
Toggle a layer's visibility.
[in] | ls | The selector to be acted on |
[in] | user_id | The ID of the layer to be affected |
Definition at line 855 of file ghid-layer-selector.c.
References _GHidLayerSelector::list_store, layer_data::ls, toggle_foreach_func(), and layer_data::user_id.
Referenced by ToggleView().
void ghid_layer_selector_update_colors | ( | GHidLayerSelector * | ls, |
const gchar *(*)(int user_id) | callback | ||
) |
Sets the colors of all layers in a layer-selector.
[in] | ls | The selector to be acted on |
[in] | callback | Takes the user_id of the layer and returns a color string |
Definition at line 991 of file ghid-layer-selector.c.
References callback(), COLOR_COL, _GHidLayerSelector::list_store, layer_data::user_id, and USER_ID_COL.
Referenced by ghid_layer_buttons_color_update().