libgeda

o_pin_basic.c File Reference

functions for the pin object More...

#include <config.h>
#include <stdio.h>
#include <math.h>
#include "libgeda_priv.h"
Include dependency graph for o_pin_basic.c:

Go to the source code of this file.

Functions

void world_get_pin_bounds (TOPLEVEL *toplevel, OBJECT *object, int *left, int *top, int *right, int *bottom)
 calculate and return the boundaries of a pin object
gboolean o_pin_get_position (TOPLEVEL *toplevel, gint *x, gint *y, OBJECT *object)
 get the position of a whichend of the pin object
OBJECTo_pin_new (TOPLEVEL *toplevel, char type, int color, int x1, int y1, int x2, int y2, int pin_type, int whichend)
 create a new pin object
void o_pin_recalc (TOPLEVEL *toplevel, OBJECT *o_current)
 recalc the visual properties of a pin object
OBJECTo_pin_read (TOPLEVEL *toplevel, const char buf[], unsigned int release_ver, unsigned int fileformat_ver, GError **err)
 read a pin object from a char buffer
char * o_pin_save (TOPLEVEL *toplevel, OBJECT *object)
 Create a string representation of the pin object.
void o_pin_translate_world (TOPLEVEL *toplevel, int dx, int dy, OBJECT *object)
 move a pin object
OBJECTo_pin_copy (TOPLEVEL *toplevel, OBJECT *o_current)
 create a copy of a pin object
void o_pin_print (TOPLEVEL *toplevel, FILE *fp, OBJECT *o_current, int origin_x, int origin_y)
 postscript print command for a pin object
void o_pin_rotate_world (TOPLEVEL *toplevel, int world_centerx, int world_centery, int angle, OBJECT *object)
 rotate a pin object around a centerpoint
void o_pin_mirror_world (TOPLEVEL *toplevel, int world_centerx, int world_centery, OBJECT *object)
 mirror a pin object horizontaly at a centerpoint
void o_pin_modify (TOPLEVEL *toplevel, OBJECT *object, int x, int y, int whichone)
 modify one point of a pin object
void o_pin_update_whichend (TOPLEVEL *toplevel, GList *object_list, int num_pins)
 guess the whichend of pins of object list
void o_pin_set_type (TOPLEVEL *toplevel, OBJECT *o_current, int pin_type)
 Sets the type, and corresponding width of a pin.

Detailed Description

Definition in file o_pin_basic.c.


Function Documentation

void world_get_pin_bounds ( TOPLEVEL toplevel,
OBJECT object,
int *  left,
int *  top,
int *  right,
int *  bottom 
)
Function Description
This function calculates the object boudaries of a pin object.
Parameters:
[in]toplevelThe TOPLEVEL object.
[in]objecta pin object
[out]leftthe left world coord
[out]topthe top world coord
[out]rightthe right world coord
[out]bottomthe bottom world coord

Definition at line 46 of file o_pin_basic.c.

Here is the call graph for this function:

gboolean o_pin_get_position ( TOPLEVEL toplevel,
gint *  x,
gint *  y,
OBJECT object 
)
Function Description
This function gets the position of the whichend side of a pin object.
Parameters:
[in]toplevelThe toplevel environment.
[out]xpointer to the x-position
[out]ypointer to the y-position
[in]objectThe object to get the position.
Returns:
TRUE if successfully determined the position, FALSE otherwise

Definition at line 62 of file o_pin_basic.c.

OBJECT* o_pin_new ( TOPLEVEL toplevel,
char  type,
int  color,
int  x1,
int  y1,
int  x2,
int  y2,
int  pin_type,
int  whichend 
)
Function Description
This function creates and returns a new pin object.
Parameters:
[in]toplevelThe TOPLEVEL object.
[in]typeThe OBJECT type (usually OBJ_PIN)
[in]colorThe color of the pin
[in]x1x-coord of the first point
[in]y1y-coord of the first point
[in]x2x-coord of the second point
[in]y2y-coord of the second point
[in]pin_typetype of pin (PIN_TYPE_NET or PIN_TYPE_BUS)
[in]whichendThe connectable end of the pin
Returns:
A new pin OBJECT

Definition at line 85 of file o_pin_basic.c.

Here is the call graph for this function:

void o_pin_recalc ( TOPLEVEL toplevel,
OBJECT o_current 
)
Function Description
This function updates the visual coords of the o_current object.
Parameters:
[in]toplevelThe TOPLEVEL object.
[in]o_currenta pin object.

Definition at line 118 of file o_pin_basic.c.

Here is the call graph for this function:

