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

gEDA-cvs: pcb.git: branch: master updated (a1a89df145cae47d0f85afeae4b8e1e045a4d5c9)



The branch, master has been updated
       via  a1a89df145cae47d0f85afeae4b8e1e045a4d5c9 (commit)
      from  f568e65da130e42d3ccdb6a9e14452e85173df86 (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
=========

 src/hid/gtk/gtkhid-gdk.c |   38 ++++++++------------------------------
 src/hid/gtk/gtkhid-gl.c  |   32 ++++++--------------------------
 2 files changed, 14 insertions(+), 56 deletions(-)


=================
 Commit Messages
=================

commit a1a89df145cae47d0f85afeae4b8e1e045a4d5c9
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    hid/gtk: Use view_data struct to simplify saving and restoring views

:100644 100644 631e5b7... ce631a5... M	src/hid/gtk/gtkhid-gdk.c
:100644 100644 ea8dd40... 21a22e8... M	src/hid/gtk/gtkhid-gl.c

=========
 Changes
=========

commit a1a89df145cae47d0f85afeae4b8e1e045a4d5c9
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    hid/gtk: Use view_data struct to simplify saving and restoring views

diff --git a/src/hid/gtk/gtkhid-gdk.c b/src/hid/gtk/gtkhid-gdk.c
index 631e5b7..ce631a5 100644
--- a/src/hid/gtk/gtkhid-gdk.c
+++ b/src/hid/gtk/gtkhid-gdk.c
@@ -1165,25 +1165,17 @@ ghid_pinout_preview_expose (GtkWidget *widget,
 {
   GhidPinoutPreview *pinout = GHID_PINOUT_PREVIEW (widget);
   GdkDrawable *save_drawable;
-  double save_zoom;
-  int da_w, da_h;
-  int save_left, save_top;
+  view_data save_view;
   int save_width, save_height;
-  int save_view_width, save_view_height;
   double xz, yz;
   render_priv *priv = gport->render_priv;
 
-  save_zoom = gport->view.coord_per_px;
-  save_width = gport->width;
-  save_height = gport->height;
-  save_left = gport->view.x0;
-  save_top = gport->view.y0;
-  save_view_width = gport->view.width;
-  save_view_height = gport->view.height;
-
   /* Setup drawable and zoom factor for drawing routines
    */
   save_drawable = gport->drawable;
+  save_view = gport->view;
+  save_width = gport->width;
+  save_height = gport->height;
 
   gdk_window_get_geometry (widget->window, 0, 0, &da_w, &da_h, 0);
   xz = (double) pinout->x_max / da_w;
@@ -1208,13 +1200,9 @@ ghid_pinout_preview_expose (GtkWidget *widget,
   hid_expose_callback (&ghid_hid, NULL, &pinout->element);
 
   gport->drawable = save_drawable;
-  gport->view.coord_per_px = save_zoom;
+  gport->view = save_view;
   gport->width = save_width;
   gport->height = save_height;
-  gport->view.x0 = save_left;
-  gport->view.y0 = save_top;
-  gport->view.width = save_view_width;
-  gport->view.height = save_view_height;
 
   return FALSE;
 }
@@ -1224,21 +1212,15 @@ ghid_render_pixmap (int cx, int cy, double zoom, int width, int height, int dept
 {
   GdkPixmap *pixmap;
   GdkDrawable *save_drawable;
-  double save_zoom;
-  int save_left, save_top;
+  view_data save_view;
   int save_width, save_height;
-  int save_view_width, save_view_height;
   BoxType region;
   render_priv *priv = gport->render_priv;
 
   save_drawable = gport->drawable;
-  save_zoom = gport->view.coord_per_px;
+  save_view = gport->view;
   save_width = gport->width;
   save_height = gport->height;
-  save_left = gport->view.x0;
-  save_top = gport->view.y0;
-  save_view_width = gport->view.width;
-  save_view_height = gport->view.height;
 
   pixmap = gdk_pixmap_new (NULL, width, height, depth);
 
@@ -1273,13 +1255,9 @@ ghid_render_pixmap (int cx, int cy, double zoom, int width, int height, int dept
   hid_expose_callback (&ghid_hid, &region, NULL);
 
   gport->drawable = save_drawable;
-  gport->view.coord_per_px = save_zoom;
+  gport->view = save_view;
   gport->width = save_width;
   gport->height = save_height;
-  gport->view.x0 = save_left;
-  gport->view.y0 = save_top;
-  gport->view.width = save_view_width;
-  gport->view.height = save_view_height;
 
   return pixmap;
 }
diff --git a/src/hid/gtk/gtkhid-gl.c b/src/hid/gtk/gtkhid-gl.c
index ea8dd40..21a22e8 100644
--- a/src/hid/gtk/gtkhid-gl.c
+++ b/src/hid/gtk/gtkhid-gl.c
@@ -1028,20 +1028,14 @@ ghid_pinout_preview_expose (GtkWidget *widget,
   GdkGLContext* pGlContext = gtk_widget_get_gl_context (widget);
   GdkGLDrawable* pGlDrawable = gtk_widget_get_gl_drawable (widget);
   GhidPinoutPreview *pinout = GHID_PINOUT_PREVIEW (widget);
-  double save_zoom;
   int da_w, da_h;
-  int save_left, save_top;
+  view_data save_view;
   int save_width, save_height;
-  int save_view_width, save_view_height;
   double xz, yz;
 
-  save_zoom = gport->view.coord_per_px;
+  save_view = gport->view;
   save_width = gport->width;
   save_height = gport->height;
-  save_left = gport->view.x0;
-  save_top = gport->view.y0;
-  save_view_width = gport->view.width;
-  save_view_height = gport->view.height;
 
   /* Setup zoom factor for drawing routines */
 
@@ -1116,13 +1110,9 @@ ghid_pinout_preview_expose (GtkWidget *widget,
   gport->render_priv->in_context = false;
   gdk_gl_drawable_gl_end (pGlDrawable);
 
-  gport->view.coord_per_px = save_zoom;
+  gport->view = save_view;
   gport->width = save_width;
   gport->height = save_height;
-  gport->view.x0 = save_left;
-  gport->view.y0 = save_top;
-  gport->view.width = save_view_width;
-  gport->view.height = save_view_height;
 
   return FALSE;
 }
@@ -1136,19 +1126,13 @@ ghid_render_pixmap (int cx, int cy, double zoom, int width, int height, int dept
   GdkGLPixmap *glpixmap;
   GdkGLContext* glcontext;
   GdkGLDrawable* gldrawable;
-  double save_zoom;
-  int save_left, save_top;
+  view_data save_view;
   int save_width, save_height;
-  int save_view_width, save_view_height;
   BoxType region;
 
-  save_zoom = gport->view.coord_per_px;
+  save_view = gport->view;
   save_width = gport->width;
   save_height = gport->height;
-  save_left = gport->view.x0;
-  save_top = gport->view.y0;
-  save_view_width = gport->view.width;
-  save_view_height = gport->view.height;
 
   /* Setup rendering context for drawing routines
    */
@@ -1240,13 +1224,9 @@ ghid_render_pixmap (int cx, int cy, double zoom, int width, int height, int dept
   g_object_unref (glconfig);
   g_object_unref (glcontext);
 
-  gport->view.coord_per_px = save_zoom;
+  gport->view = save_view;
   gport->width = save_width;
   gport->height = save_height;
-  gport->view.x0 = save_left;
-  gport->view.y0 = save_top;
-  gport->view.width = save_view_width;
-  gport->view.height = save_view_height;
 
   return pixmap;
 }




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