pcb 4.1.1
An interactive printed circuit board layout editor.
|
#include <glib.h>
#include <glib-object.h>
#include <gtk/gtk.h>
#include "gtkhid.h"
#include "gui.h"
#include "pcb-printf.h"
#include "ghid-coord-entry.h"
Go to the source code of this file.
Data Structures | |
struct | _GHidCoordEntry |
struct | _GHidCoordEntryClass |
Enumerations | |
enum | { UNIT_CHANGE_SIGNAL, LAST_SIGNAL } |
Functions | |
static void | menu_item_activate_cb (GtkMenuItem *item, GHidCoordEntry *ce) |
Callback for "Change Unit" menu click. | |
static void | ghid_coord_entry_popup_cb (GHidCoordEntry *ce, GtkMenu *menu, gpointer data) |
Callback for context menu creation. | |
static gboolean | ghid_coord_entry_output_cb (GHidCoordEntry *ce, gpointer data) |
Callback for user output. | |
static gboolean | ghid_coord_text_changed_cb (GHidCoordEntry *entry, gpointer data) |
Callback for user input. | |
static gboolean | ghid_coord_value_changed_cb (GHidCoordEntry *ce, gpointer data) |
Callback for change in value (input or ^v clicks) | |
static void | ghid_coord_entry_change_unit (GHidCoordEntry *ce, const Unit *new_unit) |
Change the unit used by a coord entry. | |
static void | ghid_coord_entry_init (GHidCoordEntry *ce) |
static void | ghid_coord_entry_class_init (GHidCoordEntryClass *klass) |
GType | ghid_coord_entry_get_type (void) |
GtkWidget * | ghid_coord_entry_new (Coord min_val, Coord max_val, Coord value, const Unit *unit, enum ce_step_size step_size) |
Create a new GHidCoordEntry. | |
Coord | ghid_coord_entry_get_value (GHidCoordEntry *ce) |
Gets a GHidCoordEntry's value, in pcb coords. | |
void | ghid_coord_entry_set_value (GHidCoordEntry *ce, Coord val) |
Sets a GHidCoordEntry's value, in pcb coords. | |
Variables | |
static guint | ghid_coord_entry_signals [LAST_SIGNAL] = { 0 } |
anonymous enum |
Definition at line 23 of file ghid-coord-entry.c.
static void ghid_coord_entry_change_unit | ( | GHidCoordEntry * | ce, |
const Unit * | new_unit | ||
) | [static] |
Change the unit used by a coord entry.
[in] | ce | The entry to be acted on [in] new_unit The new unit to be used |
Definition at line 151 of file ghid-coord-entry.c.
References CE_LARGE, CE_MEDIUM, CE_SMALL, CE_TINY, coord_to_unit(), unit::default_prec, _GHidCoordEntry::max_value, _GHidCoordEntry::min_value, unit::step_large, unit::step_medium, _GHidCoordEntry::step_size, unit::step_small, unit::step_tiny, unit::suffix, _GHidCoordEntry::unit, and _GHidCoordEntry::value.
Referenced by ghid_coord_entry_class_init().
static void ghid_coord_entry_class_init | ( | GHidCoordEntryClass * | klass | ) | [static] |
Definition at line 192 of file ghid-coord-entry.c.
References _GHidCoordEntryClass::change_unit, ghid_coord_entry_change_unit(), ghid_coord_entry_signals, and UNIT_CHANGE_SIGNAL.
Referenced by ghid_coord_entry_get_type().
GType ghid_coord_entry_get_type | ( | void | ) |
Definition at line 211 of file ghid-coord-entry.c.
References ghid_coord_entry_class_init(), and ghid_coord_entry_init().
Coord ghid_coord_entry_get_value | ( | GHidCoordEntry * | ce | ) |
Gets a GHidCoordEntry's value, in pcb coords.
Definition at line 300 of file ghid-coord-entry.c.
References _GHidCoordEntry::value.
Referenced by coord_entry_cb(), ghid_route_style_selector_edit_dialog(), and increment_spin_button_cb().
static void ghid_coord_entry_init | ( | GHidCoordEntry * | ce | ) | [static] |
Definition at line 178 of file ghid-coord-entry.c.
References ghid_coord_entry_output_cb(), ghid_coord_entry_popup_cb(), ghid_coord_text_changed_cb(), and ghid_coord_value_changed_cb().
Referenced by ghid_coord_entry_get_type().
GtkWidget* ghid_coord_entry_new | ( | Coord | min_val, |
Coord | max_val, | ||
Coord | value, | ||
const Unit * | unit, | ||
enum ce_step_size | step_size | ||
) |
Create a new GHidCoordEntry.
[in] | min_val | The minimum allowed value, in pcb coords |
[in] | max_val | The maximum allowed value, in pcb coords |
[in] | value | The default value, in pcb coords |
[in] | unit | The default unit |
[in] | step_size | How large the default increments should be |
Definition at line 250 of file ghid-coord-entry.c.
References CE_LARGE, CE_MEDIUM, CE_SMALL, CE_TINY, coord_to_unit(), unit::default_prec, FALSE, GHID_COORD_ENTRY_TYPE, _GHidCoordEntry::max_value, _GHidCoordEntry::min_value, unit::step_huge, unit::step_large, unit::step_medium, _GHidCoordEntry::step_size, unit::step_small, unit::step_tiny, unit::suffix, unit, _GHidCoordEntry::unit, and _GHidCoordEntry::value.
Referenced by _table_attach(), ghid_attribute_dialog(), ghid_coord_entry(), and ghid_table_coord_entry().
static gboolean ghid_coord_entry_output_cb | ( | GHidCoordEntry * | ce, |
gpointer | data | ||
) | [static] |
Callback for user output.
Definition at line 95 of file ghid-coord-entry.c.
References unit::default_prec, pcb_g_strdup_printf(), unit::suffix, TRUE, and _GHidCoordEntry::unit.
Referenced by ghid_coord_entry_init().
static void ghid_coord_entry_popup_cb | ( | GHidCoordEntry * | ce, |
GtkMenu * | menu, | ||
gpointer | data | ||
) | [static] |
Callback for context menu creation.
Definition at line 62 of file ghid-coord-entry.c.
References _, get_n_units(), get_unit_list(), menu_item_activate_cb(), and n.
Referenced by ghid_coord_entry_init().
void ghid_coord_entry_set_value | ( | GHidCoordEntry * | ce, |
Coord | val | ||
) |
Sets a GHidCoordEntry's value, in pcb coords.
Definition at line 307 of file ghid-coord-entry.c.
References coord_to_unit(), and _GHidCoordEntry::unit.
Referenced by dialog_style_changed_cb().
static gboolean ghid_coord_text_changed_cb | ( | GHidCoordEntry * | entry, |
gpointer | data | ||
) | [static] |
Callback for user input.
Definition at line 110 of file ghid-coord-entry.c.
References FALSE, get_unit_struct(), ghid_coord_entry_signals, _GHidCoordEntry::unit, UNIT_CHANGE_SIGNAL, unit_to_coord(), and _GHidCoordEntry::value.
Referenced by ghid_coord_entry_init(), and ghid_coord_value_changed_cb().
static gboolean ghid_coord_value_changed_cb | ( | GHidCoordEntry * | ce, |
gpointer | data | ||
) | [static] |
Callback for change in value (input or ^v clicks)
Definition at line 132 of file ghid-coord-entry.c.
References FALSE, ghid_coord_text_changed_cb(), _GHidCoordEntry::unit, unit_to_coord(), and _GHidCoordEntry::value.
Referenced by ghid_coord_entry_init().
static void menu_item_activate_cb | ( | GtkMenuItem * | item, |
GHidCoordEntry * | ce | ||
) | [static] |
Callback for "Change Unit" menu click.
Definition at line 52 of file ghid-coord-entry.c.
References get_unit_struct(), ghid_coord_entry_signals, and UNIT_CHANGE_SIGNAL.
Referenced by ghid_coord_entry_popup_cb().
guint ghid_coord_entry_signals[LAST_SIGNAL] = { 0 } [static] |
Definition at line 28 of file ghid-coord-entry.c.
Referenced by ghid_coord_entry_class_init(), ghid_coord_text_changed_cb(), and menu_item_activate_cb().