libgeda

s_conn.c File Reference

The connection system. More...

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

Go to the source code of this file.

Data Structures

struct  ConnsChangedHook

Functions

CONNs_conn_return_new (OBJECT *other_object, int type, int x, int y, int whichone, int other_whichone)
 create a new connection object
int s_conn_uniq (GList *conn_list, CONN *input_conn)
 check if a connection is uniq in a list
int s_conn_remove_other (TOPLEVEL *toplevel, OBJECT *other_object, OBJECT *to_remove)
 remove a object from the connection list of another object
static void s_conn_remove_glist (TOPLEVEL *toplevel, GList *obj_list)
 removes a GList of OBJECTs from the connection system
void s_conn_remove_object (TOPLEVEL *toplevel, OBJECT *to_remove)
 remove an OBJECT from the connection system
OBJECTs_conn_check_midpoint (OBJECT *o_current, int x, int y)
 Checks if a point is a midpoint of an OBJECT.
void s_conn_update_glist (TOPLEVEL *toplevel, GList *obj_list)
 adds a GList of OBJECTs to the connection system
static int is_bus_related (OBJECT *object)
 Checks if an object is bus, or a bus pin.
static int check_direct_compat (OBJECT *object1, OBJECT *object2)
 Checks if two objects are of compatible types to be connected.
static void add_connection (TOPLEVEL *toplevel, OBJECT *object, OBJECT *other_object, int type, int x, int y, int whichone, int other_whichone)
static void s_conn_update_line_object (TOPLEVEL *toplevel, OBJECT *object)
 add a line OBJECT to the connection system
void s_conn_update_object (TOPLEVEL *toplevel, OBJECT *object)
 add an OBJECT to the connection system
void s_conn_print (GList *conn_list)
 print all connections of a connection list
int s_conn_net_search (OBJECT *new_net, int whichone, GList *conn_list)
 Search for net in existing connections.
static GList * s_conn_return_glist_others (GList *input_list, GList *obj_list)
 get a list of all objects connected to a list of OBJECTs.
GList * s_conn_return_others (GList *input_list, OBJECT *object)
 get a list of all objects connected to this one
void s_conn_append_conns_changed_hook (TOPLEVEL *toplevel, ConnsChangedFunc func, void *data)
static void call_conns_changed_hook (gpointer data, gpointer user_data)
void s_conn_emit_conns_changed (TOPLEVEL *toplevel, OBJECT *object)
void s_conn_freeze_hooks (TOPLEVEL *toplevel, OBJECT *object)
void s_conn_thaw_hooks (TOPLEVEL *toplevel, OBJECT *object)
static void refresh_connectivity_cache (TOPLEVEL *toplevel, OBJECT *object)
static void s_conn_init_toplevel (TOPLEVEL *toplevel)
void s_conn_init (void)

Detailed Description

The connection system stores and tracks the connections between connected OBJECTS. The connected OBJECTS are either pins, nets and busses.

Each connection object with the type st_conn represents a single unidirectional relation to another object.

The following figure with two nets and a pin shows the relations between connections and OBJECTS:

s_conn_overview.png

Definition in file s_conn.c.


Function Documentation

CONN* s_conn_return_new ( OBJECT other_object,
int  type,
int  x,
int  y,
int  whichone,
int  other_whichone 
)
Function Description
create a single st_conn object and initialize it with the given parameters.
Returns:
The new connection object

Definition at line 59 of file s_conn.c.

int s_conn_uniq ( GList *  conn_list,
CONN input_conn 
)
Function Description
This function checks if there's no identical connection in the list of connections.
Parameters:
conn_listlist of connection objects
input_connsingle connection object.
Returns:
TRUE if the CONN structure is unique, FALSE otherwise.

Definition at line 88 of file s_conn.c.

int s_conn_remove_other ( TOPLEVEL toplevel,
OBJECT other_object,
OBJECT to_remove 
)
Function Description
This function removes the OBJECT to_remove from the connection list of the OBJECT other_object.
Parameters:
toplevel(currently not used)
other_objectOBJECT from that the to_remove OBJECT needs to be removed
to_removeOBJECT to remove
Returns:
TRUE if a connection has been deleted, FALSE otherwise

Definition at line 118 of file s_conn.c.

Here is the call graph for this function:

static void s_conn_remove_glist ( TOPLEVEL toplevel,
GList *  obj_list 
) [static]
Function Description
This function removes all connections from and to the OBJECTS of the given GList.
Parameters:
toplevel(currently not used)
obj_listGList of OBJECTs to unconnected from all other objects

Definition at line 175 of file s_conn.c.

Here is the call graph for this function:

void s_conn_remove_object ( TOPLEVEL toplevel,
OBJECT to_remove 
)
Function Description
This function removes all connections from and to the OBJECT to_remove.
Parameters:
toplevel(currently not used)
to_removeOBJECT to unconnected from all other objects

Definition at line 193 of file s_conn.c.

Here is the call graph for this function:

OBJECT* s_conn_check_midpoint ( OBJECT o_current,
int  x,
int  y 
)
Function Description
Checks if the point (x,y) is on the OBJECT and between it's endpoints.
Returns:
TRUE if the point is a midpoint of the OBJECT. FALSE if the point is not a midpoinit or if the OBJECT is not a NET a PIN or a BUS or if the OBJECT has neither horizontal nor vertical orientation.

