summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/dialogs/clonetiler.cpp2
-rw-r--r--src/dialogs/dialog-events.cpp2
-rw-r--r--src/dialogs/spellcheck.cpp6
-rw-r--r--src/display/canvas-arena.cpp2
-rw-r--r--src/display/sp-canvas.cpp44
-rw-r--r--src/ege-adjustment-action.cpp2
-rw-r--r--src/ege-color-prof-tracker.cpp2
-rw-r--r--src/select-context.cpp33
-rw-r--r--src/svg-view-widget.cpp2
-rw-r--r--src/svg-view.cpp6
10 files changed, 61 insertions, 40 deletions
diff --git a/src/dialogs/clonetiler.cpp b/src/dialogs/clonetiler.cpp
index 927f00233..e140f6f89 100644
--- a/src/dialogs/clonetiler.cpp
+++ b/src/dialogs/clonetiler.cpp
@@ -1716,7 +1716,7 @@ static void clonetiler_fill_width_changed(GtkAdjustment *adj, GtkWidget *u)
static void clonetiler_fill_height_changed(GtkAdjustment *adj, GtkWidget *u)
{
- gdouble const raw_dist = adj->value;
+ gdouble const raw_dist = gtk_adjustment_get_value (adj);
SPUnit const &unit = *sp_unit_selector_get_unit(SP_UNIT_SELECTOR(u));
gdouble const pixels = sp_units_get_pixels (raw_dist, unit);
diff --git a/src/dialogs/dialog-events.cpp b/src/dialogs/dialog-events.cpp
index 08600afa7..89395ffd3 100644
--- a/src/dialogs/dialog-events.cpp
+++ b/src/dialogs/dialog-events.cpp
@@ -125,7 +125,7 @@ sp_dialog_event_handler (GtkWindow *win, GdkEvent *event, gpointer data)
GdkEventAny event;
GtkWidget *widget = (GtkWidget *) win;
event.type = GDK_DELETE;
- event.window = widget->window;
+ event.window = gtk_widget_get_window (widget);
event.send_event = TRUE;
g_object_ref (G_OBJECT (event.window));
gtk_main_do_event ((GdkEvent*)&event);
diff --git a/src/dialogs/spellcheck.cpp b/src/dialogs/spellcheck.cpp
index 41732330e..53bc24211 100644
--- a/src/dialogs/spellcheck.cpp
+++ b/src/dialogs/spellcheck.cpp
@@ -292,8 +292,8 @@ spellcheck_sensitive (const gchar *cookie, gboolean gray)
gtk_widget_set_sensitive(l, gray);
}
-static void spellcheck_enable_accept(GtkTreeSelection */*selection*/,
- void */*??*/)
+static void spellcheck_enable_accept(GtkTreeSelection * /*selection*/,
+ void * /*??*/)
{
spellcheck_sensitive ("b_accept", TRUE);
}
@@ -718,7 +718,7 @@ do_spellcheck ()
GtkWidget *l = GTK_WIDGET(g_object_get_data(G_OBJECT (dlg), "banner"));
gtk_label_set_markup (GTK_LABEL(l), _("<i>Checking...</i>"));
gtk_widget_queue_draw(GTK_WIDGET(dlg));
- gdk_window_process_updates(GTK_WIDGET(dlg)->window, TRUE);
+ gdk_window_process_updates(gtk_widget_get_window (GTK_WIDGET(dlg)), TRUE);
_desktop->setWaitingCursor();
diff --git a/src/display/canvas-arena.cpp b/src/display/canvas-arena.cpp
index 9983e1c4d..57c930fff 100644
--- a/src/display/canvas-arena.cpp
+++ b/src/display/canvas-arena.cpp
@@ -184,7 +184,7 @@ sp_canvas_arena_update (SPCanvasItem *item, Geom::Affine const &affine, unsigned
DrawingItem *new_arena = arena->drawing.pick(arena->c, arena->drawing.delta, arena->sticky);
if (new_arena != arena->active) {
GdkEventCrossing ec;
- ec.window = GTK_WIDGET (item->canvas)->window;
+ ec.window = gtk_widget_get_window (GTK_WIDGET (item->canvas));
ec.send_event = TRUE;
ec.subwindow = ec.window;
ec.time = GDK_CURRENT_TIME;
diff --git a/src/display/sp-canvas.cpp b/src/display/sp-canvas.cpp
index add69401b..0d3cca0fb 100644
--- a/src/display/sp-canvas.cpp
+++ b/src/display/sp-canvas.cpp
@@ -52,7 +52,7 @@ static bool const HAS_BROKEN_MOTION_HINTS =
static gint const sp_canvas_update_priority = G_PRIORITY_HIGH_IDLE;
-#define SP_CANVAS_WINDOW(c) (((GtkWidget *) (c))->window)
+#define SP_CANVAS_WINDOW(c) (gtk_widget_get_window ((GtkWidget *) (c)))
enum {
SP_CANVAS_ITEM_VISIBLE = 1 << 7,
@@ -1152,11 +1152,13 @@ static void
sp_canvas_realize (GtkWidget *widget)
{
GdkWindowAttr attributes;
+ GtkAllocation allocation;
attributes.window_type = GDK_WINDOW_CHILD;
- attributes.x = widget->allocation.x;
- attributes.y = widget->allocation.y;
- attributes.width = widget->allocation.width;
- attributes.height = widget->allocation.height;
+ gtk_widget_get_allocation (widget, &allocation);
+ attributes.x = allocation.x;
+ attributes.y = allocation.y;
+ attributes.width = allocation.width;
+ attributes.height = allocation.height;
attributes.wclass = GDK_INPUT_OUTPUT;
attributes.visual = gdk_rgb_get_visual ();
attributes.colormap = gdk_rgb_get_cmap ();
@@ -1176,14 +1178,17 @@ sp_canvas_realize (GtkWidget *widget)
GDK_FOCUS_CHANGE_MASK);
gint attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP;
- widget->window = gdk_window_new (gtk_widget_get_parent_window (widget), &attributes, attributes_mask);
- gdk_window_set_user_data (widget->window, widget);
+ GdkWindow *window = gdk_window_new (gtk_widget_get_parent_window (widget), &attributes, attributes_mask);
+ gtk_widget_set_window (widget, window);
+ gdk_window_set_user_data (window, widget);
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
if ( prefs->getBool("/options/useextinput/value", true) )
gtk_widget_set_events(widget, attributes.event_mask);
- widget->style = gtk_style_attach (widget->style, widget->window);
+ GtkStyle *style = gtk_widget_get_style (widget);
+
+ gtk_widget_set_style (widget, gtk_style_attach (style, window));
gtk_widget_set_realized (widget, TRUE);
}
@@ -1225,9 +1230,12 @@ static void
sp_canvas_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
{
SPCanvas *canvas = SP_CANVAS (widget);
+ GtkAllocation widg_allocation;
+
+ gtk_widget_get_allocation (widget, &widg_allocation);
Geom::IntRect old_area = Geom::IntRect::from_xywh(canvas->x0, canvas->y0,
- widget->allocation.width, widget->allocation.height);
+ widg_allocation.width, widg_allocation.height);
Geom::IntRect new_area = Geom::IntRect::from_xywh(canvas->x0, canvas->y0,
allocation->width, allocation->height);
@@ -1236,27 +1244,27 @@ sp_canvas_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
if (SP_CANVAS_ITEM_GET_CLASS (canvas->root)->viewbox_changed)
SP_CANVAS_ITEM_GET_CLASS (canvas->root)->viewbox_changed (canvas->root, new_area);
- if (allocation->width > widget->allocation.width) {
+ if (allocation->width > widg_allocation.width) {
sp_canvas_request_redraw (canvas,
- canvas->x0 + widget->allocation.width,
+ canvas->x0 + widg_allocation.width,
0,
canvas->x0 + allocation->width,
canvas->y0 + allocation->height);
}
- if (allocation->height > widget->allocation.height) {
+ if (allocation->height > widg_allocation.height) {
sp_canvas_request_redraw (canvas,
0,
- canvas->y0 + widget->allocation.height,
+ canvas->y0 + widg_allocation.height,
canvas->x0 + allocation->width,
canvas->y0 + allocation->height);
}
- widget->allocation = *allocation;
+ gtk_widget_set_allocation (widget, allocation);
if (gtk_widget_get_realized (widget)) {
- gdk_window_move_resize (widget->window,
- widget->allocation.x, widget->allocation.y,
- widget->allocation.width, widget->allocation.height);
+ gdk_window_move_resize (gtk_widget_get_window (widget),
+ allocation->x, allocation->y,
+ allocation->width, allocation->height);
}
}
@@ -1627,7 +1635,7 @@ sp_canvas_motion (GtkWidget *widget, GdkEventMotion *event)
pick_current_item (canvas, (GdkEvent *) event);
status = emit_event (canvas, (GdkEvent *) event);
if (event->is_hint) {
- request_motions(widget->window, event);
+ request_motions(gtk_widget_get_window (widget), event);
}
return status;
diff --git a/src/ege-adjustment-action.cpp b/src/ege-adjustment-action.cpp
index f3009ac04..02ed37d0a 100644
--- a/src/ege-adjustment-action.cpp
+++ b/src/ege-adjustment-action.cpp
@@ -569,7 +569,7 @@ void ege_adjustment_action_set_appearance( EgeAdjustmentAction* action, gchar co
static void process_menu_action( GtkWidget* obj, gpointer data )
{
GtkCheckMenuItem* item = GTK_CHECK_MENU_ITEM(obj);
- if ( item->active ) {
+ if ( gtk_check_menu_item_get_active (item)) {
EgeAdjustmentAction* act = (EgeAdjustmentAction*)g_object_get_qdata( G_OBJECT(obj), gDataName );
gint what = GPOINTER_TO_INT(data);
diff --git a/src/ege-color-prof-tracker.cpp b/src/ege-color-prof-tracker.cpp
index 6aeb554f9..febd90287 100644
--- a/src/ege-color-prof-tracker.cpp
+++ b/src/ege-color-prof-tracker.cpp
@@ -434,7 +434,7 @@ void event_after_cb( GtkWidget* widget, GdkEvent* event, gpointer user_data )
{
if ( event->type == GDK_CONFIGURE ) {
GdkScreen* screen = gtk_widget_get_screen(widget);
- GdkWindow* window = widget->window;
+ GdkWindow* window = gtk_widget_get_window (widget);
EgeColorProfTracker* tracker = (EgeColorProfTracker*)user_data;
gint monitorNum = gdk_screen_get_monitor_at_window(screen, window);
if ( monitorNum != tracker->private_data->_monitor ) {
diff --git a/src/select-context.cpp b/src/select-context.cpp
index 3803b7d07..9ef3c7a6e 100644
--- a/src/select-context.cpp
+++ b/src/select-context.cpp
@@ -340,10 +340,11 @@ sp_select_context_item_handler(SPEventContext *event_context, SPItem *item, GdkE
// if shift or ctrl was pressed, do not move objects;
// pass the event to root handler which will perform rubberband, shift-click, ctrl-click, ctrl-drag
} else {
- sc->dragging = TRUE;
+ GdkWindow* window = gtk_widget_get_window (GTK_WIDGET (sp_desktop_canvas(desktop)));
+
+ sc->dragging = TRUE;
sc->moved = FALSE;
-
- gdk_window_set_cursor(GTK_WIDGET(sp_desktop_canvas(desktop))->window, CursorSelectDragging);
+ gdk_window_set_cursor(window, CursorSelectDragging);
sp_canvas_force_full_redraw_after_interruptions(desktop->canvas, 5);
@@ -381,14 +382,19 @@ sp_select_context_item_handler(SPEventContext *event_context, SPItem *item, GdkE
case GDK_ENTER_NOTIFY:
{
if (!desktop->isWaitingCursor() && !sc->dragging) {
- gdk_window_set_cursor(GTK_WIDGET(sp_desktop_canvas(desktop))->window, CursorSelectMouseover);
+ GdkWindow* window = gtk_widget_get_window (GTK_WIDGET (sp_desktop_canvas(desktop)));
+
+ gdk_window_set_cursor(window, CursorSelectMouseover);
}
break;
}
case GDK_LEAVE_NOTIFY:
- if (!desktop->isWaitingCursor() && !sc->dragging)
- gdk_window_set_cursor(GTK_WIDGET(sp_desktop_canvas(desktop))->window, event_context->cursor);
+ if (!desktop->isWaitingCursor() && !sc->dragging) {
+ GdkWindow* window = gtk_widget_get_window (GTK_WIDGET (sp_desktop_canvas(desktop)));
+
+ gdk_window_set_cursor(window, event_context->cursor);
+ }
break;
case GDK_KEY_PRESS:
@@ -560,7 +566,8 @@ sp_select_context_root_handler(SPEventContext *event_context, GdkEvent *event)
// if it's not click and ctrl or alt was pressed (the latter with some selection
// but not with shift) we want to drag rather than rubberband
sc->dragging = TRUE;
- gdk_window_set_cursor(GTK_WIDGET(sp_desktop_canvas(desktop))->window, CursorSelectDragging);
+ GdkWindow* window = gtk_widget_get_window (GTK_WIDGET (sp_desktop_canvas(desktop)));
+ gdk_window_set_cursor(window, CursorSelectDragging);
sp_canvas_force_full_redraw_after_interruptions(desktop->canvas, 5);
}
@@ -632,7 +639,8 @@ sp_select_context_root_handler(SPEventContext *event_context, GdkEvent *event)
xp = yp = 0;
if ((event->button.button == 1) && (sc->grabbed) && !event_context->space_panning) {
if (sc->dragging) {
- if (sc->moved) {
+ GdkWindow* window;
+ if (sc->moved) {
// item has been moved
seltrans->ungrab();
sc->moved = FALSE;
@@ -664,7 +672,8 @@ sp_select_context_root_handler(SPEventContext *event_context, GdkEvent *event)
}
}
sc->dragging = FALSE;
- gdk_window_set_cursor(GTK_WIDGET(sp_desktop_canvas(desktop))->window, CursorSelectMouseover);
+ window = gtk_widget_get_window (GTK_WIDGET (sp_desktop_canvas(desktop)));
+ gdk_window_set_cursor(window, CursorSelectMouseover);
sp_event_context_discard_delayed_snap_event(event_context);
sp_canvas_end_forced_full_redraws(desktop->canvas);
@@ -877,7 +886,8 @@ sp_select_context_root_handler(SPEventContext *event_context, GdkEvent *event)
_("<b>Alt</b>: click to select under; scroll mouse-wheel to cycle-select; drag to move selected or select by touch"));
// if Alt and nonempty selection, show moving cursor ("move selected"):
if (alt && !selection->isEmpty() && !desktop->isWaitingCursor()) {
- gdk_window_set_cursor(GTK_WIDGET(sp_desktop_canvas(desktop))->window, CursorSelectDragging);
+ GdkWindow* window = gtk_widget_get_window (GTK_WIDGET (sp_desktop_canvas(desktop)));
+ gdk_window_set_cursor(window, CursorSelectDragging);
}
//*/
break;
@@ -1120,7 +1130,8 @@ sp_select_context_root_handler(SPEventContext *event_context, GdkEvent *event)
}
// set cursor to default.
if (!desktop->isWaitingCursor()) {
- gdk_window_set_cursor(GTK_WIDGET(sp_desktop_canvas(desktop))->window, event_context->cursor);
+ GdkWindow* window = gtk_widget_get_window (GTK_WIDGET (sp_desktop_canvas(desktop)));
+ gdk_window_set_cursor(window, event_context->cursor);
}
break;
default:
diff --git a/src/svg-view-widget.cpp b/src/svg-view-widget.cpp
index 44a2d4b2d..1cfb078d3 100644
--- a/src/svg-view-widget.cpp
+++ b/src/svg-view-widget.cpp
@@ -97,7 +97,7 @@ static void sp_svg_view_widget_init(SPSVGSPViewWidget *vw)
gtk_widget_push_colormap (gdk_rgb_get_cmap ());
vw->canvas = sp_canvas_new_aa ();
gtk_widget_pop_colormap ();
- style = gtk_style_copy (vw->canvas->style);
+ style = gtk_style_copy (gtk_widget_get_style (vw->canvas));
style->bg[GTK_STATE_NORMAL] = style->white;
gtk_widget_set_style (vw->canvas, style);
gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (vw->sw), vw->canvas);
diff --git a/src/svg-view.cpp b/src/svg-view.cpp
index 6eca02d5c..5f2208a2d 100644
--- a/src/svg-view.cpp
+++ b/src/svg-view.cpp
@@ -103,13 +103,15 @@ void SPSVGView::doRescale(bool event)
void SPSVGView::mouseover()
{
GdkCursor *cursor = gdk_cursor_new(GDK_HAND2);
- gdk_window_set_cursor(GTK_WIDGET(SP_CANVAS_ITEM(_drawing)->canvas)->window, cursor);
+ GdkWindow *window = gtk_widget_get_window (GTK_WIDGET(SP_CANVAS_ITEM(_drawing)->canvas));
+ gdk_window_set_cursor(window, cursor);
gdk_cursor_unref(cursor);
}
void SPSVGView::mouseout()
{
- gdk_window_set_cursor(GTK_WIDGET(SP_CANVAS_ITEM(_drawing)->canvas)->window, NULL);
+ GdkWindow *window = gtk_widget_get_window (GTK_WIDGET(SP_CANVAS_ITEM(_drawing)->canvas));
+ gdk_window_set_cursor(window, NULL);
}
//----------------------------------------------------------------