gschem
|
#include <config.h>
#include <stdio.h>
#include "gschem.h"
Go to the source code of this file.
Defines | |
#define | INVALIDATE_MARGIN 1 |
Functions | |
void | o_redraw_rects (GSCHEM_TOPLEVEL *w_current, GdkRectangle *rectangles, int n_rectangles) |
void | o_redraw (GSCHEM_TOPLEVEL *w_current, GList *object_list, gboolean draw_selected) |
void | o_redraw_single (GSCHEM_TOPLEVEL *w_current, OBJECT *o_current) |
Redraw an object on the screen. | |
int | o_invalidate_rubber (GSCHEM_TOPLEVEL *w_current) |
int | o_redraw_cleanstates (GSCHEM_TOPLEVEL *w_current) |
void | o_draw_place (GSCHEM_TOPLEVEL *w_current, int dx, int dy, OBJECT *object) |
void | o_glist_draw_place (GSCHEM_TOPLEVEL *w_current, int dx, int dy, GList *list) |
void | o_invalidate_rect (GSCHEM_TOPLEVEL *w_current, int x1, int y1, int x2, int y2) |
Invalidates a rectangular region of the on screen drawing area. | |
void | o_invalidate_all (GSCHEM_TOPLEVEL *w_current) |
Invalidate the whole on-screen area. | |
void | o_invalidate (GSCHEM_TOPLEVEL *w_current, OBJECT *object) |
Invalidate on-screen area for an object. | |
void | o_invalidate_glist (GSCHEM_TOPLEVEL *w_current, GList *list) |
Invalidate on-screen area for a GList of objects. | |
COLOR * | o_drawing_color (GSCHEM_TOPLEVEL *w_current, OBJECT *object) |
Returns the color an object should be drawn in. |
void o_redraw_rects | ( | GSCHEM_TOPLEVEL * | w_current, |
GdkRectangle * | rectangles, | ||
int | n_rectangles | ||
) |
void o_redraw | ( | GSCHEM_TOPLEVEL * | w_current, |
GList * | object_list, | ||
gboolean | draw_selected | ||
) |
void o_redraw_single | ( | GSCHEM_TOPLEVEL * | w_current, |
OBJECT * | o_current | ||
) |
int o_invalidate_rubber | ( | GSCHEM_TOPLEVEL * | w_current | ) |
int o_redraw_cleanstates | ( | GSCHEM_TOPLEVEL * | w_current | ) |
Definition at line 319 of file o_basic.c.
void o_draw_place | ( | GSCHEM_TOPLEVEL * | w_current, |
int | dx, | ||
int | dy, | ||
OBJECT * | object | ||
) |
void o_glist_draw_place | ( | GSCHEM_TOPLEVEL * | w_current, |
int | dx, | ||
int | dy, | ||
GList * | list | ||
) |
void o_invalidate_rect | ( | GSCHEM_TOPLEVEL * | w_current, |
int | x1, | ||
int | y1, | ||
int | x2, | ||
int | y2 | ||
) |
Given a pair of (x,y) coordinates in SCREEN units, invalidate the rectangular on-screen drawing area which has those two coordinate pairs as opposite corners of its region. This will cause that region to be blitted from the back-buffer once the mainloop reaches idle.
A margin, INVALIDATE_MARGIN is added to the invalidated region as a hacky workaround for rounding errors which may occur in the WORLD -> SCREEN coordinate transform. This margin may also be used to expand the invalidated region if anti-aliased drawing is ever used.
A further, larger margin is added to account for invalidating the size occupied by an object's grips.
If the GSCHEM_TOPLEVEL in question is not rendering to a GDK_WINDOW, (e.g. image export), this function call is a no-op. A test is used: GDK_IS_WINDOW(), which should be safe since in either case, w_current->window is a GObject. This is really a _HACK_, and should be fixed with a re-worked drawing model.
[in] | w_current | The GSCHEM_TOPLEVEL who's drawing area is being invalidated. |
[in] | x1 | X coord for corner 1 (SCREEN units) |
[in] | y1 | Y coord for corner 1 (SCREEN units) |
[in] | x2 | X coord for corner 2 (SCREEN units) |
[in] | y2 | Y coord for corner 2 (SCREEN units) |
Definition at line 494 of file o_basic.c.
void o_invalidate_all | ( | GSCHEM_TOPLEVEL * | w_current | ) |
void o_invalidate | ( | GSCHEM_TOPLEVEL * | w_current, |
OBJECT * | object | ||
) |
[in] | w_current | The GSCHEM_TOPLEVEL object. |
[in] | object | The OBJECT invalidated on screen. |
Definition at line 542 of file o_basic.c.
void o_invalidate_glist | ( | GSCHEM_TOPLEVEL * | w_current, |
GList * | list | ||
) |
[in] | w_current | The GSCHEM_TOPLEVEL object. |
[in] | list | The glist objects invalidated on screen. |
Definition at line 565 of file o_basic.c.
COLOR* o_drawing_color | ( | GSCHEM_TOPLEVEL * | w_current, |
OBJECT * | object | ||
) |
The parent field of the OBJECT structure is used to recurse down and check whether the OBJECT being drawn is a prim_obj belonging to some selected OBJECT. If so, SELECT_COLOR is used.
As a convenience, the appropriate color index is looked up using x_color_lookup(), so that code is not duplicated in each drawing function.
[in] | w_current | The GSCHEM_TOPLEVEL object. |
[in] | object | The OBJECT whos color to return. |
Definition at line 597 of file o_basic.c.