OBJECT* o_pin_read ( TOPLEVEL toplevel,
const char  buf[],
unsigned int  release_ver,
unsigned int  fileformat_ver,
GError **  err 
)
Function Description
This function reads a pin object from the buffer buf. If the pin object was read successfully, a new pin object is allocated and appended to the object_list.
Parameters:
[in]toplevelThe TOPLEVEL object
[in]bufa text buffer (usually a line of a schematic file)
[in]release_verThe release number gEDA
[in]fileformat_vera integer value of the file format
Returns:
The object list, or NULL on error.

Definition at line 147 of file o_pin_basic.c.

Here is the call graph for this function:

char* o_pin_save ( TOPLEVEL toplevel,
OBJECT object 
)
Function Description
This function takes a pin object and return a string according to the file format definition.
Parameters:
[in]toplevela TOPLEVEL structure
[in]objecta pin OBJECT
Returns:
the string representation of the pin OBJECT

Definition at line 207 of file o_pin_basic.c.

void o_pin_translate_world ( TOPLEVEL toplevel,
int  dx,
int  dy,
OBJECT object 
)
Function Description
This function changes the position of a pin object.
Parameters:
[in]toplevelThe TOPLEVEL object
[in]dxThe x-distance to move the object
[in]dyThe y-distance to move the object
[in]objectThe pin OBJECT to be moved

Definition at line 235 of file o_pin_basic.c.

Here is the call graph for this function:

OBJECT* o_pin_copy ( TOPLEVEL toplevel,
OBJECT o_current 
)
Function Description
This function creates a copy of the pin object o_current.
Parameters:
[in]toplevelThe TOPLEVEL object
[in]o_currentThe object that is copied
Returns:
a new pin object

Definition at line 257 of file o_pin_basic.c.

Here is the call graph for this function:

void o_pin_print ( TOPLEVEL toplevel,
FILE *  fp,
OBJECT o_current,
int  origin_x,
int  origin_y 
)
Function Description
This function writes the postscript command of the pin object o_current into the FILE fp points to.
Parameters:
[in]toplevelThe TOPLEVEL object
[in]fppointer to a FILE structure
[in]o_currentThe OBJECT to print
[in]origin_xx-coord of the postscript origin
[in]origin_yy-coord of the postscript origin

Definition at line 280 of file o_pin_basic.c.

Here is the call graph for this function:

void o_pin_rotate_world ( TOPLEVEL toplevel,
int  world_centerx,
int  world_centery,
int  angle,
OBJECT object 
)
Function Description
This function rotates a pin object around the point (world_centerx, world_centery).
Parameters:
[in]toplevelThe TOPLEVEL object
[in]world_centerxx-coord of the rotation center
[in]world_centeryy-coord of the rotation center
[in]angleThe angle to rotat the pin object
[in]objectThe pin object
Note:
only steps of 90 degrees are allowed for the angle

Definition at line 319 of file o_pin_basic.c.

Here is the call graph for this function:

void o_pin_mirror_world ( TOPLEVEL toplevel,
int  world_centerx,
int  world_centery,
OBJECT object 
)
Function Description
This function mirrors a pin object horizontaly at the point (world_centerx, world_centery).
Parameters:
[in]toplevelThe TOPLEVEL object
[in]world_centerxx-coord of the mirror position
[in]world_centeryy-coord of the mirror position
[in]objectThe pin object

Definition at line 356 of file o_pin_basic.c.

Here is the call graph for this function:

void o_pin_modify ( TOPLEVEL toplevel,
OBJECT object,
int  x,
int  y,
int  whichone 
)
Function Description
This function modifies one point of a pin object. The point is specified by the whichone variable and the new coordinate is (x, y).
Parameters:
toplevelThe TOPLEVEL object
objectThe pin OBJECT to modify
xnew x-coord of the pin point
ynew y-coord of the pin point
whichonepin point to modify

Definition at line 382 of file o_pin_basic.c.

Here is the call graph for this function:

void o_pin_update_whichend ( TOPLEVEL toplevel,
GList *  object_list,
int  num_pins 
)
Function Description
This function determines the whichend of the pins in the object_list. In older libgeda file format versions there was no information about the active end of pins. This function calculates the bounding box of all pins in the object list. The side of the pins that are closer to the boundary of the box are set as active ends of the pins.
Parameters:
toplevelThe TOPLEVEL object
object_listlist of OBJECTs
num_pinspin count in the object list

Definition at line 407 of file o_pin_basic.c.

Here is the call graph for this function:

void o_pin_set_type ( TOPLEVEL toplevel,
OBJECT o_current,
int  pin_type 
)
Function Description
Sets the pin's type and width to a particular style.
Parameters:
[in]toplevelThe TOPLEVEL object
[in]o_currentThe pin OBJECT being modified
[in]pin_typeThe new type of this pin

Definition at line 560 of file o_pin_basic.c.

Here is the call graph for this function:

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines