[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
gEDA-cvs: branch: master updated (1.1.2.20070818-79-g903db04)
The branch, master has been updated
via 903db04d2174415fcc6ec6c0e7321d914a25b259 (commit)
via 20df014334dbd0b62e2ec3515ff932726c2a29c9 (commit)
via ccd73092afbe22bdd6ef9f17318481dc32e50c8a (commit)
from f914d437f4a76df5ba28e80e7dab6f55996a8b59 (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/o_basic.c | 12 ++++--------
gschem/src/x_dialog.c | 43 ++++++++++++++++++++-----------------------
libgeda/src/o_list.c | 36 ++++++++----------------------------
3 files changed, 32 insertions(+), 59 deletions(-)
=================
Commit Messages
=================
commit 903db04d2174415fcc6ec6c0e7321d914a25b259
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date: Tue Oct 9 22:28:54 2007 +0100
Tidy implementation of o_list_copy_all() to be more concise.
:100644 100644 bb38fb0... 60d2867... M libgeda/src/o_list.c
commit 20df014334dbd0b62e2ec3515ff932726c2a29c9
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date: Tue Oct 9 22:27:02 2007 +0100
Tidy o_redraw() to be more concise and have a tighter inner loop.
:100644 100644 51ea8ae... 59a777c... M gschem/src/o_basic.c
commit ccd73092afbe22bdd6ef9f17318481dc32e50c8a
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date: Tue Oct 9 22:05:22 2007 +0100
Avoid use of global_window_current in gschem/src/x_dialog.c: color_set()
:100644 100644 717a7b6... cee6206... M gschem/src/x_dialog.c
=========
Changes
=========
commit 903db04d2174415fcc6ec6c0e7321d914a25b259
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date: Tue Oct 9 22:28:54 2007 +0100
Tidy implementation of o_list_copy_all() to be more concise.
diff --git a/libgeda/src/o_list.c b/libgeda/src/o_list.c
index bb38fb0..60d2867 100644
--- a/libgeda/src/o_list.c
+++ b/libgeda/src/o_list.c
@@ -151,28 +151,20 @@ OBJECT *o_list_copy_to(TOPLEVEL *toplevel, OBJECT *list_head,
* \return OBJECT pointer.
*/
OBJECT *o_list_copy_all(TOPLEVEL *toplevel, OBJECT *src_list_head,
- OBJECT *dest_list_head, int flag)
+ OBJECT *dest_list_head, int flag)
{
OBJECT *src;
OBJECT *dest;
- OBJECT *temp_parent=NULL;
int adding_sel_save;
src = src_list_head;
dest = dest_list_head;
- temp_parent = toplevel->page_current->object_parent;
- toplevel->page_current->object_parent = dest_list_head;
- if (dest == NULL) {
- toplevel->page_current->object_parent = temp_parent;
- return(NULL);
- }
-
- if (src == NULL) {
- toplevel->page_current->object_parent = temp_parent;
+ if (src == NULL || dest == NULL) {
return(NULL);
}
+ /* Save ADDING_SEL as o_list_copy_to() sets it */
adding_sel_save = toplevel->ADDING_SEL;
/* first do all NON text items */
@@ -181,7 +173,7 @@ OBJECT *o_list_copy_all(TOPLEVEL *toplevel, OBJECT *src_list_head,
if (src->type != OBJ_TEXT) {
dest->next = o_list_copy_to(toplevel, NULL, src, flag,
NULL);
-
+
dest->next->prev = dest;
dest = dest->next;
dest->sid = global_sid++;
@@ -193,32 +185,21 @@ OBJECT *o_list_copy_all(TOPLEVEL *toplevel, OBJECT *src_list_head,
src = src_list_head;
/*dest = dest_list_head; out since we want to add to the end */
- if (dest == NULL) {
- toplevel->page_current->object_parent = temp_parent;
- return(NULL);
- }
-
- if (src == NULL) {
- toplevel->page_current->object_parent = temp_parent;
- return(NULL);
- }
-
/* then do all text items */
while(src != NULL) {
if (src->type == OBJ_TEXT) {
dest->next = o_list_copy_to(toplevel, NULL, src, flag,
NULL);
-
+
dest->next->prev = dest;
dest = dest->next;
dest->sid = global_sid++;
-
+
if (src->attached_to /*&& !toplevel->ADDING_SEL*/) {
if (src->attached_to->copied_to) {
- o_attrib_attach(toplevel,
- toplevel->page_current->object_parent,
- dest, src->attached_to->copied_to);
+ o_attrib_attach(toplevel, dest_list_head,
+ dest, src->attached_to->copied_to);
}
}
}
@@ -234,7 +215,6 @@ OBJECT *o_list_copy_all(TOPLEVEL *toplevel, OBJECT *src_list_head,
}
toplevel->ADDING_SEL = adding_sel_save;
- toplevel->page_current->object_parent = temp_parent;
return(dest);
}
commit 20df014334dbd0b62e2ec3515ff932726c2a29c9
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date: Tue Oct 9 22:27:02 2007 +0100
Tidy o_redraw() to be more concise and have a tighter inner loop.
diff --git a/gschem/src/o_basic.c b/gschem/src/o_basic.c
index 51ea8ae..59a777c 100644
--- a/gschem/src/o_basic.c
+++ b/gschem/src/o_basic.c
@@ -116,22 +116,18 @@ void o_redraw(GSCHEM_TOPLEVEL *w_current, OBJECT *object_list, gboolean draw_sel
OBJECT *o_current = object_list;
int redraw_state = toplevel->DONT_REDRAW;
+ w_current->inside_redraw = 1;
while (o_current != NULL) {
if ((o_current->draw_func != NULL) &&
(o_current->type != OBJ_HEAD)) {
- if (o_current->selected && !draw_selected) {
- toplevel->DONT_REDRAW = 1 || redraw_state;
- }
- else {
- toplevel->DONT_REDRAW = 0 || redraw_state;
- }
- w_current->inside_redraw = 1;
+ toplevel->DONT_REDRAW = redraw_state ||
+ (!draw_selected && o_current->selected);
(*o_current->draw_func)(w_current, o_current);
- w_current->inside_redraw = 0;
}
o_current = o_current->next;
}
+ w_current->inside_redraw = 0;
toplevel->DONT_REDRAW = redraw_state;
}
commit ccd73092afbe22bdd6ef9f17318481dc32e50c8a
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date: Tue Oct 9 22:05:22 2007 +0100
Avoid use of global_window_current in gschem/src/x_dialog.c: color_set()
diff --git a/gschem/src/x_dialog.c b/gschem/src/x_dialog.c
index 717a7b6..cee6206 100644
--- a/gschem/src/x_dialog.c
+++ b/gschem/src/x_dialog.c
@@ -78,6 +78,11 @@ struct fill_type_data {
GList *objects;
};
+struct color_set_data_st {
+ GSCHEM_TOPLEVEL *w_current;
+ int index;
+};
+
/*! \todo Finish function documentation!!!
* \brief
* \par Function Description
@@ -2169,17 +2174,9 @@ void coord_dialog (GSCHEM_TOPLEVEL *w_current, int x, int y)
*/
gint color_set(GtkWidget *w, gpointer data)
{
- int index;
+ struct color_set_data_st *color_set_data = (struct color_set_data_st *)data;
- /*
- * here we really are passing an int sized piece of data, the index rather
- * than a pointer and we shouldn't have issues as long as
- * sizeof(void *) >= sizeof(int)
- */
- index = GPOINTER_TO_INT( data );
-
- /* hate to use this here... but I have to... */
- global_window_current->edit_color = index;
+ color_set_data->w_current->edit_color = color_set_data->index;
return(0);
}
@@ -2268,6 +2265,7 @@ static GtkWidget *create_color_menu (GSCHEM_TOPLEVEL * w_current, int * select_i
char *buf;
char *menu_string;
char *temp=NULL;
+ struct color_set_data_st *color_set_data;
/* first lets see if we have a selected object, if so select its color */
int select_col = -1;
@@ -2311,22 +2309,21 @@ static GtkWidget *create_color_menu (GSCHEM_TOPLEVEL * w_current, int * select_i
menuitem));
gtk_menu_append (GTK_MENU (menu), menuitem);
-
- gtk_signal_connect (GTK_OBJECT (menuitem),
- "activate",
- (GtkSignalFunc) color_set,
- GINT_TO_POINTER( index ));
-
- /* I have no idea if doing the above cast is valid,
- * since index isn't a pointer, it's just being
- * treated as one, it's then cast to an int in
- * color_set. This should be ok as long as
- * sizeof(void *) >= sizeof(int)
- */
+
+ color_set_data = g_new0 (struct color_set_data_st, 1);
+ color_set_data->w_current = w_current;
+ color_set_data->index = index;
+
+ g_signal_connect_data (GTK_OBJECT (menuitem),
+ "activate",
+ G_CALLBACK (color_set),
+ color_set_data,
+ (GClosureNotify) g_free,
+ 0 /* GConnectFlags */);
if (select_col == -1){
/* set the default to the current color */
- if (index == global_window_current->edit_color) {
+ if (index == w_current->edit_color) {
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menuitem), TRUE);
/*fprintf(stderr, "checking item %d\n", index); */
*select_index = item_index;
_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs