[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
gEDA-cvs: gaf.git: branch: master updated (1.5.2-20090328-190-g7b2ec0b)
The branch, master has been updated
via 7b2ec0b1da38f6f078de4bb1ef61d100d9a5972e (commit)
via a419f4f196ef6574940d082d88f46b95bbeb0ea9 (commit)
via ea46d8defce4390b9650e8d2a5035de4794673df (commit)
via 476299cad187c839cb252d6d2d985590f99bb6e9 (commit)
from 821845073b187409488bbf78ed947fd084439546 (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/prototype.h | 2 +-
gschem/src/o_complex.c | 7 +-
gschem/src/x_compselect.c | 2 +-
gsymcheck/docs/Makefile.am | 2 +-
libgeda/include/libgeda/prototype.h | 1 -
libgeda/src/o_complex_basic.c | 137 +++++++++++++++++------------------
libgeda/src/o_list.c | 6 +--
m4/geda-groff.m4 | 21 +++++-
8 files changed, 90 insertions(+), 88 deletions(-)
=================
Commit Messages
=================
commit 7b2ec0b1da38f6f078de4bb1ef61d100d9a5972e
Author: Peter TB Brett <peter@xxxxxxxxxxxxx>
Commit: Peter TB Brett <peter@xxxxxxxxxxxxx>
build-sys: Add check for groff html driver. [2836109]
Some distributions, such as Ubuntu, do not install the groff HTML
device by default, and an additional package must be installed to
provide it. AX_PROG_GROFF therefore needs to check that groff is able
to create HTML files.
:100644 100644 576a955... 366b828... M gsymcheck/docs/Makefile.am
:100644 100644 8181a57... a0c7881... M m4/geda-groff.m4
commit a419f4f196ef6574940d082d88f46b95bbeb0ea9
Author: Peter TB Brett <peter@xxxxxxxxxxxxx>
Commit: Peter TB Brett <peter@xxxxxxxxxxxxx>
libgeda: Make o_complex_promote_attribs() respect keep_invisible. [2460301]
Placing components from the component selector should respect
TOPLEVEL->keep_invisible when deciding how to deal with promoted
attributes.
:100644 100644 6af6446... 35aa709... M libgeda/src/o_complex_basic.c
commit ea46d8defce4390b9650e8d2a5035de4794673df
Author: Peter TB Brett <peter@xxxxxxxxxxxxx>
Commit: Peter TB Brett <peter@xxxxxxxxxxxxx>
libgeda: Make o_complex_copy() actually copy. [2460301]
In the past, o_complex_copy() has instantiated a new COMPLEX by
calling o_complex_new(), which reads in symbol data from the symbol
library. A separate o_complex_copy_embedded() function performed a
copy for embedded objects, by actually performing a deep copy of the
COMPLEX to be copied.
Also note that components being placed from the component selector are
copied into place.
This lead to a bug reported by Peter Clifton, whereby the contents of
an embedded symbol could vary.
- If placed normally and then embedded, the attributes promoted out of
the COMPLEX prior to preparing to place were "resurrected" by the
magical file-reading powers of o_complex_copy(), and these
attributes were then kept when the symbol was embedded.
- If placed as embedded, the attributes were *not* resurrected,
meaning that the promotable attributes were *not* present in the
embedded symbol.
This patch modifies o_complex_copy() to explicitly carry out a deep
copy of the object to be copied, removing the file-reading behaviour
(this seems to be the Right Thing in this context). It also removes
o_complex_copy_embedded(), since it is then superfluous.
:100644 100644 77d608f... 731f753... M libgeda/include/libgeda/prototype.h
:100644 100644 23f9f7b... 6af6446... M libgeda/src/o_complex_basic.c
:100644 100644 b4bc97a... f0385f4... M libgeda/src/o_list.c
commit 476299cad187c839cb252d6d2d985590f99bb6e9
Author: Peter TB Brett <peter@xxxxxxxxxxxxx>
Commit: Peter TB Brett <peter@xxxxxxxxxxxxx>
gschem: Modify o_complex_prepare_place() to take CLibSymbol arg.
This saves a roundtrip from s_clib_symbol_get_name() to
s_clib_symbol_get_data_by_name().
:100644 100644 468399c... 6f079f7... M gschem/include/prototype.h
:100644 100644 edd04f2... 95410ee... M gschem/src/o_complex.c
:100644 100644 20f7e74... 1d2b605... M gschem/src/x_compselect.c
=========
Changes
=========
commit 7b2ec0b1da38f6f078de4bb1ef61d100d9a5972e
Author: Peter TB Brett <peter@xxxxxxxxxxxxx>
Commit: Peter TB Brett <peter@xxxxxxxxxxxxx>
build-sys: Add check for groff html driver. [2836109]
Some distributions, such as Ubuntu, do not install the groff HTML
device by default, and an additional package must be installed to
provide it. AX_PROG_GROFF therefore needs to check that groff is able
to create HTML files.
diff --git a/gsymcheck/docs/Makefile.am b/gsymcheck/docs/Makefile.am
index 576a955..366b828 100644
--- a/gsymcheck/docs/Makefile.am
+++ b/gsymcheck/docs/Makefile.am
@@ -10,7 +10,7 @@ docsmandir = $(docdir)/man
docsman_DATA = gsymcheck.html
.1.html:
-if ENABLE_GROFF
+if ENABLE_GROFF_HTML
LC_NUMERIC=C $(GROFF) -man -T html $< > $@.tmp \
&& mv -f $@.tmp $@
else
diff --git a/m4/geda-groff.m4 b/m4/geda-groff.m4
index 8181a57..a0c7881 100644
--- a/m4/geda-groff.m4
+++ b/m4/geda-groff.m4
@@ -1,7 +1,7 @@
# geda-groff.m4 -*-Autoconf-*-
# serial 1
-dnl Carry out configuration tasks needed by desktop-i18n tool
+dnl Look for GNU troff
dnl Copyright (C) 2009 Peter Brett <peter@xxxxxxxxxxxxx>
dnl
dnl This program is free software; you can redistribute it and/or modify
@@ -24,6 +24,21 @@ AC_DEFUN([AX_PROG_GROFF],
AC_ARG_VAR([GROFF], [Path to groff executable])
AC_CHECK_PROG([GROFF], [groff], [groff], [no])
- AM_CONDITIONAL([ENABLE_GROFF],
- [test "X$groff" != Xno])
+ # Some distros are annoying and package groff into a crippled
+ # version without many of the drivers, along with a separate full
+ # version. So explicitly check for the html driver.
+ if test "X$GROFF" != "Xno" ; then
+ AC_MSG_CHECKING([whether $GROFF has an html driver])
+ echo '.TH conftest 1 "January 1st, 1970" Version 1' > conftest.1
+ if LC_NUMERIC=C $GROFF -man -T html > /dev/null 2>&AS_MESSAGE_LOG_FD; then
+ HAVE_GROFF_HTML=yes
+ else
+ HAVE_GROFF_HTML=no
+ fi
+ rm -f conftest.1
+ AC_MSG_RESULT([$HAVE_GROFF_HTML])
+ fi
+
+ AM_CONDITIONAL([ENABLE_GROFF_HTML],
+ [test "X$HAVE_GROFF_HTML" != Xno])
])dnl AX_PROG_GROFF
commit a419f4f196ef6574940d082d88f46b95bbeb0ea9
Author: Peter TB Brett <peter@xxxxxxxxxxxxx>
Commit: Peter TB Brett <peter@xxxxxxxxxxxxx>
libgeda: Make o_complex_promote_attribs() respect keep_invisible. [2460301]
Placing components from the component selector should respect
TOPLEVEL->keep_invisible when deciding how to deal with promoted
attributes.
diff --git a/libgeda/src/o_complex_basic.c b/libgeda/src/o_complex_basic.c
index 6af6446..35aa709 100644
--- a/libgeda/src/o_complex_basic.c
+++ b/libgeda/src/o_complex_basic.c
@@ -309,21 +309,45 @@ static GList *o_complex_get_promotable (TOPLEVEL *toplevel, OBJECT *object, int
}
-/*! \brief Promote attributes from the passed complex OBJECT
- *
+/*! \brief Promote attributes from a complex OBJECT
* \par Function Description
- * Promotes attributes from the passed complex OBJECT, detaching
- * them from inside the object and returning them in a list.
+ * Selects promotable attributes from \a object, and returns a new
+ * #GList containing them (suitable for appending to a #PAGE).
*
- * \param [in] toplevel The toplevel environment.
- * \param [in] object The complex who's attributes are being promoted.
- * \return A GList list of promoted attributes.
+ * \param [in] toplevel The #TOPLEVEL environment.
+ * \param [in] object The complex #OBJECT to promote from.
+ * \return A #GList of promoted attributes.
*/
GList *o_complex_promote_attribs (TOPLEVEL *toplevel, OBJECT *object)
{
- GList *promoted;
+ GList *promoted = NULL;
+ GList *promotable = NULL;
+ GList *iter = NULL;
+
+ promotable = o_complex_get_promotable (toplevel, object, FALSE);
- promoted = o_complex_get_promotable (toplevel, object, TRUE);
+ /* Run through the attributes deciding if we want to keep them (in
+ * which case we copy them and make them invisible) or if we want to
+ * remove them. */
+ if (toplevel->keep_invisible) {
+ for (iter = promotable; iter != NULL; iter = g_list_next (iter)) {
+ OBJECT *o_kept = (OBJECT *) iter->data;
+ OBJECT *o_copy = o_object_copy (toplevel, o_kept,
+ toplevel->ADDING_SEL);
+ o_kept->visibility = INVISIBLE;
+ o_copy->parent = NULL;
+ promoted = g_list_prepend (promoted, o_copy);
+ }
+ promoted = g_list_reverse (promoted);
+ } else {
+ for (iter = promotable; iter != NULL; iter = g_list_next (iter)) {
+ OBJECT *o_removed = (OBJECT *) iter->data;
+ o_removed->parent = NULL;
+ object->complex->prim_objs =
+ g_list_remove (object->complex->prim_objs, o_removed);
+ }
+ promoted = promotable;
+ }
/* Attach promoted attributes to the original complex object */
o_attrib_attach_list (toplevel, promoted, object, TRUE);
commit ea46d8defce4390b9650e8d2a5035de4794673df
Author: Peter TB Brett <peter@xxxxxxxxxxxxx>
Commit: Peter TB Brett <peter@xxxxxxxxxxxxx>
libgeda: Make o_complex_copy() actually copy. [2460301]
In the past, o_complex_copy() has instantiated a new COMPLEX by
calling o_complex_new(), which reads in symbol data from the symbol
library. A separate o_complex_copy_embedded() function performed a
copy for embedded objects, by actually performing a deep copy of the
COMPLEX to be copied.
Also note that components being placed from the component selector are
copied into place.
This lead to a bug reported by Peter Clifton, whereby the contents of
an embedded symbol could vary.
- If placed normally and then embedded, the attributes promoted out of
the COMPLEX prior to preparing to place were "resurrected" by the
magical file-reading powers of o_complex_copy(), and these
attributes were then kept when the symbol was embedded.
- If placed as embedded, the attributes were *not* resurrected,
meaning that the promotable attributes were *not* present in the
embedded symbol.
This patch modifies o_complex_copy() to explicitly carry out a deep
copy of the object to be copied, removing the file-reading behaviour
(this seems to be the Right Thing in this context). It also removes
o_complex_copy_embedded(), since it is then superfluous.
diff --git a/libgeda/include/libgeda/prototype.h b/libgeda/include/libgeda/prototype.h
index 77d608f..731f753 100644
--- a/libgeda/include/libgeda/prototype.h
+++ b/libgeda/include/libgeda/prototype.h
@@ -170,7 +170,6 @@ OBJECT *o_complex_new_embedded(TOPLEVEL *toplevel, char type, int color, int x,
void o_complex_set_filename(TOPLEVEL *toplevel, const char *basename);
void o_complex_translate_world(TOPLEVEL *toplevel, int dx, int dy, OBJECT *object);
OBJECT *o_complex_copy(TOPLEVEL *toplevel, OBJECT *o_current);
-OBJECT *o_complex_copy_embedded(TOPLEVEL *toplevel, OBJECT *o_current);
void o_complex_rotate_world(TOPLEVEL *toplevel, int world_centerx, int world_centery, int angle, OBJECT *object);
void o_complex_mirror_world(TOPLEVEL *toplevel, int world_centerx, int world_centery, OBJECT *object);
OBJECT *o_complex_find_pin_by_attribute(OBJECT *object, char *name, char *wanted_value);
diff --git a/libgeda/src/o_complex_basic.c b/libgeda/src/o_complex_basic.c
index 23f9f7b..6af6446 100644
--- a/libgeda/src/o_complex_basic.c
+++ b/libgeda/src/o_complex_basic.c
@@ -766,91 +766,60 @@ void o_complex_translate_world(TOPLEVEL *toplevel, int dx, int dy,
o_complex_recalc (toplevel, object);
}
-/*! \brief create a copy of a complex object
+/*! \brief Create a copy of a COMPLEX object
* \par Function Description
* This function creates a copy of the complex object \a o_current.
*
* \param [in] toplevel The TOPLEVEL object
* \param [in] o_current The object that is copied
- * \return a new complex object
+ * \return a new COMPLEX object
*/
OBJECT *o_complex_copy(TOPLEVEL *toplevel, OBJECT *o_current)
{
- OBJECT *new_obj=NULL;
- int selectable;
- const CLibSymbol *clib = NULL;
+ OBJECT *o_new;
+ GList *iter;
g_return_val_if_fail(o_current != NULL, NULL);
- selectable = (o_current->sel_func != NULL);
+ o_new = s_basic_new_object(o_current->type, "complex");
+ o_new->color = o_current->color;
+ o_new->complex_basename = g_strdup(o_current->complex_basename);
+ o_new->complex_embedded = o_current->complex_embedded;
+ o_new->sel_func = o_current->sel_func;
+ o_new->draw_func = o_current->draw_func;
+
+ o_new->complex = g_malloc0(sizeof(COMPLEX));
+ o_new->complex->x = o_current->complex->x;
+ o_new->complex->y = o_current->complex->y;
+ o_new->complex->angle = o_current->complex->angle;
+ o_new->complex->mirror = o_current->complex->mirror;
+
+ /* Copy contents and set the parent pointers on the copied objects. */
+ o_new->complex->prim_objs =
+ o_glist_copy_all (toplevel, o_current->complex->prim_objs,
+ NULL, toplevel->ADDING_SEL);
- clib = s_clib_get_symbol_by_name (o_current->complex_basename);
+ for (iter = o_new->complex->prim_objs;
+ iter != NULL;
+ iter = g_list_next (iter)) {
+ ((OBJECT*) iter->data)->parent = o_new;
+ }
- new_obj = o_complex_new (toplevel, o_current->type, o_current->color,
- o_current->complex->x, o_current->complex->y,
- o_current->complex->angle,
- o_current->complex->mirror,
- clib, o_current->complex_basename,
- selectable);
+ /* Recalculate bounds */
+ o_complex_recalc(toplevel, o_new);
/* Delete or hide attributes eligible for promotion inside the complex */
- o_complex_remove_promotable_attribs (toplevel, new_obj);
-
- o_attrib_slot_update (toplevel, new_obj);
-
- /* deal with stuff that has changed */
-
- /* here you need to create a list of attributes which need to be
- * connected to the new list, probably make an attribute list and
- * fill it with sid's of the attributes */
-
- return new_obj;
-}
-
-/*! \brief create a copy of a embedded complex object
- * \par Function Description
- * This function creates a copy of an embedded complex object \a o_current.
- *
- * \param [in] toplevel The TOPLEVEL object
- * \param [in] o_current The object that is copied
- * \return a new complex object
- */
-OBJECT *o_complex_copy_embedded(TOPLEVEL *toplevel, OBJECT *o_current)
-{
- OBJECT *new_obj=NULL;
- GList *iter;
- int selectable;
-
- g_return_val_if_fail(o_current != NULL, NULL);
+ o_complex_remove_promotable_attribs (toplevel, o_new);
- selectable = (o_current->sel_func != NULL);
-
- new_obj = o_complex_new_embedded (toplevel, o_current->type, o_current->color,
- o_current->complex->x, o_current->complex->y,
- o_current->complex->angle,
- o_current->complex->mirror,
- o_current->complex_basename,
- selectable);
+ o_attrib_slot_update (toplevel, o_new);
/* deal with stuff that has changed */
- new_obj->complex->prim_objs =
- o_glist_copy_all (toplevel, o_current->complex->prim_objs,
- new_obj->complex->prim_objs, toplevel->ADDING_SEL);
-
- /* set the parent field now */
- for (iter = new_obj->complex->prim_objs; iter != NULL; iter = g_list_next (iter)) {
- OBJECT *tmp = iter->data;
- tmp->parent = new_obj;
- }
-
- o_complex_recalc(toplevel, new_obj);
-
- /* here you need to create a list of attributes which need to be
+ /* here you need to create a list of attributes which need to be
* connected to the new list, probably make an attribute list and
* fill it with sid's of the attributes */
- return new_obj;
+ return o_new;
}
diff --git a/libgeda/src/o_list.c b/libgeda/src/o_list.c
index b4bc97a..f0385f4 100644
--- a/libgeda/src/o_list.c
+++ b/libgeda/src/o_list.c
@@ -83,11 +83,7 @@ OBJECT *o_object_copy (TOPLEVEL *toplevel,
case(OBJ_COMPLEX):
case(OBJ_PLACEHOLDER):
- if (o_complex_is_embedded (selected)) {
- new_obj = o_complex_copy_embedded (toplevel, selected);
- } else {
- new_obj = o_complex_copy (toplevel, selected);
- }
+ new_obj = o_complex_copy (toplevel, selected);
break;
case(OBJ_TEXT):
commit 476299cad187c839cb252d6d2d985590f99bb6e9
Author: Peter TB Brett <peter@xxxxxxxxxxxxx>
Commit: Peter TB Brett <peter@xxxxxxxxxxxxx>
gschem: Modify o_complex_prepare_place() to take CLibSymbol arg.
This saves a roundtrip from s_clib_symbol_get_name() to
s_clib_symbol_get_data_by_name().
diff --git a/gschem/include/prototype.h b/gschem/include/prototype.h
index 468399c..6f079f7 100644
--- a/gschem/include/prototype.h
+++ b/gschem/include/prototype.h
@@ -549,7 +549,7 @@ void o_circle_draw_grips(GSCHEM_TOPLEVEL *w_current, OBJECT *o_current);
/* o_complex.c */
void o_complex_draw(GSCHEM_TOPLEVEL *w_current, OBJECT *o_current);
void o_complex_draw_place(GSCHEM_TOPLEVEL *w_current, int dx, int dy, OBJECT *complex);
-void o_complex_prepare_place(GSCHEM_TOPLEVEL *w_current, const char *sym_name);
+void o_complex_prepare_place(GSCHEM_TOPLEVEL *w_current, const CLibSymbol *sym);
void o_complex_place_changed_run_hook(GSCHEM_TOPLEVEL *w_current);
void o_complex_end(GSCHEM_TOPLEVEL *w_current, int x, int y, int continue_placing);
void o_complex_translate_all(GSCHEM_TOPLEVEL *w_current, int offset);
diff --git a/gschem/src/o_complex.c b/gschem/src/o_complex.c
index edd04f2..95410ee 100644
--- a/gschem/src/o_complex.c
+++ b/gschem/src/o_complex.c
@@ -66,13 +66,13 @@ void o_complex_draw_place (GSCHEM_TOPLEVEL *w_current, int dx, int dy, OBJECT *o
* \par Function Description
*
*/
-void o_complex_prepare_place(GSCHEM_TOPLEVEL *w_current, const char *sym_name)
+void o_complex_prepare_place(GSCHEM_TOPLEVEL *w_current, const CLibSymbol *sym)
{
TOPLEVEL *toplevel = w_current->toplevel;
GList *temp_list;
OBJECT *o_current;
char *buffer;
- const CLibSymbol *sym;
+ const gchar *sym_name = s_clib_symbol_get_name (sym);
int redraw_state;
/* remove the old place list if it exists */
@@ -90,7 +90,7 @@ void o_complex_prepare_place(GSCHEM_TOPLEVEL *w_current, const char *sym_name)
temp_list = NULL;
toplevel->ADDING_SEL=1;
- buffer = s_clib_symbol_get_data_by_name (sym_name);
+ buffer = s_clib_symbol_get_data (sym);
temp_list = o_read_buffer (toplevel,
temp_list,
buffer, -1,
@@ -106,7 +106,6 @@ void o_complex_prepare_place(GSCHEM_TOPLEVEL *w_current, const char *sym_name)
OBJECT *new_object;
toplevel->ADDING_SEL = 1; /* reuse this flag, rename later hack */
- sym = s_clib_get_symbol_by_name (sym_name);
new_object = o_complex_new (toplevel, OBJ_COMPLEX, DEFAULT_COLOR,
0, 0, 0, 0, sym, sym_name, 1);
diff --git a/gschem/src/x_compselect.c b/gschem/src/x_compselect.c
index 20f7e74..1d2b605 100644
--- a/gschem/src/x_compselect.c
+++ b/gschem/src/x_compselect.c
@@ -155,7 +155,7 @@ x_compselect_callback_response (GtkDialog *dialog,
w_current->event_state = SELECT;
} else {
/* Otherwise set the new symbol to place */
- o_complex_prepare_place (w_current, s_clib_symbol_get_name (symbol));
+ o_complex_prepare_place (w_current, symbol);
}
break;
}
_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs