libgeda
|
functions for the basic object type More...
#include <config.h>
#include <stdio.h>
#include "libgeda_priv.h"
Go to the source code of this file.
Data Structures | |
struct | change_notify_entry |
Functions | |
int | inside_region (int xmin, int ymin, int xmax, int ymax, int x, int y) |
Check if point is inside a region. | |
void | o_recalc_single_object (TOPLEVEL *toplevel, OBJECT *o_current) |
Recalculate position of the given object. | |
void | o_recalc_object_glist (TOPLEVEL *toplevel, GList *object_glist) |
Recalculate position of a list (GList) of objects. | |
void | o_set_line_options (TOPLEVEL *toplevel, OBJECT *o_current, OBJECT_END end, OBJECT_TYPE type, int width, int length, int space) |
Set an OBJECT's line options. | |
gboolean | o_get_line_options (OBJECT *object, OBJECT_END *end, OBJECT_TYPE *type, int *width, int *length, int *space) |
get OBJECT's line properties. | |
void | o_set_fill_options (TOPLEVEL *toplevel, OBJECT *o_current, OBJECT_FILLING type, int width, int pitch1, int angle1, int pitch2, int angle2) |
Set OBJECT's fill options. | |
gboolean | o_get_fill_options (OBJECT *object, OBJECT_FILLING *type, int *width, int *pitch1, int *angle1, int *pitch2, int *angle2) |
get OBJECT's fill properties. | |
gboolean | o_get_position (TOPLEVEL *toplevel, gint *x, gint *y, OBJECT *object) |
get the base position of an object | |
void | o_translate_world (TOPLEVEL *toplevel, gint dx, gint dy, OBJECT *object) |
Translates an object in world coordinates. | |
void | o_rotate_world (TOPLEVEL *toplevel, int world_centerx, int world_centery, int angle, OBJECT *object) |
Rotates an object in world coordinates. | |
void | o_mirror_world (TOPLEVEL *toplevel, int world_centerx, int world_centery, OBJECT *object) |
Mirrors an object in world coordinates. | |
double | o_shortest_distance (OBJECT *object, int x, int y) |
Calculates the distance between the given point and the closest point on the given object. | |
double | o_shortest_distance_full (OBJECT *object, int x, int y, int force_solid) |
Calculates the distance between the given point and the closest point on the given object. Allows forcing objects to solid. | |
void | o_bounds_invalidate (TOPLEVEL *toplevel, OBJECT *obj) |
Mark an OBJECT's cached bounds as invalid. | |
void | o_set_color (TOPLEVEL *toplevel, OBJECT *object, int color) |
Change the color of an object. | |
PAGE * | o_get_page (TOPLEVEL *toplevel, OBJECT *object) |
Get an object's parent PAGE. | |
PAGE * | o_get_page_compat (TOPLEVEL *toplevel, OBJECT *object) |
Get an object's parent PAGE, or fall back to global current page. | |
OBJECT * | o_get_parent (TOPLEVEL *toplevel, OBJECT *object) |
Get an object's containing complex object. | |
void | o_add_change_notify (TOPLEVEL *toplevel, ChangeNotifyFunc pre_change_func, ChangeNotifyFunc change_func, void *user_data) |
Add change notification handlers to a TOPLEVEL. | |
void | o_remove_change_notify (TOPLEVEL *toplevel, ChangeNotifyFunc pre_change_func, ChangeNotifyFunc change_func, void *user_data) |
Remove change notification handlers from a TOPLEVEL. | |
void | o_emit_pre_change_notify (TOPLEVEL *toplevel, OBJECT *object) |
Emit an object pre-change notification. | |
void | o_emit_change_notify (TOPLEVEL *toplevel, OBJECT *object) |
Emit an object change notification. | |
gboolean | o_is_visible (TOPLEVEL *toplevel, OBJECT *object) |
Query visibility of the object. | |
void | o_set_visibility (TOPLEVEL *toplevel, OBJECT *object, int visibility) |
Set visibility of the object. |
This file contains the code used to handle OBJECTs (st_object). The object is the basic type of all elements stored in schematic and symbol files.
The object be extended to become concrete objects like a line, a pin, text, a circle or a picture. These extentions are substructures in the object struct. The subobjects are picture (st_picture), path (st_path), arcs (st_arc), a line (st_line), box (st_box), circle (st_circle), text (st_text) and a complex type (st_complex).
Pins, nets and busses are just a kind of a line.
The complex object can carry many primary objects. If the complex object is a symbol, then the complex symbol contains all the pins, the text and the graphics.
Definition in file o_basic.c.
int inside_region | ( | int | xmin, |
int | ymin, | ||
int | xmax, | ||
int | ymax, | ||
int | x, | ||
int | y | ||
) |
[in] | xmin | Smaller x coordinate of the region. |
[in] | ymin | Smaller y coordinate of the region. |
[in] | xmax | Larger x coordinate of the region. |
[in] | ymax | Larger y coordinate of the region. |
[in] | x | x coordinate of the point to check. |
[in] | y | y coordinate of the point to check. |
void o_recalc_object_glist | ( | TOPLEVEL * | toplevel, |
GList * | object_glist | ||
) |
void o_set_line_options | ( | TOPLEVEL * | toplevel, |
OBJECT * | o_current, | ||
OBJECT_END | end, | ||
OBJECT_TYPE | type, | ||
int | width, | ||
int | length, | ||
int | space | ||
) |
[in] | toplevel | The TOPLEVEL object. |
[in,out] | o_current | OBJECT to set line options on. |
[in] | end | An OBJECT_END. |
[in] | type | An OBJECT_TYPE. |
[in] | width | Line width. |
[in] | length | Line length. |
[in] | space | Spacing between dashes/dots. Cannot be negative. |
Definition at line 183 of file o_basic.c.
gboolean o_get_line_options | ( | OBJECT * | object, |
OBJECT_END * | end, | ||
OBJECT_TYPE * | type, | ||
int * | width, | ||
int * | length, | ||
int * | space | ||
) |
[in] | object | OBJECT to read the properties |
[out] | end | An OBJECT_END. |
[out] | type | An OBJECT_TYPE. |
[out] | width | Line width. |
[out] | length | Line length. |
[out] | space | Spacing between dashes/dots. |
void o_set_fill_options | ( | TOPLEVEL * | toplevel, |
OBJECT * | o_current, | ||
OBJECT_FILLING | type, | ||
int | width, | ||
int | pitch1, | ||
int | angle1, | ||
int | pitch2, | ||
int | angle2 | ||
) |
[in] | toplevel | The TOPLEVEL object. |
[in,out] | o_current | OBJECT to be updated. |
[in] | type | OBJECT_FILLING type. |
[in] | width | fill width. |
[in] | pitch1 | cross hatch line distance |
[in] | angle1 | cross hatch angle |
[in] | pitch2 | cross hatch line distance |
[in] | angle2 | cross hatch angle |
Definition at line 281 of file o_basic.c.
gboolean o_get_fill_options | ( | OBJECT * | object, |
OBJECT_FILLING * | type, | ||
int * | width, | ||
int * | pitch1, | ||
int * | angle1, | ||
int * | pitch2, | ||
int * | angle2 | ||
) |
[in] | object | OBJECT to read the properties |
[out] | type | OBJECT_FILLING type |
[out] | width | fill width. |
[out] | pitch1 | cross hatch line distance |
[out] | angle1 | cross hatch angle |
[out] | pitch2 | cross hatch line distance |
[out] | angle2 | cross hatch angle |
[in] | toplevel | The toplevel environment. |
[out] | x | pointer to the x-position |
[out] | y | pointer to the y-position |
[in] | object | The object to get the position. |
Definition at line 349 of file o_basic.c.
[in] | toplevel | The toplevel environment. |
[in] | dx | Amount to horizontally translate object |
[in] | dy | Amount to vertically translate object |
[in] | object | The object to translate. |
Definition at line 388 of file o_basic.c.
void o_rotate_world | ( | TOPLEVEL * | toplevel, |
int | world_centerx, | ||
int | world_centery, | ||
int | angle, | ||
OBJECT * | object | ||
) |
[in] | toplevel | The toplevel environment. |
[in] | world_centerx | X coordinate of rotation center (world coords) |
[in] | world_centery | Y coordinate of rotation center (world coords) |
[in] | angle | Angle of rotation (degrees) |
[in] | object | The object to rotate. |
Definition at line 427 of file o_basic.c.
[in] | toplevel | The TOPLEVEL object. |
[in] | world_centerx | Origin x coordinate in WORLD units. |
[in] | world_centery | Origin y coordinate in WORLD units. |
[in,out] | object | The OBJECT to mirror. |
Definition at line 465 of file o_basic.c.
double o_shortest_distance | ( | OBJECT * | object, |
int | x, | ||
int | y | ||
) |
[in] | object | The given object. |
[in] | x | The x coordinate of the given point. |
[in] | y | The y coordinate of the given point. |
Definition at line 504 of file o_basic.c.
double o_shortest_distance_full | ( | OBJECT * | object, |
int | x, | ||
int | y, | ||
int | force_solid | ||
) |
[in] | object | The given object. |
[in] | x | The x coordinate of the given point. |
[in] | y | The y coordinate of the given point. |
[in] | force_solid | If true, force treating the object as solid. |
Definition at line 521 of file o_basic.c.
[in] | toplevel | |
[in] | obj |
[in] | toplevel | The TOPLEVEL structure. |
[in] | object | The OBJECT for which to retrieve the parent PAGE. |
Definition at line 607 of file o_basic.c.
[in] | toplevel | The TOPLEVEL structure. |
[in] | object | The OBJECT for which to retrieve the parent PAGE. |
Definition at line 635 of file o_basic.c.
void o_add_change_notify | ( | TOPLEVEL * | toplevel, |
ChangeNotifyFunc | pre_change_func, | ||
ChangeNotifyFunc | change_func, | ||
void * | user_data | ||
) |
toplevel | TOPLEVEL structure to add handlers to. |
pre_change_func | Function to be called just before changes. |
change_func | Function to be called just after changes. |
user_data | User data to be passed to callback functions. |
void o_remove_change_notify | ( | TOPLEVEL * | toplevel, |
ChangeNotifyFunc | pre_change_func, | ||
ChangeNotifyFunc | change_func, | ||
void * | user_data | ||
) |
toplevel | TOPLEVEL structure to remove handlers from. |
pre_change_func | Function called just before changes. |
change_func | Function called just after changes. |
user_data | User data passed to callback functions. |