pcb 4.1.1
An interactive printed circuit board layout editor.

gui-drc-window.c File Reference

#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"
Include dependency graph for gui-drc-window.c:

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.
GhidDrcViolationghid_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 Documentation

#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

Typedef Documentation

typedef struct object_list object_list

Enumeration Type Documentation

anonymous enum
Enumerator:
DRC_VIOLATION_NUM_COL 
DRC_VIOLATION_OBJ_COL 
NUM_DRC_COLUMNS 

Definition at line 87 of file gui-drc-window.c.

anonymous enum
Enumerator:
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
Enumerator:
PROP_VIOLATION 

Definition at line 473 of file gui-drc-window.c.


Function Documentation

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().

Here is the call graph for this function:

static gint drc_window_configure_event_cb ( GtkWidget *  widget,
GdkEventConfigure *  ev,
gpointer  data 
) [static]
static void ghid_drc_violation_class_init ( GhidViolationRendererClass klass) [static]

GType class initialiser for GhidDrcViolation.

Function Description
GType class initialiser for GhidDrcViolation. We override our parent virtual class methods as needed and register our GObject properties.
Parameters:
[in]klassThe 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().

Here is the call graph for this function:

static void ghid_drc_violation_finalize ( GObject *  object) [static]

GObject finalise handler.

Function Description
Just before the GhidDrcViolation GObject is finalized, free our allocated data, and then chain up to the parent's finalize handler.
Parameters:
[in]widgetThe 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.

Function Description
Getter function for GhidDrcViolation's GObject properties, "settings-name" and "toplevel".
Parameters:
[in]objectThe GObject whose properties we are getting
[in]property_idThe numeric id. under which the property was registered with g_object_class_install_property()
[out]valueThe GValue in which to return the value of the property
[in]pspecA 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.

Function Description
Function to retrieve GhidViolationRenderer's GType identifier. Upon first call, this registers the GhidViolationRenderer in the GType system. Subsequently it returns the saved value from its first execution.
Returns:
the GType identifier associated with GhidViolationRenderer.

Definition at line 423 of file gui-drc-window.c.

References ghid_drc_violation_class_init().

Here is the call graph for this function:

static void ghid_drc_violation_set_property ( GObject *  object,
guint  property_id,
const GValue *  value,
GParamSpec *  pspec 
) [static]

GObject property setter function.

Function Description
Setter function for GhidDrcViolation's GObject properties, "settings-name" and "toplevel"
Parameters:
[in]objectThe GObject whose properties we are setting
[in]property_idThe numeric id. under which the property was registered with g_object_class_install_property()
[in]valueThe GValue the property is being set from
[in]pspecA 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.

Here is the call graph for this function:

void ghid_drc_window_reset_message ( void  )

Definition at line 868 of file gui-drc-window.c.

References drc_list_model, and num_violations.

int ghid_drc_window_throw_dialog ( void  )

Definition at line 875 of file gui-drc-window.c.

References ghid_drc_window_show(), and TRUE.

Here is the call graph for this function:

static void ghid_violation_renderer_class_init ( GhidViolationRendererClass klass) [static]

GType class initialiser for GhidViolationRenderer.

Function Description
GType class initialiser for GhidViolationRenderer. We override our parent virtual class methods as needed and register our GObject properties.
Parameters:
[in]klassThe 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().

Here is the call graph for this function:

static void ghid_violation_renderer_finalize ( GObject *  object) [static]

GObject finalise handler.

Function Description
Just before the GhidViolationRenderer GObject is finalized, free our allocated data, and then chain up to the parent's finalize handler.
Parameters:
[in]widgetThe 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.

Function Description
Getter function for GhidViolationRenderer's GObject properties.
Parameters:
[in]objectThe GObject whose properties we are getting
[in]property_idThe numeric id. under which the property was registered with g_object_class_install_property()
[out]valueThe GValue in which to return the value of the property
[in]pspecA 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.

Function Description
Function to retrieve GhidViolationRenderer's GType identifier. Upon first call, this registers the GhidViolationRenderer in the GType system. Subsequently it returns the saved value from its first execution.
Returns:
the GType identifier associated with GhidViolationRenderer.

Definition at line 709 of file gui-drc-window.c.

References ghid_violation_renderer_class_init().

Here is the call graph for this function:

GtkCellRenderer* ghid_violation_renderer_new ( void  )

Convenience function to create a new violation renderer.

Function Description
Convenience function which creates a GhidViolationRenderer.
Returns:
The GhidViolationRenderer created.

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]
static void ghid_violation_renderer_set_property ( GObject *  object,
guint  property_id,
const GValue *  value,
GParamSpec *  pspec 
) [static]

GObject property setter function.

Function Description
Setter function for GhidViolationRenderer's GObject properties, "settings-name" and "toplevel".
Parameters:
[in]objectThe GObject whose properties we are setting
[in]property_idThe numeric id. under which the property was registered with g_object_class_install_property()
[in]valueThe GValue the property is being set from
[in]pspecA 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().

Here is the call graph for this function:

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().

Here is the call graph for this function:


Variable Documentation

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]
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]