[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
gEDA-cvs: gaf.git: branch: master updated (1.5.0-20080706-244-gdbd7015)
The branch, master has been updated
via dbd70154fa54654121c200946c161839b28c349f (commit)
via 15c0ec6270423dc3be610fff89c6e922e0e6975a (commit)
via e8324b367c8bb23536e72593192b53723d22c3d4 (commit)
via 232b3fc9ddbfaa67bf2552c4cf6dc47a736fec3e (commit)
via 690c85d16d63e5350ce67f4f045cfbc8bb10e8aa (commit)
via 90413c7fe36fe73d9ab93a7ceadc0debe2b840ee (commit)
via 0d1615ffc21c995ddc554a407941230eb1ea6677 (commit)
from 4043c6326d7d56e01cd878a81d1e86c0fcb774b8 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
gschem/include/gschem_struct.h | 2 +
gschem/include/i_vars.h | 1 +
gschem/include/prototype.h | 1 +
gschem/include/x_compselect.h | 4 +-
gschem/lib/system-gschemrc.in | 16 ++++
gschem/src/g_rc.c | 35 +++++++
gschem/src/g_register.c | 1 +
gschem/src/gschem_toplevel.c | 1 +
gschem/src/i_vars.c | 2 +
gschem/src/x_compselect.c | 160 ++++++++++++++++++++++++++++++++-
libgeda/include/colors.h | 4 +
libgeda/include/defines.h | 4 +
libgeda/include/globals.h | 4 +
libgeda/src/a_basic.c | 7 +-
libgeda/src/f_basic.c | 5 +
libgeda/src/f_print.c | 5 +
libgeda/src/o_bus_basic.c | 157 ++++++++++++++++++++++++---------
libgeda/src/o_net_basic.c | 194 +++++++++++++++++++++++++++-------------
libgeda/src/o_pin_basic.c | 136 ++++++++++++++++++++++------
libgeda/src/s_tile.c | 9 ++-
20 files changed, 602 insertions(+), 146 deletions(-)
=================
Commit Messages
=================
commit dbd70154fa54654121c200946c161839b28c349f
Author: Werner Hoch <werner.ho@xxxxxx>
Date: Sat Oct 25 22:10:57 2008 +0200
doxygen: documentation for libgeda o_bus_basic.c ...
and some file headers.
:100644 100644 49223b3... da7e1eb... M libgeda/include/colors.h
:100644 100644 9572f2c... 4a697b8... M libgeda/include/defines.h
:100644 100644 a84510d... 401f97e... M libgeda/include/globals.h
:100644 100644 f53d9fb... 043ebdf... M libgeda/src/f_basic.c
:100644 100644 61e6924... 8c6e0b2... M libgeda/src/f_print.c
:100644 100644 1152564... d0796f8... M libgeda/src/o_bus_basic.c
commit 15c0ec6270423dc3be610fff89c6e922e0e6975a
Author: Werner Hoch <werner.ho@xxxxxx>
Date: Sat Oct 25 21:11:56 2008 +0200
libgeda: removed duplicate file format definition
VERSION_20020825 was defined in o_basic, but it's allready defined in
defines.h.
:100644 100644 cbc5be5... 00b6c2a... M libgeda/src/a_basic.c
commit e8324b367c8bb23536e72593192b53723d22c3d4
Author: Werner Hoch <werner.ho@xxxxxx>
Date: Sat Oct 25 10:51:29 2008 +0200
doxygen: documentation for libgeda o_pin_basic.c
:100644 100644 e44a292... a7916e6... M libgeda/src/o_net_basic.c
:100644 100644 7b27991... 6d24e11... M libgeda/src/o_pin_basic.c
commit 232b3fc9ddbfaa67bf2552c4cf6dc47a736fec3e
Author: Werner Hoch <werner.ho@xxxxxx>
Date: Thu Oct 23 21:48:33 2008 +0200
doxygen: documentation for libgeda o_net.c
added function documentations to o_net.c
small documentation fixes in s_tile.c
:100644 100644 880fcb4... e44a292... M libgeda/src/o_net_basic.c
:100644 100644 0a6c2e3... 0e88fd6... M libgeda/src/s_tile.c
commit 690c85d16d63e5350ce67f4f045cfbc8bb10e8aa
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date: Sat Oct 11 11:11:30 2008 +0200
gschem: save configuration of component dialog
Save the position of the vpaned widget in the dialog configuration
file.
(added static function definition suggested by Peter)
:100644 100644 0ef5c22... e99c049... M gschem/include/x_compselect.h
:100644 100644 8c26fae... 87cc457... M gschem/src/x_compselect.c
commit 90413c7fe36fe73d9ab93a7ceadc0debe2b840ee
Author: Werner Hoch <werner.ho@xxxxxx>
Date: Fri Oct 10 10:41:26 2008 +0200
gschem: show attributes in the component select dialog [#1444029]
gui code to show the attributes in the component select dialog. The
attributes are taken from the TOPLEVEL structure of the preview
widget.
The attribute treeview is only created if the GList of the attributs
is not empty and the attributes are only updated if the treeview is
present.
Added an option that will print all attributes in alphabetical
order. To do that the first element of the option has to be and "*":
(component-dialog-attributes '(*))
:100644 100644 3f39be2... 0ef5c22... M gschem/include/x_compselect.h
:100644 100644 26dbd92... 96cdbfc... M gschem/lib/system-gschemrc.in
:100644 100644 1730f52... 8c26fae... M gschem/src/x_compselect.c
commit 0d1615ffc21c995ddc554a407941230eb1ea6677
Author: Werner Hoch <werner.ho@xxxxxx>
Date: Wed Oct 8 20:10:41 2008 +0200
gschem: configs for the attributes in the select dialog [#1444029]
configuration code to get the attribute list for the component select
dialog into gschem toplevel structure.
:100644 100644 ec42020... 55d620f... M gschem/include/gschem_struct.h
:100644 100644 b9087a9... d6e1f30... M gschem/include/i_vars.h
:100644 100644 f738faa... f908976... M gschem/include/prototype.h
:100644 100644 5cacce1... 26dbd92... M gschem/lib/system-gschemrc.in
:100644 100644 0a3c6a7... e204abf... M gschem/src/g_rc.c
:100644 100644 6a97f3c... 0cab242... M gschem/src/g_register.c
:100644 100644 13c7c08... 30540e6... M gschem/src/gschem_toplevel.c
:100644 100644 a6b7084... 704958a... M gschem/src/i_vars.c
=========
Changes
=========
commit dbd70154fa54654121c200946c161839b28c349f
Author: Werner Hoch <werner.ho@xxxxxx>
Date: Sat Oct 25 22:10:57 2008 +0200
doxygen: documentation for libgeda o_bus_basic.c ...
and some file headers.
diff --git a/libgeda/include/colors.h b/libgeda/include/colors.h
index 49223b3..da7e1eb 100644
--- a/libgeda/include/colors.h
+++ b/libgeda/include/colors.h
@@ -17,6 +17,10 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+/*! \file colors.h
+ * \brief define some constants for the colors
+ */
+
#ifndef _COLORS_H_INCL
#define _COLORS_H_INCL
diff --git a/libgeda/include/defines.h b/libgeda/include/defines.h
index 9572f2c..4a697b8 100644
--- a/libgeda/include/defines.h
+++ b/libgeda/include/defines.h
@@ -17,6 +17,10 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+/*! \file defines.h
+ * \brief global libgeda definitions
+ */
+
#ifndef _DEFINES_H_INCL
#define _DEFINES_H_INCL
diff --git a/libgeda/include/globals.h b/libgeda/include/globals.h
index a84510d..401f97e 100644
--- a/libgeda/include/globals.h
+++ b/libgeda/include/globals.h
@@ -17,6 +17,10 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+/*! \file globals.h
+ * \brief global libgeda variables
+ */
+
#ifndef _GLOBALS_H_INCL
#define _GLOBALS_H_INCL
diff --git a/libgeda/src/f_basic.c b/libgeda/src/f_basic.c
index f53d9fb..043ebdf 100644
--- a/libgeda/src/f_basic.c
+++ b/libgeda/src/f_basic.c
@@ -17,6 +17,11 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA
*/
+
+/*! \file f_basic.c
+ * \brief file related functions
+ */
+
#include <config.h>
#include <stdio.h>
diff --git a/libgeda/src/f_print.c b/libgeda/src/f_print.c
index 61e6924..8c6e0b2 100644
--- a/libgeda/src/f_print.c
+++ b/libgeda/src/f_print.c
@@ -17,6 +17,11 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA
*/
+
+/*! \file f_print.c
+ * \brief functions to write postscript files
+ */
+
#include <config.h>
#include <stdio.h>
diff --git a/libgeda/src/o_bus_basic.c b/libgeda/src/o_bus_basic.c
index 1152564..d0796f8 100644
--- a/libgeda/src/o_bus_basic.c
+++ b/libgeda/src/o_bus_basic.c
@@ -1,7 +1,3 @@
-/*! \todo No comments found in o_bus_basic.nw
- * Finish file comments.
- */
-
/* gEDA - GPL Electronic Design Automation
* libgeda - gEDA's library
* Copyright (C) 1998-2007 Ales Hvezda
@@ -21,6 +17,11 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA
*/
+
+/*! \file o_bus_basic.c
+ * \brief functions for the bus object
+ */
+
#include <config.h>
#include <stdio.h>
#include <math.h>
@@ -34,9 +35,16 @@
/*! Default setting for bus draw function. */
void (*bus_draw_func)() = NULL;
-/* \brief
- * \par Function Description
+/*! \brief calculate and return the boundaries of a bus object
+ * \par Function Description
+ * This function calculates the object boudaries of a bus \a object.
*
+ * \param [in] toplevel The TOPLEVEL object.
+ * \param [in] object a bus object
+ * \param [out] left the left world coord
+ * \param [out] top the top world coord
+ * \param [out] right the right world coord
+ * \param [out] bottom the bottom world coord
*/
void world_get_bus_bounds(TOPLEVEL *toplevel, OBJECT *object, int *left, int *top,
int *right, int *bottom)
@@ -44,9 +52,19 @@ void world_get_bus_bounds(TOPLEVEL *toplevel, OBJECT *object, int *left, int *to
world_get_line_bounds( toplevel, object, left, top, right, bottom );
}
-/* \brief
- * \par Function Description
- *
+/*! \brief create a new bus object
+ * \par Function Description
+ * This function creates and returns a new bus object.
+ *
+ * \param [in] toplevel The TOPLEVEL object.
+ * \param [in] type The OBJECT type (usually OBJ_BUS)
+ * \param [in] color The color of the bus
+ * \param [in] x1 x-coord of the first point
+ * \param [in] y1 y-coord of the first point
+ * \param [in] x2 x-coord of the second point
+ * \param [in] y2 y-coord of the second point
+ * \param [in] bus_ripper_direction direction of the bus rippers
+ * \return A new bus OBJECT
*/
OBJECT *o_bus_new(TOPLEVEL *toplevel,
char type, int color,
@@ -83,9 +101,12 @@ OBJECT *o_bus_new(TOPLEVEL *toplevel,
return new_node;
}
-/* \brief
- * \par Function Description
- *
+/*! \brief recalc the visual properties of a bus object
+ * \par Function Description
+ * This function updates the visual coords of the \a o_current object.
+ *
+ * \param [in] toplevel The TOPLEVEL object.
+ * \param [in] o_current a bus object.
*/
void o_bus_recalc(TOPLEVEL *toplevel, OBJECT *o_current)
{
@@ -108,9 +129,18 @@ void o_bus_recalc(TOPLEVEL *toplevel, OBJECT *o_current)
o_current->w_bounds_valid = TRUE;
}
-/* \brief
- * \par Function Description
- *
+/*! \brief read a bus object from a char buffer
+ * \par Function Description
+ * This function reads a bus object from the buffer \a buf.
+ * If the bus object was read successfully, a new bus object is
+ * allocated and appended to the \a object_list.
+ *
+ * \param [in] toplevel The TOPLEVEL object
+ * \param [in] object_list list of OBJECTS to append a new bus
+ * \param [in] buf a text buffer (usually a line of a schematic file)
+ * \param [in] release_ver The release number gEDA
+ * \param [in] fileformat_ver a integer value of the file format
+ * \return The object list
*/
OBJECT *o_bus_read(TOPLEVEL *toplevel, OBJECT *object_list, char buf[],
unsigned int release_ver, unsigned int fileformat_ver)
@@ -166,9 +196,13 @@ OBJECT *o_bus_read(TOPLEVEL *toplevel, OBJECT *object_list, char buf[],
return(object_list);
}
-/* \brief
- * \par Function Description
+/*! \brief Create a string representation of the bus object
+ * \par Function Description
+ * This function takes a bus \a object and return a string
+ * according to the file format definition.
*
+ * \param [in] object a bus OBJECT
+ * \return the string representation of the bus OBJECT
*/
char *o_bus_save(OBJECT *object)
{
@@ -193,9 +227,14 @@ char *o_bus_save(OBJECT *object)
return(buf);
}
-/* \brief
- * \par Function Description
+/*! \brief move a bus object
+ * \par Function Description
+ * This function changes the position of a bus \a object.
*
+ * \param [in] toplevel The TOPLEVEL object
+ * \param [in] dx The x-distance to move the object
+ * \param [in] dy The y-distance to move the object
+ * \param [in] object The bus OBJECT to be moved
*/
void o_bus_translate_world(TOPLEVEL *toplevel, int dx, int dy, OBJECT *object)
{
@@ -214,9 +253,13 @@ void o_bus_translate_world(TOPLEVEL *toplevel, int dx, int dy, OBJECT *object)
s_tile_update_object(toplevel, object);
}
-/* \brief
- * \par Function Description
+/*! \brief create a copy of a bus object
+ * \par Function Description
+ * This function creates a copy of the bus object \a o_current.
*
+ * \param [in] toplevel The TOPLEVEL object
+ * \param [in] o_current The object that is copied
+ * \return a new bus object
*/
OBJECT *o_bus_copy(TOPLEVEL *toplevel, OBJECT *o_current)
{
@@ -246,11 +289,17 @@ OBJECT *o_bus_copy(TOPLEVEL *toplevel, OBJECT *o_current)
return new_obj;
}
-/* \brief
- * \par Function Description
- *
+/*! \brief postscript print command for a bus object
+ * \par Function Description
+ * This function writes the postscript command of the bus object \a o_current
+ * into the FILE \a fp points to.
+ *
+ * \param [in] toplevel The TOPLEVEL object
+ * \param [in] fp pointer to a FILE structure
+ * \param [in] o_current The OBJECT to print
+ * \param [in] origin_x x-coord of the postscript origin
+ * \param [in] origin_y y-coord of the postscript origin
*/
-/* need to make this bus specific */
void o_bus_print(TOPLEVEL *toplevel, FILE *fp, OBJECT *o_current,
int origin_x, int origin_y)
{
@@ -289,9 +338,17 @@ void o_bus_print(TOPLEVEL *toplevel, FILE *fp, OBJECT *o_current,
}
-/* \brief
- * \par Function Description
- *
+/*! \brief rotate a bus object around a centerpoint
+ * \par Function Description
+ * This function rotates a bus \a object around the point
+ * (\a world_centerx, \a world_centery).
+ *
+ * \param [in] toplevel The TOPLEVEL object
+ * \param [in] world_centerx x-coord of the rotation center
+ * \param [in] world_centery y-coord of the rotation center
+ * \param [in] angle The angle to rotat the bus object
+ * \param [in] object The bus object
+ * \note only steps of 90 degrees are allowed for the \a angle
*/
void o_bus_rotate_world(TOPLEVEL *toplevel,
int world_centerx, int world_centery, int angle,
@@ -320,9 +377,15 @@ void o_bus_rotate_world(TOPLEVEL *toplevel,
o_bus_translate_world(toplevel, world_centerx, world_centery, object);
}
-/* \brief
- * \par Function Description
- *
+/*! \brief mirror a bus object horizontaly at a centerpoint
+ * \par Function Description
+ * This function mirrors a bus \a object horizontaly at the point
+ * (\a world_centerx, \a world_centery).
+ *
+ * \param [in] toplevel The TOPLEVEL object
+ * \param [in] world_centerx x-coord of the mirror position
+ * \param [in] world_centery y-coord of the mirror position
+ * \param [in] object The bus object
*/
void o_bus_mirror_world(TOPLEVEL *toplevel,
int world_centerx, int world_centery, OBJECT *object)
@@ -337,9 +400,12 @@ void o_bus_mirror_world(TOPLEVEL *toplevel,
o_bus_translate_world(toplevel, world_centerx, world_centery, object);
}
-/* \brief
- * \par Function Description
+/*! \brief calculate the orientation of a bus object
+ * \par Function Description
+ * This function calculates the orientation of a bus object.
*
+ * \param [in] object The bus object
+ * \return The orientation: HORIZONTAL, VERTICAL or NEITHER
*/
int o_bus_orientation(OBJECT *object)
{
@@ -357,12 +423,12 @@ int o_bus_orientation(OBJECT *object)
/* \brief
* \par Function Description
+ * This function does the actual work of making one bus segment out of two
+ * connected segments.
+ * The second object (del_object) is the object that should be deleted.
*
+ * \todo This function is currently not used. Check it before using it
*/
-/* this function does the actual work of making one net segment out of two */
-/* connected segments */
-/* The second object (del_object) is the object that should be deleted */
-/* needs to be bus specific */
void o_bus_consolidate_lowlevel(OBJECT *object, OBJECT *del_object,
int orient)
{
@@ -444,8 +510,8 @@ void o_bus_consolidate_lowlevel(OBJECT *object, OBJECT *del_object,
/* \brief
* \par Function Description
*
+ * \todo Not Implemented Yet
*/
-/* needs to be bus specific */
int o_bus_consolidate_segments(TOPLEVEL *toplevel, OBJECT *object)
{
@@ -455,15 +521,24 @@ int o_bus_consolidate_segments(TOPLEVEL *toplevel, OBJECT *object)
/* \brief
* \par Function Description
*
+ * \todo Not Implemented Yet
*/
void o_bus_consolidate(TOPLEVEL *toplevel)
{
}
-/* \brief
- * \par Function Description
- *
+/*! \brief modify one point of a bus object
+ * \par Function Description
+ * This function modifies one point of a bus \a object. The point
+ * is specified by the \a whichone variable and the new coordinate
+ * is (\a x, \a y).
+ *
+ * \param toplevel The TOPLEVEL object
+ * \param object The bus OBJECT to modify
+ * \param x new x-coord of the bus point
+ * \param y new y-coord of the bus point
+ * \param whichone bus point to modify
*/
void o_bus_modify(TOPLEVEL *toplevel, OBJECT *object,
int x, int y, int whichone)
commit 15c0ec6270423dc3be610fff89c6e922e0e6975a
Author: Werner Hoch <werner.ho@xxxxxx>
Date: Sat Oct 25 21:11:56 2008 +0200
libgeda: removed duplicate file format definition
VERSION_20020825 was defined in o_basic, but it's allready defined in
defines.h.
diff --git a/libgeda/src/a_basic.c b/libgeda/src/a_basic.c
index cbc5be5..00b6c2a 100644
--- a/libgeda/src/a_basic.c
+++ b/libgeda/src/a_basic.c
@@ -17,6 +17,10 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA
*/
+
+/*! \file a_basic.c
+ * \brief basic libgeda read and write functions
+ */
#include <config.h>
#include <stdio.h>
@@ -30,9 +34,6 @@
#include <dmalloc.h>
#endif
-/*! \brief Current version string */
-#define VERSION_20020825 20020825
-
/*! \brief Get the file header string.
* \par Function Description
* This function simply returns the DATE_VERSION and
commit e8324b367c8bb23536e72593192b53723d22c3d4
Author: Werner Hoch <werner.ho@xxxxxx>
Date: Sat Oct 25 10:51:29 2008 +0200
doxygen: documentation for libgeda o_pin_basic.c
diff --git a/libgeda/src/o_net_basic.c b/libgeda/src/o_net_basic.c
index e44a292..a7916e6 100644
--- a/libgeda/src/o_net_basic.c
+++ b/libgeda/src/o_net_basic.c
@@ -28,6 +28,10 @@
#include <dmalloc.h>
#endif
+/*! \file o_net_basic.c
+ * \brief functions for the net object
+ */
+
/*! Default setting for net draw function. */
void (*net_draw_func)() = NULL;
diff --git a/libgeda/src/o_pin_basic.c b/libgeda/src/o_pin_basic.c
index 7b27991..6d24e11 100644
--- a/libgeda/src/o_pin_basic.c
+++ b/libgeda/src/o_pin_basic.c
@@ -28,13 +28,23 @@
#include <dmalloc.h>
#endif
+/*! \file o_pin_basic.c
+ * \brief functions for the pin object
+ */
+
/*! Default setting for pin draw function. */
void (*pin_draw_func)() = NULL;
-/*! \todo Finish function documentation!!!
- * \brief
+/*! \brief calculate and return the boundaries of a pin object
* \par Function Description
+ * This function calculates the object boudaries of a pin \a object.
*
+ * \param [in] toplevel The TOPLEVEL object.
+ * \param [in] object a pin object
+ * \param [out] left the left world coord
+ * \param [out] top the top world coord
+ * \param [out] right the right world coord
+ * \param [out] bottom the bottom world coord
*/
void world_get_pin_bounds(TOPLEVEL *toplevel, OBJECT *object, int *left, int *top,
int *right, int *bottom)
@@ -42,10 +52,20 @@ void world_get_pin_bounds(TOPLEVEL *toplevel, OBJECT *object, int *left, int *to
world_get_line_bounds( toplevel, object, left, top, right, bottom );
}
-/*! \todo Finish function documentation!!!
- * \brief
+/*! \brief create a new pin object
* \par Function Description
- *
+ * This function creates and returns a new pin object.
+ *
+ * \param [in] toplevel The TOPLEVEL object.
+ * \param [in] type The OBJECT type (usually OBJ_PIN)
+ * \param [in] color The color of the pin
+ * \param [in] x1 x-coord of the first point
+ * \param [in] y1 y-coord of the first point
+ * \param [in] x2 x-coord of the second point
+ * \param [in] y2 y-coord of the second point
+ * \param [in] pin_type type of pin (PIN_TYPE_NET or PIN_TYPE_BUS)
+ * \param [in] whichend The connectable end of the pin
+ * \return A new pin OBJECT
*/
OBJECT *o_pin_new(TOPLEVEL *toplevel,
char type, int color,
@@ -80,9 +100,12 @@ OBJECT *o_pin_new(TOPLEVEL *toplevel,
return new_node;
}
-/*! \todo Finish function documentation!!!
- * \brief
+/*! \brief recalc the visual properties of a pin object
* \par Function Description
+ * This function updates the visual coords of the \a o_current object.
+ *
+ * \param [in] toplevel The TOPLEVEL object.
+ * \param [in] o_current a pin object.
*
*/
void o_pin_recalc(TOPLEVEL *toplevel, OBJECT *o_current)
@@ -102,10 +125,18 @@ void o_pin_recalc(TOPLEVEL *toplevel, OBJECT *o_current)
o_current->w_bounds_valid = TRUE;
}
-/*! \todo Finish function documentation!!!
- * \brief
+/*! \brief read a pin object from a char buffer
* \par Function Description
- *
+ * This function reads a pin object from the buffer \a buf.
+ * If the pin object was read successfully, a new pin object is
+ * allocated and appended to the \a object_list.
+ *
+ * \param [in] toplevel The TOPLEVEL object
+ * \param [in] object_list list of OBJECTS to append a new pin
+ * \param [in] buf a text buffer (usually a line of a schematic file)
+ * \param [in] release_ver The release number gEDA
+ * \param [in] fileformat_ver a integer value of the file format
+ * \return The object list
*/
OBJECT *o_pin_read(TOPLEVEL *toplevel, OBJECT *object_list, char buf[],
unsigned int release_ver, unsigned int fileformat_ver)
@@ -165,10 +196,13 @@ OBJECT *o_pin_read(TOPLEVEL *toplevel, OBJECT *object_list, char buf[],
return(object_list);
}
-/*! \todo Finish function documentation!!!
- * \brief
+/*! \brief Create a string representation of the pin object
* \par Function Description
+ * This function takes a pin \a object and return a string
+ * according to the file format definition.
*
+ * \param [in] object a pin OBJECT
+ * \return the string representation of the pin OBJECT
*/
char *o_pin_save(OBJECT *object)
{
@@ -197,10 +231,14 @@ char *o_pin_save(OBJECT *object)
return(buf);
}
-/*! \todo Finish function documentation!!!
- * \brief
+/*! \brief move a pin object
* \par Function Description
+ * This function changes the position of a pin \a object.
*
+ * \param [in] toplevel The TOPLEVEL object
+ * \param [in] dx The x-distance to move the object
+ * \param [in] dy The y-distance to move the object
+ * \param [in] object The pin OBJECT to be moved
*/
void o_pin_translate_world(TOPLEVEL *toplevel, int dx, int dy, OBJECT *object)
{
@@ -219,10 +257,13 @@ void o_pin_translate_world(TOPLEVEL *toplevel, int dx, int dy, OBJECT *object)
s_tile_update_object(toplevel, object);
}
-/*! \todo Finish function documentation!!!
- * \brief
+/*! \brief create a copy of a pin object
* \par Function Description
+ * This function creates a copy of the pin object \a o_current.
*
+ * \param [in] toplevel The TOPLEVEL object
+ * \param [in] o_current The object that is copied
+ * \return a new pin object
*/
OBJECT *o_pin_copy(TOPLEVEL *toplevel, OBJECT *o_current)
{
@@ -250,10 +291,16 @@ OBJECT *o_pin_copy(TOPLEVEL *toplevel, OBJECT *o_current)
return new_obj;
}
-/*! \todo Finish function documentation!!!
- * \brief
+/*! \brief postscript print command for a pin object
* \par Function Description
- *
+ * This function writes the postscript command of the pin object \a o_current
+ * into the FILE \a fp points to.
+ *
+ * \param [in] toplevel The TOPLEVEL object
+ * \param [in] fp pointer to a FILE structure
+ * \param [in] o_current The OBJECT to print
+ * \param [in] origin_x x-coord of the postscript origin
+ * \param [in] origin_y y-coord of the postscript origin
*/
void o_pin_print(TOPLEVEL *toplevel, FILE *fp, OBJECT *o_current,
int origin_x, int origin_y)
@@ -284,10 +331,17 @@ void o_pin_print(TOPLEVEL *toplevel, FILE *fp, OBJECT *o_current,
}
-/*! \todo Finish function documentation!!!
- * \brief
+/*! \brief rotate a pin object around a centerpoint
* \par Function Description
- *
+ * This function rotates a pin \a object around the point
+ * (\a world_centerx, \a world_centery).
+ *
+ * \param [in] toplevel The TOPLEVEL object
+ * \param [in] world_centerx x-coord of the rotation center
+ * \param [in] world_centery y-coord of the rotation center
+ * \param [in] angle The angle to rotat the pin object
+ * \param [in] object The pin object
+ * \note only steps of 90 degrees are allowed for the \a angle
*/
void o_pin_rotate_world(TOPLEVEL *toplevel, int world_centerx,
int world_centery, int angle,
@@ -296,7 +350,7 @@ void o_pin_rotate_world(TOPLEVEL *toplevel, int world_centerx,
int newx, newy;
if (angle == 0)
- return;
+ return;
/* translate object to origin */
o_pin_translate_world(toplevel, -world_centerx, -world_centery, object);
@@ -316,10 +370,15 @@ void o_pin_rotate_world(TOPLEVEL *toplevel, int world_centerx,
o_pin_translate_world(toplevel, world_centerx, world_centery, object);
}
-/*! \todo Finish function documentation!!!
- * \brief
+/*! \brief mirror a pin object horizontaly at a centerpoint
* \par Function Description
- *
+ * This function mirrors a pin \a object horizontaly at the point
+ * (\a world_centerx, \a world_centery).
+ *
+ * \param [in] toplevel The TOPLEVEL object
+ * \param [in] world_centerx x-coord of the mirror position
+ * \param [in] world_centery y-coord of the mirror position
+ * \param [in] object The pin object
*/
void o_pin_mirror_world(TOPLEVEL *toplevel,
int world_centerx, int world_centery, OBJECT *object)
@@ -334,9 +393,17 @@ void o_pin_mirror_world(TOPLEVEL *toplevel,
o_pin_translate_world(toplevel, world_centerx, world_centery, object);
}
-/*! \todo Finish function documentation!!!
- * \brief
+/*! \brief modify one point of a pin object
* \par Function Description
+ * This function modifies one point of a pin \a object. The point
+ * is specified by the \a whichone variable and the new coordinate
+ * is (\a x, \a y).
+ *
+ * \param toplevel The TOPLEVEL object
+ * \param object The pin OBJECT to modify
+ * \param x new x-coord of the pin point
+ * \param y new y-coord of the pin point
+ * \param whichone pin point to modify
*
*/
void o_pin_modify(TOPLEVEL *toplevel, OBJECT *object,
@@ -350,9 +417,18 @@ void o_pin_modify(TOPLEVEL *toplevel, OBJECT *object,
s_tile_update_object(toplevel, object);
}
-/*! \todo Finish function documentation!!!
- * \brief
+/*! \brief guess the whichend of pins of object list
* \par Function Description
+ * This function determines the whichend of the pins in the \a object_list.
+ * In older libgeda file format versions there was no information about the
+ * active end of pins.
+ * This function calculates the bounding box of all pins in the object list.
+ * The side of the pins that are closer to the boundary of the box are
+ * set as active ends of the pins.
+ *
+ * \param toplevel The TOPLEVEL object
+ * \param object_list list of OBJECTs
+ * \param num_pins pin count in the object list
*
*/
void o_pin_update_whichend(TOPLEVEL *toplevel,
commit 232b3fc9ddbfaa67bf2552c4cf6dc47a736fec3e
Author: Werner Hoch <werner.ho@xxxxxx>
Date: Thu Oct 23 21:48:33 2008 +0200
doxygen: documentation for libgeda o_net.c
added function documentations to o_net.c
small documentation fixes in s_tile.c
diff --git a/libgeda/src/o_net_basic.c b/libgeda/src/o_net_basic.c
index 880fcb4..e44a292 100644
--- a/libgeda/src/o_net_basic.c
+++ b/libgeda/src/o_net_basic.c
@@ -31,16 +31,16 @@
/*! Default setting for net draw function. */
void (*net_draw_func)() = NULL;
-/*! \todo Finish function documentation!!!
- * \brief
+/*! \brief calculate and return the boundaries of a net object
* \par Function Description
+ * This function calculates the object boudaries of a net \a object.
*
* \param [in] toplevel The TOPLEVEL object.
- * \param [in] line
- * \param [out] left
- * \param [out] top
- * \param [out] right
- * \param [out] bottom
+ * \param [in] object a net object
+ * \param [out] left the left world coord
+ * \param [out] top the top world coord
+ * \param [out] right the right world coord
+ * \param [out] bottom the bottom world coord
*/
void world_get_net_bounds(TOPLEVEL *toplevel, OBJECT *object, int *left,
int *top, int *right, int *bottom)
@@ -48,18 +48,18 @@ void world_get_net_bounds(TOPLEVEL *toplevel, OBJECT *object, int *left,
world_get_line_bounds( toplevel, object, left, top, right, bottom );
}
-/*! \todo Finish function documentation!!!
- * \brief
+/*! \brief create a new net object
* \par Function Description
- *
+ * This function creates and returns a new net object.
+ *
* \param [in] toplevel The TOPLEVEL object.
- * \param [in] type
- * \param [in] color
- * \param [in] x1
- * \param [in] y1
- * \param [in] x2
- * \param [in] y2
- * \return OBJECT *
+ * \param [in] type The OBJECT type (usually OBJ_NET)
+ * \param [in] color The color of the net
+ * \param [in] x1 x-coord of the first point
+ * \param [in] y1 y-coord of the first point
+ * \param [in] x2 x-coord of the second point
+ * \param [in] y2 y-coord of the second point
+ * \return A new net OBJECT
*/
OBJECT *o_net_new(TOPLEVEL *toplevel, char type,
int color, int x1, int y1, int x2, int y2)
@@ -91,10 +91,12 @@ OBJECT *o_net_new(TOPLEVEL *toplevel, char type,
return new_node;
}
-/*! \todo Finish function documentation!!!
- * \brief
+/*! \brief recalc the visual properties of a net object
* \par Function Description
- *
+ * This function updates the visual coords of the \a o_current object.
+ *
+ * \param [in] toplevel The TOPLEVEL object.
+ * \param [in] o_current a net object.
*
*/
void o_net_recalc(TOPLEVEL *toplevel, OBJECT *o_current)
@@ -119,10 +121,18 @@ void o_net_recalc(TOPLEVEL *toplevel, OBJECT *o_current)
o_current->w_bounds_valid = TRUE;
}
-/*! \todo Finish function documentation!!!
- * \brief
+/*! \brief read a net object from a char buffer
* \par Function Description
- *
+ * This function reads a net object from the buffer \a buf.
+ * If the netobject was read successfully, a new net object is
+ * allocated and appended to the \a object_list.
+ *
+ * \param [in] toplevel The TOPLEVEL object
+ * \param [in] object_list list of OBJECTS to append a new net
+ * \param [in] buf a text buffer (usually a line of a schematic file)
+ * \param [in] release_ver The release number gEDA
+ * \param [in] fileformat_ver a integer value of the file format
+ * \return The object list
*
*/
OBJECT *o_net_read(TOPLEVEL *toplevel, OBJECT *object_list, char buf[],
@@ -165,11 +175,13 @@ OBJECT *o_net_read(TOPLEVEL *toplevel, OBJECT *object_list, char buf[],
return (object_list);
}
-/*! \todo Finish function documentation!!!
- * \brief
+/*! \brief Create a string representation of the net object
* \par Function Description
+ * This function takes a net \a object and return a string
+ * according to the file format definition.
*
- *
+ * \param [in] object a net OBJECT
+ * \return the string representation of the net OBJECT
*/
char *o_net_save(OBJECT *object)
{
@@ -193,18 +205,21 @@ char *o_net_save(OBJECT *object)
return (buf);
}
-/*! \todo Finish function documentation!!!
- * \brief
+/*! \brief move a net object
* \par Function Description
+ * This function changes the position of a net \a object.
*
+ * \param [in] toplevel The TOPLEVEL object
+ * \param [in] dx The x-distance to move the object
+ * \param [in] dy The y-distance to move the object
+ * \param [in] object The net OBJECT to be moved
*
*/
void o_net_translate_world(TOPLEVEL *toplevel, int dx, int dy,
OBJECT *object)
{
if (object == NULL)
- printf("ntw NO!\n");
-
+ printf("ntw NO!\n");
/* Update world coords */
object->line->x[0] = object->line->x[0] + dx;
@@ -218,11 +233,13 @@ void o_net_translate_world(TOPLEVEL *toplevel, int dx, int dy,
s_tile_update_object(toplevel, object);
}
-/*! \todo Finish function documentation!!!
- * \brief
+/*! \brief create a copy of a net object
* \par Function Description
+ * This function creates a copy of the net object \a o_current.
*
- *
+ * \param [in] toplevel The TOPLEVEL object
+ * \param [in] o_current The object that is copied
+ * \return a new net object
*/
OBJECT *o_net_copy(TOPLEVEL *toplevel, OBJECT *o_current)
{
@@ -251,11 +268,16 @@ OBJECT *o_net_copy(TOPLEVEL *toplevel, OBJECT *o_current)
return new_obj;
}
-/*! \todo Finish function documentation!!!
- * \brief
+/*! \brief postscript print command for a net object
* \par Function Description
- *
- *
+ * This function writes the postscript command of the net object \a o_current
+ * into the FILE \a fp points to.
+ *
+ * \param [in] toplevel The TOPLEVEL object
+ * \param [in] fp pointer to a FILE structure
+ * \param [in] o_current The OBJECT to print
+ * \param [in] origin_x x-coord of the postscript origin
+ * \param [in] origin_y y-coord of the postscript origin
*/
void o_net_print(TOPLEVEL *toplevel, FILE *fp, OBJECT *o_current,
int origin_x, int origin_y)
@@ -293,11 +315,17 @@ void o_net_print(TOPLEVEL *toplevel, FILE *fp, OBJECT *o_current,
}
-/*! \todo Finish function documentation!!!
- * \brief
+/*! \brief rotate a net object around a centerpoint
* \par Function Description
- *
- *
+ * This function rotates a net \a object around the point
+ * (\a world_centerx, \a world_centery).
+ *
+ * \param [in] toplevel The TOPLEVEL object
+ * \param [in] world_centerx x-coord of the rotation center
+ * \param [in] world_centery y-coord of the rotation center
+ * \param [in] angle The angle to rotat the net object
+ * \param [in] object The net object
+ * \note only steps of 90 degrees are allowed for the \a angle
*/
void o_net_rotate_world(TOPLEVEL *toplevel,
int world_centerx, int world_centery, int angle,
@@ -306,7 +334,7 @@ void o_net_rotate_world(TOPLEVEL *toplevel,
int newx, newy;
if (angle == 0)
- return;
+ return;
/* translate object to origin */
o_net_translate_world(toplevel, -world_centerx, -world_centery,
@@ -327,11 +355,15 @@ void o_net_rotate_world(TOPLEVEL *toplevel,
o_net_translate_world(toplevel, world_centerx, world_centery, object);
}
-/*! \todo Finish function documentation!!!
- * \brief
+/*! \brief mirror a net object horizontaly at a centerpoint
* \par Function Description
- *
- *
+ * This function mirrors a net \a object horizontaly at the point
+ * (\a world_centerx, \a world_centery).
+ *
+ * \param [in] toplevel The TOPLEVEL object
+ * \param [in] world_centerx x-coord of the mirror position
+ * \param [in] world_centery y-coord of the mirror position
+ * \param [in] object The net object
*/
void o_net_mirror_world(TOPLEVEL *toplevel, int world_centerx,
int world_centery, OBJECT *object)
@@ -347,6 +379,13 @@ void o_net_mirror_world(TOPLEVEL *toplevel, int world_centerx,
o_net_translate_world(toplevel, world_centerx, world_centery, object);
}
+/*! \brief calculate the orientation of a net object
+ * \par Function Description
+ * This function calculates the orientation of a net object.
+ *
+ * \param [in] object The net object
+ * \return The orientation: HORIZONTAL, VERTICAL or NEITHER
+ */
int o_net_orientation(OBJECT *object)
{
if (object->line->y[0] == object->line->y[1]) {
@@ -361,13 +400,19 @@ int o_net_orientation(OBJECT *object)
}
-/*! \todo Finish function documentation!!!
- * \brief
+/*! \brief merge two net object
* \par Function Description
+ * This function does the actual work of making one net segment out of two
+ * connected segments. The first net segment is extended to the lenght of
+ * both objects.
+ * The second object (\a del_object) is the object that should be deleted.
+ *
+ * \param [in] object A net object to extend
+ * \param [in] del_object A net object to be merged into \a object
+ * \param [in] orient The orientation of both net objects
*
- * this function does the actual work of making one net segment out of two
- * connected segments
- * The second object (del_object) is the object that should be deleted
+ * \note The first net \a object gets the attributes of the second net
+ * \a del_object if the two nets are merged together.
*/
void o_net_consolidate_lowlevel(OBJECT *object, OBJECT *del_object,
int orient)
@@ -442,12 +487,16 @@ void o_net_consolidate_lowlevel(OBJECT *object, OBJECT *del_object,
}
}
-/*! \todo Finish function documentation!!!
- * \brief
+/*! \brief Check if there's a midpoint connection at (x,y)
* \par Function Description
- *
- * check to see if this connection also causes a midpoint
- * if so, return false, else return true
+ * This function checks if the \a object is connected to another net
+ * between it's endpoints. Net segment's only can be merged if there
+ * is no midpoint connection.
+ *
+ * \param object a net OBJECT to check
+ * \param x x-coord of the connection location
+ * \param y y-coord of the connection location
+ * \return TRUE if there's no midpoint connection, else return FALSE
*/
int o_net_consolidate_nomidpoint(OBJECT *object, int x, int y)
{
@@ -474,10 +523,14 @@ int o_net_consolidate_nomidpoint(OBJECT *object, int x, int y)
return(TRUE);
}
-/*! \todo Finish function documentation!!!
- * \brief
+/*! \brief try to consolidate a net object
* \par Function Description
- *
+ * This function tries to consolidate a net with any other object
+ * that is connected to the current \a object.
+ *
+ * \param toplevel The TOPLEVEL object
+ * \param object The object to consolidate
+ * \return 0 if no consolidation was possible, -1 otherwise
*
*/
int o_net_consolidate_segments(TOPLEVEL *toplevel, OBJECT *object)
@@ -555,10 +608,12 @@ int o_net_consolidate_segments(TOPLEVEL *toplevel, OBJECT *object)
return(0);
}
-/*! \todo Finish function documentation!!!
- * \brief
+/*! \brief consolidate all net objects
* \par Function Description
+ * This function consolidates all net objects until no more consolidations
+ * are posible.
*
+ * \param toplevel The TOPLEVEL object
*
*/
void o_net_consolidate(TOPLEVEL *toplevel)
@@ -583,10 +638,17 @@ void o_net_consolidate(TOPLEVEL *toplevel)
}
}
-/*! \todo Finish function documentation!!!
- * \brief
+/*! \brief modify one point of a net object
* \par Function Description
- *
+ * This function modifies one point of a net \a object. The point
+ * is specified by the \a whichone variable and the new coordinate
+ * is (\a x, \a y).
+ *
+ * \param toplevel The TOPLEVEL object
+ * \param object The net OBJECT to modify
+ * \param x new x-coord of the net point
+ * \param y new y-coord of the net point
+ * \param whichone net point to modify
*
*/
void o_net_modify(TOPLEVEL *toplevel, OBJECT *object,
diff --git a/libgeda/src/s_tile.c b/libgeda/src/s_tile.c
index 0a6c2e3..0e88fd6 100644
--- a/libgeda/src/s_tile.c
+++ b/libgeda/src/s_tile.c
@@ -422,10 +422,13 @@ void s_tile_print(TOPLEVEL * toplevel)
}
-/*! \brief free all tiles
+/*! \brief free all object links from the tiles
* \par Function Description
- * This function frees all tiles from the given page.
- * \param p_current The PAGE where the tiles are removed.
+ * This function removes all objects from the tiles of the given \a page.
+ *
+ * \param [in] p_current The PAGE to clean up the tiles
+ * \note In theory, calling this function is not required. If all objects
+ * have been removed from a page, all object lists of the tiles should be empty.
*/
void s_tile_free_all(PAGE * p_current)
{
commit 690c85d16d63e5350ce67f4f045cfbc8bb10e8aa
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date: Sat Oct 11 11:11:30 2008 +0200
gschem: save configuration of component dialog
Save the position of the vpaned widget in the dialog configuration
file.
(added static function definition suggested by Peter)
diff --git a/gschem/include/x_compselect.h b/gschem/include/x_compselect.h
index 0ef5c22..e99c049 100644
--- a/gschem/include/x_compselect.h
+++ b/gschem/include/x_compselect.h
@@ -61,7 +61,7 @@ struct _CompselectClass {
struct _Compselect {
GschemDialog parent_instance;
- GtkWidget *hpaned;
+ GtkWidget *hpaned, *vpaned;
GtkTreeView *libtreeview, *inusetreeview, *attrtreeview;
GtkNotebook *viewtabs;
Preview *preview;
diff --git a/gschem/src/x_compselect.c b/gschem/src/x_compselect.c
index 8c26fae..87cc457 100644
--- a/gschem/src/x_compselect.c
+++ b/gschem/src/x_compselect.c
@@ -465,7 +465,7 @@ tree_row_activated (GtkTreeView *tree_view,
/*! \brief GCompareFunc to sort an text object list by the object strings
*/
-gint
+static gint
sort_object_text(OBJECT *a, OBJECT *b)
{
return strcmp(a->text->string, b->text->string);
@@ -1229,6 +1229,9 @@ compselect_geometry_save (GschemDialog *dialog, GKeyFile *key_file, gchar *group
position = gtk_paned_get_position (GTK_PANED (COMPSELECT (dialog)->hpaned));
g_key_file_set_integer (key_file, group_name, "hpaned", position );
+ position = gtk_paned_get_position (GTK_PANED (COMPSELECT (dialog)->vpaned));
+ g_key_file_set_integer (key_file, group_name, "vpaned", position );
+
position = gtk_notebook_get_current_page (COMPSELECT (dialog)->viewtabs);
g_key_file_set_integer (key_file, group_name, "source-tab", position );
}
@@ -1257,6 +1260,10 @@ compselect_geometry_restore (GschemDialog *dialog, GKeyFile *key_file, gchar *gr
if (position != 0)
gtk_paned_set_position (GTK_PANED (COMPSELECT (dialog)->hpaned), position);
+ position = g_key_file_get_integer (key_file, group_name, "vpaned", NULL);
+ if (position != 0)
+ gtk_paned_set_position (GTK_PANED (COMPSELECT (dialog)->vpaned), position);
+
position = g_key_file_get_integer (key_file, group_name, "source-tab", NULL);
gtk_notebook_set_current_page (COMPSELECT (dialog)->viewtabs, position);
}
@@ -1341,6 +1348,7 @@ compselect_constructor (GType type,
/* GtkContainer */
"border-width", 5,
NULL));
+ compselect->vpaned = vpaned;
/* horizontal pane containing selection and preview */
hpaned = GTK_WIDGET (g_object_new (GTK_TYPE_HPANED,
commit 90413c7fe36fe73d9ab93a7ceadc0debe2b840ee
Author: Werner Hoch <werner.ho@xxxxxx>
Date: Fri Oct 10 10:41:26 2008 +0200
gschem: show attributes in the component select dialog [#1444029]
gui code to show the attributes in the component select dialog. The
attributes are taken from the TOPLEVEL structure of the preview
widget.
The attribute treeview is only created if the GList of the attributs
is not empty and the attributes are only updated if the treeview is
present.
Added an option that will print all attributes in alphabetical
order. To do that the first element of the option has to be and "*":
(component-dialog-attributes '(*))
diff --git a/gschem/include/x_compselect.h b/gschem/include/x_compselect.h
index 3f39be2..0ef5c22 100644
--- a/gschem/include/x_compselect.h
+++ b/gschem/include/x_compselect.h
@@ -62,7 +62,7 @@ struct _Compselect {
GschemDialog parent_instance;
GtkWidget *hpaned;
- GtkTreeView *libtreeview, *inusetreeview;
+ GtkTreeView *libtreeview, *inusetreeview, *attrtreeview;
GtkNotebook *viewtabs;
Preview *preview;
GtkEntry *entry_filter;
diff --git a/gschem/lib/system-gschemrc.in b/gschem/lib/system-gschemrc.in
index 26dbd92..96cdbfc 100644
--- a/gschem/lib/system-gschemrc.in
+++ b/gschem/lib/system-gschemrc.in
@@ -368,13 +368,16 @@
;
; Sets a list of attributs that are visible in the component select dialog.
; The attributes are sorted in the same order as they appear in the list.
+; If the first list element is an asterisk "*", all attributes will be
+; displayed in alphabetical order.
; An empty list will disable the attribute view in the dialog.
;
-(component-dialog-attributes '("device" "description" "footprint" "comment"
- "net" "model" "model-name" "file" "value"
- "numslots" "slotdef" "slot"
- "documentation" "symversion" "author"
- "use-license=" "dist-license="))
+;(component-dialog-attributes '("device" "description" "footprint" "comment"
+; "net" "model" "model-name" "file" "value"
+; "numslots" "slotdef" "slot"
+; "documentation" "symversion" "author"
+; "use-license=" "dist-license="))
+(component-dialog-attributes '("*"))
;(component-dialog-attributes '())
; logging string
diff --git a/gschem/src/x_compselect.c b/gschem/src/x_compselect.c
index 1730f52..8c26fae 100644
--- a/gschem/src/x_compselect.c
+++ b/gschem/src/x_compselect.c
@@ -463,6 +463,74 @@ tree_row_activated (GtkTreeView *tree_view,
gtk_tree_view_expand_row (tree_view, path, FALSE);
}
+/*! \brief GCompareFunc to sort an text object list by the object strings
+ */
+gint
+sort_object_text(OBJECT *a, OBJECT *b)
+{
+ return strcmp(a->text->string, b->text->string);
+}
+
+/*! \brief Update the model of the attributes treeview
+ * \par Function Description
+ * This function takes the toplevel attributes from the preview widget and
+ * puts them into the model of the <b>attrtreeview</b> widget.
+ * \param [in] compselect The dialog compselect
+ * \param [in] preview_toplevel The toplevel of the preview widget
+ */
+void
+update_attributes_model (Compselect *compselect, TOPLEVEL *preview_toplevel)
+{
+ GtkListStore *model;
+ GtkTreeIter iter;
+ GList *listiter, *o_iter, *o_attrlist, *filter_list;
+ gchar *name, *value;
+ OBJECT *o_current;
+
+ model = (GtkListStore*) gtk_tree_view_get_model(compselect->attrtreeview);
+ gtk_list_store_clear(model);
+
+ if (preview_toplevel->page_current == NULL) {
+ return;
+ }
+
+ o_attrlist = o_complex_get_toplevel_attribs (preview_toplevel,
+ preview_toplevel->page_current->object_head);
+
+ filter_list = GSCHEM_DIALOG (compselect)->w_current->component_select_attrlist;
+
+ if (filter_list != NULL
+ && strcmp(filter_list->data, "*") == 0) {
+ /* display all attributes in alphabetical order */
+ o_attrlist = g_list_sort(o_attrlist, (GCompareFunc) sort_object_text);
+ for (o_iter = o_attrlist; o_iter != NULL; o_iter = g_list_next(o_iter)) {
+ o_current = o_iter->data;
+ o_attrib_get_name_value(o_current->text->string, &name, &value);
+ gtk_list_store_append(model, &iter);
+ gtk_list_store_set(model, &iter, 0, name, 1, value, -1);
+ g_free(name);
+ g_free(value);
+ }
+ } else {
+ /* display only attribute that are in the filter list */
+ for (listiter = filter_list;
+ listiter != NULL;
+ listiter = g_list_next(listiter)) {
+ for (o_iter = o_attrlist; o_iter != NULL; o_iter = g_list_next(o_iter)) {
+ o_current = o_iter->data;
+ if (o_attrib_get_name_value(o_current->text->string, &name, &value)) {
+ if (strcmp(name, listiter->data) == 0) {
+ gtk_list_store_append(model, &iter);
+ gtk_list_store_set(model, &iter, 0, name, 1, value, -1);
+ }
+ g_free(name);
+ g_free(value);
+ }
+ }
+ }
+ }
+ g_list_free(o_attrlist);
+}
/*! \brief Handles changes in the treeview selection.
* \par Function Description
@@ -510,6 +578,11 @@ compselect_callback_tree_selection_changed (GtkTreeSelection *selection,
"active", (buffer != NULL),
NULL);
+ /* update the attributes with the toplevel of the preview widget*/
+ if (compselect->attrtreeview != NULL)
+ update_attributes_model (compselect,
+ compselect->preview->preview_w_current->toplevel);
+
/* signal a component has been selected to parent of dialog */
g_signal_emit_by_name (compselect,
"response",
@@ -1023,6 +1096,62 @@ create_lib_treeview (Compselect *compselect)
return vbox;
}
+/*! \brief Creates the treeview widget for the attributes
+ */
+static GtkWidget*
+create_attributes_treeview (Compselect *compselect)
+{
+ GtkWidget *attrtreeview, *scrolled_win;
+ GtkListStore *model;
+ GtkCellRenderer *renderer;
+ GtkTreeViewColumn *column;
+
+ model = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_STRING);
+
+ attrtreeview = GTK_WIDGET (g_object_new (GTK_TYPE_TREE_VIEW,
+ /* GtkTreeView */
+ "model", model,
+ "headers-visible", TRUE,
+ "rules-hint", TRUE,
+ NULL));
+
+ /* two columns for name and value of the attributes */
+ renderer = GTK_CELL_RENDERER( g_object_new( GTK_TYPE_CELL_RENDERER_TEXT,
+ "editable", FALSE,
+ NULL));
+
+ column = GTK_TREE_VIEW_COLUMN( g_object_new( GTK_TYPE_TREE_VIEW_COLUMN,
+ "title", _("Name"),
+ "resizable", TRUE,
+ NULL));
+ gtk_tree_view_column_pack_start(column, renderer, TRUE);
+ gtk_tree_view_column_add_attribute(column, renderer, "text", 0);
+ gtk_tree_view_append_column (GTK_TREE_VIEW (attrtreeview), column);
+
+ column = GTK_TREE_VIEW_COLUMN( g_object_new( GTK_TYPE_TREE_VIEW_COLUMN,
+ "title", _("Value"),
+ "resizable", TRUE,
+ NULL));
+ gtk_tree_view_column_pack_start(column, renderer, TRUE);
+ gtk_tree_view_column_add_attribute(column, renderer, "text", 1);
+ gtk_tree_view_append_column (GTK_TREE_VIEW (attrtreeview), column);
+
+ scrolled_win = GTK_WIDGET (g_object_new (GTK_TYPE_SCROLLED_WINDOW,
+ /* GtkContainer */
+ "border-width", 5,
+ /* GtkScrolledWindow */
+ "hscrollbar-policy", GTK_POLICY_AUTOMATIC,
+ "vscrollbar-policy", GTK_POLICY_ALWAYS,
+ "shadow-type", GTK_SHADOW_ETCHED_IN,
+ NULL));
+
+ gtk_container_add(GTK_CONTAINER (scrolled_win), attrtreeview);
+
+ compselect->attrtreeview = GTK_TREE_VIEW(attrtreeview);
+
+ return scrolled_win;
+}
+
/*! \brief Create the combo box for behaviors.
* \par Function Description
* This function creates and returns a <B>GtkComboBox</B> for
@@ -1181,7 +1310,7 @@ compselect_constructor (GType type,
GObject *object;
Compselect *compselect;
- GtkWidget *hpaned, *notebook;
+ GtkWidget *hpaned, *vpaned, *notebook, *attributes;
GtkWidget *libview, *inuseview;
GtkWidget *preview, *combobox;
GtkWidget *alignment, *frame;
@@ -1207,6 +1336,12 @@ compselect_constructor (GType type,
"homogeneous", FALSE,
NULL);
+ /* vertical pane containing selection/preview and attributes */
+ vpaned = GTK_WIDGET (g_object_new (GTK_TYPE_VPANED,
+ /* GtkContainer */
+ "border-width", 5,
+ NULL));
+
/* horizontal pane containing selection and preview */
hpaned = GTK_WIDGET (g_object_new (GTK_TYPE_HPANED,
/* GtkContainer */
@@ -1258,10 +1393,21 @@ compselect_constructor (GType type,
gtk_paned_pack2 (GTK_PANED (hpaned), frame, FALSE, FALSE);
+ gtk_paned_pack1 (GTK_PANED (vpaned), hpaned, FALSE, FALSE);
+
+ /* only create the attribute treeview if there are elements in the
+ component_select_attrlist */
+ if (GSCHEM_DIALOG (compselect)->w_current->component_select_attrlist == NULL) {
+ compselect->attrtreeview = NULL;
+ } else {
+ attributes = create_attributes_treeview(compselect);
+ gtk_paned_pack2 (GTK_PANED (vpaned), attributes, FALSE, FALSE);
+ }
+
/* add the hpaned to the dialog vbox */
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (compselect)->vbox), hpaned,
+ gtk_box_pack_start (GTK_BOX (GTK_DIALOG (compselect)->vbox), vpaned,
TRUE, TRUE, 0);
- gtk_widget_show_all (hpaned);
+ gtk_widget_show_all (vpaned);
/* -- behavior combo box -- */
commit 0d1615ffc21c995ddc554a407941230eb1ea6677
Author: Werner Hoch <werner.ho@xxxxxx>
Date: Wed Oct 8 20:10:41 2008 +0200
gschem: configs for the attributes in the select dialog [#1444029]
configuration code to get the attribute list for the component select
dialog into gschem toplevel structure.
diff --git a/gschem/include/gschem_struct.h b/gschem/include/gschem_struct.h
index ec42020..55d620f 100644
--- a/gschem/include/gschem_struct.h
+++ b/gschem/include/gschem_struct.h
@@ -172,6 +172,8 @@ struct st_gschem_toplevel {
/* controls if after doing a place the same component can be placed again */
int continue_component_place;
+ GList *component_select_attrlist; /* holds a list of attribute names that are displayed in the
+ component select dialog */
int undo_levels; /* number of undo levels stored on disk */
int undo_control; /* sets if undo is enabled or not */
diff --git a/gschem/include/i_vars.h b/gschem/include/i_vars.h
index b9087a9..d6e1f30 100644
--- a/gschem/include/i_vars.h
+++ b/gschem/include/i_vars.h
@@ -70,6 +70,7 @@ extern int default_text_origin_marker;
extern int default_fast_mousepan;
extern int default_raise_dialog_boxes;
extern int default_continue_component_place;
+extern GList *default_component_select_attrlist;
extern int default_undo_levels;
extern int default_undo_control;
extern int default_undo_type;
diff --git a/gschem/include/prototype.h b/gschem/include/prototype.h
index f738faa..f908976 100644
--- a/gschem/include/prototype.h
+++ b/gschem/include/prototype.h
@@ -227,6 +227,7 @@ SCM g_rc_scrollbar_update(SCM mode);
SCM g_rc_object_clipping(SCM mode);
SCM g_rc_logging(SCM mode);
SCM g_rc_embed_components(SCM mode);
+SCM g_rc_component_dialog_attributes(SCM stringlist);
SCM g_rc_text_size(SCM size);
SCM g_rc_text_caps_style(SCM mode);
SCM g_rc_postscript_font_scale(SCM scale);
diff --git a/gschem/lib/system-gschemrc.in b/gschem/lib/system-gschemrc.in
index 5cacce1..26dbd92 100644
--- a/gschem/lib/system-gschemrc.in
+++ b/gschem/lib/system-gschemrc.in
@@ -364,6 +364,19 @@
;(embed-components "enabled")
(embed-components "disabled")
+; component-dialog-attributes stringlist
+;
+; Sets a list of attributs that are visible in the component select dialog.
+; The attributes are sorted in the same order as they appear in the list.
+; An empty list will disable the attribute view in the dialog.
+;
+(component-dialog-attributes '("device" "description" "footprint" "comment"
+ "net" "model" "model-name" "file" "value"
+ "numslots" "slotdef" "slot"
+ "documentation" "symversion" "author"
+ "use-license=" "dist-license="))
+;(component-dialog-attributes '())
+
; logging string
;
; Determines if the logging mechanism is enabled or disabled
diff --git a/gschem/src/g_rc.c b/gschem/src/g_rc.c
index 0a3c6a7..e204abf 100644
--- a/gschem/src/g_rc.c
+++ b/gschem/src/g_rc.c
@@ -520,6 +520,41 @@ SCM g_rc_embed_components(SCM mode)
2);
}
+/*! \brief read the configuration string list for the component dialog
+ * \par Function Description
+ * This function reads the string list from the component-dialog-attributes
+ * configuration parameter and converts the list into a GList.
+ * The GList is stored in the global default_component_select_attrlist variable.
+ */
+SCM g_rc_component_dialog_attributes(SCM stringlist)
+{
+ int length, i;
+ GList *list=NULL;
+ gchar *attr;
+
+ SCM_ASSERT(scm_list_p(stringlist), stringlist, SCM_ARG1, "scm_is_list failed");
+ length = scm_ilength(stringlist);
+
+ /* If the command is called multiple times, remove the old list before
+ recreating it */
+ g_list_foreach(default_component_select_attrlist, (GFunc)g_free, NULL);
+ g_list_free(default_component_select_attrlist);
+
+ /* convert the scm list into a GList */
+ for (i=0; i < length; i++) {
+ SCM_ASSERT(scm_is_string(scm_list_ref(stringlist, scm_from_int(i))),
+ scm_list_ref(stringlist, scm_from_int(i)), SCM_ARG1,
+ "list element is not a string");
+ attr = g_strdup(SCM_STRING_CHARS(scm_list_ref(stringlist, scm_from_int(i))));
+ list = g_list_prepend(list, attr);
+ }
+
+ default_component_select_attrlist = g_list_reverse(list);
+
+ return SCM_BOOL_T;
+}
+
+
/*! \todo Finish function documentation!!!
* \brief
* \par Function Description
diff --git a/gschem/src/g_register.c b/gschem/src/g_register.c
index 6a97f3c..0cab242 100644
--- a/gschem/src/g_register.c
+++ b/gschem/src/g_register.c
@@ -90,6 +90,7 @@ static struct gsubr_t gschem_funcs[] = {
{ "scrollbar-update", 1, 0, 0, g_rc_scrollbar_update },
{ "object-clipping", 1, 0, 0, g_rc_object_clipping },
{ "embed-components", 1, 0, 0, g_rc_embed_components },
+ { "component-dialog-attributes",1, 0, 0, g_rc_component_dialog_attributes },
{ "logging", 1, 0, 0, g_rc_logging },
{ "text-size", 1, 0, 0, g_rc_text_size },
{ "snap-size", 1, 0, 0, g_rc_snap_size },
diff --git a/gschem/src/gschem_toplevel.c b/gschem/src/gschem_toplevel.c
index 13c7c08..30540e6 100644
--- a/gschem/src/gschem_toplevel.c
+++ b/gschem/src/gschem_toplevel.c
@@ -185,6 +185,7 @@ GSCHEM_TOPLEVEL *gschem_toplevel_new ()
w_current->fast_mousepan = 0;
w_current->raise_dialog_boxes = 0;
w_current->continue_component_place = 0;
+ w_current->component_select_attrlist = NULL;
w_current->undo_levels = 0;
w_current->undo_control = 0;
w_current->undo_type = 0;
diff --git a/gschem/src/i_vars.c b/gschem/src/i_vars.c
index a6b7084..704958a 100644
--- a/gschem/src/i_vars.c
+++ b/gschem/src/i_vars.c
@@ -105,6 +105,7 @@ int default_text_origin_marker = TRUE;
int default_fast_mousepan = TRUE;
int default_raise_dialog_boxes = FALSE;
int default_continue_component_place = TRUE;
+GList *default_component_select_attrlist = NULL;
int default_undo_levels = 20;
int default_undo_control = TRUE;
int default_undo_type = UNDO_DISK;
@@ -240,6 +241,7 @@ void i_vars_set(GSCHEM_TOPLEVEL *w_current)
w_current->fast_mousepan = default_fast_mousepan;
w_current->raise_dialog_boxes = default_raise_dialog_boxes;
w_current->continue_component_place = default_continue_component_place;
+ w_current->component_select_attrlist = default_component_select_attrlist;
w_current->undo_levels = default_undo_levels;
w_current->undo_control = default_undo_control;
w_current->undo_type = default_undo_type;
_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs