gattrib
|
Functions for manipulating OBJECTs. More...
#include <config.h>
#include <stdio.h>
#include <math.h>
#include <libgeda/libgeda.h>
#include "../include/struct.h"
#include "../include/prototype.h"
#include "../include/globals.h"
Go to the source code of this file.
Defines | |
#define | DEFAULT_TEXT_SIZE 10 |
Functions | |
void | s_object_add_comp_attrib_to_object (TOPLEVEL *toplevel, OBJECT *o_current, char *new_attrib_name, char *new_attrib_value, gint visibility, gint show_name_value) |
Add an attribute to an OBJECT. | |
void | s_object_add_net_attrib_to_object (TOPLEVEL *toplevel, OBJECT *o_current, char *new_attrib_name, char *new_attrib_value) |
void | s_object_add_pin_attrib_to_object (TOPLEVEL *toplevel, OBJECT *o_current, char *new_attrib_name, char *new_attrib_value) |
Add a new attribute to an pin OBJECT. | |
void | s_object_replace_attrib_in_object (TOPLEVEL *toplevel, OBJECT *o_current, char *new_attrib_name, char *new_attrib_value, gint visibility, gint show_name_value) |
Replace attribute value in object. | |
void | s_object_remove_attrib_in_object (TOPLEVEL *toplevel, OBJECT *o_current, char *new_attrib_name) |
Remove attribute from object. | |
OBJECT * | s_object_attrib_add_attrib_in_object (TOPLEVEL *toplevel, char *text_string, int visibility, int show_name_value, OBJECT *object) |
Attach attribute to object. | |
void | s_object_delete_text_object_in_object (TOPLEVEL *toplevel, OBJECT *text_object) |
Delete text object. | |
int | s_object_has_sym_file (OBJECT *object) |
Ensure object has a symbol file. |
This file holds functions involved in manipulating the OBJECT data structure. OBJECT is defined in libgeda. An OBJECT is a graphical primitive normally used in gschem. Example OBJECTs: some text, a component (complex), a pin, a line, etc.
The functions herein are functions which I wrote as wrappers to the fcns in libgeda.
Definition in file s_object.c.
#define DEFAULT_TEXT_SIZE 10 |
Definition at line 57 of file s_object.c.
void s_object_add_comp_attrib_to_object | ( | TOPLEVEL * | toplevel, |
OBJECT * | o_current, | ||
char * | new_attrib_name, | ||
char * | new_attrib_value, | ||
gint | visibility, | ||
gint | show_name_value | ||
) |
This fcn adds a new attrib to o_current, when o_current is a component. It does it in the following way:
toplevel | TOPLEVEL structure |
o_current | pointer to object to add attribute to |
new_attrib_name | name of the attribute to add |
new_attrib_value | value of the attribute to add |
visibility | Is the attribute visible? |
show_name_value | Control visibility of name and value. |
Definition at line 81 of file s_object.c.
void s_object_add_net_attrib_to_object | ( | TOPLEVEL * | toplevel, |
OBJECT * | o_current, | ||
char * | new_attrib_name, | ||
char * | new_attrib_value | ||
) |
Definition at line 111 of file s_object.c.
void s_object_add_pin_attrib_to_object | ( | TOPLEVEL * | toplevel, |
OBJECT * | o_current, | ||
char * | new_attrib_name, | ||
char * | new_attrib_value | ||
) |
Add a new attribute to o_current, when o_current is a pin. It does it in the following way:
toplevel | TOPLEVEL structure |
o_current | Pointer to pin object |
new_attrib_name | Name of attribute to add new_attrib_value Value of attribute to add |
Definition at line 139 of file s_object.c.
void s_object_replace_attrib_in_object | ( | TOPLEVEL * | toplevel, |
OBJECT * | o_current, | ||
char * | new_attrib_name, | ||
char * | new_attrib_value, | ||
gint | visibility, | ||
gint | show_name_value | ||
) |
Find the instance of attrib_name on o_current, and replace its value with the new_attrib_value.
toplevel | TOPLEVEL object |
o_current | object to operate on |
new_attrib_name | name of attribute to replace |
new_attrib_value | value to set attribute to |
visibility | set visibility of attribute |
show_name_value | set visibility of attribute name and value |
Definition at line 172 of file s_object.c.
void s_object_remove_attrib_in_object | ( | TOPLEVEL * | toplevel, |
OBJECT * | o_current, | ||
char * | new_attrib_name | ||
) |
Remove an attribute from an object.
toplevel | TOPLEVEL structure |
o_current | Object to remove attribute from |
new_attrib_name | Name of attribute to remove |
Definition at line 237 of file s_object.c.
OBJECT* s_object_attrib_add_attrib_in_object | ( | TOPLEVEL * | toplevel, |
char * | text_string, | ||
int | visibility, | ||
int | show_name_value, | ||
OBJECT * | object | ||
) |
Attach the name=value pair to the OBJECT "object". This function was stolen from gschem/src/o_attrib.c:o_attrib_add_attrib and hacked for gattrib.
toplevel | TOPLEVEL to operate on |
text_string | |
visibility | |
show_name_value | |
object |
Definition at line 302 of file s_object.c.
void s_object_delete_text_object_in_object | ( | TOPLEVEL * | toplevel, |
OBJECT * | text_object | ||
) |
Delete the text object pointed to by text_object. This function was shamelessly stolen from gschem/src/o_delete.c and hacked for gattrib by SDB.
toplevel | TOPLEVEL to be operated on |
test_object | text object to be deleted |
Definition at line 397 of file s_object.c.
int s_object_has_sym_file | ( | OBJECT * | object | ) |
This verifies that the object has a non-null symbol file.
Definition at line 413 of file s_object.c.