Definition at line 240 of file s_conn.c.

void s_conn_update_glist ( TOPLEVEL toplevel,
GList *  obj_list 
)
Function Description
This function adds all connections from and to the OBJECTS of the given GList.
Parameters:
toplevel(currently not used)
obj_listGList of OBJECTs to add into the connection system

Definition at line 294 of file s_conn.c.

Here is the call graph for this function:

static int is_bus_related ( OBJECT object) [static]
Function Description
Checks if an object is a bus or a bus pin
Parameters:
objectThe OBJECT to test
Returns:
TRUE if the objects is a bis, or bus pin

Definition at line 314 of file s_conn.c.

static int check_direct_compat ( OBJECT object1,
OBJECT object2 
) [static]
Function Description
Checks if two objects are legal to be connected together
Parameters:
object1First OBJECT
object2Second OBJECT
Returns:
TRUE if the objects are compatible, FALSE if not

Definition at line 330 of file s_conn.c.

Here is the call graph for this function:

static void add_connection ( TOPLEVEL toplevel,
OBJECT object,
OBJECT other_object,
int  type,
int  x,
int  y,
int  whichone,
int  other_whichone 
) [static]

Definition at line 336 of file s_conn.c.

Here is the call graph for this function:

static void s_conn_update_line_object ( TOPLEVEL toplevel,
OBJECT object 
) [static]
Function Description
This function searches for all geometrical conections of the OBJECT object to all other connectable objects. It adds connections to the object and from all other objects to this one.
Parameters:
toplevel(currently not used)
objectOBJECT to add into the connection system

Definition at line 363 of file s_conn.c.

Here is the call graph for this function:

void s_conn_update_object ( TOPLEVEL toplevel,
OBJECT object 
)
Function Description
This function searches for all geometrical conections of the OBJECT object to all other connectable objects. It adds connections to the object and from all other objects to this one.
Parameters:
toplevel(currently not used)
objectOBJECT to add into the connection system

Definition at line 505 of file s_conn.c.

Here is the call graph for this function:

void s_conn_print ( GList *  conn_list)
Function Description
This is a debugging function to print a List of connections.
Parameters:
conn_listGList of connection objects

Definition at line 526 of file s_conn.c.

int s_conn_net_search ( OBJECT new_net,
int  whichone,
GList *  conn_list 
)
Function Description
This method searches the connection list for the first matching connection with the given x, y, and whichone endpoint.
Parameters:
[in]new_netNet OBJECT to compare to.
[in]whichoneThe connection number to check.
[in]conn_listList of existing connections to compare new_net to.
Returns:
TRUE if a matching connection is found, FALSE otherwise.

Definition at line 560 of file s_conn.c.

static GList* s_conn_return_glist_others ( GList *  input_list,
GList *  obj_list 
) [static]
Function Description
This function gets all other_object from the connection list of the OBJECTs in the pased list.
Parameters:
[in]input_listGList of OBJECT's or NULL
[in]obj_listThe GList of OBJECT to get connections from
Returns:
A GList of objects
Warning:
Caller must g_list_free returned GList pointer. Do not free individual data items in list.

Definition at line 596 of file s_conn.c.

Here is the call graph for this function:

GList* s_conn_return_others ( GList *  input_list,
OBJECT object 
)
Function Description
This function gets all other_object from the connection list of the current object. COMPLEX objects are entered, and their prim_objs processed. If an input_list is given, the other objects are appended to that list.
Parameters:
[in]input_listGList of OBJECT's
[in]objectOBJECT to get other OBJECTs from
Returns:
A GList of OBJECTs
Warning:
Caller must g_list_free returned GList pointer. Do not free individual data items in list.

Definition at line 627 of file s_conn.c.

Here is the call graph for this function:

void s_conn_append_conns_changed_hook ( TOPLEVEL toplevel,
ConnsChangedFunc  func,
void *  data 
)

Definition at line 665 of file s_conn.c.

static void call_conns_changed_hook ( gpointer  data,
gpointer  user_data 
) [static]

Definition at line 680 of file s_conn.c.

void s_conn_emit_conns_changed ( TOPLEVEL toplevel,
OBJECT object 
)

Definition at line 689 of file s_conn.c.

Here is the call graph for this function:

void s_conn_freeze_hooks ( TOPLEVEL toplevel,
OBJECT object 
)

Definition at line 702 of file s_conn.c.

void s_conn_thaw_hooks ( TOPLEVEL toplevel,
OBJECT object 
)

Definition at line 707 of file s_conn.c.

Here is the call graph for this function:

static void refresh_connectivity_cache ( TOPLEVEL toplevel,
OBJECT object 
) [static]

Definition at line 718 of file s_conn.c.

Here is the call graph for this function:

static void s_conn_init_toplevel ( TOPLEVEL toplevel) [static]

Definition at line 728 of file s_conn.c.

Here is the call graph for this function:

void s_conn_init ( void  )

Definition at line 742 of file s_conn.c.

Here is the call graph for this function:

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines