[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

gEDA-cvs: CVS update: g_smob.c



  User: cnieves 
  Date: 06/12/05 17:47:24

  Modified:    .        g_smob.c
  Log:
  * include/prototype.h, src/g_smob.c:
  
    Added new scheme function get-attrib-angle. It returns the angle
  
    of the given attribute.
  
    Also made a minor fix to the documentation of g_get_attrib_bounds.
  
  
  
  
  Revision  Changes    Path
  1.10      +29 -1     eda/geda/gaf/libgeda/src/g_smob.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: g_smob.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/libgeda/src/g_smob.c,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -b -r1.9 -r1.10
  --- g_smob.c	1 Nov 2006 16:11:27 -0000	1.9
  +++ g_smob.c	5 Dec 2006 22:47:23 -0000	1.10
  @@ -220,6 +220,7 @@
   		     g_get_attrib_name_value);
   
     scm_c_define_gsubr ("get-attribute-bounds", 1, 0, 0, g_get_attrib_bounds);
  +  scm_c_define_gsubr ("get-attribute-angle", 1, 0, 0, g_get_attrib_angle);
     
   
     return;
  @@ -231,7 +232,7 @@
    *  I got top and bottom values reversed from world_get_complex_bounds,
    *  so don\'t rely on the position in the list. 
    *  \param[in] attrib_smob the attribute.
  - *  \return a list of the bounds of the <B>object smob</B>. 
  + *  \return a list of the bounds of the <B>attrib smob</B>. 
    *  The list has the format: ( (left right) (top bottom) )
    */
   SCM g_get_attrib_bounds(SCM attrib_smob)
  @@ -266,6 +267,33 @@
     return returned;
   }
   
  +/*! \brief Get the angle of an attribute.
  + *  \par Function Description
  + *  Get the angle of an attribute.
  + *  \param[in] attrib_smob the attribute.
  + *  \return the angle of the <B>attrib smob</B>. 
  + */
  +SCM g_get_attrib_angle(SCM attrib_smob)
  +{
  +  TOPLEVEL *w_current;
  +  struct st_attrib_smob *attribute;
  +
  +  SCM_ASSERT ( SCM_NIMP(attrib_smob) && 
  +               ((long) SCM_CAR(attrib_smob) == attrib_smob_tag),
  +               attrib_smob, SCM_ARG1, "get-attribute-angle");
  +  
  +  attribute = (struct st_attrib_smob *)SCM_CDR(attrib_smob);
  +  w_current = attribute->world;
  +
  +  SCM_ASSERT ( attribute && 
  +               attribute->attribute &&
  +	       attribute->attribute->object &&
  +	       attribute->attribute->object->text,
  +               attrib_smob, SCM_ARG1, "get-attribute-angle");
  +
  +  return SCM_MAKINUM(attribute->attribute->object->text->angle);
  +}
  +
   /*! \brief Free object smob memory.
    *  \par Function Description
    *  Free the memory allocated by the object smob and return its size.
  
  
  


_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs