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

gEDA-cvs: gaf.git: branch: master updated (1.7.0-20110116-47-g0fffd6b)



The branch, master has been updated
       via  0fffd6b16214cd05cba9de9e4d65d4e1ea2cf16a (commit)
       via  41ae0eaa4d3b23702510d3d51bbfe4821166bc06 (commit)
      from  82db4b3a104b722af13a24333f6f3f60c1f5549e (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/src/gschem.c              |   13 ----------
 gschem/src/o_basic.c             |   50 +++++++++++++++++++++++++-------------
 libgeda/include/libgeda/funcs.h  |   12 ---------
 libgeda/include/libgeda/struct.h |    5 ----
 libgeda/src/o_arc_basic.c        |    5 ----
 libgeda/src/o_box_basic.c        |    5 ----
 libgeda/src/o_bus_basic.c        |    5 ----
 libgeda/src/o_circle_basic.c     |    7 +----
 libgeda/src/o_complex_basic.c    |    8 ------
 libgeda/src/o_line_basic.c       |    7 +----
 libgeda/src/o_net_basic.c        |    5 ----
 libgeda/src/o_path_basic.c       |    5 ----
 libgeda/src/o_picture.c          |    7 -----
 libgeda/src/o_pin_basic.c        |    5 ----
 libgeda/src/o_text_basic.c       |    5 ----
 libgeda/src/s_basic.c            |    3 --
 16 files changed, 35 insertions(+), 112 deletions(-)


=================
 Commit Messages
=================

commit 0fffd6b16214cd05cba9de9e4d65d4e1ea2cf16a
Author: Peter TB Brett <peter@xxxxxxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    Remove draw funcs from libgeda.
    
    Removes all of the statically-registered draw functions from libgeda,
    as well as the draw_func field from the OBJECT structure. Makes
    o_redraw_single() dispatch to type-specific drawing functions
    directly.
    
    Refreshed by Peter Clifton <pcjc2@xxxxxxxxx>

:100644 100644 cdf0280... ea98861... M	gschem/src/gschem.c
:100644 100644 913f660... 8f2674c... M	gschem/src/o_basic.c
:100644 100644 220c7ab... c7e18dd... M	libgeda/include/libgeda/funcs.h
:100644 100644 bcc7a78... d789975... M	libgeda/include/libgeda/struct.h
:100644 100644 cb1c3fc... 39b0e8f... M	libgeda/src/o_arc_basic.c
:100644 100644 e857a6a... 8a0d165... M	libgeda/src/o_box_basic.c
:100644 100644 d400502... ae22db7... M	libgeda/src/o_bus_basic.c
:100644 100644 088dea8... 92c839a... M	libgeda/src/o_circle_basic.c
:100644 100644 722801b... 133f2d7... M	libgeda/src/o_complex_basic.c
:100644 100644 4805940... 887c525... M	libgeda/src/o_line_basic.c
:100644 100644 ca4c1e4... 443cb4c... M	libgeda/src/o_net_basic.c
:100644 100644 de424e8... e5b907b... M	libgeda/src/o_path_basic.c
:100644 100644 924f15c... 3119c12... M	libgeda/src/o_picture.c
:100644 100644 02c7a97... ef91efb... M	libgeda/src/o_pin_basic.c
:100644 100644 0c91581... d40288d... M	libgeda/src/o_text_basic.c
:100644 100644 3d2ea4d... fe1c419... M	libgeda/src/s_basic.c

commit 41ae0eaa4d3b23702510d3d51bbfe4821166bc06
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    Remove unused OBJECT->action_func

:100644 100644 7ce5213... bcc7a78... M	libgeda/include/libgeda/struct.h
:100644 100644 3c82657... 3d2ea4d... M	libgeda/src/s_basic.c

=========
 Changes
=========

commit 0fffd6b16214cd05cba9de9e4d65d4e1ea2cf16a
Author: Peter TB Brett <peter@xxxxxxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    Remove draw funcs from libgeda.
    
    Removes all of the statically-registered draw functions from libgeda,
    as well as the draw_func field from the OBJECT structure. Makes
    o_redraw_single() dispatch to type-specific drawing functions
    directly.
    
    Refreshed by Peter Clifton <pcjc2@xxxxxxxxx>

diff --git a/gschem/src/gschem.c b/gschem/src/gschem.c
index cdf0280..ea98861 100644
--- a/gschem/src/gschem.c
+++ b/gschem/src/gschem.c
@@ -167,19 +167,6 @@ void main_prog(void *closure, int argc, char *argv[])
   
   libgeda_init();
 
-  /* Install various libgeda callbacks */
-  arc_draw_func = o_arc_draw;
-  box_draw_func = o_box_draw;
-  bus_draw_func = o_bus_draw;
-  circle_draw_func = o_circle_draw;
-  complex_draw_func = o_complex_draw;
-  line_draw_func = o_line_draw;
-  net_draw_func = o_net_draw;
-  picture_draw_func = o_picture_draw;
-  path_draw_func = o_path_draw;
-  pin_draw_func = o_pin_draw;
-  text_draw_func = o_text_draw;
-
   /* create log file right away even if logging is enabled */
   s_log_init ("gschem");
 
diff --git a/gschem/src/o_basic.c b/gschem/src/o_basic.c
index 913f660..8f2674c 100644
--- a/gschem/src/o_basic.c
+++ b/gschem/src/o_basic.c
@@ -89,11 +89,11 @@ void o_redraw_rects (GSCHEM_TOPLEVEL *w_current,
   for (iter = obj_list; iter != NULL; iter = g_list_next (iter)) {
     OBJECT *o_current = iter->data;
 
-    if ((o_current->draw_func != NULL)
-        && !(o_current->dont_redraw
-             || (!draw_selected && o_current->selected))) {
-      (*o_current->draw_func)(w_current, o_current);
-    }
+    if (o_current->dont_redraw ||
+        (!draw_selected && o_current->selected))
+      continue;
+
+    o_redraw_single (w_current, o_current);
   }
 
   o_cue_redraw_all (w_current, obj_list, draw_selected);
@@ -192,17 +192,14 @@ void o_redraw (GSCHEM_TOPLEVEL *w_current, GList *object_list, gboolean draw_sel
   OBJECT *o_current;
   GList *iter;
 
-  iter = object_list;
-  while (iter != NULL) {
+  for (iter = object_list; iter != NULL; iter = g_list_next (iter)) {
     o_current = (OBJECT *)iter->data;
 
-    if ((o_current->draw_func != NULL)
-        && !(o_current->dont_redraw
-             || (!draw_selected && o_current->selected))) {
-      (*o_current->draw_func)(w_current, o_current);
-    }
+    if (o_current->dont_redraw ||
+        (!draw_selected && o_current->selected))
+      continue;
 
-    iter = g_list_next (iter);
+    o_redraw_single (w_current, o_current);
   }
 }
 
@@ -216,12 +213,31 @@ void o_redraw (GSCHEM_TOPLEVEL *w_current, GList *object_list, gboolean draw_sel
  */
 void o_redraw_single(GSCHEM_TOPLEVEL *w_current, OBJECT *o_current)
 {
+  void (*func) (GSCHEM_TOPLEVEL *, OBJECT *) = NULL;
+
   if (o_current == NULL)
-  return;
+    return;
 
-  if (o_current->draw_func != NULL) {
-    (*o_current->draw_func)(w_current, o_current);
+  switch (o_current->type) {
+      case OBJ_LINE:    func = o_line_draw;    break;
+      case OBJ_NET:     func = o_net_draw;     break;
+      case OBJ_BUS:     func = o_bus_draw;     break;
+      case OBJ_BOX:     func = o_box_draw;     break;
+      case OBJ_PICTURE: func = o_picture_draw; break;
+      case OBJ_CIRCLE:  func = o_circle_draw;  break;
+      case OBJ_PLACEHOLDER:
+      case OBJ_COMPLEX: func = o_complex_draw; break;
+      case OBJ_TEXT:    func = o_text_draw;    break;
+      case OBJ_PATH:    func = o_path_draw;    break;
+      case OBJ_PIN:     func = o_pin_draw;     break;
+      case OBJ_ARC:     func = o_arc_draw;     break;
+      default:
+        g_critical ("o_redraw_single: object %p has bad type '%c'\n",
+                    o_current, o_current->type);
   }
+
+  if (func != NULL)
+    (*func) (w_current, o_current);
 }
 
 
diff --git a/libgeda/include/libgeda/funcs.h b/libgeda/include/libgeda/funcs.h
index 220c7ab..c7e18dd 100644
--- a/libgeda/include/libgeda/funcs.h
+++ b/libgeda/include/libgeda/funcs.h
@@ -1,13 +1 @@
-extern void (*arc_draw_func)();
-extern void (*box_draw_func)();
-extern void (*picture_draw_func)();
-extern void (*circle_draw_func)();
-extern void (*complex_draw_func)();
-extern void (*line_draw_func)();
-extern void (*net_draw_func)();
-extern void (*bus_draw_func)();
-extern void (*text_draw_func)();
-extern void (*pin_draw_func)();
-extern void (*path_draw_func)();
 extern void (*x_log_update_func)();
-
diff --git a/libgeda/include/libgeda/struct.h b/libgeda/include/libgeda/struct.h
index bcc7a78..d789975 100644
--- a/libgeda/include/libgeda/struct.h
+++ b/libgeda/include/libgeda/struct.h
@@ -255,8 +255,6 @@ struct st_object {
   gchar *complex_basename;              /* Component Library Symbol name */
   OBJECT *parent;                       /* Parent object pointer */
 
-  void (*draw_func)();			/* Draw function */
-
   int color; 				/* Which color */
   int dont_redraw;			/* Flag to skip redrawing */
   int selectable;			/* object selectable flag */
diff --git a/libgeda/src/o_arc_basic.c b/libgeda/src/o_arc_basic.c
index cb1c3fc..39b0e8f 100644
--- a/libgeda/src/o_arc_basic.c
+++ b/libgeda/src/o_arc_basic.c
@@ -33,9 +33,6 @@
 #include <dmalloc.h>
 #endif
 
-/*! Default setting for arc draw function. */
-void (*arc_draw_func)() = NULL;
-
 /*! \brief
  *  \par Function Description
  *  The function creates a new OBJECT of type arc.
@@ -110,8 +107,6 @@ OBJECT *o_arc_new(TOPLEVEL *toplevel,
   o_arc_recalc(toplevel, new_node);
 
   /* new_node->graphical = arc; eventually */
-	
-  new_node->draw_func = arc_draw_func;  
 
   return new_node;
 }
diff --git a/libgeda/src/o_box_basic.c b/libgeda/src/o_box_basic.c
index e857a6a..8a0d165 100644
--- a/libgeda/src/o_box_basic.c
+++ b/libgeda/src/o_box_basic.c
@@ -32,9 +32,6 @@
 #include <dmalloc.h>
 #endif
 
-/*! Default setting for draw function. */
-void (*box_draw_func)() = NULL;
-
 /*! \brief Create a BOX OBJECT
  *  \par Function Description
  *  This function creates a new object representing a box.
@@ -86,8 +83,6 @@ OBJECT *o_box_new(TOPLEVEL *toplevel,
   o_set_fill_options(toplevel, new_node,
 		     FILLING_HOLLOW, -1, -1, -1, -1, -1);
 
-  new_node->draw_func = box_draw_func; 
-
   /* compute the bounding box */
   o_box_recalc(toplevel, new_node);
 
diff --git a/libgeda/src/o_bus_basic.c b/libgeda/src/o_bus_basic.c
index d400502..ae22db7 100644
--- a/libgeda/src/o_bus_basic.c
+++ b/libgeda/src/o_bus_basic.c
@@ -32,9 +32,6 @@
 #include <dmalloc.h>
 #endif
 
-/*! Default setting for bus draw function. */
-void (*bus_draw_func)() = NULL;
-
 /*! \brief get the position of the first bus point
  *  \par Function Description
  *  This function gets the position of the first point of a bus object.
@@ -105,8 +102,6 @@ OBJECT *o_bus_new(TOPLEVEL *toplevel,
 
   o_bus_recalc (toplevel, new_node);
 
-  new_node->draw_func = bus_draw_func;  
-
   return new_node;
 }
 
diff --git a/libgeda/src/o_circle_basic.c b/libgeda/src/o_circle_basic.c
index 088dea8..92c839a 100644
--- a/libgeda/src/o_circle_basic.c
+++ b/libgeda/src/o_circle_basic.c
@@ -32,9 +32,6 @@
 #include <dmalloc.h>
 #endif
 
-/*! Default setting for circle draw function. */
-void (*circle_draw_func)() = NULL;
-
 /*! \brief calculate the distance between two points
  *  \par Function Description
  *  This function calculates the distance between two points.
@@ -99,9 +96,7 @@ OBJECT *o_circle_new(TOPLEVEL *toplevel,
 		     END_NONE, TYPE_SOLID, 0, -1, -1);
   o_set_fill_options(toplevel, new_node,
 		     FILLING_HOLLOW, -1, -1, -1, -1, -1);
-  
-  new_node->draw_func = circle_draw_func;  
-  
+
   /* compute the bounding box coords */
   o_circle_recalc(toplevel, new_node);
 
diff --git a/libgeda/src/o_complex_basic.c b/libgeda/src/o_complex_basic.c
index 722801b..133f2d7 100644
--- a/libgeda/src/o_complex_basic.c
+++ b/libgeda/src/o_complex_basic.c
@@ -41,9 +41,6 @@
 #include <dmalloc.h>
 #endif
 
-/*! Default setting for complex draw function. */
-void (*complex_draw_func)() = NULL;
-
 
 /*! \brief Return the bounds of the given object.
  *  \par Given an object, calculate the bounds coordinates.
@@ -438,8 +435,6 @@ OBJECT *o_complex_new(TOPLEVEL *toplevel,
   new_node->complex->x = x;
   new_node->complex->y = y;
 
-  new_node->draw_func = complex_draw_func;
-
   prim_objs = NULL;
 
   /* get the symbol data */
@@ -599,8 +594,6 @@ OBJECT *o_complex_new_embedded(TOPLEVEL *toplevel,
   new_node->color = color;
   new_node->selectable = selectable;
 
-  new_node->draw_func = complex_draw_func;  
-
   new_node->complex->prim_objs = NULL;
 
   /* don't have to translate/rotate/mirror here at all since the */
@@ -790,7 +783,6 @@ OBJECT *o_complex_copy(TOPLEVEL *toplevel, OBJECT *o_current)
   o_new->selectable = o_current->selectable;
   o_new->complex_basename = g_strdup(o_current->complex_basename);
   o_new->complex_embedded = o_current->complex_embedded;
-  o_new->draw_func = o_current->draw_func;
 
   o_new->complex = g_malloc0(sizeof(COMPLEX));
   o_new->complex->x = o_current->complex->x;
diff --git a/libgeda/src/o_line_basic.c b/libgeda/src/o_line_basic.c
index 4805940..887c525 100644
--- a/libgeda/src/o_line_basic.c
+++ b/libgeda/src/o_line_basic.c
@@ -33,9 +33,6 @@
 #include <dmalloc.h>
 #endif
 
-/*! Default setting for line draw function. */
-void (*line_draw_func)() = NULL;
-
 /*! \brief Create and add line OBJECT to list.
  *  \par Function Description
  *  This function creates a new object representing a line.
@@ -87,9 +84,7 @@ OBJECT *o_line_new(TOPLEVEL *toplevel,
 		     END_NONE, TYPE_SOLID, 0, -1, -1);
   o_set_fill_options(toplevel, new_node,
 		     FILLING_HOLLOW, -1, -1, -1, -1, -1);
-  
-  new_node->draw_func = line_draw_func;
-  
+
   /* compute bounding box */
   o_line_recalc(toplevel, new_node);
 
diff --git a/libgeda/src/o_net_basic.c b/libgeda/src/o_net_basic.c
index ca4c1e4..443cb4c 100644
--- a/libgeda/src/o_net_basic.c
+++ b/libgeda/src/o_net_basic.c
@@ -32,9 +32,6 @@
  *  \brief functions for the net object
  */
 
-/*! Default setting for net draw function. */
-void (*net_draw_func)() = NULL;
-
 /*! \brief get the position of the first net point
  *  \par Function Description
  *  This function gets the position of the first point of a net object.
@@ -100,8 +97,6 @@ OBJECT *o_net_new(TOPLEVEL *toplevel, char type,
 
   o_net_recalc (toplevel, new_node);
 
-  new_node->draw_func = net_draw_func;
-
   return new_node;
 }
 
diff --git a/libgeda/src/o_path_basic.c b/libgeda/src/o_path_basic.c
index de424e8..e5b907b 100644
--- a/libgeda/src/o_path_basic.c
+++ b/libgeda/src/o_path_basic.c
@@ -29,9 +29,6 @@
 #include <dmalloc.h>
 #endif
 
-/*! Default setting for path draw function. */
-void (*path_draw_func)() = NULL;
-
 
 typedef void (*DRAW_FUNC) (TOPLEVEL *toplevel, FILE *fp, PATH *path,
                            int line_width, int length, int space,
@@ -91,8 +88,6 @@ OBJECT *o_path_new (TOPLEVEL *toplevel,
   o_set_fill_options (toplevel, new_node,
                       FILLING_HOLLOW, -1, -1, -1, -1, -1);
 
-  new_node->draw_func = path_draw_func;
-
   /* compute bounding box */
   o_path_recalc (toplevel, new_node);
 
diff --git a/libgeda/src/o_picture.c b/libgeda/src/o_picture.c
index 924f15c..3119c12 100644
--- a/libgeda/src/o_picture.c
+++ b/libgeda/src/o_picture.c
@@ -34,9 +34,6 @@
 
 #include "libgeda_priv.h"
 
-/*! Default setting for picture draw function. */
-void (*picture_draw_func)() = NULL;
-
 /*! \brief Create picture OBJECT from character string.
  *  \par Function Description
  *  This function will get the description of a picture from the
@@ -346,8 +343,6 @@ OBJECT *o_picture_new(TOPLEVEL *toplevel, GdkPixbuf *pixbuf,
   picture->mirrored = mirrored;
   picture->embedded = embedded;
 
-  new_node->draw_func = picture_draw_func;
-
   /* compute the bounding picture */
   o_picture_recalc(toplevel, new_node);
 
@@ -706,8 +701,6 @@ OBJECT *o_picture_copy(TOPLEVEL *toplevel, OBJECT *object)
   /* Copy the picture data */
   picture->pixbuf = gdk_pixbuf_copy (object->picture->pixbuf);
 
-  new_node->draw_func = object->draw_func;
-
   /* compute the bounding picture */
   o_picture_recalc(toplevel, new_node);
 
diff --git a/libgeda/src/o_pin_basic.c b/libgeda/src/o_pin_basic.c
index 02c7a97..ef91efb 100644
--- a/libgeda/src/o_pin_basic.c
+++ b/libgeda/src/o_pin_basic.c
@@ -32,9 +32,6 @@
  *  \brief functions for the pin object
  */
 
-/*! Default setting for pin draw function. */
-void (*pin_draw_func)() = NULL;
-
 /*! \brief calculate and return the boundaries of a pin object
  *  \par Function Description
  *  This function calculates the object boudaries of a pin \a object.
@@ -105,8 +102,6 @@ OBJECT *o_pin_new(TOPLEVEL *toplevel,
 
   o_pin_recalc (toplevel, new_node);
 
-  new_node->draw_func = pin_draw_func;  
-
   new_node->whichend = whichend;
 
   return new_node;
diff --git a/libgeda/src/o_text_basic.c b/libgeda/src/o_text_basic.c
index 0c91581..d40288d 100644
--- a/libgeda/src/o_text_basic.c
+++ b/libgeda/src/o_text_basic.c
@@ -97,9 +97,6 @@
  */
 #define PRINT_LINE_SPACING 1.12
 
-/*! Default setting for text draw function. */
-void (*text_draw_func)() = NULL;
-
 /*! Size of a tab in characters */
 int tab_in_chars = 8;
 
@@ -277,8 +274,6 @@ OBJECT *o_text_new(TOPLEVEL *toplevel,
 
   new_node->text = text;
 
-  new_node->draw_func = text_draw_func;  
-
   new_node->color = color;
   o_set_visibility (toplevel, new_node, visibility);
   new_node->show_name_value = show_name_value;
diff --git a/libgeda/src/s_basic.c b/libgeda/src/s_basic.c
index 3d2ea4d..fe1c419 100644
--- a/libgeda/src/s_basic.c
+++ b/libgeda/src/s_basic.c
@@ -117,8 +117,6 @@ OBJECT *s_basic_init_object(OBJECT *new_node, int type, char const *name)
 
   new_node->bus_ripper_direction = 0;
 
-  new_node->draw_func = error_if_called; 
-
   new_node->line_end = END_NONE;
   new_node->line_type = TYPE_SOLID;
   new_node->line_width = 0;

commit 41ae0eaa4d3b23702510d3d51bbfe4821166bc06
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    Remove unused OBJECT->action_func

diff --git a/libgeda/include/libgeda/struct.h b/libgeda/include/libgeda/struct.h
index 7ce5213..bcc7a78 100644
--- a/libgeda/include/libgeda/struct.h
+++ b/libgeda/include/libgeda/struct.h
@@ -255,9 +255,6 @@ struct st_object {
   gchar *complex_basename;              /* Component Library Symbol name */
   OBJECT *parent;                       /* Parent object pointer */
 
-  /* unused for now */
-  void (*action_func)();			/* Execute function */
-
   void (*draw_func)();			/* Draw function */
 
   int color; 				/* Which color */
diff --git a/libgeda/src/s_basic.c b/libgeda/src/s_basic.c
index 3c82657..3d2ea4d 100644
--- a/libgeda/src/s_basic.c
+++ b/libgeda/src/s_basic.c
@@ -117,7 +117,6 @@ OBJECT *s_basic_init_object(OBJECT *new_node, int type, char const *name)
 
   new_node->bus_ripper_direction = 0;
 
-  new_node->action_func = error_if_called; 
   new_node->draw_func = error_if_called; 
 
   new_node->line_end = END_NONE;




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