[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
gEDA-cvs: pcb.git: branch: master updated (718b9c34a4c2e4070436cf8abf756f22c5c74cec)
The branch, master has been updated
via 718b9c34a4c2e4070436cf8abf756f22c5c74cec (commit)
from ce34fefde11f0b617e1291b27a65aeebe6d3bf6d (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 | 84 +++++++++++++++++++++-----------------
src/hid/gtk/gtkhid-main.c | 18 +++++---
src/hid/gtk/gui-misc.c | 3 +-
src/hid/gtk/gui-output-events.c | 4 +-
src/hid/gtk/gui-pinout-preview.c | 3 +-
src/hid/gtk/gui-top-window.c | 17 +++++---
src/hid/gtk/gui-utils.c | 9 +++-
7 files changed, 81 insertions(+), 57 deletions(-)
=================
Commit Messages
=================
commit 718b9c34a4c2e4070436cf8abf756f22c5c74cec
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>
hid/gtk: Use gtk_widget_get_window() accessor
In GTK3.0, direct access to widget->window will be impossible.
:100644 100644 f0ce1ab... 85fd1d6... M src/hid/gtk/gtkhid-gdk.c
:100644 100644 1eed303... 6df553e... M src/hid/gtk/gtkhid-main.c
:100644 100644 dbed88e... 0f8daf7... M src/hid/gtk/gui-misc.c
:100644 100644 b9c5ab3... 22dd54e... M src/hid/gtk/gui-output-events.c
:100644 100644 88576a1... c4bef20... M src/hid/gtk/gui-pinout-preview.c
:100644 100644 f57dd5c... 9c22ea2... M src/hid/gtk/gui-top-window.c
:100644 100644 e9008c6... db61f77... M src/hid/gtk/gui-utils.c
=========
Changes
=========
commit 718b9c34a4c2e4070436cf8abf756f22c5c74cec
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>
hid/gtk: Use gtk_widget_get_window() accessor
In GTK3.0, direct access to widget->window will be impossible.
diff --git a/src/hid/gtk/gtkhid-gdk.c b/src/hid/gtk/gtkhid-gdk.c
index f0ce1ab..85fd1d6 100644
--- a/src/hid/gtk/gtkhid-gdk.c
+++ b/src/hid/gtk/gtkhid-gdk.c
@@ -487,6 +487,7 @@ static int
use_gc (hidGC gc)
{
render_priv *priv = gport->render_priv;
+ GdkWindow *window = gtk_widget_get_window (gport->top_window);
if (gc->me_pointer != &ghid_hid)
{
@@ -498,7 +499,7 @@ use_gc (hidGC gc)
return 0;
if (!gc->gc)
{
- gc->gc = gdk_gc_new (gport->top_window->window);
+ gc->gc = gdk_gc_new (window);
ghid_set_color (gc, gc->colorname);
ghid_set_line_width (gc, gc->width);
ghid_set_line_cap (gc, (EndCapStyle)gc->cap);
@@ -922,13 +923,16 @@ ghid_notify_mark_change (bool changes_complete)
static void
draw_right_cross (GdkGC *xor_gc, gint x, gint y)
{
- gdk_draw_line (gport->drawing_area->window, xor_gc, x, 0, x, gport->height);
- gdk_draw_line (gport->drawing_area->window, xor_gc, 0, y, gport->width, y);
+ GdkWindow *window = gtk_widget_get_window (gport->drawing_area);
+
+ gdk_draw_line (window, xor_gc, x, 0, x, gport->height);
+ gdk_draw_line (window, xor_gc, 0, y, gport->width, y);
}
static void
draw_slanted_cross (GdkGC *xor_gc, gint x, gint y)
{
+ GdkWindow *window = gtk_widget_get_window (gport->drawing_area);
gint x0, y0, x1, y1;
x0 = x + (gport->height - y);
@@ -939,7 +943,7 @@ draw_slanted_cross (GdkGC *xor_gc, gint x, gint y)
y0 = MAX(0, MIN (y0, gport->height));
y1 = y - x;
y1 = MAX(0, MIN (y1, gport->height));
- gdk_draw_line (gport->drawing_area->window, xor_gc, x0, y0, x1, y1);
+ gdk_draw_line (window, xor_gc, x0, y0, x1, y1);
x0 = x - (gport->height - y);
x0 = MAX(0, MIN (x0, gport->width));
@@ -949,12 +953,13 @@ draw_slanted_cross (GdkGC *xor_gc, gint x, gint y)
y0 = MAX(0, MIN (y0, gport->height));
y1 = y - (gport->width - x);
y1 = MAX(0, MIN (y1, gport->height));
- gdk_draw_line (gport->drawing_area->window, xor_gc, x0, y0, x1, y1);
+ gdk_draw_line (window, xor_gc, x0, y0, x1, y1);
}
static void
draw_dozen_cross (GdkGC *xor_gc, gint x, gint y)
{
+ GdkWindow *window = gtk_widget_get_window (gport->drawing_area);
gint x0, y0, x1, y1;
gdouble tan60 = sqrt (3);
@@ -966,7 +971,7 @@ draw_dozen_cross (GdkGC *xor_gc, gint x, gint y)
y0 = MAX(0, MIN (y0, gport->height));
y1 = y - x * tan60;
y1 = MAX(0, MIN (y1, gport->height));
- gdk_draw_line (gport->drawing_area->window, xor_gc, x0, y0, x1, y1);
+ gdk_draw_line (window, xor_gc, x0, y0, x1, y1);
x0 = x + (gport->height - y) * tan60;
x0 = MAX(0, MIN (x0, gport->width));
@@ -976,7 +981,7 @@ draw_dozen_cross (GdkGC *xor_gc, gint x, gint y)
y0 = MAX(0, MIN (y0, gport->height));
y1 = y - x / tan60;
y1 = MAX(0, MIN (y1, gport->height));
- gdk_draw_line (gport->drawing_area->window, xor_gc, x0, y0, x1, y1);
+ gdk_draw_line (window, xor_gc, x0, y0, x1, y1);
x0 = x - (gport->height - y) / tan60;
x0 = MAX(0, MIN (x0, gport->width));
@@ -986,7 +991,7 @@ draw_dozen_cross (GdkGC *xor_gc, gint x, gint y)
y0 = MAX(0, MIN (y0, gport->height));
y1 = y - (gport->width - x) * tan60;
y1 = MAX(0, MIN (y1, gport->height));
- gdk_draw_line (gport->drawing_area->window, xor_gc, x0, y0, x1, y1);
+ gdk_draw_line (window, xor_gc, x0, y0, x1, y1);
x0 = x - (gport->height - y) * tan60;
x0 = MAX(0, MIN (x0, gport->width));
@@ -996,7 +1001,7 @@ draw_dozen_cross (GdkGC *xor_gc, gint x, gint y)
y0 = MAX(0, MIN (y0, gport->height));
y1 = y - (gport->width - x) / tan60;
y1 = MAX(0, MIN (y1, gport->height));
- gdk_draw_line (gport->drawing_area->window, xor_gc, x0, y0, x1, y1);
+ gdk_draw_line (window, xor_gc, x0, y0, x1, y1);
}
static void
@@ -1019,6 +1024,7 @@ static void
show_crosshair (gboolean paint_new_location)
{
render_priv *priv = gport->render_priv;
+ GdkWindow *window = gtk_widget_get_window (gport->drawing_area);
gint x, y;
static gint x_prev = -1, y_prev = -1;
static gboolean draw_markers, draw_markers_prev = FALSE;
@@ -1030,7 +1036,7 @@ show_crosshair (gboolean paint_new_location)
if (!xor_gc)
{
- xor_gc = gdk_gc_new (ghid_port.drawing_area->window);
+ xor_gc = gdk_gc_new (window);
gdk_gc_copy (xor_gc, ghid_port.drawing_area->style->white_gc);
gdk_gc_set_function (xor_gc, GDK_XOR);
gdk_gc_set_clip_origin (xor_gc, 0, 0);
@@ -1047,16 +1053,16 @@ show_crosshair (gboolean paint_new_location)
{
draw_crosshair (xor_gc, x_prev, y_prev);
if (draw_markers_prev)
- {
- gdk_draw_rectangle (gport->drawing_area->window, xor_gc, TRUE,
- 0, y_prev - VCD, VCD, VCW);
- gdk_draw_rectangle (gport->drawing_area->window, xor_gc, TRUE,
- gport->width - VCD, y_prev - VCD, VCD, VCW);
- gdk_draw_rectangle (gport->drawing_area->window, xor_gc, TRUE,
- x_prev - VCD, 0, VCW, VCD);
- gdk_draw_rectangle (gport->drawing_area->window, xor_gc, TRUE,
- x_prev - VCD, gport->height - VCD, VCW, VCD);
- }
+ {
+ gdk_draw_rectangle (window, xor_gc, TRUE,
+ 0, y_prev - VCD, VCD, VCW);
+ gdk_draw_rectangle (window, xor_gc, TRUE,
+ gport->width - VCD, y_prev - VCD, VCD, VCW);
+ gdk_draw_rectangle (window, xor_gc, TRUE,
+ x_prev - VCD, 0, VCW, VCD);
+ gdk_draw_rectangle (window, xor_gc, TRUE,
+ x_prev - VCD, gport->height - VCD, VCW, VCD);
+ }
}
if (x >= 0 && paint_new_location)
@@ -1064,16 +1070,16 @@ show_crosshair (gboolean paint_new_location)
draw_crosshair (xor_gc, x, y);
draw_markers = ghidgui->auto_pan_on && have_crosshair_attachments ();
if (draw_markers)
- {
- gdk_draw_rectangle (gport->drawing_area->window, xor_gc, TRUE,
- 0, y - VCD, VCD, VCW);
- gdk_draw_rectangle (gport->drawing_area->window, xor_gc, TRUE,
- gport->width - VCD, y - VCD, VCD, VCW);
- gdk_draw_rectangle (gport->drawing_area->window, xor_gc, TRUE,
- x - VCD, 0, VCW, VCD);
- gdk_draw_rectangle (gport->drawing_area->window, xor_gc, TRUE,
- x - VCD, gport->height - VCD, VCW, VCD);
- }
+ {
+ gdk_draw_rectangle (window, xor_gc, TRUE,
+ 0, y - VCD, VCD, VCW);
+ gdk_draw_rectangle (window, xor_gc, TRUE,
+ gport->width - VCD, y - VCD, VCD, VCW);
+ gdk_draw_rectangle (window, xor_gc, TRUE,
+ x - VCD, 0, VCW, VCD);
+ gdk_draw_rectangle (window, xor_gc, TRUE,
+ x - VCD, gport->height - VCD, VCW, VCD);
+ }
x_prev = x;
y_prev = y;
draw_markers_prev = draw_markers;
@@ -1134,11 +1140,12 @@ void
ghid_screen_update (void)
{
render_priv *priv = gport->render_priv;
+ GdkWindow *window = gtk_widget_get_window (gport->drawing_area);
if (gport->pixmap == NULL)
return;
- gdk_draw_drawable (gport->drawing_area->window, priv->bg_gc, gport->pixmap,
+ gdk_draw_drawable (window, priv->bg_gc, gport->pixmap,
0, 0, 0, 0, gport->width, gport->height);
show_crosshair (TRUE);
}
@@ -1149,10 +1156,11 @@ ghid_drawing_area_expose_cb (GtkWidget *widget,
GHidPort *port)
{
render_priv *priv = port->render_priv;
+ GdkWindow *window = gtk_widget_get_window (gport->drawing_area);
- gdk_draw_drawable (widget->window, priv->bg_gc, port->pixmap,
- ev->area.x, ev->area.y, ev->area.x, ev->area.y,
- ev->area.width, ev->area.height);
+ gdk_draw_drawable (window, priv->bg_gc, port->pixmap,
+ ev->area.x, ev->area.y, ev->area.x, ev->area.y,
+ ev->area.width, ev->area.height);
show_crosshair (TRUE);
return FALSE;
}
@@ -1167,6 +1175,7 @@ ghid_pinout_preview_expose (GtkWidget *widget,
GdkEventExpose *ev)
{
GhidPinoutPreview *pinout = GHID_PINOUT_PREVIEW (widget);
+ GdkWindow *window = gtk_widget_get_window (widget);
GdkDrawable *save_drawable;
GtkAllocation allocation;
view_data save_view;
@@ -1189,7 +1198,7 @@ ghid_pinout_preview_expose (GtkWidget *widget,
else
gport->view.coord_per_px = yz;
- gport->drawable = widget->window;
+ gport->drawable = window;
gport->width = allocation.width;
gport->height = allocation.height;
gport->view.width = allocation.width * gport->view.coord_per_px;
@@ -1198,7 +1207,7 @@ ghid_pinout_preview_expose (GtkWidget *widget,
gport->view.y0 = (pinout->y_max - gport->view.height) / 2;
/* clear background */
- gdk_draw_rectangle (widget->window, priv->bg_gc, TRUE,
+ gdk_draw_rectangle (window, priv->bg_gc, TRUE,
0, 0, allocation.width, allocation.height);
/* call the drawing routine */
@@ -1322,6 +1331,7 @@ ghid_pcb_to_event_coords (Coord pcb_x, Coord pcb_y, int *event_x, int *event_y)
static void
draw_lead_user (render_priv *priv)
{
+ GdkWindow *window = gtk_widget_get_window (gport->drawing_area);
int i;
Coord radius = priv->lead_user_radius;
Coord width = MM_TO_COORD (LEAD_USER_WIDTH);
@@ -1334,7 +1344,7 @@ draw_lead_user (render_priv *priv)
if (lead_gc == NULL)
{
- lead_gc = gdk_gc_new (ghid_port.drawing_area->window);
+ lead_gc = gdk_gc_new (window);
gdk_gc_copy (lead_gc, ghid_port.drawing_area->style->white_gc);
gdk_gc_set_function (lead_gc, GDK_XOR);
gdk_gc_set_clip_origin (lead_gc, 0, 0);
diff --git a/src/hid/gtk/gtkhid-main.c b/src/hid/gtk/gtkhid-main.c
index 1eed303..6df553e 100644
--- a/src/hid/gtk/gtkhid-main.c
+++ b/src/hid/gtk/gtkhid-main.c
@@ -261,7 +261,8 @@ ghid_shift_is_pressed ()
if( ! ghid_gui_is_up )
return 0;
- gdk_window_get_pointer (out->drawing_area->window, NULL, NULL, &mask);
+ gdk_window_get_pointer (gtk_widget_get_window (out->drawing_area),
+ NULL, NULL, &mask);
return (mask & GDK_SHIFT_MASK) ? TRUE : FALSE;
}
@@ -274,7 +275,8 @@ ghid_control_is_pressed ()
if( ! ghid_gui_is_up )
return 0;
- gdk_window_get_pointer (out->drawing_area->window, NULL, NULL, &mask);
+ gdk_window_get_pointer (gtk_widget_get_window (out->drawing_area),
+ NULL, NULL, &mask);
return (mask & GDK_CONTROL_MASK) ? TRUE : FALSE;
}
@@ -287,7 +289,8 @@ ghid_mod1_is_pressed ()
if( ! ghid_gui_is_up )
return 0;
- gdk_window_get_pointer (out->drawing_area->window, NULL, NULL, &mask);
+ gdk_window_get_pointer (gtk_widget_get_window (out->drawing_area),
+ NULL, NULL, &mask);
#ifdef __APPLE__
return (mask & ( 1 << 13 ) ) ? TRUE : FALSE; // The option key is not MOD1, although it should be...
#else
@@ -326,7 +329,8 @@ ghid_set_crosshair (int x, int y, int action)
* and gdk_display_warp_pointer work relative to the whole display, whilst
* our coordinates are relative to the drawing area origin.
*/
- gdk_window_get_origin (gport->drawing_area->window, &offset_x, &offset_y);
+ gdk_window_get_origin (gtk_widget_get_window (gport->drawing_area),
+ &offset_x, &offset_y);
display = gdk_display_get_default ();
switch (action) {
@@ -1544,7 +1548,8 @@ Benchmark (int argc, char **argv, Coord x, Coord y)
do
{
ghid_invalidate_all ();
- gdk_window_process_updates (gport->drawing_area->window, FALSE);
+ gdk_window_process_updates (gtk_widget_get_window (gport->drawing_area),
+ FALSE);
time (&end);
i++;
}
@@ -1595,7 +1600,8 @@ Center(int argc, char **argv, Coord pcb_x, Coord pcb_y)
*/
ghid_pcb_to_event_coords (pcb_x, pcb_y, &widget_x, &widget_y);
- gdk_window_get_origin (gport->drawing_area->window, &offset_x, &offset_y);
+ gdk_window_get_origin (gtk_widget_get_window (gport->drawing_area),
+ &offset_x, &offset_y);
pointer_x = offset_x + widget_x;
pointer_y = offset_y + widget_y;
diff --git a/src/hid/gtk/gui-misc.c b/src/hid/gtk/gui-misc.c
index dbed88e..0f8daf7 100644
--- a/src/hid/gtk/gui-misc.c
+++ b/src/hid/gtk/gui-misc.c
@@ -382,7 +382,8 @@ ghid_get_pointer (int *x, int *y)
{
gint xp, yp;
- gdk_window_get_pointer (gport->drawing_area->window, &xp, &yp, NULL);
+ gdk_window_get_pointer (gtk_widget_get_window (gport->drawing_area),
+ &xp, &yp, NULL);
if (x)
*x = xp;
if (y)
diff --git a/src/hid/gtk/gui-output-events.c b/src/hid/gtk/gui-output-events.c
index b9c5ab3..22dd54e 100644
--- a/src/hid/gtk/gui-output-events.c
+++ b/src/hid/gtk/gui-output-events.c
@@ -121,7 +121,7 @@ ghid_note_event_location (GdkEventButton * ev)
if (!ev)
{
- gdk_window_get_pointer (ghid_port.drawing_area->window,
+ gdk_window_get_pointer (gtk_widget_get_window (ghid_port.drawing_area),
&event_x, &event_y, NULL);
}
else
@@ -391,7 +391,7 @@ ghid_port_drawing_area_configure_event_cb (GtkWidget * widget,
if (gport->pixmap)
gdk_pixmap_unref (gport->pixmap);
- gport->pixmap = gdk_pixmap_new (widget->window,
+ gport->pixmap = gdk_pixmap_new (gtk_widget_get_window (widget),
gport->width, gport->height, -1);
gport->drawable = gport->pixmap;
diff --git a/src/hid/gtk/gui-pinout-preview.c b/src/hid/gtk/gui-pinout-preview.c
index 88576a1..c4bef20 100644
--- a/src/hid/gtk/gui-pinout-preview.c
+++ b/src/hid/gtk/gui-pinout-preview.c
@@ -197,7 +197,8 @@ ghid_pinout_preview_set_property (GObject * object, guint property_id,
case PROP_ELEMENT_DATA:
pinout_set_data (pinout, (ElementType *)g_value_get_pointer (value));
if (GTK_WIDGET_REALIZED (GTK_WIDGET (pinout)))
- gdk_window_invalidate_rect (GTK_WIDGET (pinout)->window, NULL, FALSE);
+ gdk_window_invalidate_rect (
+ gtk_widget_get_window (GTK_WIDGET (pinout)), NULL, FALSE);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
diff --git a/src/hid/gtk/gui-top-window.c b/src/hid/gtk/gui-top-window.c
index f57dd5c..9c22ea2 100644
--- a/src/hid/gtk/gui-top-window.c
+++ b/src/hid/gtk/gui-top-window.c
@@ -1354,7 +1354,8 @@ ghid_build_pcb_top_window (void)
gtk_widget_show_all (gport->top_window);
ghid_pack_mode_buttons ();
- gdk_window_set_back_pixmap (gport->drawing_area->window, NULL, FALSE);
+ gdk_window_set_back_pixmap (gtk_widget_get_window (gport->drawing_area),
+ NULL, FALSE);
}
@@ -1428,28 +1429,30 @@ ghid_interface_set_sensitive (gboolean sensitive)
static void
ghid_init_icons (GHidPort * port)
{
- XC_clock_source = gdk_bitmap_create_from_data (gport->top_window->window,
+ GdkWindow *window = gtk_widget_get_window (gport->top_window);
+
+ XC_clock_source = gdk_bitmap_create_from_data (window,
(char *) rotateIcon_bits,
rotateIcon_width,
rotateIcon_height);
XC_clock_mask =
- gdk_bitmap_create_from_data (gport->top_window->window, (char *) rotateMask_bits,
+ gdk_bitmap_create_from_data (window, (char *) rotateMask_bits,
rotateMask_width, rotateMask_height);
- XC_hand_source = gdk_bitmap_create_from_data (gport->top_window->window,
+ XC_hand_source = gdk_bitmap_create_from_data (window,
(char *) handIcon_bits,
handIcon_width,
handIcon_height);
XC_hand_mask =
- gdk_bitmap_create_from_data (gport->top_window->window, (char *) handMask_bits,
+ gdk_bitmap_create_from_data (window, (char *) handMask_bits,
handMask_width, handMask_height);
- XC_lock_source = gdk_bitmap_create_from_data (gport->top_window->window,
+ XC_lock_source = gdk_bitmap_create_from_data (window,
(char *) lockIcon_bits,
lockIcon_width,
lockIcon_height);
XC_lock_mask =
- gdk_bitmap_create_from_data (gport->top_window->window, (char *) lockMask_bits,
+ gdk_bitmap_create_from_data (window, (char *) lockMask_bits,
lockMask_width, lockMask_height);
}
diff --git a/src/hid/gtk/gui-utils.c b/src/hid/gtk/gui-utils.c
index e9008c6..db61f77 100644
--- a/src/hid/gtk/gui-utils.c
+++ b/src/hid/gtk/gui-utils.c
@@ -92,7 +92,8 @@ ghid_modifier_keys_state (GdkModifierType * state)
GHidPort *out = &ghid_port;
if (!state)
- gdk_window_get_pointer (out->drawing_area->window, NULL, NULL, &mask);
+ gdk_window_get_pointer (gtk_widget_get_window (out->drawing_area),
+ NULL, NULL, &mask);
else
mask = *state;
@@ -129,7 +130,8 @@ ghid_button_state (GdkModifierType * state)
GHidPort *out = &ghid_port;
if (!state)
- gdk_window_get_pointer (out->drawing_area->window, NULL, NULL, &mask);
+ gdk_window_get_pointer (gtk_widget_get_window (out->drawing_area),
+ NULL, NULL, &mask);
else
mask = *state;
@@ -152,7 +154,8 @@ ghid_button_state (GdkModifierType * state)
void
ghid_draw_area_update (GHidPort * port, GdkRectangle * rect)
{
- gdk_window_invalidate_rect (port->drawing_area->window, rect, FALSE);
+ gdk_window_invalidate_rect (gtk_widget_get_window (port->drawing_area),
+ rect, FALSE);
}
_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs