Beispiel #1
0
/*! \brief Add an attribute to an OBJECT
 *
 * This fcn adds a new attrib to o_current, when o_current is a
 * component.  It does it in the following 
 * way:
 * -# It creates an object -- "attrib_graphic" -- and fills it in.
 * -# It gets the position info from o_current's refdes attrib and
 *    calls o_text_new() to add position info and name=value string
 *    to attrib_graphic.
 * -# It calls o_attrib_add() to wrap attrib_graphic with (attribute OBJECT )
 * \param toplevel TOPLEVEL structure
 * \param o_current pointer to object to add attribute to
 * \param new_attrib_name name of the attribute to add
 * \param new_attrib_value value of the attribute to add
 * \param visibility Is the attribute visible?
 * \param show_name_value Control visibility of name and value.
 */
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)
{
  char *name_value_pair;
  OBJECT *attrib_graphic_object;


  /* One last sanity check, then add attrib */
  if (strlen(new_attrib_value) != 0) {
    name_value_pair = g_strconcat(new_attrib_name, "=", new_attrib_value, NULL);
    attrib_graphic_object =
      s_object_attrib_add_attrib_in_object (toplevel,
                                            name_value_pair,
                                            visibility,
                                            show_name_value,
                                            o_current);
  }
  
  return;

}
Beispiel #2
0
/*! \brief Add a new attribute to an pin OBJECT
 *
 * Add a new attribute to o_current, when o_current is a
 * pin.  It does it in the following 
 * way:
 * -# It creates an object -- "attrib_graphic" -- and fills it in.
 * -# It gets the position info from o_current's refdes attrib and
 *    calls o_text_new() to add position info and name=value string
 *    to attrib_graphic.
 * -# It calls o_attrib_add() to wrap attrib_graphic with (attribute OBJECT )
 * \param toplevel TOPLEVEL structure
 * \param o_current Pointer to pin object
 * \param new_attrib_name Name of attribute to add
 * \param new_attrib_value Value of attribute to add
 * \todo Do I really need separate fcns for comps, nets, and
 * pins???
 */
void
s_object_add_pin_attrib_to_object (TOPLEVEL *toplevel,
                                   OBJECT *o_current,
                                   char *new_attrib_name,
                                   char *new_attrib_value)
{
  char *name_value_pair;

  /* One last sanity check */
  if (strlen(new_attrib_value) != 0) {
    name_value_pair = g_strconcat(new_attrib_name, "=", new_attrib_value, NULL);
    s_object_attrib_add_attrib_in_object (toplevel,
                                          name_value_pair,
                                          INVISIBLE,
                                          SHOW_NAME_VALUE,
                                          o_current);
  }

  return;
}