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

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



The branch, master has been updated
       via  60b0ea93b440c505628429637688e8a9ed6eda43 (commit)
       via  34a21a5b21bb80dea76164972d7ae7b9756eb6a2 (commit)
       via  c3038ad2b4325ddd0ec3769d31c355d7e8f0b211 (commit)
       via  d6dd08b4e0c1257994de834f07f194f1855c1606 (commit)
       via  e08826eec68b844e7b260a6176916a6f04d2f50b (commit)
       via  cda6dec709ca096e8ac3df4d087e445527831a14 (commit)
       via  3a02a899c62e2fcbddea0fadea1de2a52bab97c0 (commit)
      from  b99fde814d5c3e1ba6ba02512a5d582376ed9aea (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
=========

 configure.ac                    |   13 +---
 src/hid/gtk/gtkhid-gdk.c        |   15 ----
 src/hid/gtk/gtkhid-main.c       |  163 ++++++++++-----------------------------
 src/hid/gtk/gui-dialog.c        |    2 -
 src/hid/gtk/gui-output-events.c |    9 +--
 5 files changed, 47 insertions(+), 155 deletions(-)


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

commit 60b0ea93b440c505628429637688e8a9ed6eda43
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    hid/gtk: Remove unused Vx2 and Vy2 functions from gtkhid-{main,gdk}.c

:100644 100644 b1dc11d... 0a2cc59... M	src/hid/gtk/gtkhid-gdk.c
:100644 100644 6b2dd87... 9fd781c... M	src/hid/gtk/gtkhid-main.c

commit 34a21a5b21bb80dea76164972d7ae7b9756eb6a2
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    hid/gtk: Remove unused file scope variables event_x and event_y

:100644 100644 569a09b... e0120b6... M	src/hid/gtk/gui-output-events.c

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

    hid/gtk: Compute warp pointer offset without reading current position
    
    This is closer to the way the old code which used the an XWarpPointer
    call worked, and makes the two code-paths where we warp the pointer
    consistent. Also, remove some unnecessary comments which were more
    relevant to explain why we previously had too implementations.

:100644 100644 d3df2f9... 6b2dd87... M	src/hid/gtk/gtkhid-main.c

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

    hid/gtk: Fix "Center" action in a couple of ways
    
    We need to update the adjustments together otherwise the center
    action will only work on one axis at a time.
    
    Fix typo for out-of bounds check which mixed width and height.

:100644 100644 991c97d... d3df2f9... M	src/hid/gtk/gtkhid-main.c

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

    hid/gtk: Clean up mouse warping code now we require a later GTK version
    
    Remove the X11 specific implementation and remove some comments in the
    GDK one which were more relevant to explain why we previously had two
    implementations.

:100644 100644 f606faa... cf685a7... M	configure.ac
:100644 100644 e91b68c... 991c97d... M	src/hid/gtk/gtkhid-main.c

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

    Cleanup conditional code now we require a later GTK version

:100644 100644 1f6b11a... 80c1157... M	src/hid/gtk/gui-dialog.c

commit 3a02a899c62e2fcbddea0fadea1de2a52bab97c0
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    Bump required GTK version in configure.ac test to 2.12
    
    This is required, as we utilise some of the newer APIs.
    
    NB: GTK+ 2.12.0 was released in September 2007

:100644 100644 abdd8a1... f606faa... M	configure.ac

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

commit 60b0ea93b440c505628429637688e8a9ed6eda43
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    hid/gtk: Remove unused Vx2 and Vy2 functions from gtkhid-{main,gdk}.c

diff --git a/src/hid/gtk/gtkhid-gdk.c b/src/hid/gtk/gtkhid-gdk.c
index b1dc11d..0a2cc59 100644
--- a/src/hid/gtk/gtkhid-gdk.c
+++ b/src/hid/gtk/gtkhid-gdk.c
@@ -28,21 +28,6 @@ extern HID ghid_hid;
 static int cur_mask = -1;
 static int mask_seq = 0;
 
-/* ------------------------------------------------------------ */
-
-static inline int
-Vx2 (int x)
-{
-  return (x - gport->view_x0) / gport->zoom + 0.5;
-}
-
-static inline int
-Vy2 (int y)
-{
-  return (y - gport->view_y0) / gport->zoom + 0.5;
-}
-
-/* ------------------------------------------------------------ */
 
 typedef struct hid_gc_struct
 {
diff --git a/src/hid/gtk/gtkhid-main.c b/src/hid/gtk/gtkhid-main.c
index 6b2dd87..9fd781c 100644
--- a/src/hid/gtk/gtkhid-main.c
+++ b/src/hid/gtk/gtkhid-main.c
@@ -33,21 +33,6 @@ static void zoom_by (double factor, int x, int y);
 
 int ghid_flip_x = 0, ghid_flip_y = 0;
 
-/* ------------------------------------------------------------ */
-
-static inline int 
-Vx2 (int x)
-{     
-  return (x - gport->view_x0) / gport->zoom + 0.5;
-}       
-        
-static inline int 
-Vy2 (int y)
-{     
-  return (y - gport->view_y0) / gport->zoom + 0.5;
-}       
-
-/* ------------------------------------------------------------ */
 
 static void
 ghid_pan_fixup ()

commit 34a21a5b21bb80dea76164972d7ae7b9756eb6a2
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    hid/gtk: Remove unused file scope variables event_x and event_y

diff --git a/src/hid/gtk/gui-output-events.c b/src/hid/gtk/gui-output-events.c
index 569a09b..e0120b6 100644
--- a/src/hid/gtk/gui-output-events.c
+++ b/src/hid/gtk/gui-output-events.c
@@ -214,8 +214,6 @@ ghid_port_ranges_zoom (gdouble zoom)
  * handles all events from PCB drawing area
  */
 
-static gint event_x, event_y;
-
 void
 ghid_get_coords (const char *msg, int *x, int *y)
 {
@@ -231,14 +229,13 @@ ghid_get_coords (const char *msg, int *x, int *y)
 gboolean
 ghid_note_event_location (GdkEventButton * ev)
 {
-  gint x, y;
+  gint event_x, event_y;
   gboolean moved;
 
   if (!ev)
     {
-      gdk_window_get_pointer (ghid_port.drawing_area->window, &x, &y, NULL);
-      event_x = x;
-      event_y = y;
+      gdk_window_get_pointer (ghid_port.drawing_area->window,
+                              &event_x, &event_y, NULL);
     }
   else
     {

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

    hid/gtk: Compute warp pointer offset without reading current position
    
    This is closer to the way the old code which used the an XWarpPointer
    call worked, and makes the two code-paths where we warp the pointer
    consistent. Also, remove some unnecessary comments which were more
    relevant to explain why we previously had too implementations.

diff --git a/src/hid/gtk/gtkhid-main.c b/src/hid/gtk/gtkhid-main.c
index d3df2f9..6b2dd87 100644
--- a/src/hid/gtk/gtkhid-main.c
+++ b/src/hid/gtk/gtkhid-main.c
@@ -1652,10 +1652,10 @@ currently within the window already.
 static int
 Center(int argc, char **argv, int x, int y)
 {
-  int x0, y0, w2, h2, dx, dy;
+  int x0, y0, w2, h2;
   GdkDisplay *display;
   GdkScreen *screen;
-  gint cx, cy;
+  int xofs, yofs;
 
   if (argc != 0)
     AFAIL (center);
@@ -1680,8 +1680,6 @@ Center(int argc, char **argv, int x, int y)
       y = y0 + h2;
     }
 
-  dx = (x0 - gport->view_x0) / gport->zoom ;
-  dy = (y0 - gport->view_y0) / gport->zoom;
   gport->view_x0 = x0;
   gport->view_y0 = y0;
 
@@ -1694,9 +1692,13 @@ Center(int argc, char **argv, int x, int y)
   display = gdk_display_get_default ();
   screen = gdk_display_get_default_screen (display);
 
-  /* figure out where the pointer is and then move it from there by the specified delta */
-  gdk_display_get_pointer (display, NULL, &cx, &cy, NULL);
-  gdk_display_warp_pointer (display, screen, cx - dx, cy - dy);
+  /*
+   * Figure out where the drawing area is on the screen because
+   * gdk_display_warp_pointer will warp relative to the whole display
+   * but the value we've been given is relative to your drawing area
+   */
+  gdk_window_get_origin (gport->drawing_area->window, &xofs, &yofs);
+  gdk_display_warp_pointer (display, screen, xofs + Vx (x), yofs + Vy (y));
 
   return 0;
 }

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

    hid/gtk: Fix "Center" action in a couple of ways
    
    We need to update the adjustments together otherwise the center
    action will only work on one axis at a time.
    
    Fix typo for out-of bounds check which mixed width and height.

diff --git a/src/hid/gtk/gtkhid-main.c b/src/hid/gtk/gtkhid-main.c
index 991c97d..d3df2f9 100644
--- a/src/hid/gtk/gtkhid-main.c
+++ b/src/hid/gtk/gtkhid-main.c
@@ -53,14 +53,14 @@ static void
 ghid_pan_fixup ()
 {
 
-  /* 
+  /*
    * don't pan so far to the right that we see way past the right 
    * edge of the board.
    */
   if (gport->view_x0 > PCB->MaxWidth - gport->view_width)
     gport->view_x0 = PCB->MaxWidth - gport->view_width;
 
-  /* 
+  /*
    * don't pan so far down that we see way past the bottom edge of
    * the board.
    */
@@ -74,20 +74,20 @@ ghid_pan_fixup ()
    if (gport->view_y0 < 0)
     gport->view_y0 = 0;
 
+  /* if we can see the entire board and some, then zoom to fit */
+  if (gport->view_width > PCB->MaxWidth &&
+      gport->view_height > PCB->MaxHeight)
+    {
+      zoom_by (1, 0, 0);
+      return;
+    }
 
-   /* if we can see the entire board and some, then zoom to fit */
-   if (gport->view_width > PCB->MaxWidth &&
-       gport->view_height > PCB->MaxHeight)
-     {
-       zoom_by (1, 0, 0);
-       return;
-     }
-
-   gtk_range_set_value (GTK_RANGE (ghidgui->h_range), gport->view_x0);
-   gtk_range_set_value (GTK_RANGE (ghidgui->v_range), gport->view_y0);
-
-   ghid_invalidate_all ();
+  ghidgui->adjustment_changed_holdoff = TRUE;
+  gtk_range_set_value (GTK_RANGE (ghidgui->h_range), gport->view_x0);
+  gtk_range_set_value (GTK_RANGE (ghidgui->v_range), gport->view_y0);
+  ghidgui->adjustment_changed_holdoff = FALSE;
 
+  ghid_port_ranges_changed();
 }
 
 /* ------------------------------------------------------------ */
@@ -1668,7 +1668,7 @@ Center(int argc, char **argv, int x, int y)
   x0 = x - w2;
   y0 = y - h2;
 
-  if (x0 < 0) 
+  if (x0 < 0)
     {
       x0 = 0;
       x = x0 + w2;
@@ -1677,7 +1677,7 @@ Center(int argc, char **argv, int x, int y)
   if (y0 < 0)
     {
       y0 = 0;
-      y = y0 + w2;
+      y = y0 + h2;
     }
 
   dx = (x0 - gport->view_x0) / gport->zoom ;

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

    hid/gtk: Clean up mouse warping code now we require a later GTK version
    
    Remove the X11 specific implementation and remove some comments in the
    GDK one which were more relevant to explain why we previously had two
    implementations.

diff --git a/configure.ac b/configure.ac
index f606faa..cf685a7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -721,15 +721,6 @@ Please review the following errors:
 $GTK_PKG_ERRORS])]
 	)
 	GTK_VERSION=`$PKG_CONFIG gtk+-2.0 --modversion`
-	
-	# if we are building for gtk >= 2.8.0, we can use gdk_display_warp_pointer()
-	# otherwise we need XWarpPointer and we'll pull in the required headers with
-	# gdk/gdkx.h and we'll need to link with X11
-	if ! $PKG_CONFIG gtk+-2.0 --atleast-version=2.8.0 ; then
-		CPPFLAGS="$CFLAGS $GTK_CFLAGS"
-		AC_CHECK_HEADERS([gdk/gdkx.h])
-	fi
-
 	GLIB_VERSION=`$PKG_CONFIG glib-2.0 --modversion`
 	;;
 
diff --git a/src/hid/gtk/gtkhid-main.c b/src/hid/gtk/gtkhid-main.c
index e91b68c..991c97d 100644
--- a/src/hid/gtk/gtkhid-main.c
+++ b/src/hid/gtk/gtkhid-main.c
@@ -20,11 +20,6 @@
 #include "gui.h"
 #include "hid/common/draw_helpers.h"
 
-
-#if !GTK_CHECK_VERSION(2,8,0) && defined(HAVE_GDK_GDKX_H)
-#include <gdk/gdkx.h>
-#endif
-
 #ifdef HAVE_LIBDMALLOC
 #include <dmalloc.h>
 #endif
@@ -489,41 +484,20 @@ ghid_set_crosshair (int x, int y, int action)
 
   if (action == HID_SC_WARP_POINTER)
     {
-#if GTK_CHECK_VERSION(2,8,0)
-    gint xofs, yofs;
-    GdkDisplay *display;
-    GdkScreen *screen;
-
-    display = gdk_display_get_default ();
-    screen = gdk_display_get_default_screen (display); 
-
-    /*
-     * Figure out where the drawing area is on the screen because
-     * gdk_display_warp_pointer will warp relative to the whole display
-     * but the value we've been given is relative to your drawing area
-     */ 
-    gdk_window_get_origin (gport->drawing_area->window, &xofs, &yofs);
-
-    /* 
-     * Note that under X11, gdk_display_warp_pointer is just a wrapper around XWarpPointer, but
-     * hopefully by avoiding the direct call to an X function we might still work under windows
-     * and other non-X11 based gdk's
-     */
-    gdk_display_warp_pointer (display, screen, xofs + Vx (x), yofs + Vy (y));
+      gint xofs, yofs;
+      GdkDisplay *display;
+      GdkScreen *screen;
 
+      display = gdk_display_get_default ();
+      screen = gdk_display_get_default_screen (display);
 
-#else
-#  ifdef HAVE_GDK_GDKX_H
-    gint xofs, yofs;
-    gdk_window_get_origin (gport->drawing_area->window, &xofs, &yofs);
-    XWarpPointer (GDK_DRAWABLE_XDISPLAY (gport->drawing_area->window),
-		  None, GDK_WINDOW_XID (gport->drawing_area->window),
-		  0, 0, 0, 0,
-		  xofs + Vx (x), yofs + Vy (y));
-#  else
-#    error  "sorry.  You need gtk+>=2.8.0 unless you are on X windows"
-#  endif
-#endif
+      /*
+       * Figure out where the drawing area is on the screen because
+       * gdk_display_warp_pointer will warp relative to the whole display
+       * but the value we've been given is relative to your drawing area
+       */
+      gdk_window_get_origin (gport->drawing_area->window, &xofs, &yofs);
+      gdk_display_warp_pointer (display, screen, xofs + Vx (x), yofs + Vy (y));
     }
 }
 
