libgeda

o_bus_basic.c File Reference

functions for the bus object More...

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

Go to the source code of this file.

Functions

gboolean o_bus_get_position (TOPLEVEL *toplevel, gint *x, gint *y, OBJECT *object)
 get the position of the first bus point
void world_get_bus_bounds (TOPLEVEL *toplevel, OBJECT *object, int *left, int *top, int *right, int *bottom)
 calculate and return the boundaries of a bus object
OBJECTo_bus_new (TOPLEVEL *toplevel, char type, int color, int x1, int y1, int x2, int y2, int bus_ripper_direction)
 create a new bus object
void o_bus_recalc (TOPLEVEL *toplevel, OBJECT *o_current)
 recalc the visual properties of a bus object
OBJECTo_bus_read (TOPLEVEL *toplevel, const char buf[], unsigned int release_ver, unsigned int fileformat_ver, GError **err)
 read a bus object from a char buffer
char * o_bus_save (TOPLEVEL *toplevel, OBJECT *object)
 Create a string representation of the bus object.
void o_bus_translate_world (TOPLEVEL *toplevel, int dx, int dy, OBJECT *object)
 move a bus object
OBJECTo_bus_copy (TOPLEVEL *toplevel, OBJECT *o_current)
 create a copy of a bus object
void o_bus_print (TOPLEVEL *toplevel, FILE *fp, OBJECT *o_current, int origin_x, int origin_y)
 postscript print command for a bus object
void o_bus_rotate_world (TOPLEVEL *toplevel, int world_centerx, int world_centery, int angle, OBJECT *object)
 rotate a bus object around a centerpoint
void o_bus_mirror_world (TOPLEVEL *toplevel, int world_centerx, int world_centery, OBJECT *object)
 mirror a bus object horizontaly at a centerpoint
int o_bus_orientation (OBJECT *object)
 calculate the orientation of a bus object
static void o_bus_consolidate_lowlevel (OBJECT *object, OBJECT *del_object, int orient)
static int o_bus_consolidate_segments (TOPLEVEL *toplevel, OBJECT *object)
void o_bus_consolidate (TOPLEVEL *toplevel)
void o_bus_modify (TOPLEVEL *toplevel, OBJECT *object, int x, int y, int whichone)
 modify one point of a bus object

Detailed Description

Definition in file o_bus_basic.c.


Function Documentation

gboolean o_bus_get_position ( TOPLEVEL toplevel,
gint *  x,
gint *  y,
OBJECT object 
)
Function Description
This function gets the position of the first point of a bus 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 45 of file o_bus_basic.c.

Here is the call graph for this function:

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

Definition at line 62 of file o_bus_basic.c.

Here is the call graph for this function:

OBJECT* o_bus_new ( TOPLEVEL toplevel,
char  type,
int  color,
int  x1,
int  y1,
int  x2,
int  y2,
int  bus_ripper_direction 
)
Function Description
This function creates and returns a new bus object.
Parameters:
[in]toplevelThe TOPLEVEL object.
[in]typeThe OBJECT type (usually OBJ_BUS)
[in]colorThe color of the bus
[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]bus_ripper_directiondirection of the bus rippers
Returns:
A new bus OBJECT

Definition at line 82 of file o_bus_basic.c.

Here is the call graph for this function:

void o_bus_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 bus object.

Definition at line 115 of file o_bus_basic.c.

Here is the call graph for this function:

OBJECT* o_bus_read ( TOPLEVEL toplevel,
const char  buf[],
unsigned int  release_ver,
unsigned int  fileformat_ver,
GError **  err 
)
Function Description
This function reads a bus object from the buffer buf. If the bus object was read successfully, a new bus 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 148 of file o_bus_basic.c.

Here is the call graph for this function:

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

Definition at line 207 of file o_bus_basic.c.

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

Definition at line 231 of file o_bus_basic.c.

Here is the call graph for this function:

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

Definition at line 253 of file o_bus_basic.c.

Here is the call graph for this function:

void o_bus_print ( TOPLEVEL toplevel,
FILE *  fp,
OBJECT o_current,
int  origin_x,
int  origin_y 
)
Function Description
This function writes the postscript command of the bus 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_bus_basic.c.

Here is the call graph for this function:

void o_bus_rotate_world ( TOPLEVEL toplevel,
int  world_centerx,
int  world_centery,
int  angle,
OBJECT object 
)
Function Description
This function rotates a bus 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 bus object
[in]objectThe bus object
Note:
only steps of 90 degrees are allowed for the angle

Definition at line 322 of file o_bus_basic.c.

Here is the call graph for this function:

void o_bus_mirror_world ( TOPLEVEL toplevel,
int  world_centerx,
int  world_centery,
OBJECT object 
)
Function Description
This function mirrors a bus 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 bus object

Definition at line 359 of file o_bus_basic.c.

Here is the call graph for this function:

int o_bus_orientation ( OBJECT object)
Function Description
This function calculates the orientation of a bus object.
Parameters:
[in]objectThe bus object
Returns:
The orientation: HORIZONTAL, VERTICAL or NEITHER

Definition at line 379 of file o_bus_basic.c.

static void o_bus_consolidate_lowlevel ( OBJECT object,
OBJECT del_object,
int  orient 
) [static]

Definition at line 401 of file o_bus_basic.c.

static int o_bus_consolidate_segments ( TOPLEVEL toplevel,
OBJECT object 
) [static]

Definition at line 484 of file o_bus_basic.c.

void o_bus_consolidate ( TOPLEVEL toplevel)

Definition at line 495 of file o_bus_basic.c.

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

Definition at line 512 of file o_bus_basic.c.

Here is the call graph for this function:

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines