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

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



The branch, master has been updated
       via  ea0558a0353948ea26bfb1eafd1b11db5d7fb2b0 (commit)
       via  332cb8ddc1cc032ac29c7d2b9a0051ccc228b6da (commit)
       via  7accf3312d2a93162bbb4dbb6c7e972e8e8d2487 (commit)
      from  30be45bbf73d23c6e274c2cad804fe5af076cbba (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         |   61 ++++++++++++++++++++++++++++++++++++++
 src/hid/gtk/gtkhid-main.c        |   45 ----------------------------
 src/hid/gtk/gui-output-events.c  |    7 ++++
 src/hid/gtk/gui-pinout-preview.c |   21 +++++++++++++
 src/hid/gtk/gui-top-window.c     |    1 +
 src/hid/gtk/gui.h                |    4 ++
 6 files changed, 94 insertions(+), 45 deletions(-)


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

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

    hid/gtk: Move set_layer function into GDK specific code.
    
    Not that this is particularly GDK specific, just that the GL
    renderer hopefully coming soon needs to do some extra work.

:100644 100644 62e2333... 52d9990... M	src/hid/gtk/gtkhid-gdk.c
:100644 100644 169884e... c77faaf... M	src/hid/gtk/gtkhid-main.c
:100644 100644 29c98f8... 97ebb1c... M	src/hid/gtk/gui.h

commit 332cb8ddc1cc032ac29c7d2b9a0051ccc228b6da
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    hid/gtk: Add hooks to tell the render when we start/stop drawing
    
    This is necessary if the renderer requires certain state to be configured
    before its drawing calls can be operated.

:100644 100644 e8d3b73... 62e2333... M	src/hid/gtk/gtkhid-gdk.c
:100644 100644 10dd85b... 3b543cb... M	src/hid/gtk/gui-output-events.c
:100644 100644 838b5fa... 29c98f8... M	src/hid/gtk/gui.h

commit 7accf3312d2a93162bbb4dbb6c7e972e8e8d2487
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    hid/gtk: Add hooks for the renderer to initalise drawing widgets

:100644 100644 c8bac31... e8d3b73... M	src/hid/gtk/gtkhid-gdk.c
:100644 100644 5b8d20a... 6cd8069... M	src/hid/gtk/gui-pinout-preview.c
:100644 100644 1808065... 2098c27... M	src/hid/gtk/gui-top-window.c
:100644 100644 332239b... 838b5fa... M	src/hid/gtk/gui.h

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

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

    hid/gtk: Move set_layer function into GDK specific code.
    
    Not that this is particularly GDK specific, just that the GL
    renderer hopefully coming soon needs to do some extra work.

diff --git a/src/hid/gtk/gtkhid-gdk.c b/src/hid/gtk/gtkhid-gdk.c
index 62e2333..52d9990 100644
--- a/src/hid/gtk/gtkhid-gdk.c
+++ b/src/hid/gtk/gtkhid-gdk.c
@@ -52,6 +52,51 @@ typedef struct hid_gc_struct
 hid_gc_struct;
 
 
+int
+ghid_set_layer (const char *name, int group, int empty)
+{
+  int idx = group;
+  if (idx >= 0 && idx < max_group)
+    {
+      int n = PCB->LayerGroups.Number[group];
+      for (idx = 0; idx < n-1; idx ++)
+	{
+	  int ni = PCB->LayerGroups.Entries[group][idx];
+	  if (ni >= 0 && ni < max_copper_layer + 2
+	      && PCB->Data->Layer[ni].On)
+	    break;
+	}
+      idx = PCB->LayerGroups.Entries[group][idx];
+    }
+
+  if (idx >= 0 && idx < max_copper_layer + 2)
+    return /*pinout ? 1 : */ PCB->Data->Layer[idx].On;
+  if (idx < 0)
+    {
+      switch (SL_TYPE (idx))
+	{
+	case SL_INVISIBLE:
+	  return /* pinout ? 0 : */ PCB->InvisibleObjectsOn;
+	case SL_MASK:
+	  if (SL_MYSIDE (idx) /*&& !pinout */ )
+	    return TEST_FLAG (SHOWMASKFLAG, PCB);
+	  return 0;
+	case SL_SILK:
+	  if (SL_MYSIDE (idx) /*|| pinout */ )
+	    return PCB->ElementOn;
+	  return 0;
+	case SL_ASSY:
+	  return 0;
+	case SL_PDRILL:
+	case SL_UDRILL:
+	  return 1;
+	case SL_RATS:
+	  return PCB->RatOn;
+	}
+    }
+  return 0;
+}
+
 void
 ghid_destroy_gc (hidGC gc)
 {
diff --git a/src/hid/gtk/gtkhid-main.c b/src/hid/gtk/gtkhid-main.c
index 169884e..c77faaf 100644
--- a/src/hid/gtk/gtkhid-main.c
+++ b/src/hid/gtk/gtkhid-main.c
@@ -288,51 +288,6 @@ zoom_by (double factor, int x, int y)
 
 /* ------------------------------------------------------------ */
 
-int
-ghid_set_layer (const char *name, int group, int empty)
-{
-  int idx = group;
-  if (idx >= 0 && idx < max_group)
-    {
-      int n = PCB->LayerGroups.Number[group];
-      for (idx = 0; idx < n-1; idx ++)
-	{
-	  int ni = PCB->LayerGroups.Entries[group][idx];
-	  if (ni >= 0 && ni < max_copper_layer + 2
-	      && PCB->Data->Layer[ni].On)
-	    break;
-	}
-      idx = PCB->LayerGroups.Entries[group][idx];
-    }
-
-  if (idx >= 0 && idx < max_copper_layer + 2)
-    return /*pinout ? 1 : */ PCB->Data->Layer[idx].On;
-  if (idx < 0)
-    {
-      switch (SL_TYPE (idx))
-	{
-	case SL_INVISIBLE:
-	  return /* pinout ? 0 : */ PCB->InvisibleObjectsOn;
-	case SL_MASK:
-	  if (SL_MYSIDE (idx) /*&& !pinout */ )
-	    return TEST_FLAG (SHOWMASKFLAG, PCB);
-	  return 0;
-	case SL_SILK:
-	  if (SL_MYSIDE (idx) /*|| pinout */ )
-	    return PCB->ElementOn;
-	  return 0;
-	case SL_ASSY:
-	  return 0;
-	case SL_PDRILL:
-	case SL_UDRILL:
-	  return 1;
-	case SL_RATS:
-	  return PCB->RatOn;
-	}
-    }
-  return 0;
-}
-
 void
 ghid_calibrate (double xval, double yval)
 {
diff --git a/src/hid/gtk/gui.h b/src/hid/gtk/gui.h
index 29c98f8..97ebb1c 100644
--- a/src/hid/gtk/gui.h
+++ b/src/hid/gtk/gui.h
@@ -475,6 +475,7 @@ void ghid_logv (const char *fmt, va_list args);
 void ghid_pinout_window_show (GHidPort * out, ElementTypePtr Element);
 
 /* gtkhid-gdk.c */
+int ghid_set_layer (const char *name, int group, int empty);
 hidGC ghid_make_gc (void);
 void ghid_destroy_gc (hidGC);
 void ghid_use_mask (int use_it);

commit 332cb8ddc1cc032ac29c7d2b9a0051ccc228b6da
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    hid/gtk: Add hooks to tell the render when we start/stop drawing
    
    This is necessary if the renderer requires certain state to be configured
    before its drawing calls can be operated.

diff --git a/src/hid/gtk/gtkhid-gdk.c b/src/hid/gtk/gtkhid-gdk.c
index e8d3b73..62e2333 100644
--- a/src/hid/gtk/gtkhid-gdk.c
+++ b/src/hid/gtk/gtkhid-gdk.c
@@ -929,6 +929,17 @@ ghid_drawing_area_configure_hook (GHidPort *port)
     }
 }
 
+gboolean
+ghid_start_drawing (GHidPort *port)
+{
+  return TRUE;
+}
+
+void
+ghid_end_drawing (GHidPort *port)
+{
+}
+
 void
 ghid_screen_update (void)
 {
diff --git a/src/hid/gtk/gui-output-events.c b/src/hid/gtk/gui-output-events.c
index 10dd85b..3b543cb 100644
--- a/src/hid/gtk/gui-output-events.c
+++ b/src/hid/gtk/gui-output-events.c
@@ -671,8 +671,13 @@ ghid_port_window_motion_cb (GtkWidget * widget,
   static gint x_prev = -1, y_prev = -1;
   gboolean moved;
 
+
   gdk_event_request_motions (ev);
 
+  if (!ghid_start_drawing (out))
+    return FALSE;
+
+
   if (out->panning)
     {
       dx = gport->zoom * (x_prev - ev->x);
@@ -693,6 +698,8 @@ ghid_port_window_motion_cb (GtkWidget * widget,
   ghid_show_crosshair (TRUE);
   if (moved && have_crosshair_attachments ())
     ghid_draw_area_update (gport, NULL);
+
+  ghid_end_drawing (out);
   return FALSE;
 }
 
diff --git a/src/hid/gtk/gui.h b/src/hid/gtk/gui.h
index 838b5fa..29c98f8 100644
--- a/src/hid/gtk/gui.h
+++ b/src/hid/gtk/gui.h
@@ -497,6 +497,8 @@ void ghid_show_crosshair (gboolean show);
 void ghid_init_renderer (int *, char ***, GHidPort *);
 void ghid_init_drawing_widget (GtkWidget *widget, GHidPort *);
 void ghid_drawing_area_configure_hook (GHidPort *port);
+gboolean ghid_start_drawing (GHidPort *port);
+void ghid_end_drawing (GHidPort *port);
 void ghid_screen_update (void);
 gboolean ghid_drawing_area_expose_cb (GtkWidget *, GdkEventExpose *,
                                       GHidPort *);

commit 7accf3312d2a93162bbb4dbb6c7e972e8e8d2487
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    hid/gtk: Add hooks for the renderer to initalise drawing widgets

diff --git a/src/hid/gtk/gtkhid-gdk.c b/src/hid/gtk/gtkhid-gdk.c
index c8bac31..e8d3b73 100644
--- a/src/hid/gtk/gtkhid-gdk.c
+++ b/src/hid/gtk/gtkhid-gdk.c
@@ -902,6 +902,11 @@ ghid_init_renderer (int *argc, char ***argv, GHidPort *port)
 }
 
 void
+ghid_init_drawing_widget (GtkWidget *widget, GHidPort *port)
+{
+}
+
+void
 ghid_drawing_area_configure_hook (GHidPort *port)
 {
   static int done_once = 0;
diff --git a/src/hid/gtk/gui-pinout-preview.c b/src/hid/gtk/gui-pinout-preview.c
index 5b8d20a..6cd8069 100644
--- a/src/hid/gtk/gui-pinout-preview.c
+++ b/src/hid/gtk/gui-pinout-preview.c
@@ -159,6 +159,26 @@ enum
 static GObjectClass *ghid_pinout_preview_parent_class = NULL;
 
 
+/*! \brief GObject constructed
+ *
+ *  \par Function Description
+ *  Initialise the pinout preview object once it is constructed.
+ *  Chain up in case the parent class wants to do anything too.
+ *
+ *  \param [in] object  The pinout preview object
+ */
+static void
+ghid_pinout_preview_constructed (GObject *object)
+{
+  /* chain up to the parent class */
+  if (G_OBJECT_CLASS (ghid_pinout_preview_parent_class)->constructed != NULL)
+    G_OBJECT_CLASS (ghid_pinout_preview_parent_class)->constructed (object);
+
+  ghid_init_drawing_widget (GTK_WIDGET (object), gport);
+}
+
+
+
 /*! \brief GObject finalise handler
  *
  *  \par Function Description
@@ -253,6 +273,7 @@ ghid_pinout_preview_class_init (GhidPinoutPreviewClass * klass)
   gobject_class->finalize = ghid_pinout_preview_finalize;
   gobject_class->set_property = ghid_pinout_preview_set_property;
   gobject_class->get_property = ghid_pinout_preview_get_property;
+  gobject_class->constructed = ghid_pinout_preview_constructed;
 
   gtk_widget_class->expose_event = ghid_pinout_preview_expose;
 
diff --git a/src/hid/gtk/gui-top-window.c b/src/hid/gtk/gui-top-window.c
index 1808065..2098c27 100644
--- a/src/hid/gtk/gui-top-window.c
+++ b/src/hid/gtk/gui-top-window.c
@@ -2311,6 +2311,7 @@ ghid_build_pcb_top_window (void)
   gtk_box_pack_start (GTK_BOX (hbox), viewport, TRUE, TRUE, 0);
 
   gport->drawing_area = gtk_drawing_area_new ();
+  ghid_init_drawing_widget (gport->drawing_area, gport);
 
   gtk_widget_add_events (gport->drawing_area, GDK_EXPOSURE_MASK
 			 | GDK_LEAVE_NOTIFY_MASK | GDK_ENTER_NOTIFY_MASK
diff --git a/src/hid/gtk/gui.h b/src/hid/gtk/gui.h
index 332239b..838b5fa 100644
--- a/src/hid/gtk/gui.h
+++ b/src/hid/gtk/gui.h
@@ -495,6 +495,7 @@ void ghid_invalidate_lr (int left, int right, int top, int bottom);
 void ghid_invalidate_all ();
 void ghid_show_crosshair (gboolean show);
 void ghid_init_renderer (int *, char ***, GHidPort *);
+void ghid_init_drawing_widget (GtkWidget *widget, GHidPort *);
 void ghid_drawing_area_configure_hook (GHidPort *port);
 void ghid_screen_update (void);
 gboolean ghid_drawing_area_expose_cb (GtkWidget *, GdkEventExpose *,




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