@@ -1679,7 +1653,10 @@ static int
 Center(int argc, char **argv, int x, int y)
 {
   int x0, y0, w2, h2, dx, dy;
- 
+  GdkDisplay *display;
+  GdkScreen *screen;
+  gint cx, cy;
+
   if (argc != 0)
     AFAIL (center);
 
@@ -1708,61 +1685,18 @@ Center(int argc, char **argv, int x, int y)
   gport->view_x0 = x0;
   gport->view_y0 = y0;
 
-
   ghid_pan_fixup ();
 
   /* Move the pointer to the center of the window, but only if it's
      currently within the window already.  Watch out for edges,
      though.  */
 
-#if GTK_CHECK_VERSION(2,8,0)
-  {
-    GdkDisplay *display;
-    GdkScreen *screen;
-    gint cx, cy;
-
-    display = gdk_display_get_default ();
-    screen = gdk_display_get_default_screen (display); 
-
-    /* figure out where the pointer is and then move it from there by the specified delta */
-    gdk_display_get_pointer (display, NULL, &cx, &cy, NULL); 
-    gdk_display_warp_pointer (display, screen, cx - dx, cy - dy);
-
-    /* 
-     * Note that under X11, gdk_display_warp_pointer is just a wrapper around XWarpPointer, but
-     * hopefully by avoiding the direct call to an X function we might still work under windows
-     * and other non-X11 based gdk's
-     */
-  }
-#else  
-#  ifdef HAVE_GDK_GDKX_H
-  {
-
-    Window w_src, w_dst; 
-    w_src = GDK_WINDOW_XID (gport->drawing_area->window);
-    w_dst = w_src;
+  display = gdk_display_get_default ();
+  screen = gdk_display_get_default_screen (display);
 
-    /* don't warp with the auto drc - that creates auto-scroll chaos */
-    if (TEST_FLAG (AUTODRCFLAG, PCB) && Settings.Mode == LINE_MODE
-	&& Crosshair.AttachedLine.State != STATE_FIRST)
-      return 0;
-    
-    XWarpPointer (GDK_DRAWABLE_XDISPLAY (gport->drawing_area->window),
-		 w_src, w_dst,
-		 0, 0, 0, 0,
-		 Vx2 (x), Vy2 (y));
-    
-    /* XWarpPointer creates Motion events normally bound to
-     *  EventMoveCrosshair.
-     *  We don't do any updates when EventMoveCrosshair
-     *  is called the next time to prevent from rounding errors
-     */
-    /* FIXME?
-     * IgnoreMotionEvents = ignore;
-     */
-  }
-#  endif
-#endif
+  /* figure out where the pointer is and then move it from there by the specified delta */
+  gdk_display_get_pointer (display, NULL, &cx, &cy, NULL);
+  gdk_display_warp_pointer (display, screen, cx - dx, cy - dy);
 
   return 0;
 }

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

    Cleanup conditional code now we require a later GTK version

