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

gEDA-cvs: CVS update: o_misc.c



  User: ahvezda 
  Date: 07/01/08 23:47:09

  Modified:    .        o_misc.c
  Log:
  Added "embed/unembed all components/schematics" functionality to gschlas
  
  
  
  
  Revision  Changes    Path
  1.40      +0 -114    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.39
  retrieving revision 1.40
  diff -u -b -r1.39 -r1.40
  --- o_misc.c	21 Dec 2006 20:32:11 -0000	1.39
  +++ o_misc.c	9 Jan 2007 04:47:09 -0000	1.40
  @@ -513,120 +513,6 @@
     }
   }
   
  -/*! \todo Finish function documentation!!!
  - *  \brief
  - *  \par Function Description
  - * 
  - */
  -void o_embed(TOPLEVEL *w_current, OBJECT *o_current)
  -{
  -  gchar *new_basename;
  -
  -  /* check o_current is a complex and is not already embedded */
  -  if (o_current->type == OBJ_COMPLEX &&
  -      !o_complex_is_embedded (o_current))
  -  {
  -    /* change the clib of complex to "EMBEDDED" */
  -    if (o_current->complex_clib) {
  -      g_free (o_current->complex_clib);
  -    }
  -    o_current->complex_clib = g_strdup ("EMBEDDED");
  -
  -    /* change the basename to "EMBEDDED"+basename */
  -    new_basename = g_strconcat ("EMBEDDED",
  -                                o_current->complex_basename,
  -                                NULL);
  -    g_free (o_current->complex_basename);
  -    o_current->complex_basename = new_basename;
  -
  -    s_log_message (_("Component [%s] has been embedded\n"),
  -                   o_current->complex_basename + 8);
  -    
  -    /* page content has been modified */
  -    w_current->page_current->CHANGED = 1;
  -  }
  -
  -  /* If it's a picture and it's not embedded */
  -  if ( (o_current->type == OBJ_PICTURE) &&
  -       (o_current->picture->embedded == 0) ) {
  -
  -    o_current->picture->embedded = 1;
  -    
  -    s_log_message (_("Picture [%s] has been embedded\n"),
  -		   basename(o_current->picture->filename));
  -    
  -    
  -    /* page content has been modified */
  -    w_current->page_current->CHANGED = 1;
  -  }
  -  
  -}
  -
  -/*! \todo Finish function documentation!!!
  - *  \brief
  - *  \par Function Description
  - * 
  - */
  -void o_unembed(TOPLEVEL *w_current, OBJECT *o_current)
  -{
  -  gchar *new_basename, *new_clib;
  -  const GSList *clibs;
  -  
  -  /* check o_current is an embedded complex */
  -  if (o_current->type == OBJ_COMPLEX &&
  -      o_complex_is_embedded (o_current))
  -  {
  -    /* get ride of the EMBEDDED word in basename */
  -    new_basename = g_strdup (o_current->complex_basename + 8);
  -    
  -    /* search for the symbol in the library */
  -    clibs = s_clib_search_basename (new_basename);
  -
  -    if (!clibs) {
  -      /* symbol not found in the symbol library: signal an error */
  -      s_log_message (_("Could not find component [%s], while trying to unembed. Component is still embedded\n"),
  -                     o_current->complex_basename + 8);
  -      
  -    } else {
  -      /* set the object new basename */
  -      g_free (o_current->complex_basename);
  -      o_current->complex_basename = new_basename;
  -
  -      /* set the object new clib */
  -      g_free (o_current->complex_clib);
  -      if (g_slist_next (clibs)) {
  -        s_log_message (_("More than one component found with name [%s]\n"),
  -                       new_basename);
  -        /* PB: for now, use the first directory in clibs */
  -        /* PB: maybe open a dialog to select the right one? */
  -      }
  -      new_clib = g_strdup ((gchar*)clibs->data);
  -      o_current->complex_clib = new_clib;
  -
  -      s_log_message (_("Component [%s] has been successfully unembedded\n"),
  -                     o_current->complex_basename);
  -      
  -      /* page content has been modified */
  -      w_current->page_current->CHANGED = 1;
  -      
  -    }
  -  }
  -
  -  /* If it's a picture and it's embedded */
  -  if ( (o_current->type == OBJ_PICTURE) &&
  -       (o_current->picture->embedded == 1) ) {
  -
  -    o_current->picture->embedded = 0;
  -    
  -    s_log_message (_("Picture [%s] has been unembedded\n"),
  -		   basename(o_current->picture->filename));
  -    
  -    
  -    /* page content has been modified */
  -    w_current->page_current->CHANGED = 1;
  -  }
  -  
  -}
   
   /*! \todo Finish function documentation!!!
    *  \brief
  
  
  


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