pcb 4.1.1
An interactive printed circuit board layout editor.
|
#include <glib.h>
#include <glib-object.h>
#include <gdk/gdkkeysyms.h>
#include <gtk/gtk.h>
#include "global.h"
#include "gtkhid.h"
#include "gui.h"
#include "pcb-printf.h"
#include "ghid-route-style-selector.h"
Go to the source code of this file.
Data Structures | |
struct | _GHidRouteStyleSelector |
struct | _GHidRouteStyleSelectorClass |
struct | _route_style |
struct | _dialog |
Enumerations | |
enum | { SELECT_STYLE_SIGNAL, STYLE_EDITED_SIGNAL, LAST_SIGNAL } |
Signals exposed by the widget. More... | |
enum | { TEXT_COL, DATA_COL, N_COLS } |
Columns used for internal data store. More... | |
Functions | |
struct _route_style * | ghid_route_style_selector_real_add_route_style (GHidRouteStyleSelector *rss, RouteStyleType *data, gboolean temp) |
Create a new GHidRouteStyleSelector. | |
static void | ghid_route_style_selector_finalize (GObject *object) |
Clean up object before garbage collection. | |
static void | init_radio_groups (GHidRouteStyleSelector *rss) |
static void | radio_select_cb (GtkToggleAction *action, GHidRouteStyleSelector *rss) |
Callback for user selection of a route style. | |
static void | dialog_style_changed_cb (GtkComboBox *combo, struct _dialog *dialog) |
Callback for dialog box's combobox being changed. | |
static void | _table_attach (GtkWidget *table, gint row, const gchar *label, GtkWidget **entry, Coord min, Coord max) |
void | ghid_route_style_selector_edit_dialog (GHidRouteStyleSelector *rss) |
static void | edit_button_cb (GtkButton *btn, GHidRouteStyleSelector *rss) |
static void | ghid_route_style_selector_init (GHidRouteStyleSelector *rss) |
static void | ghid_route_style_selector_class_init (GHidRouteStyleSelectorClass *klass) |
GType | ghid_route_style_selector_get_type (void) |
GtkWidget * | ghid_route_style_selector_new () |
Create a new GHidRouteStyleSelector. | |
void | ghid_route_style_selector_add_route_style (GHidRouteStyleSelector *rss, RouteStyleType *data) |
Adds a route style to a GHidRouteStyleSelector. | |
gint | ghid_route_style_selector_install_items (GHidRouteStyleSelector *rss, GtkMenuShell *shell, gint pos) |
Install the "Route Style" menu items. | |
gboolean | ghid_route_style_selector_select_style (GHidRouteStyleSelector *rss, RouteStyleType *rst) |
Selects a route style and emits a select-style signal. | |
GtkAccelGroup * | ghid_route_style_selector_get_accel_group (GHidRouteStyleSelector *rss) |
Returns the GtkAccelGroup of a route style selector. | |
void | ghid_route_style_selector_sync (GHidRouteStyleSelector *rss, Coord Thick, Coord Hole, Coord Diameter, Coord Keepaway) |
Sets a GHidRouteStyleSelector selection to given values. | |
void | ghid_route_style_selector_empty (GHidRouteStyleSelector *rss) |
Removes all styles from a route style selector. | |
Variables | |
static gint | action_count |
Global action creation counter. | |
static GtkVBox * | ghid_route_style_selector_parent_class |
static guint | ghid_route_style_selector_signals [LAST_SIGNAL] = { 0 } |
anonymous enum |
Signals exposed by the widget.
Definition at line 29 of file ghid-route-style-selector.c.
anonymous enum |
Columns used for internal data store.
Definition at line 36 of file ghid-route-style-selector.c.
static void _table_attach | ( | GtkWidget * | table, |
gint | row, | ||
const gchar * | label, | ||
GtkWidget ** | entry, | ||
Coord | min, | ||
Coord | max | ||
) | [static] |
Definition at line 155 of file ghid-route-style-selector.c.
References CE_SMALL, ghid_coord_entry_new(), SettingType::grid_unit, and Settings.
Referenced by ghid_route_style_selector_edit_dialog().
static void dialog_style_changed_cb | ( | GtkComboBox * | combo, |
struct _dialog * | dialog | ||
) | [static] |
Callback for dialog box's combobox being changed.
[in] | combo | The combobox |
[in] | dialog | The rest of the widgets to be updated |
Definition at line 126 of file ghid-route-style-selector.c.
References _, _dialog::clearance_entry, DATA_COL, RouteStyleType::Diameter, GHID_COORD_ENTRY, ghid_coord_entry_set_value(), RouteStyleType::Hole, RouteStyleType::Keepaway, _dialog::line_entry, _GHidRouteStyleSelector::model, RouteStyleType::Name, _dialog::name_entry, _dialog::rss, _route_style::rst, style, RouteStyleType::Thick, _dialog::via_hole_entry, and _dialog::via_size_entry.
Referenced by ghid_route_style_selector_edit_dialog().
static void edit_button_cb | ( | GtkButton * | btn, |
GHidRouteStyleSelector * | rss | ||
) | [static] |
Definition at line 308 of file ghid-route-style-selector.c.
References ghid_route_style_selector_edit_dialog().
Referenced by ghid_route_style_selector_new().
void ghid_route_style_selector_add_route_style | ( | GHidRouteStyleSelector * | rss, |
RouteStyleType * | data | ||
) |
Adds a route style to a GHidRouteStyleSelector.
[in] | rss | The selector to be acted on |
[in] | data | PCB's route style object describing the style |
Definition at line 497 of file ghid-route-style-selector.c.
References FALSE, and ghid_route_style_selector_real_add_route_style().
Referenced by make_route_style_buttons().
static void ghid_route_style_selector_class_init | ( | GHidRouteStyleSelectorClass * | klass | ) | [static] |
Definition at line 320 of file ghid-route-style-selector.c.
References ghid_route_style_selector_finalize(), ghid_route_style_selector_parent_class, ghid_route_style_selector_signals, SELECT_STYLE_SIGNAL, and STYLE_EDITED_SIGNAL.
Referenced by ghid_route_style_selector_get_type().
void ghid_route_style_selector_edit_dialog | ( | GHidRouteStyleSelector * | rss | ) |
Definition at line 170 of file ghid-route-style-selector.c.
References _, _table_attach(), _route_style::action, _GHidRouteStyleSelector::active_style, _dialog::clearance_entry, DATA_COL, dialog_style_changed_cb(), RouteStyleType::Diameter, FALSE, ghid_category_vbox(), GHID_COORD_ENTRY, ghid_coord_entry_get_value(), ghid_route_style_selector_real_add_route_style(), ghid_route_style_selector_select_style(), ghid_route_style_selector_signals, RouteStyleType::Hole, RouteStyleType::Keepaway, _dialog::line_entry, _GHidRouteStyleSelector::model, RouteStyleType::Name, _dialog::name_entry, _route_style::rref, _dialog::rss, _route_style::rst, StripWhiteSpaceAndDup(), style, STYLE_EDITED_SIGNAL, TEXT_COL, RouteStyleType::Thick, TRUE, _dialog::via_hole_entry, _dialog::via_size_entry, and window.
Referenced by AdjustStyle(), and edit_button_cb().
void ghid_route_style_selector_empty | ( | GHidRouteStyleSelector * | rss | ) |
Removes all styles from a route style selector.
Definition at line 638 of file ghid-route-style-selector.c.
References _route_style::action, _GHidRouteStyleSelector::action_group, _GHidRouteStyleSelector::action_radio_group, _route_style::button, _GHidRouteStyleSelector::button_radio_group, DATA_COL, init_radio_groups(), _route_style::menu_item, _GHidRouteStyleSelector::model, RouteStyleType::Name, _route_style::rref, _route_style::rst, _GHidRouteStyleSelector::shortcut_key_idx, and _route_style::temporary.
Referenced by ghid_route_style_selector_finalize(), and PCBChanged().
static void ghid_route_style_selector_finalize | ( | GObject * | object | ) | [static] |
Clean up object before garbage collection.
Definition at line 349 of file ghid-route-style-selector.c.
References _GHidRouteStyleSelector::accel_group, _GHidRouteStyleSelector::action_group, ghid_route_style_selector_empty(), and ghid_route_style_selector_parent_class.
Referenced by ghid_route_style_selector_class_init().
GtkAccelGroup* ghid_route_style_selector_get_accel_group | ( | GHidRouteStyleSelector * | rss | ) |
Returns the GtkAccelGroup of a route style selector.
[in] | rss | The selector to be acted on |
Definition at line 586 of file ghid-route-style-selector.c.
References _GHidRouteStyleSelector::accel_group.
Referenced by ghid_install_accel_groups(), and ghid_remove_accel_groups().
GType ghid_route_style_selector_get_type | ( | void | ) |
Definition at line 363 of file ghid-route-style-selector.c.
References ghid_route_style_selector_class_init(), and ghid_route_style_selector_init().
static void ghid_route_style_selector_init | ( | GHidRouteStyleSelector * | rss | ) | [static] |
Definition at line 315 of file ghid-route-style-selector.c.
Referenced by ghid_route_style_selector_get_type().
gint ghid_route_style_selector_install_items | ( | GHidRouteStyleSelector * | rss, |
GtkMenuShell * | shell, | ||
gint | pos | ||
) |
Install the "Route Style" menu items.
[in] | rss | 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 518 of file ghid-route-style-selector.c.
References _route_style::action, action, DATA_COL, _route_style::menu_item, _GHidRouteStyleSelector::model, n, and style.
Referenced by ghid_main_menu_install_route_style_selector().
GtkWidget* ghid_route_style_selector_new | ( | void | ) |
Create a new GHidRouteStyleSelector.
Definition at line 396 of file ghid-route-style-selector.c.
References _, _GHidRouteStyleSelector::accel_group, _GHidRouteStyleSelector::action_group, _GHidRouteStyleSelector::action_radio_group, _GHidRouteStyleSelector::active_style, _GHidRouteStyleSelector::button_radio_group, _GHidRouteStyleSelector::edit_button, edit_button_cb(), FALSE, GHID_ROUTE_STYLE_SELECTOR_TYPE, init_radio_groups(), _GHidRouteStyleSelector::model, N_COLS, _GHidRouteStyleSelector::null_action, _GHidRouteStyleSelector::null_button, and _GHidRouteStyleSelector::shortcut_key_idx.
Referenced by ghid_build_pcb_top_window().
struct _route_style * ghid_route_style_selector_real_add_route_style | ( | GHidRouteStyleSelector * | rss, |
RouteStyleType * | data, | ||
gboolean | temp | ||
) | [read] |
Create a new GHidRouteStyleSelector.
[in] | rss | The selector to be acted on |
[in] | data | PCB's route style object that will be edited |
[in] | temp | Whether the style is "real" or session-only |
Definition at line 432 of file ghid-route-style-selector.c.
References _GHidRouteStyleSelector::accel_group, _route_style::action, action_count, _GHidRouteStyleSelector::action_group, _GHidRouteStyleSelector::action_radio_group, _route_style::button, _GHidRouteStyleSelector::button_radio_group, DATA_COL, FALSE, _GHidRouteStyleSelector::model, RouteStyleType::Name, radio_select_cb(), _route_style::rref, _route_style::rst, _GHidRouteStyleSelector::shortcut_key_idx, _route_style::sig_id, _route_style::temporary, and TEXT_COL.
Referenced by ghid_route_style_selector_add_route_style(), and ghid_route_style_selector_edit_dialog().
gboolean ghid_route_style_selector_select_style | ( | GHidRouteStyleSelector * | rss, |
RouteStyleType * | rst | ||
) |
Selects a route style and emits a select-style signal.
[in] | rss | The selector to be acted on |
[in] | rst | The style to select |
Definition at line 550 of file ghid-route-style-selector.c.
References _route_style::action, _GHidRouteStyleSelector::active_style, DATA_COL, FALSE, ghid_route_style_selector_signals, _GHidRouteStyleSelector::model, _route_style::rst, SELECT_STYLE_SIGNAL, _route_style::sig_id, style, and TRUE.
Referenced by ghid_route_style_selector_edit_dialog(), and ghid_sync_with_new_layout().
void ghid_route_style_selector_sync | ( | GHidRouteStyleSelector * | rss, |
Coord | Thick, | ||
Coord | Hole, | ||
Coord | Diameter, | ||
Coord | Keepaway | ||
) |
Sets a GHidRouteStyleSelector selection to given values.
[in] | rss | The selector to be acted on |
[in] | Thick | Coord to match selection to |
[in] | Hole | Coord to match selection to |
[in] | Diameter | Coord to match selection to |
[in] | Keepaway | Coord to match selection to |
Definition at line 605 of file ghid-route-style-selector.c.
References _route_style::action, _GHidRouteStyleSelector::active_style, DATA_COL, RouteStyleType::Diameter, FALSE, RouteStyleType::Hole, RouteStyleType::Keepaway, _GHidRouteStyleSelector::model, _GHidRouteStyleSelector::null_action, _route_style::rst, _route_style::sig_id, style, RouteStyleType::Thick, and TRUE.
Referenced by RouteStylesChanged().
static void init_radio_groups | ( | GHidRouteStyleSelector * | rss | ) | [static] |
Definition at line 83 of file ghid-route-style-selector.c.
References _GHidRouteStyleSelector::action_radio_group, _GHidRouteStyleSelector::button_radio_group, _GHidRouteStyleSelector::null_action, and _GHidRouteStyleSelector::null_button.
Referenced by ghid_route_style_selector_empty(), and ghid_route_style_selector_new().
static void radio_select_cb | ( | GtkToggleAction * | action, |
GHidRouteStyleSelector * | rss | ||
) | [static] |
Callback for user selection of a route style.
Definition at line 96 of file ghid-route-style-selector.c.
References _GHidRouteStyleSelector::active_style, ghid_route_style_selector_signals, _route_style::rst, and SELECT_STYLE_SIGNAL.
Referenced by ghid_route_style_selector_real_add_route_style().
gint action_count [static] |
Global action creation counter.
Definition at line 26 of file ghid-route-style-selector.c.
Referenced by ghid_route_style_selector_real_add_route_style(), and load_mouse_resource().
GtkVBox* ghid_route_style_selector_parent_class [static] |
Definition at line 42 of file ghid-route-style-selector.c.
Referenced by ghid_route_style_selector_class_init(), and ghid_route_style_selector_finalize().
guint ghid_route_style_selector_signals[LAST_SIGNAL] = { 0 } [static] |
Definition at line 43 of file ghid-route-style-selector.c.
Referenced by ghid_route_style_selector_class_init(), ghid_route_style_selector_edit_dialog(), ghid_route_style_selector_select_style(), and radio_select_cb().