diff --git a/src/hid/gtk/gui-dialog.c b/src/hid/gtk/gui-dialog.c
index 1f6b11a..80c1157 100644
--- a/src/hid/gtk/gui-dialog.c
+++ b/src/hid/gtk/gui-dialog.c
@@ -229,14 +229,12 @@ ghid_dialog_close_confirm ()
                           GTK_STOCK_SAVE,            GTK_RESPONSE_YES,
                           NULL);
 
-#if GTK_CHECK_VERSION (2,6,0)
   /* Set the alternative button order (ok, cancel, help) for other systems */
   gtk_dialog_set_alternative_button_order(GTK_DIALOG(dialog),
                                           GTK_RESPONSE_YES,
                                           GTK_RESPONSE_NO,
                                           GTK_RESPONSE_CANCEL,
                                           -1);
-#endif
 
   switch (gtk_dialog_run (GTK_DIALOG (dialog)))
     {

commit 3a02a899c62e2fcbddea0fadea1de2a52bab97c0
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    Bump required GTK version in configure.ac test to 2.12
    
    This is required, as we utilise some of the newer APIs.
    
    NB: GTK+ 2.12.0 was released in September 2007

diff --git a/configure.ac b/configure.ac
index abdd8a1..f606faa 100644
--- a/configure.ac
+++ b/configure.ac
@@ -715,8 +715,8 @@ for e in $HIDLIST; do
 		AC_MSG_ERROR([Cannot find pkg-config, make sure it is installed and in your PATH])
 	fi
 
-	PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.4.0, , 
-		[AC_MSG_ERROR([Cannot find gtk+ >= 2.4.0, install it and rerun ./configure
+	PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.12.0, ,
+		[AC_MSG_ERROR([Cannot find gtk+ >= 2.12.0, install it and rerun ./configure
 Please review the following errors:
 $GTK_PKG_ERRORS])]
 	)




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