[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
gEDA-cvs: branch: master updated (1.1.2.20070818-40-g1f336cc)
The branch, master has been updated
via 1f336cc81195dadaffd4bbec17e8a40950b7935b (commit)
via f60cb40a3c47595d1931540508e89643fdcece07 (commit)
from 23953797984fda7cb62dceef38ac26da25c2dcd2 (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
=========
libgeda/src/o_picture.c | 63 +++++++++++++++++++---------------------------
1 files changed, 26 insertions(+), 37 deletions(-)
=================
Commit Messages
=================
commit 1f336cc81195dadaffd4bbec17e8a40950b7935b
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date: Wed Sep 5 18:47:23 2007 +0100
Simplify test to call gdk_init() in o_read_picture()
Avoids testing a GtkWidget pointer in TOPLEVEL variable setup by gschem or
gattrib. Instead, just ensure we call gdk_init() at least once. If gschem
or gattrib already did, its not a problem as repeated calls aren't harmful.
:100644 100644 08fec40... 6ec5ccd... M libgeda/src/o_picture.c
commit f60cb40a3c47595d1931540508e89643fdcece07
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date: Wed Sep 5 18:47:23 2007 +0100
Tidy o_picture_copy(), avoiding use of some TOPLEVEL variables
:100644 100644 a5c7406... 08fec40... M libgeda/src/o_picture.c
=========
Changes
=========
commit 1f336cc81195dadaffd4bbec17e8a40950b7935b
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date: Wed Sep 5 18:47:23 2007 +0100
Simplify test to call gdk_init() in o_read_picture()
Avoids testing a GtkWidget pointer in TOPLEVEL variable setup by gschem or
gattrib. Instead, just ensure we call gdk_init() at least once. If gschem
or gattrib already did, its not a problem as repeated calls aren't harmful.
diff --git a/libgeda/src/o_picture.c b/libgeda/src/o_picture.c
index 08fec40..6ec5ccd 100644
--- a/libgeda/src/o_picture.c
+++ b/libgeda/src/o_picture.c
@@ -74,10 +74,8 @@ OBJECT *o_picture_read(TOPLEVEL *toplevel, OBJECT *object_list,
GdkPixbuf *pixbuf;
static char gdk_initialized=0;
- /* Initialize GDK first if it isn't a graphic app */
- /* i.e: it has no main window */
- if ( (toplevel->main_window == NULL) &&
- (gdk_initialized == 0)) {
+ /* Initialize GDK first in case this isn't a graphic app */
+ if (gdk_initialized == 0) {
gdk_init(NULL, NULL);
gdk_initialized = 1;
}
commit f60cb40a3c47595d1931540508e89643fdcece07
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date: Wed Sep 5 18:47:23 2007 +0100
Tidy o_picture_copy(), avoiding use of some TOPLEVEL variables
diff --git a/libgeda/src/o_picture.c b/libgeda/src/o_picture.c
index a5c7406..08fec40 100644
--- a/libgeda/src/o_picture.c
+++ b/libgeda/src/o_picture.c
@@ -723,6 +723,7 @@ OBJECT *o_picture_copy(TOPLEVEL *toplevel, OBJECT *list_tail,
{
OBJECT *new_obj;
int color;
+ GdkPixbuf *new_pixbuf;
if (o_current->saved_color == -1) {
color = o_current->color;
@@ -735,54 +736,44 @@ OBJECT *o_picture_copy(TOPLEVEL *toplevel, OBJECT *list_tail,
* be modified.
*/
+ /* Copy the picture data */
+ new_pixbuf =
+ gdk_pixbuf_scale_simple(o_current->picture->original_picture,
+ gdk_pixbuf_get_width (o_current->picture->original_picture),
+ gdk_pixbuf_get_height (o_current->picture->original_picture),
+ GDK_INTERP_BILINEAR);
+
/* create and link a new picture object */
new_obj = o_picture_add(toplevel, list_tail,
- toplevel->current_pixbuf,
- toplevel->pixbuf_filename,
- toplevel->pixbuf_wh_ratio,
- OBJ_PICTURE,
- 0, 0, 0, 0, 0, FALSE, FALSE);
+ new_pixbuf,
+ o_current->picture->filename,
+ o_current->picture->ratio,
+ OBJ_PICTURE,
+ o_current->picture->upper_x,
+ o_current->picture->upper_y,
+ o_current->picture->lower_x,
+ o_current->picture->lower_y,
+ o_current->picture->angle,
+ o_current->picture->mirrored,
+ o_current->picture->embedded);
/* The dimensions of the new picture are set with the ones of the
* original picture. The two picturees have the same line type and
* the same filling options.
- *
- * The coordinates and the values in screen unit are computed with
- * #o_picture_recalc().
*/
- /* modifying */
- /* pb20011002 - have to check if o_current is a picture object */
- new_obj->picture->upper_x = o_current->picture->upper_x;
- new_obj->picture->upper_y = o_current->picture->upper_y;
- new_obj->picture->lower_x = o_current->picture->lower_x;
- new_obj->picture->lower_y = o_current->picture->lower_y;
-
- /* Copy the picture data */
- new_obj->picture->original_picture =
- gdk_pixbuf_scale_simple(o_current->picture->original_picture,
- gdk_pixbuf_get_width (o_current->picture->original_picture),
- gdk_pixbuf_get_height (o_current->picture->original_picture),
- GDK_INTERP_BILINEAR);
+
new_obj->picture->displayed_picture =
gdk_pixbuf_scale_simple(o_current->picture->displayed_picture,
- gdk_pixbuf_get_width (o_current->picture->displayed_picture),
- gdk_pixbuf_get_height (o_current->picture->displayed_picture),
- GDK_INTERP_BILINEAR);
+ gdk_pixbuf_get_width (o_current->picture->displayed_picture),
+ gdk_pixbuf_get_height (o_current->picture->displayed_picture),
+ GDK_INTERP_BILINEAR);
- new_obj->picture->ratio = o_current->picture->ratio;
- new_obj->picture->filename = g_strdup(o_current->picture->filename);
-
- new_obj->picture->angle = o_current->picture->angle;
- new_obj->picture->mirrored = o_current->picture->mirrored;
-
- o_picture_recalc(toplevel, new_obj);
-
/* new_obj->attribute = 0;*/
o_attrib_list_copied_to (o_current->attribs, new_obj);
/* return the new tail of the object list */
return(new_obj);
-}
+}
/*! \brief Get RGB data from image.
* \par Function Description
_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs