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

gEDA-cvs: CVS update: g_hook.c



  User: peterb  
  Date: 07/05/28 03:42:19

  Modified:    .        g_hook.c i_callbacks.c o_complex.c o_copy.c
                        o_misc.c o_net.c x_compselect.c x_window.c
  Log:
  Implement new component library system in gschem.
  
  
  
  A new component library model was introduced into libgeda to
  
  allow gschem etc. to work well with database systems.  This
  
  patch updates gschem to use the new library system.  Most code
  
  dealing with creating, updating and (un)embedding symbols is
  
  affected.  However, this patch should not introduce any
  
  changes for the end-user.
  
  
  
  
  Revision  Changes    Path
  1.21                 eda/geda/gaf/gschem/src/g_hook.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: g_hook.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/g_hook.c,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -b -r1.20 -r1.21
  --- g_hook.c	17 Apr 2007 20:19:16 -0000	1.20
  +++ g_hook.c	28 May 2007 07:42:19 -0000	1.21
  @@ -669,9 +669,8 @@
     TOPLEVEL *w_current;
     PAGE *page;
     gboolean selectable, mirror;
  -  gchar *comp_name, *clib;
  +  gchar *comp_name;
     int x, y, angle;
  -  GSList *clibs = NULL;
     OBJECT *new_object;
   
     /* Return if scm_comp_name is NULL (an empty list) or scheme's FALSE */
  @@ -712,30 +711,15 @@
       return SCM_BOOL_F;
     }
   
  -  clibs = (GSList *) s_clib_search_basename (comp_name);
  -  if (clibs == NULL) {
  -    /* Component not found */
  -    s_log_message ("add-component-at-xy: Component with name [%s] not found.\n",
  -		   comp_name);
  -    return SCM_BOOL_F;    
  -  } 
  -
  -  g_assert(clibs != NULL);
  -  if (g_slist_next (clibs)) {
  -    s_log_message ("add-component-at-xy: More than one component found with name [%s]\n",
  -		   comp_name);
  -    /* PB: for now, use the first directory in clibs */
  -    /* PB: maybe open a dialog to select the right one? */
  -  }
  -  clib = (gchar*)clibs->data;
  -  
  -  new_object = page->object_tail = o_complex_add(w_current, 
  +  new_object 
  +    = page->object_tail 
  +    = o_complex_add_by_name(w_current, 
   						 page->object_tail, NULL, 
   						 'C', 
   						 WHITE, 
   						 x, y, 
   						 angle, mirror,
  -						 clib, comp_name, 
  +			    comp_name, 
   						 selectable, FALSE);
     
     /* 
  
  
  
  1.85                 eda/geda/gaf/gschem/src/i_callbacks.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: i_callbacks.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/i_callbacks.c,v
  retrieving revision 1.84
  retrieving revision 1.85
  diff -u -b -r1.84 -r1.85
  --- i_callbacks.c	22 Apr 2007 17:59:50 -0000	1.84
  +++ i_callbacks.c	28 May 2007 07:42:19 -0000	1.85
  @@ -2848,13 +2848,14 @@
   /*! \todo Finish function documentation!!!
    *  \brief
    *  \par Function Description
  - *
  + *  \todo Allow hierarchy descent into embedded components (using a
  + *  component library lookup)
    */
   DEFINE_I_CALLBACK(hierarchy_down_symbol)
   {
     TOPLEVEL *w_current = (TOPLEVEL *) data;
     OBJECT *object;
  -  char *filename;
  +  const CLibSymbol *sym;
   
     exit_if_null(w_current);
   
  @@ -2863,12 +2864,11 @@
       /* only allow going into symbols */
       if (object->type == OBJ_COMPLEX &&
           !o_complex_is_embedded (object)) {
  -      filename = g_strconcat (object->complex_clib,
  -                              G_DIR_SEPARATOR_S,
  -                              object->complex_basename, NULL);
  -      s_log_message(_("Searching for symbol [%s]\n"), filename);
  -      s_hierarchy_down_symbol(w_current, filename, w_current->page_current);
  -      g_free(filename);
  +      sym = object->complex_clib;
  +      s_log_message(_("Searching for symbol [%s]\n"), 
  +		    s_clib_symbol_get_name(sym));
  +      s_hierarchy_down_symbol(w_current, sym, 
  +			      w_current->page_current);
         /* s_hierarchy_down_symbol() will not zoom the loaded page */
         a_zoom_extents(w_current,
                        w_current->page_current->object_head,
  @@ -2909,6 +2909,7 @@
     char *attrib_device = NULL;
     char *attrib_value = NULL;
     OBJECT *object = NULL;
  +  const gchar *sourcename = NULL;
   
     exit_if_null(w_current);
   
  @@ -2932,11 +2933,13 @@
         if (!attrib_value) {
           attrib_value = o_attrib_search_name(object->complex->prim_objs, "value", 0);
         }
  +      
  +      sourcename = s_clib_source_get_name (s_clib_symbol_get_source(object->complex_clib));
         initiate_gschemdoc(attrib_doc,
                            attrib_device,
                            attrib_value,
                            object->complex_basename,
  -                         object->complex_clib);
  +                         sourcename);
   
         if (attrib_doc) g_free(attrib_doc);
         if (attrib_device) g_free(attrib_device);
  
  
  
  1.35                 eda/geda/gaf/gschem/src/o_complex.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: o_complex.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/o_complex.c,v
  retrieving revision 1.34
  retrieving revision 1.35
  diff -u -b -r1.34 -r1.35
  --- o_complex.c	15 May 2007 18:56:30 -0000	1.34
  +++ o_complex.c	28 May 2007 07:42:19 -0000	1.35
  @@ -147,7 +147,8 @@
   		&(w_current->page_current->complex_place_list),
   		OBJ_COMPLEX, WHITE, x, y, 0, 0,
   		w_current->internal_clib,
  -		w_current->internal_basename, 1, TRUE);
  +		s_clib_symbol_get_name (w_current->internal_clib), 
  +		1, TRUE);
     w_current->ADDING_SEL = 0;
     w_current->DONT_DRAW_CONN = 0;
   
  @@ -260,7 +261,7 @@
     OBJECT *o_current;
     OBJECT *o_start;
     OBJECT *o_temp;
  -  char *include_filename;
  +  char *buffer;
     int temp, new_angle, i;
     GList *connected_objects=NULL;
   
  @@ -277,17 +278,15 @@
   #endif
   
     if (w_current->include_complex) {
  -    include_filename = g_strconcat (w_current->internal_clib,
  -                                    G_DIR_SEPARATOR_S,
  -                                    w_current->internal_basename,
  -                                    NULL);
  +    buffer = s_clib_symbol_get_data (w_current->internal_clib);
   
       w_current->ADDING_SEL=1;
       o_start = w_current->page_current->object_tail;
       w_current->page_current->object_tail =
  -      o_read(w_current,
  +      o_read_buffer(w_current,
                w_current->page_current->object_tail,
  -             include_filename);
  +		    buffer, -1,
  +		    s_clib_symbol_get_name(w_current->internal_clib));
       o_start = o_start->next;
       w_current->ADDING_SEL=0;
   
  @@ -308,7 +307,7 @@
       o_cue_draw_list(w_current, connected_objects);
       g_list_free(connected_objects);
   
  -    g_free(include_filename);
  +    g_free(buffer);
   
       if (w_current->actionfeedback_mode == OUTLINE) {
   #if 0
  @@ -358,7 +357,8 @@
                     w_current->page_current->object_tail, NULL,
                     OBJ_COMPLEX, WHITE, x, y, w_current->complex_rotate, 0,
                     w_current->internal_clib,
  -                  w_current->internal_basename, 1, TRUE);
  +                  s_clib_symbol_get_name (w_current->internal_clib), 
  +		  1, TRUE);
   
     /* complex rotate post processing */
     o_temp = o_temp->next; /* skip over last object */
  @@ -398,21 +398,7 @@
   
     /* put code here to deal with emebedded stuff */
     if (w_current->embed_complex) {
  -    char* new_basename;
  -
  -    g_free(o_current->complex_clib);
  -
  -    o_current->complex_clib = g_strdup ("EMBEDDED");
  -
  -    new_basename = g_strconcat ("EMBEDDED",
  -                                o_current->complex_basename,
  -                                NULL);
  -
  -    g_free(o_current->complex_basename);
  -
  -    o_current->complex_basename = g_strdup (new_basename);
  -
  -    g_free(new_basename);
  +    o_current->complex_embedded = TRUE;
     }
   
     /* check for nulls in all this hack */
  
  
  
  1.31                 eda/geda/gaf/gschem/src/o_copy.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: o_copy.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/o_copy.c,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -b -r1.30 -r1.31
  --- o_copy.c	24 Feb 2007 18:43:14 -0000	1.30
  +++ o_copy.c	28 May 2007 07:42:19 -0000	1.31
  @@ -222,8 +222,7 @@
         case(OBJ_COMPLEX):
         case(OBJ_PLACEHOLDER):
           w_current->ADDING_SEL=1; 
  -        if (object->complex_clib && 
  -            strncmp(object->complex_clib, "EMBEDDED", 8) == 0) {
  +        if (o_complex_is_embedded(object)) {
   
             new_object = (OBJECT *) 
               o_complex_copy_embedded(w_current, 
  
  
  
  1.45                 eda/geda/gaf/gschem/src/o_misc.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: o_misc.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/o_misc.c,v
  retrieving revision 1.44
  retrieving revision 1.45
  diff -u -b -r1.44 -r1.45
  --- o_misc.c	17 Apr 2007 20:19:17 -0000	1.44
  +++ o_misc.c	28 May 2007 07:42:19 -0000	1.45
  @@ -1057,38 +1057,37 @@
     OBJECT *tmp_list, *new_complex;
     ATTRIB *new_attribs, *a_current;
     gboolean is_embedded;
  -  gchar *basename, *clib;
  +  const CLibSymbol *clib;
   
     g_return_if_fail (o_current != NULL);
   
     is_embedded = o_complex_is_embedded (o_current);
   
  -  /* identify symbol name */
  -  if (is_embedded) {
  -    const GSList *clibs;
  -    
  -    /* skip over EMBEDDED word */
  -    basename = g_strdup (o_current->complex_basename + 8);
  -
  -    /* search for basename in component library */
  -    clibs    = s_clib_search_basename (basename);
  -    if (!clibs) {
  -      s_log_message (_("Could not unembedded component, could not find appropriate .sym file\n"));
  -      s_log_message (_("Component still embedded and not updated\n"));
  +  /* find symbol if not known */
  +  if (o_current->complex_clib == NULL) {
  +    const GList *symlist = NULL;
  +    
  +    g_assert (o_current->complex_basename != NULL);
  +    symlist = s_clib_glob (o_current->complex_basename);
  +
  +    if (symlist == NULL) {
  +      s_log_message (_("Could not find symbol [%s] in library. Update failed.\n"), 
  +		     o_current->complex_basename);
         return;
  -    }
  -    if (g_slist_next (clibs)) {
  +    } else {
  +      if (g_list_next (symlist) != NULL) {
         s_log_message (_("More than one component found with name [%s]\n"),
  -                     basename);
  +		       o_current->complex_basename);
         /* PB: for now, use the first directory in clibs */
         /* PB: maybe open a dialog to select the right one? */
       }
  -    clib = (gchar*)clibs->data;
  -  } else {
  -    basename = o_current->complex_basename;
  -    clib     = o_current->complex_clib;
     }
   
  +    o_current->complex_clib = (CLibSymbol *) symlist->data;
  +  }
  +
  +  clib = o_current->complex_clib;
  +
     /* erase the complex object */
     o_erase_single (w_current, o_current);
     /* delete its connections */
  @@ -1107,7 +1106,8 @@
                                  o_current->complex->y,
                                  o_current->complex->angle,
                                  o_current->complex->mirror,
  -                               clib, basename, 1, TRUE);
  +                               clib, o_current->complex_basename, 
  +			       1, TRUE);
   
     /* updating the old complex with data from the new one */
     /* first process the prim_objs: */
  @@ -1175,11 +1175,8 @@
   		   o_current);
     o_redraw_single (w_current, o_current);
   
  -  if (is_embedded) {
  -    /* we previously allocated memory for basename */
  -    g_free (basename);
  -    /* clib should not be freed here since it is owned by libgeda */
  -  }
  +  /* Re-flag as embedded if necessary */
  +  o_current->complex_embedded = is_embedded;
       
     /* mark the page as modified */
     w_current->page_current->CHANGED = 1;
  
  
  
  1.34                 eda/geda/gaf/gschem/src/o_net.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: o_net.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/o_net.c,v
  retrieving revision 1.33
  retrieving revision 1.34
  diff -u -b -r1.33 -r1.34
  --- o_net.c	17 Apr 2007 20:19:17 -0000	1.33
  +++ o_net.c	28 May 2007 07:42:19 -0000	1.34
  @@ -851,7 +851,7 @@
     int made_changes = FALSE;
     const int ripper_size = w_current->bus_ripper_size;
     int complex_angle = 0;
  -  char *clib = NULL;
  +  const CLibSymbol *rippersym = NULL;
     
     length = o_line_length(net_obj);
   
  @@ -1123,10 +1123,11 @@
       s_conn_remove(w_current, net_obj);
   
       if (w_current->bus_ripper_type == COMP_BUS_RIPPER) {
  -      const GSList *clibs = s_clib_search_basename (w_current->bus_ripper_symname);
  -      if (clibs != NULL) {
  -        clib = (gchar*)clibs->data;
  +      GList *symlist = s_clib_glob (w_current->bus_ripper_symname);
  +      if (symlist != NULL) {
  +        rippersym = (CLibSymbol *) symlist->data;
         }
  +      g_list_free (symlist);
       }
       
       for (i = 0; i < ripper_count; i++) {
  @@ -1138,7 +1139,7 @@
                       rippers[i].x[1], rippers[i].y[1]);
         } else {
   
  -        if (clib) {
  +        if (rippersym != NULL) {
             w_current->page_current->object_tail = 
             (OBJECT *) o_complex_add(
                                      w_current,
  @@ -1147,12 +1148,12 @@
                                      OBJ_COMPLEX, WHITE,
                                      rippers[i].x[0], rippers[i].y[0],
                                      complex_angle, 0,
  -                                   clib,
  +                                   rippersym,
                                      w_current->bus_ripper_symname, 1, TRUE);
             
             o_complex_draw(w_current,w_current->page_current->object_tail);
           } else {
  -          s_log_message(_("Could not find %s in any component-library\n"),
  +          s_log_message(_("Bus ripper symbol [%s] was not found in any component library\n"),
                           w_current->bus_ripper_symname);
           }
         }
  
  
  
  1.21                 eda/geda/gaf/gschem/src/x_compselect.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: x_compselect.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/x_compselect.c,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -b -r1.20 -r1.21
  --- x_compselect.c	21 Apr 2007 18:59:07 -0000	1.20
  +++ x_compselect.c	28 May 2007 07:42:19 -0000	1.21
  @@ -86,11 +86,11 @@
   
     switch (arg1) {
         case GTK_RESPONSE_APPLY: {
  -        gchar *filename, *directory, *component;
  +	CLibSymbol *symbol;
           CompselectBehavior behavior;
           
           g_object_get (compselect,
  -                      "filename", &filename,
  +                      "symbol", &symbol,
                         "behavior", &behavior,
                         NULL);
   
  @@ -108,26 +108,12 @@
                 g_assert_not_reached();
           }
   
  -        if (filename == NULL) {
  +        if (symbol == NULL) {
             break;
           }
           
  -        component = g_path_get_basename (filename);
  -        directory = g_path_get_dirname  (filename);
  -        g_free (filename);
  -        
  -        if (toplevel->current_clib == NULL ||
  -            g_ascii_strcasecmp (toplevel->current_clib, directory) != 0 ||
  -            toplevel->current_basename == NULL ||
  -            g_ascii_strcasecmp (toplevel->current_basename, component) != 0) {
  -	  g_free (toplevel->current_clib);
  -          toplevel->current_clib = directory;
  +	toplevel->current_clib = symbol;
           
  -          strcpy (toplevel->current_basename, component);
  -	} else {
  -	  g_free(directory);
  -	}
  -	g_free (component);
   	if (toplevel->event_state == ENDCOMP) {
             gint diff_x, diff_y;
   
  @@ -142,8 +128,7 @@
   	g_list_free(toplevel->page_current->complex_place_list);
   	toplevel->page_current->complex_place_list = NULL;
   	
  -	o_complex_set_filename(toplevel, toplevel->current_clib,
  -			       toplevel->current_basename);
  +	o_complex_set_filename(toplevel, toplevel->current_clib, NULL);
           
   	toplevel->event_state = DRAWCOMP;
   
  @@ -236,7 +221,7 @@
   
   
   enum {
  -  PROP_FILENAME=1,
  +  PROP_SYMBOL=1,
     PROP_BEHAVIOR,
     PROP_HIDDEN
   };
  @@ -262,10 +247,9 @@
    *  This function determines what data is to be displayed in the
    *  component column of the selection tree.
    *
  - *  Any toplevel entry of the model (that is one without parent)
  - *  represents an absolute path to a directory of the component
  - *  library. Only the last part of the path is displayed. Otherwise it
  - *  simply copies data from the model to the column.
  + *  The top level of the model contains sources, and the next symbols.
  + *  s_clib_source_get_name() or s_clib_symbol_get_name() as
  + *  appropriate is called to get the text to display.
    *
    *  \param [in] tree_column The GtkTreeColumn.
    *  \param [in] cell        The GtkCellRenderer that is being rendered
  @@ -283,16 +267,27 @@
   {
     GtkTreeIter parent;
     GValue value = { 0, };
  +  GValue strvalue = { 0, };
  +  CLibSource *source;
  +  CLibSymbol *symbol;
     
     gtk_tree_model_get_value (tree_model, iter, 0, &value);
  +
  +  g_value_init (&strvalue, G_TYPE_STRING);
  +
     if (!gtk_tree_model_iter_parent (tree_model, &parent, iter)) {
  -    g_value_set_string_take_ownership (
  -      &value, g_path_get_basename (g_value_get_string (&value)));
  +    /* If top level, must be a source. */
  +    source = (CLibSource *) g_value_get_pointer (&value);
  +    g_value_set_string (&strvalue, s_clib_source_get_name (source));
  +  } else {
  +    /* Otherwise, must be a symbol */
  +    symbol = (CLibSymbol *) g_value_get_pointer (&value);
  +    g_value_set_string (&strvalue, s_clib_symbol_get_name (symbol));
     }
  -  g_object_set_property ((GObject*)cell, "text", &value);
  +  g_object_set_property ((GObject*)cell, "text", &strvalue);
   
     g_value_unset (&value);
  -  
  +  g_value_unset (&strvalue);
   }
   
   /*! \brief Determines visibility of items of the treeview.
  @@ -311,7 +306,8 @@
                                         gpointer      data)
   {
     Compselect *compselect = (Compselect*)data;
  -  gchar *compname;
  +  CLibSymbol *sym;
  +  const gchar *compname;
     gchar *compname_upper=NULL, *text_upper=NULL;
     const gchar *text;
     gboolean ret;
  @@ -323,6 +319,8 @@
       return TRUE;
     }
   
  +  /* If this is a source, only display it if it has children that
  +   * match */
     if (gtk_tree_model_iter_has_child (model, iter)) {
       GtkTreeIter iter2;
   
  @@ -336,14 +334,14 @@
       } while (gtk_tree_model_iter_next (model, &iter2));
     } else {
       gtk_tree_model_get (model, iter,
  -                        0, &compname,
  +                        0, &sym,
                           -1);
  +    compname = s_clib_symbol_get_name (sym);
       /* Do a case insensitive comparison, converting the strings 
          to uppercase */
       compname_upper = g_ascii_strup(compname, -1);
       text_upper = g_ascii_strup(text, -1);
       ret = (strstr (compname_upper, text_upper) != NULL);
  -    g_free (compname);
       g_free(compname_upper);
       g_free(text_upper);
     }
  @@ -406,30 +404,21 @@
     GtkTreeModel *model;
     GtkTreeIter iter, parent;
     Compselect *compselect = (Compselect*)user_data;
  -  GString *ret;
  -  gchar *value, *filename;
  +  CLibSymbol *sym = NULL;
  +  gchar *filename;
   
     if (!gtk_tree_selection_get_selected (selection, &model, &iter)) {
       return;
     }
   
  -  if (gtk_tree_model_iter_has_child (model, &iter)) {
  +  if (!gtk_tree_model_iter_parent (model, &parent, &iter)) {
       /* selected element is not a leaf -> not a component name */
       return;
     }
     
     /* build full path to component looking at parents */
  -  gtk_tree_model_get (model, &iter, 0, &value,-1);
  -  ret = g_string_new (value);
  -  g_free (value);
  -  while (gtk_tree_model_iter_parent (model, &parent, &iter)) {
  -    gtk_tree_model_get (model, &parent, 0, &value, -1);
  -    ret = g_string_prepend (ret, G_DIR_SEPARATOR_S);
  -    ret = g_string_prepend (ret, value);
  -    g_free (value);
  -    iter = parent;
  -  }
  -  filename = g_string_free (ret, FALSE);
  +  gtk_tree_model_get (model, &iter, 0, &sym, -1);
  +  filename = s_clib_symbol_get_filename(sym);
   
     /* update the treeview with new filename */
     g_object_set (compselect->preview,
  @@ -565,34 +554,38 @@
   compselect_create_child_model (void)
   {
     GtkTreeStore *store;
  -  const GList *directories, *dir; 
  +  GList *srchead, *srclist;
  +  GList *symhead, *symlist; 
   
  -  store = (GtkTreeStore*)gtk_tree_store_new (1,
  -                                             G_TYPE_STRING);
  +  store = (GtkTreeStore*)gtk_tree_store_new (1, G_TYPE_POINTER);
     
     /* populate component store */
  -  directories = s_clib_get_directories ();
  -  for (dir = directories; dir != NULL; dir = g_list_next (dir)) {
  +  srchead = s_clib_get_sources ();
  +  for (srclist = srchead; 
  +       srclist != NULL; 
  +       srclist = g_list_next (srclist)) {
  +
       GtkTreeIter iter, iter2;
  -    GSList *components, *comp;
   
       gtk_tree_store_append (store, &iter, NULL);
       gtk_tree_store_set (store, &iter,
  -                        0, dir->data,
  +                        0, srclist->data,
                           -1);
       
  -    components = s_clib_get_files ((gchar*)dir->data, ".sym");
  -    components = g_slist_sort (components, (GCompareFunc)g_ascii_strcasecmp);
  -    for (comp = components; comp != NULL; comp = g_slist_next (comp)) {
  +    symhead = s_clib_source_get_symbols ((CLibSource *)srclist->data);
  +    for (symlist = symhead; 
  +	 symlist != NULL; 
  +	 symlist = g_list_next (symlist)) {
  +
         gtk_tree_store_append (store, &iter2, &iter);
         gtk_tree_store_set (store, &iter2,
  -                          0, comp->data,
  +                          0, symlist->data,
                             -1);
       }
   
  -    g_slist_foreach (components, (GFunc)g_free, NULL);
  -    g_slist_free (components);
  +    g_list_free (symhead);
     }
  +  g_list_free (srchead);
   
     return (GtkTreeModel*)store;
   }
  @@ -663,11 +656,10 @@
     gobject_class->get_property = compselect_get_property;
   
     g_object_class_install_property (
  -    gobject_class, PROP_FILENAME,
  -    g_param_spec_string ("filename",
  +    gobject_class, PROP_SYMBOL,
  +    g_param_spec_pointer ("symbol",
                            "",
                            "",
  -                         NULL,
                            G_PARAM_READABLE));
     g_object_class_install_property (
       gobject_class, PROP_BEHAVIOR,
  @@ -985,29 +977,22 @@
     Compselect *compselect = COMPSELECT (object);
   
     switch(property_id) {
  -      case PROP_FILENAME: {
  +      case PROP_SYMBOL: 
  +	{
           GtkTreeModel *model;
           GtkTreeIter iter, parent;
  +	  CLibSymbol *symbol;
           if (gtk_tree_selection_get_selected (
                 gtk_tree_view_get_selection (compselect->treeview),
                 &model,
  -              &iter)) {
  -          GString *str;
  -          gchar *tmp;
  -          
  -          gtk_tree_model_get (model, &iter, 0, &tmp, -1);
  -          str = g_string_new (tmp);
  -          g_free (tmp);
  -          while (gtk_tree_model_iter_parent (model, &parent, &iter)) {
  -            gtk_tree_model_get (model, &parent, 0, &tmp, -1);
  -            str = g_string_prepend (str, G_DIR_SEPARATOR_S);
  -            str = g_string_prepend (str, tmp);
  -            g_free (tmp);
  -            iter = parent;
  -          }
  -          g_value_take_string (value, g_string_free (str, FALSE));
  +		&iter)
  +	      && gtk_tree_model_iter_parent (model, &parent, &iter)) {
  +	    
  +	    gtk_tree_model_get (model, &iter, 0, &symbol, -1);
  +	    g_value_set_pointer (value, symbol);
  +
           } else {
  -          g_value_set_string (value, NULL);
  +	    g_value_set_pointer (value, NULL);
           }
         }
           break;
  
  
  
  1.55                 eda/geda/gaf/gschem/src/x_window.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: x_window.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/x_window.c,v
  retrieving revision 1.54
  retrieving revision 1.55
  diff -u -b -r1.54 -r1.55
  --- x_window.c	5 May 2007 12:40:45 -0000	1.54
  +++ x_window.c	28 May 2007 07:42:19 -0000	1.55
  @@ -63,7 +63,6 @@
     toplevel->current_visible = -1; /* not sure on these */
     toplevel->current_show = -1;
   
  -  toplevel->internal_basename=NULL;
     toplevel->internal_clib=NULL;
   
     toplevel->series_name = NULL;
  
  
  


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