Functions for a footprint preview dialog. More...
Go to the source code of this file.
Functions | |
static void | preview_close_cb (GtkWidget *widget, GtkWidget *preview_window) |
Close the preview window (destroy the preview widget). | |
static gboolean | preview_configure_event (GtkWidget *widget, GdkEventConfigure *event) |
Create a new backing pixmap of the appropriate size. | |
void | preview_delete_event (GtkWidget *widget, GdkEvent *event) |
Delete the window. | |
int | preview_set_fg_color (GdkGC *gc, const char *color_name) |
Set the foreground color of the Graphics Context. | |
int | preview_set_fill_mode (GdkGC *gc, GdkFill fill_mode) |
Set the fill mode of the Graphics Context. | |
int | preview_set_line_cap (GdkGC *gc, GdkCapStyle line_cap) |
Set the line capsulation of the Graphics Context. | |
int | preview_set_line_style (GdkGC *gc, GdkLineStyle line_style) |
Set the line style of the Graphics Context. | |
int | preview_set_line_width (GdkGC *gc, gint line_width) |
Set the line width of the Graphics Context. | |
int | preview_use_gc (GdkDrawable *drawable, GdkGC *gc, const char *color_name, gint line_width, GdkCapStyle line_cap, GdkLineStyle line_style, GdkFill fill_mode) |
Use a Graphics Context when drawing entities. | |
static void | preview_draw_arc (GtkWidget *widget, preview_arc arc) |
Draw an arc on the preview pixmap. | |
static void | preview_draw_background (GtkWidget *widget, gdouble x, gdouble y) |
Draw a white background (rectangle) on the screen. | |
static void | preview_draw_line (GtkWidget *widget, preview_line line) |
Draw a line on the preview pixmap. | |
static void | preview_draw_pad (GtkWidget *widget) |
Draw a pad on the preview pixmap. | |
static void | preview_draw_pin (GtkWidget *widget) |
Draw a pin on the preview pixmap. | |
static void | preview_draw_polygon (GtkWidget *widget, preview_polygon polygon) |
Draw a pin on the preview pixmap. | |
static void | preview_draw_rectangle (GtkWidget *widget, preview_rectangle rectangle) |
Draws a rectangle on the preview canvas. | |
static gboolean | preview_expose_event (GtkWidget *widget, GdkEventExpose *event) |
Redraw the screen from the backing pixmap. | |
int | preview_create_window (gchar *footprint_name, gint width, gint height) |
Create a preview window containing a pixmap with the footprint. |
Functions for a footprint preview dialog.
Definition in file preview_dialog.c.
static void preview_close_cb | ( | GtkWidget * | widget, | |
GtkWidget * | preview_window | |||
) | [static] |
Close the preview window (destroy the preview widget).
widget | : is the caller widget. | |
preview_window | : is the widget to be closed. |
Definition at line 35 of file preview_dialog.c.
Referenced by preview_create_window().
static gboolean preview_configure_event | ( | GtkWidget * | widget, | |
GdkEventConfigure * | event | |||
) | [static] |
Create a new backing pixmap of the appropriate size.
TRUE
when function is completed. widget | : is the (drawable) widget to contain the image. | |
event | : is the configure event passed from the caller. |
Definition at line 53 of file preview_dialog.c.
References pixmap.
Referenced by preview_create_window().
int preview_create_window | ( | gchar * | footprint_name, | |
gint | width, | |||
gint | height | |||
) |
Create a preview window containing a pixmap with the footprint.
The footprint_name
variable is used in the dialog title.
footprint_name | : is the footprint type. | |
width | : is width of the pixmap. | |
height | : is height of the pixmap. |
Definition at line 679 of file preview_dialog.c.
void preview_delete_event | ( | GtkWidget * | widget, | |
GdkEvent * | event | |||
) |
Delete the window.
widget | : is the widget to be deleted. | |
event | : is the delete event passed from the caller. |
Definition at line 85 of file preview_dialog.c.
Referenced by preview_create_window().
static void preview_draw_arc | ( | GtkWidget * | widget, | |
preview_arc | arc | |||
) | [static] |
Draw an arc on the preview pixmap.
Draws an arc or a filled 'pie slice'.
The arc is defined by the bounding rectangle of the entire ellipse, and the start and end angles of the part of the ellipse to be drawn.
widget | : is the toplevel widget containing the drawable. | |
arc | : is a preview arc. |
Definition at line 442 of file preview_dialog.c.
References preview_arc::angle1, preview_arc::angle2, preview_arc::drawable, preview_arc::filled, preview_arc::gc, preview_arc::height, preview_arc::width, preview_arc::x, and preview_arc::y.
static void preview_draw_background | ( | GtkWidget * | widget, | |
gdouble | x, | |||
gdouble | y | |||
) | [static] |
Draw a white background (rectangle) on the screen.
widget | : is the toplevel widget containing the drawable. | |
x | : is the X-coordinate of the left edge of the background. | |
y | : is the Y-coordinate of the top edge of the background. |
Definition at line 476 of file preview_dialog.c.
References pixmap.
static void preview_draw_line | ( | GtkWidget * | widget, | |
preview_line | line | |||
) | [static] |
Draw a line on the preview pixmap.
Draws a line, using the foreground color and other attributes of the GdkGC.
widget | : is the toplevel widget containing the drawable. | |
line | : is a preview line. |
Definition at line 518 of file preview_dialog.c.
References preview_line::drawable, preview_line::gc, preview_line::x1, preview_line::x2, preview_line::y1, and preview_line::y2.
static void preview_draw_pad | ( | GtkWidget * | widget | ) | [static] |
Draw a pad on the preview pixmap.
widget | : is the toplevel widget containing the drawable. |
Definition at line 547 of file preview_dialog.c.
static void preview_draw_pin | ( | GtkWidget * | widget | ) | [static] |
Draw a pin on the preview pixmap.
widget | : is the toplevel widget containing the drawable. |
Definition at line 561 of file preview_dialog.c.
static void preview_draw_polygon | ( | GtkWidget * | widget, | |
preview_polygon | polygon | |||
) | [static] |
Draw a pin on the preview pixmap.
widget | : is the toplevel widget containing the drawable. | |
polygon | : is a preview polygon. |
Definition at line 575 of file preview_dialog.c.
References preview_polygon::drawable, preview_polygon::filled, preview_polygon::gc, preview_polygon::npoints, and preview_polygon::points.
static void preview_draw_rectangle | ( | GtkWidget * | widget, | |
preview_rectangle | rectangle | |||
) | [static] |
Draws a rectangle on the preview canvas.
Draws a rectangular outline or filled rectangle, using the foreground color and other attributes of the GdkGC.
A rectangle drawn filled is 1 pixel smaller in both dimensions than a rectangle outlined.
Calling gdk_draw_rectangle (window, gc, TRUE, 0, 0, 20, 20) results in a filled rectangle 20 pixels wide and 20 pixels high.
Calling gdk_draw_rectangle (window, gc, FALSE, 0, 0, 20, 20) results in an outlined rectangle with corners at (0, 0), (0, 20), (20, 20), and (20, 0), which makes it 21 pixels wide and 21 pixels high.
widget | : is the toplevel widget containing the drawable. | |
rectangle | : is a preview rectangle. |
Definition at line 613 of file preview_dialog.c.
References preview_rectangle::drawable, preview_rectangle::filled, preview_rectangle::gc, preview_rectangle::height, preview_rectangle::width, preview_rectangle::x, and preview_rectangle::y.
static gboolean preview_expose_event | ( | GtkWidget * | widget, | |
GdkEventExpose * | event | |||
) | [static] |
Redraw the screen from the backing pixmap.
FALSE
when function is completed. widget | : is the toplevel widget containing the drawable. | |
event | : is the event passed from the caller. |
Definition at line 645 of file preview_dialog.c.
References pixmap.
Referenced by preview_create_window().
int preview_set_fg_color | ( | GdkGC * | gc, | |
const char * | color_name | |||
) |
Set the foreground color of the Graphics Context.
EXIT_SUCCESS
when function is completed, EXIT_FAILURE
when an eror occurred. gc | : is the Graphics Context. | |
color_name | : is a NULL terminated color name. |
Definition at line 104 of file preview_dialog.c.
Referenced by preview_use_gc().
int preview_set_fill_mode | ( | GdkGC * | gc, | |
GdkFill | fill_mode | |||
) |
Set the fill mode of the Graphics Context.
EXIT_SUCCESS
when function is completed, EXIT_FAILURE
when an eror occurred. gc | : is the Graphics Context. | |
fill_mode | : determines how primitives are drawn. Valid values are:
|
Definition at line 140 of file preview_dialog.c.
Referenced by preview_use_gc().
int preview_set_line_cap | ( | GdkGC * | gc, | |
GdkCapStyle | line_cap | |||
) |
Set the line capsulation of the Graphics Context.
EXIT_SUCCESS
when function is completed, EXIT_FAILURE
when an eror occurs. gc | : is the Graphics Context. | |
line_cap | : determines how the end of lines are drawn. Valid values are:
|
Definition at line 190 of file preview_dialog.c.
Referenced by preview_use_gc().
int preview_set_line_style | ( | GdkGC * | gc, | |
GdkLineStyle | line_style | |||
) |
Set the line style of the Graphics Context.
EXIT_SUCCESS
when function is completed, EXIT_FAILURE
when an eror occurs. gc | : is the Graphics Context. | |
line_style | : determines how lines are drawn. Valid values are:
|
Definition at line 245 of file preview_dialog.c.
Referenced by preview_use_gc().
int preview_set_line_width | ( | GdkGC * | gc, | |
gint | line_width | |||
) |
Set the line width of the Graphics Context.
EXIT_SUCCESS
when function is completed, EXIT_FAILURE
when an eror occurs. gc | : is the Graphics Context. | |
line_width | : is the line width in pixels [px]. |
Definition at line 297 of file preview_dialog.c.
Referenced by preview_use_gc().
int preview_use_gc | ( | GdkDrawable * | drawable, | |
GdkGC * | gc, | |||
const char * | color_name, | |||
gint | line_width, | |||
GdkCapStyle | line_cap, | |||
GdkLineStyle | line_style, | |||
GdkFill | fill_mode | |||
) |
Use a Graphics Context when drawing entities.
If the passed Graphics Context is NULL , create a Graphics Context.
EXIT_SUCCESS
when function is completed, EXIT_FAILURE
when an eror occurs. drawable | : is an opaque structure representing an object that can be drawn onto. This can be a GdkPixmap, a GdkBitmap, or a GdkWindow. | |
gc | : is the Graphics Context. | |
color_name | : is a NULL terminated color name. | |
line_width | : is the line width in pixels [px]. | |
line_cap | : determines how the end of lines are drawn. Valid values are:
| |
line_style | : determines how lines are drawn. Valid values are:
| |
fill_mode | : determines how primitives are drawn. Valid values are:
|
Definition at line 346 of file preview_dialog.c.