pcb 4.1.1
An interactive printed circuit board layout editor.
|
#include "error.h"
#include "search.h"
#include "draw.h"
#include "find.h"
#include "pcb-printf.h"
#include "undo.h"
#include "set.h"
#include "gui.h"
#include "gui-drc-window.h"
Go to the source code of this file.
Data Structures | |
struct | object_list |
Defines | |
#define | VIOLATION_PIXMAP_PIXEL_SIZE 100 |
#define | VIOLATION_PIXMAP_PIXEL_BORDER 5 |
#define | VIOLATION_PIXMAP_PCB_SIZE MIL_TO_COORD (100) |
Typedefs | |
typedef struct object_list | object_list |
Enumerations | |
enum | { DRC_VIOLATION_NUM_COL = 0, DRC_VIOLATION_OBJ_COL, NUM_DRC_COLUMNS } |
enum | { PROP_TITLE = 1, PROP_EXPLANATION, PROP_X_COORD, PROP_Y_COORD, PROP_ANGLE, PROP_HAVE_MEASURED, PROP_MEASURED_VALUE, PROP_REQUIRED_VALUE, PROP_OBJECT_LIST, PROP_PIXMAP } |
enum | { PROP_VIOLATION = 1 } |
Functions | |
static gint | drc_window_configure_event_cb (GtkWidget *widget, GdkEventConfigure *ev, gpointer data) |
static void | drc_close_cb (gpointer data) |
static void | drc_refresh_cb (gpointer data) |
static void | drc_destroy_cb (GtkWidget *widget, gpointer data) |
static void | selection_changed_cb (GtkTreeSelection *selection, gpointer user_data) |
static void | row_activated_cb (GtkTreeView *view, GtkTreePath *path, GtkTreeViewColumn *column, gpointer user_data) |
static void | ghid_drc_violation_finalize (GObject *object) |
GObject finalise handler. | |
static void | ghid_drc_violation_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) |
GObject property setter function. | |
static void | ghid_drc_violation_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) |
GObject property getter function. | |
static void | ghid_drc_violation_class_init (GhidViolationRendererClass *klass) |
GType class initialiser for GhidDrcViolation. | |
GType | ghid_drc_violation_get_type () |
Function to retrieve GhidViolationRenderer's GType identifier. | |
GhidDrcViolation * | ghid_drc_violation_new (DrcViolationType *violation, GdkDrawable *pixmap) |
static void | ghid_violation_renderer_finalize (GObject *object) |
GObject finalise handler. | |
static void | ghid_violation_renderer_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) |
GObject property setter function. | |
static void | ghid_violation_renderer_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) |
GObject property getter function. | |
static void | ghid_violation_renderer_get_size (GtkCellRenderer *cell, GtkWidget *widget, GdkRectangle *cell_area, gint *x_offset, gint *y_offset, gint *width, gint *height) |
static void | ghid_violation_renderer_render (GtkCellRenderer *cell, GdkDrawable *window, GtkWidget *widget, GdkRectangle *background_area, GdkRectangle *cell_area, GdkRectangle *expose_area, GtkCellRendererState flags) |
static void | ghid_violation_renderer_class_init (GhidViolationRendererClass *klass) |
GType class initialiser for GhidViolationRenderer. | |
GType | ghid_violation_renderer_get_type () |
Function to retrieve GhidViolationRenderer's GType identifier. | |
GtkCellRenderer * | ghid_violation_renderer_new (void) |
Convenience function to create a new violation renderer. | |
void | ghid_drc_window_show (gboolean raise) |
void | ghid_drc_window_append_violation (DrcViolationType *violation) |
void | ghid_drc_window_reset_message (void) |
int | ghid_drc_window_throw_dialog (void) |
Variables | |
static GtkWidget * | drc_window |
static GtkWidget * | drc_list |
static GtkListStore * | drc_list_model = NULL |
static int | num_violations = 0 |
static GObjectClass * | ghid_drc_violation_parent_class = NULL |
static GObjectClass * | ghid_violation_renderer_parent_class = NULL |
#define VIOLATION_PIXMAP_PCB_SIZE MIL_TO_COORD (100) |
Definition at line 47 of file gui-drc-window.c.
Referenced by ghid_violation_renderer_render().
#define VIOLATION_PIXMAP_PIXEL_BORDER 5 |
Definition at line 46 of file gui-drc-window.c.
Referenced by ghid_violation_renderer_render().
#define VIOLATION_PIXMAP_PIXEL_SIZE 100 |
Definition at line 45 of file gui-drc-window.c.
Referenced by ghid_violation_renderer_get_size(), and ghid_violation_renderer_render().
typedef struct object_list object_list |
anonymous enum |
Definition at line 87 of file gui-drc-window.c.
anonymous enum |
PROP_TITLE | |
PROP_EXPLANATION | |
PROP_X_COORD | |
PROP_Y_COORD | |
PROP_ANGLE | |
PROP_HAVE_MEASURED | |
PROP_MEASURED_VALUE | |
PROP_REQUIRED_VALUE | |
PROP_OBJECT_LIST | |
PROP_PIXMAP |
Definition at line 176 of file gui-drc-window.c.
anonymous enum |
Definition at line 473 of file gui-drc-window.c.
static void drc_close_cb | ( | gpointer | data | ) | [static] |
Definition at line 69 of file gui-drc-window.c.
References drc_window.
Referenced by ghid_drc_window_show().
static void drc_destroy_cb | ( | GtkWidget * | widget, |
gpointer | data | ||
) | [static] |
Definition at line 82 of file gui-drc-window.c.
References drc_window.
Referenced by ghid_drc_window_show().
static void drc_refresh_cb | ( | gpointer | data | ) | [static] |
Definition at line 76 of file gui-drc-window.c.
References hid_actionl().
Referenced by ghid_drc_window_show().
static gint drc_window_configure_event_cb | ( | GtkWidget * | widget, |
GdkEventConfigure * | ev, | ||
gpointer | data | ||
) | [static] |
Definition at line 55 of file gui-drc-window.c.
References GhidGui::config_modified, GhidGui::drc_window_height, GhidGui::drc_window_width, FALSE, ghidgui, and TRUE.
Referenced by ghid_drc_window_show().
static void ghid_drc_violation_class_init | ( | GhidViolationRendererClass * | klass | ) | [static] |
GType class initialiser for GhidDrcViolation.
[in] | klass | The GhidDrcViolationClass we are initialising |
Definition at line 330 of file gui-drc-window.c.
References ghid_drc_violation_finalize(), ghid_drc_violation_get_property(), ghid_drc_violation_parent_class, ghid_drc_violation_set_property(), PROP_ANGLE, PROP_EXPLANATION, PROP_HAVE_MEASURED, PROP_MEASURED_VALUE, PROP_OBJECT_LIST, PROP_PIXMAP, PROP_REQUIRED_VALUE, PROP_TITLE, PROP_X_COORD, and PROP_Y_COORD.
Referenced by ghid_drc_violation_get_type().
static void ghid_drc_violation_finalize | ( | GObject * | object | ) | [static] |
GObject finalise handler.
[in] | widget | The GObject being finalized. |
Definition at line 203 of file gui-drc-window.c.
References _GhidDrcViolation::explanation, GHID_DRC_VIOLATION, ghid_drc_violation_parent_class, _GhidDrcViolation::object_id_list, _GhidDrcViolation::object_type_list, _GhidDrcViolation::pixmap, and _GhidDrcViolation::title.
Referenced by ghid_drc_violation_class_init().
static void ghid_drc_violation_get_property | ( | GObject * | object, |
guint | property_id, | ||
GValue * | value, | ||
GParamSpec * | pspec | ||
) | [static] |
GObject property getter function.
[in] | object | The GObject whose properties we are getting |
[in] | property_id | The numeric id. under which the property was registered with g_object_class_install_property() |
[out] | value | The GValue in which to return the value of the property |
[in] | pspec | A GParamSpec describing the property being got |
Definition at line 309 of file gui-drc-window.c.
Referenced by ghid_drc_violation_class_init().
GType ghid_drc_violation_get_type | ( | void | ) |
Function to retrieve GhidViolationRenderer's GType identifier.
Definition at line 423 of file gui-drc-window.c.
References ghid_drc_violation_class_init().
GhidDrcViolation* ghid_drc_violation_new | ( | DrcViolationType * | violation, |
GdkDrawable * | pixmap | ||
) |
Definition at line 450 of file gui-drc-window.c.
References drc_violation_st::angle, object_list::count, drc_violation_st::explanation, GHID_TYPE_DRC_VIOLATION, drc_violation_st::have_measured, object_list::id_list, drc_violation_st::measured_value, drc_violation_st::object_count, drc_violation_st::object_id_list, drc_violation_st::object_type_list, drc_violation_st::required_value, drc_violation_st::title, object_list::type_list, drc_violation_st::x, and drc_violation_st::y.
Referenced by ghid_drc_window_append_violation().
static void ghid_drc_violation_set_property | ( | GObject * | object, |
guint | property_id, | ||
const GValue * | value, | ||
GParamSpec * | pspec | ||
) | [static] |
GObject property setter function.
[in] | object | The GObject whose properties we are setting |
[in] | property_id | The numeric id. under which the property was registered with g_object_class_install_property() |
[in] | value | The GValue the property is being set from |
[in] | pspec | A GParamSpec describing the property being set |
Definition at line 237 of file gui-drc-window.c.
References _GhidDrcViolation::angle, object_list::count, _GhidDrcViolation::explanation, GHID_DRC_VIOLATION, _GhidDrcViolation::have_measured, object_list::id_list, _GhidDrcViolation::measured_value, _GhidDrcViolation::object_count, _GhidDrcViolation::object_id_list, _GhidDrcViolation::object_type_list, _GhidDrcViolation::pixmap, PROP_ANGLE, PROP_EXPLANATION, PROP_HAVE_MEASURED, PROP_MEASURED_VALUE, PROP_OBJECT_LIST, PROP_PIXMAP, PROP_REQUIRED_VALUE, PROP_TITLE, PROP_X_COORD, PROP_Y_COORD, _GhidDrcViolation::required_value, _GhidDrcViolation::title, object_list::type_list, _GhidDrcViolation::x_coord, and _GhidDrcViolation::y_coord.
Referenced by ghid_drc_violation_class_init().
void ghid_drc_window_append_violation | ( | DrcViolationType * | violation | ) |
Definition at line 847 of file gui-drc-window.c.
References drc_list_model, DRC_VIOLATION_NUM_COL, DRC_VIOLATION_OBJ_COL, FALSE, ghid_drc_violation_new(), ghid_drc_window_show(), and num_violations.
void ghid_drc_window_reset_message | ( | void | ) |
Definition at line 868 of file gui-drc-window.c.
References drc_list_model, and num_violations.
void ghid_drc_window_show | ( | gboolean | raise | ) |
Definition at line 757 of file gui-drc-window.c.
References _, SettingType::AutoPlace, drc_close_cb(), drc_destroy_cb(), drc_list, drc_list_model, drc_refresh_cb(), DRC_VIOLATION_NUM_COL, DRC_VIOLATION_OBJ_COL, drc_window, drc_window_configure_event_cb(), GhidGui::drc_window_height, GhidGui::drc_window_width, FALSE, ghid_violation_renderer_new(), ghidgui, NUM_DRC_COLUMNS, row_activated_cb(), selection_changed_cb(), Settings, and TRUE.
Referenced by DoWindows(), ghid_drc_window_append_violation(), and ghid_drc_window_throw_dialog().
int ghid_drc_window_throw_dialog | ( | void | ) |
Definition at line 875 of file gui-drc-window.c.
References ghid_drc_window_show(), and TRUE.
static void ghid_violation_renderer_class_init | ( | GhidViolationRendererClass * | klass | ) | [static] |
GType class initialiser for GhidViolationRenderer.
[in] | klass | The GhidViolationRendererClass we are initialising |
Definition at line 676 of file gui-drc-window.c.
References GHID_TYPE_DRC_VIOLATION, ghid_violation_renderer_finalize(), ghid_violation_renderer_get_property(), ghid_violation_renderer_get_size(), ghid_violation_renderer_render(), ghid_violation_renderer_set_property(), and PROP_VIOLATION.
Referenced by ghid_violation_renderer_get_type().
static void ghid_violation_renderer_finalize | ( | GObject * | object | ) | [static] |
GObject finalise handler.
[in] | widget | The GObject being finalized. |
Definition at line 491 of file gui-drc-window.c.
References GHID_VIOLATION_RENDERER, and _GhidViolationRenderer::violation.
Referenced by ghid_violation_renderer_class_init().
static void ghid_violation_renderer_get_property | ( | GObject * | object, |
guint | property_id, | ||
GValue * | value, | ||
GParamSpec * | pspec | ||
) | [static] |
GObject property getter function.
[in] | object | The GObject whose properties we are getting |
[in] | property_id | The numeric id. under which the property was registered with g_object_class_install_property() |
[out] | value | The GValue in which to return the value of the property |
[in] | pspec | A GParamSpec describing the property being got |
Definition at line 583 of file gui-drc-window.c.
Referenced by ghid_violation_renderer_class_init().
static void ghid_violation_renderer_get_size | ( | GtkCellRenderer * | cell, |
GtkWidget * | widget, | ||
GdkRectangle * | cell_area, | ||
gint * | x_offset, | ||
gint * | y_offset, | ||
gint * | width, | ||
gint * | height | ||
) | [static] |
Definition at line 595 of file gui-drc-window.c.
References MAX, and VIOLATION_PIXMAP_PIXEL_SIZE.
Referenced by ghid_violation_renderer_class_init().
GType ghid_violation_renderer_get_type | ( | void | ) |
Function to retrieve GhidViolationRenderer's GType identifier.
Definition at line 709 of file gui-drc-window.c.
References ghid_violation_renderer_class_init().
GtkCellRenderer* ghid_violation_renderer_new | ( | void | ) |
Convenience function to create a new violation renderer.
Definition at line 744 of file gui-drc-window.c.
References GHID_TYPE_VIOLATION_RENDERER.
Referenced by ghid_drc_window_show().
static void ghid_violation_renderer_render | ( | GtkCellRenderer * | cell, |
GdkDrawable * | window, | ||
GtkWidget * | widget, | ||
GdkRectangle * | background_area, | ||
GdkRectangle * | cell_area, | ||
GdkRectangle * | expose_area, | ||
GtkCellRendererState | flags | ||
) | [static] |
Definition at line 618 of file gui-drc-window.c.
References ghid_render_pixmap(), GHID_VIOLATION_RENDERER, pixmap, _GhidDrcViolation::pixmap, style, _GhidViolationRenderer::violation, VIOLATION_PIXMAP_PCB_SIZE, VIOLATION_PIXMAP_PIXEL_BORDER, VIOLATION_PIXMAP_PIXEL_SIZE, _GhidDrcViolation::x_coord, and _GhidDrcViolation::y_coord.
Referenced by ghid_violation_renderer_class_init().
static void ghid_violation_renderer_set_property | ( | GObject * | object, |
guint | property_id, | ||
const GValue * | value, | ||
GParamSpec * | pspec | ||
) | [static] |
GObject property setter function.
[in] | object | The GObject whose properties we are setting |
[in] | property_id | The numeric id. under which the property was registered with g_object_class_install_property() |
[in] | value | The GValue the property is being set from |
[in] | pspec | A GParamSpec describing the property being set |
Definition at line 515 of file gui-drc-window.c.
References _, unit::allow, _GhidDrcViolation::explanation, GHID_VIOLATION_RENDERER, SettingType::grid_unit, _GhidDrcViolation::have_measured, _GhidDrcViolation::measured_value, pcb_g_strdup_printf(), PROP_VIOLATION, _GhidDrcViolation::required_value, Settings, _GhidDrcViolation::title, and _GhidViolationRenderer::violation.
Referenced by ghid_violation_renderer_class_init().
static void row_activated_cb | ( | GtkTreeView * | view, |
GtkTreePath * | path, | ||
GtkTreeViewColumn * | column, | ||
gpointer | user_data | ||
) | [static] |
Definition at line 158 of file gui-drc-window.c.
References CenterDisplay(), DRC_VIOLATION_OBJ_COL, gport, GHidPort::top_window, _GhidDrcViolation::x_coord, and _GhidDrcViolation::y_coord.
Referenced by ghid_drc_window_show().
static void selection_changed_cb | ( | GtkTreeSelection * | selection, |
gpointer | user_data | ||
) | [static] |
Definition at line 95 of file gui-drc-window.c.
References _, AddObjectToFlagUndoList(), CenterDisplay(), ChangeGroupVisibility(), ClearFlagOnAllObjects(), PCBType::Data, Draw(), DrawObject(), DRC_VIOLATION_OBJ_COL, GetLayerNumber(), IncrementUndoSerialNumber(), Message(), _GhidDrcViolation::object_count, _GhidDrcViolation::object_id_list, _GhidDrcViolation::object_type_list, PCB, ptr1, ptr2, ptr3, SearchObjectByID(), SET_FLAG, SetChangedFlag(), _GhidDrcViolation::x_coord, and _GhidDrcViolation::y_coord.
Referenced by ghid_drc_window_show().
GtkWidget * drc_list |
Definition at line 49 of file gui-drc-window.c.
Referenced by ghid_drc_window_show().
GtkListStore* drc_list_model = NULL [static] |
Definition at line 50 of file gui-drc-window.c.
Referenced by ghid_drc_window_append_violation(), ghid_drc_window_reset_message(), and ghid_drc_window_show().
GtkWidget* drc_window [static] |
Definition at line 49 of file gui-drc-window.c.
Referenced by drc_close_cb(), drc_destroy_cb(), and ghid_drc_window_show().
GObjectClass* ghid_drc_violation_parent_class = NULL [static] |
Definition at line 191 of file gui-drc-window.c.
Referenced by ghid_drc_violation_class_init(), and ghid_drc_violation_finalize().
GObjectClass* ghid_violation_renderer_parent_class = NULL [static] |
Definition at line 479 of file gui-drc-window.c.
int num_violations = 0 [static] |
Definition at line 51 of file gui-drc-window.c.
Referenced by ghid_drc_window_append_violation(), and ghid_drc_window_reset_message().