summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
authorAlex Valavanis <valavanisalex@gmail.com>2011-06-15 00:16:48 +0000
committerAlex Valavanis <valavanisalex@gmail.com>2011-06-15 00:16:48 +0000
commit901027a9b2ef18744d9fef25723018226c80809d (patch)
tree1e3b3e1334421c6db927ad01f27ae9528fd80f7e /src/widgets
parentRemove deprecated glib macro wrappers (diff)
parentClean up deprecated GTK_WIDGET API (diff)
downloadinkscape-901027a9b2ef18744d9fef25723018226c80809d.tar.gz
inkscape-901027a9b2ef18744d9fef25723018226c80809d.zip
Clean up deprecated GTK_WIDGET API
(bzr r10305)
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/desktop-widget.cpp16
-rw-r--r--src/widgets/eek-preview.cpp10
-rw-r--r--src/widgets/font-selector.cpp8
-rw-r--r--src/widgets/gradient-image.cpp6
-rw-r--r--src/widgets/icon.cpp10
-rw-r--r--src/widgets/ruler.cpp4
-rw-r--r--src/widgets/sp-color-preview.cpp6
-rw-r--r--src/widgets/sp-color-slider.cpp4
-rw-r--r--src/widgets/sp-widget.cpp4
-rw-r--r--src/widgets/toolbox.cpp8
10 files changed, 38 insertions, 38 deletions
diff --git a/src/widgets/desktop-widget.cpp b/src/widgets/desktop-widget.cpp
index 69b27d6e4..0d890fa86 100644
--- a/src/widgets/desktop-widget.cpp
+++ b/src/widgets/desktop-widget.cpp
@@ -213,7 +213,7 @@ void CMSPrefWatcher::_setCmsSensitive(bool enabled)
#if ENABLE_LCMS
for ( std::list<SPDesktopWidget*>::iterator it = _widget_list.begin(); it != _widget_list.end(); ++it ) {
SPDesktopWidget *dtw = *it;
- if ( GTK_WIDGET_SENSITIVE( dtw->cms_adjust ) != enabled ) {
+ if ( gtk_widget_get_sensitive( dtw->cms_adjust ) != enabled ) {
cms_adjust_set_sensitive( dtw, enabled );
}
}
@@ -231,7 +231,7 @@ SPDesktopWidget::setMessage (Inkscape::MessageType type, const gchar *message)
gtk_label_set_markup (sb, message ? message : "");
// make sure the important messages are displayed immediately!
- if (type == Inkscape::IMMEDIATE_MESSAGE && GTK_WIDGET_DRAWABLE (GTK_WIDGET(sb))) {
+ if (type == Inkscape::IMMEDIATE_MESSAGE && gtk_widget_is_drawable (GTK_WIDGET(sb))) {
gtk_widget_queue_draw(GTK_WIDGET(sb));
gdk_window_process_updates(GTK_WIDGET(sb)->window, TRUE);
}
@@ -697,7 +697,7 @@ sp_desktop_widget_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
return;
}
- if (GTK_WIDGET_REALIZED (widget)) {
+ if (gtk_widget_get_realized (widget)) {
Geom::Rect const area = dtw->desktop->get_display_area();
double zoom = dtw->desktop->current_zoom();
@@ -1077,7 +1077,7 @@ SPDesktopWidget::letZoomGrabFocus()
void
SPDesktopWidget::getWindowGeometry (gint &x, gint &y, gint &w, gint &h)
{
- gboolean vis = GTK_WIDGET_VISIBLE (this);
+ gboolean vis = gtk_widget_get_visible (GTK_WIDGET(this));
(void)vis; // TODO figure out why it is here but not used.
Gtk::Window *window = (Gtk::Window*)gtk_object_get_data (GTK_OBJECT(this), "window");
@@ -1803,7 +1803,7 @@ void
sp_desktop_widget_toggle_rulers (SPDesktopWidget *dtw)
{
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
- if (GTK_WIDGET_VISIBLE (dtw->hruler)) {
+ if (gtk_widget_get_visible (dtw->hruler)) {
gtk_widget_hide_all (dtw->hruler);
gtk_widget_hide_all (dtw->vruler);
prefs->setBool(dtw->desktop->is_fullscreen() ? "/fullscreen/rulers/state" : "/window/rulers/state", false);
@@ -1818,7 +1818,7 @@ void
sp_desktop_widget_toggle_scrollbars (SPDesktopWidget *dtw)
{
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
- if (GTK_WIDGET_VISIBLE (dtw->hscrollbar)) {
+ if (gtk_widget_get_visible (dtw->hscrollbar)) {
gtk_widget_hide_all (dtw->hscrollbar);
gtk_widget_hide_all (dtw->vscrollbar_box);
gtk_widget_hide_all( dtw->cms_adjust );
@@ -1834,7 +1834,7 @@ sp_desktop_widget_toggle_scrollbars (SPDesktopWidget *dtw)
void sp_desktop_widget_toggle_color_prof_adj( SPDesktopWidget *dtw )
{
- if ( GTK_WIDGET_SENSITIVE( dtw->cms_adjust ) ) {
+ if ( gtk_widget_get_sensitive( dtw->cms_adjust ) ) {
if ( SP_BUTTON_IS_DOWN(dtw->cms_adjust) ) {
sp_button_toggle_set_down( SP_BUTTON(dtw->cms_adjust), FALSE );
} else {
@@ -1848,7 +1848,7 @@ void
sp_spw_toggle_menubar (SPDesktopWidget *dtw, bool is_fullscreen)
{
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
- if (GTK_WIDGET_VISIBLE (dtw->menubar)) {
+ if (gtk_widget_get_visible (dtw->menubar)) {
gtk_widget_hide_all (dtw->menubar);
prefs->setBool(is_fullscreen ? "/fullscreen/menu/state" : "/window/menu/state", false);
} else {
diff --git a/src/widgets/eek-preview.cpp b/src/widgets/eek-preview.cpp
index 816c4bf50..1ca656ae1 100644
--- a/src/widgets/eek-preview.cpp
+++ b/src/widgets/eek-preview.cpp
@@ -192,7 +192,7 @@ static guint eek_preview_signals[LAST_SIGNAL] = { 0 };
gboolean eek_preview_expose_event( GtkWidget* widget, GdkEventExpose* event )
{
-/* g_message("Exposed!!! %s", GTK_WIDGET_HAS_FOCUS(widget) ? "XXX" : "---" ); */
+/* g_message("Exposed!!! %s", gtk_widget_has_focus(widget) ? "XXX" : "---" ); */
gint insetX = 0;
gint insetY = 0;
@@ -218,13 +218,13 @@ gboolean eek_preview_expose_event( GtkWidget* widget, GdkEventExpose* event )
}
*/
- if ( GTK_WIDGET_DRAWABLE( widget ) ) {
+ if ( gtk_widget_is_drawable( widget ) ) {
GtkStyle* style = gtk_widget_get_style( widget );
if ( insetX > 0 || insetY > 0 ) {
gtk_paint_flat_box( style,
widget->window,
- (GtkStateType)GTK_WIDGET_STATE(widget),
+ (GtkStateType)gtk_widget_get_state(widget),
GTK_SHADOW_NONE,
NULL,
widget,
@@ -379,7 +379,7 @@ gboolean eek_preview_expose_event( GtkWidget* widget, GdkEventExpose* event )
}
- if ( GTK_WIDGET_HAS_FOCUS(widget) ) {
+ if ( gtk_widget_has_focus(widget) ) {
gtk_paint_focus( style,
widget->window,
GTK_STATE_NORMAL,
@@ -437,7 +437,7 @@ static gboolean eek_preview_button_press_cb( GtkWidget* widget, GdkEventButton*
if ( gtk_get_event_widget( (GdkEvent*)event ) == widget ) {
EekPreview* preview = EEK_PREVIEW(widget);
- if ( preview->_takesFocus && !GTK_WIDGET_HAS_FOCUS(widget) ) {
+ if ( preview->_takesFocus && !gtk_widget_has_focus(widget) ) {
gtk_widget_grab_focus(widget);
}
diff --git a/src/widgets/font-selector.cpp b/src/widgets/font-selector.cpp
index f493c393a..8c6afeb4c 100644
--- a/src/widgets/font-selector.cpp
+++ b/src/widgets/font-selector.cpp
@@ -620,7 +620,7 @@ static gint sp_font_preview_expose(GtkWidget *widget, GdkEventExpose *event)
{
SPFontPreview *fprev = SP_FONT_PREVIEW(widget);
- if (GTK_WIDGET_DRAWABLE (widget)) {
+ if (gtk_widget_is_drawable (widget)) {
if (fprev->rfont) {
int glyphs[SPFP_MAX_LEN];
@@ -811,13 +811,13 @@ void sp_font_preview_set_font(SPFontPreview *fprev, font_instance *font, SPFontS
fprev->rfont = fprev->font->RasterFont(flip, 0);
}
- if (GTK_WIDGET_DRAWABLE (fprev)) gtk_widget_queue_draw (GTK_WIDGET (fprev));
+ if (gtk_widget_is_drawable (GTK_WIDGET (fprev))) gtk_widget_queue_draw (GTK_WIDGET (fprev));
}
void sp_font_preview_set_rgba32(SPFontPreview *fprev, guint32 rgba)
{
fprev->rgba = rgba;
- if (GTK_WIDGET_DRAWABLE (fprev)) {
+ if (gtk_widget_is_drawable (GTK_WIDGET (fprev))) {
gtk_widget_queue_draw (GTK_WIDGET (fprev));
}
}
@@ -830,7 +830,7 @@ void sp_font_preview_set_phrase(SPFontPreview *fprev, const gchar *phrase)
} else {
fprev->phrase = NULL;
}
- if (GTK_WIDGET_DRAWABLE(fprev)) {
+ if (gtk_widget_is_drawable( GTK_WIDGET (fprev))) {
gtk_widget_queue_draw (GTK_WIDGET (fprev));
}
}
diff --git a/src/widgets/gradient-image.cpp b/src/widgets/gradient-image.cpp
index 62a063755..f3a471bfc 100644
--- a/src/widgets/gradient-image.cpp
+++ b/src/widgets/gradient-image.cpp
@@ -165,7 +165,7 @@ sp_gradient_image_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
widget->allocation = *allocation;
- if (GTK_WIDGET_REALIZED (widget)) {
+ if (gtk_widget_get_realized (widget)) {
g_free (image->px);
image->px = g_new (guchar, 3 * VBLOCK * allocation->width);
}
@@ -180,7 +180,7 @@ sp_gradient_image_expose (GtkWidget *widget, GdkEventExpose *event)
image = SP_GRADIENT_IMAGE (widget);
- if (GTK_WIDGET_DRAWABLE (widget)) {
+ if (gtk_widget_is_drawable (widget)) {
gint x0, y0, x1, y1;
x0 = MAX (event->area.x, widget->allocation.x);
y0 = MAX (event->area.y, widget->allocation.y);
@@ -288,7 +288,7 @@ sp_gradient_image_update (SPGradientImage *image)
nr_pixblock_release (&pb);
}
- if (GTK_WIDGET_DRAWABLE (image)) {
+ if (gtk_widget_is_drawable (GTK_WIDGET (image))) {
gtk_widget_queue_draw (GTK_WIDGET (image));
}
}
diff --git a/src/widgets/icon.cpp b/src/widgets/icon.cpp
index c2634f6a1..b1d5c73bb 100644
--- a/src/widgets/icon.cpp
+++ b/src/widgets/icon.cpp
@@ -176,7 +176,7 @@ void IconImpl::classInit(SPIconClass *klass)
void IconImpl::init(SPIcon *icon)
{
- GTK_WIDGET_FLAGS(icon) |= GTK_NO_WINDOW;
+ gtk_widget_set_has_window (GTK_WIDGET (icon), FALSE);
icon->lsize = Inkscape::ICON_SIZE_BUTTON;
icon->psize = 0;
icon->name = 0;
@@ -224,14 +224,14 @@ void IconImpl::sizeAllocate(GtkWidget *widget, GtkAllocation *allocation)
{
widget->allocation = *allocation;
- if (GTK_WIDGET_DRAWABLE(widget)) {
+ if (gtk_widget_is_drawable(widget)) {
gtk_widget_queue_draw(widget);
}
}
int IconImpl::expose(GtkWidget *widget, GdkEventExpose *event)
{
- if ( GTK_WIDGET_DRAWABLE(widget) ) {
+ if ( gtk_widget_is_drawable(widget) ) {
SPIcon *icon = SP_ICON(widget);
if ( !icon->pb ) {
fetchPixbuf( icon );
@@ -995,13 +995,13 @@ void IconImpl::paint(SPIcon *icon, GdkRectangle const */*area*/)
bool unref_image = false;
/* copied from the expose function of GtkImage */
- if (GTK_WIDGET_STATE (icon) != GTK_STATE_NORMAL && image) {
+ if (gtk_widget_get_state (GTK_WIDGET(icon)) != GTK_STATE_NORMAL && image) {
GtkIconSource *source = gtk_icon_source_new();
gtk_icon_source_set_pixbuf(source, icon->pb);
gtk_icon_source_set_size(source, GTK_ICON_SIZE_SMALL_TOOLBAR); // note: this is boilerplate and not used
gtk_icon_source_set_size_wildcarded(source, FALSE);
image = gtk_style_render_icon (widget.style, source, gtk_widget_get_direction(&widget),
- (GtkStateType) GTK_WIDGET_STATE(&widget), (GtkIconSize)-1, &widget, "gtk-image");
+ (GtkStateType) gtk_widget_get_state(&widget), (GtkIconSize)-1, &widget, "gtk-image");
gtk_icon_source_free(source);
unref_image = true;
}
diff --git a/src/widgets/ruler.cpp b/src/widgets/ruler.cpp
index dd0336413..704d395f7 100644
--- a/src/widgets/ruler.cpp
+++ b/src/widgets/ruler.cpp
@@ -246,7 +246,7 @@ sp_ruler_common_draw_ticks (GtkRuler *ruler)
g_return_if_fail (ruler != NULL);
- if (!GTK_WIDGET_DRAWABLE (ruler))
+ if (!gtk_widget_is_drawable (GTK_WIDGET (ruler)))
return;
g_object_get(G_OBJECT(ruler), "orientation", &orientation, NULL);
@@ -425,6 +425,6 @@ sp_ruler_set_metric (GtkRuler *ruler,
ruler->metric = const_cast<GtkRulerMetric *>(&sp_ruler_metrics[metric]);
- if (GTK_WIDGET_DRAWABLE (ruler))
+ if (gtk_widget_is_drawable (GTK_WIDGET (ruler)))
gtk_widget_queue_draw (GTK_WIDGET (ruler));
}
diff --git a/src/widgets/sp-color-preview.cpp b/src/widgets/sp-color-preview.cpp
index aad850b7c..433301f85 100644
--- a/src/widgets/sp-color-preview.cpp
+++ b/src/widgets/sp-color-preview.cpp
@@ -110,7 +110,7 @@ sp_color_preview_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
widget->allocation = *allocation;
- if (GTK_WIDGET_DRAWABLE (image)) {
+ if (gtk_widget_is_drawable (GTK_WIDGET (image))) {
gtk_widget_queue_draw (GTK_WIDGET (image));
}
}
@@ -122,7 +122,7 @@ sp_color_preview_expose (GtkWidget *widget, GdkEventExpose *event)
cp = SP_COLOR_PREVIEW (widget);
- if (GTK_WIDGET_DRAWABLE (widget)) {
+ if (gtk_widget_is_drawable (widget)) {
sp_color_preview_paint (cp, &event->area);
}
@@ -146,7 +146,7 @@ sp_color_preview_set_rgba32 (SPColorPreview *cp, guint32 rgba)
{
cp->rgba = rgba;
- if (GTK_WIDGET_DRAWABLE (cp)) {
+ if (gtk_widget_is_drawable (GTK_WIDGET (cp))) {
gtk_widget_queue_draw (GTK_WIDGET (cp));
}
}
diff --git a/src/widgets/sp-color-slider.cpp b/src/widgets/sp-color-slider.cpp
index efea69590..7b365bc73 100644
--- a/src/widgets/sp-color-slider.cpp
+++ b/src/widgets/sp-color-slider.cpp
@@ -235,7 +235,7 @@ sp_color_slider_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
widget->allocation = *allocation;
- if (GTK_WIDGET_REALIZED (widget)) {
+ if (gtk_widget_get_realized (widget)) {
/* Resize GdkWindow */
gdk_window_move_resize (widget->window, allocation->x, allocation->y, allocation->width, allocation->height);
}
@@ -248,7 +248,7 @@ sp_color_slider_expose (GtkWidget *widget, GdkEventExpose *event)
slider = SP_COLOR_SLIDER (widget);
- if (GTK_WIDGET_DRAWABLE (widget)) {
+ if (gtk_widget_is_drawable (widget)) {
gint width, height;
width = widget->allocation.width;
height = widget->allocation.height;
diff --git a/src/widgets/sp-widget.cpp b/src/widgets/sp-widget.cpp
index fd20d8e17..d5877db99 100644
--- a/src/widgets/sp-widget.cpp
+++ b/src/widgets/sp-widget.cpp
@@ -188,7 +188,7 @@ sp_widget_expose (GtkWidget *widget, GdkEventExpose *event)
gtk_container_propagate_expose (GTK_CONTAINER(widget), bin->child, event);
}
/*
- if ((bin->child) && (GTK_WIDGET_NO_WINDOW (bin->child))) {
+ if ((bin->child) && (!gtk_widget_get_has_window (bin->child))) {
GdkEventExpose ce;
ce = *event;
gtk_widget_event (bin->child, (GdkEvent *) &ce);
@@ -237,7 +237,7 @@ sp_widget_construct_global (SPWidget *spw, Inkscape::Application *inkscape)
g_return_val_if_fail (!spw->inkscape, NULL);
spw->inkscape = inkscape;
- if (GTK_WIDGET_VISIBLE (spw)) {
+ if (gtk_widget_get_visible (GTK_WIDGET(spw))) {
g_signal_connect (G_OBJECT (inkscape), "modify_selection", G_CALLBACK (sp_widget_modify_selection), spw);
g_signal_connect (G_OBJECT (inkscape), "change_selection", G_CALLBACK (sp_widget_change_selection), spw);
g_signal_connect (G_OBJECT (inkscape), "set_selection", G_CALLBACK (sp_widget_set_selection), spw);
diff --git a/src/widgets/toolbox.cpp b/src/widgets/toolbox.cpp
index 30fb753de..67c15139f 100644
--- a/src/widgets/toolbox.cpp
+++ b/src/widgets/toolbox.cpp
@@ -1794,7 +1794,7 @@ void ToolboxFactory::setOrientation(GtkWidget* toolbox, GtkOrientation orientati
{
#if DUMP_DETAILS
g_message("Set orientation for %p to be %d", toolbox, orientation);
- GType type = GTK_WIDGET_TYPE(toolbox);
+ GType type = G_OBJECT_TYPE(toolbox);
g_message(" [%s]", g_type_name(type));
g_message(" %p", g_object_get_data(G_OBJECT(toolbox), BAR_ID_KEY));
#endif
@@ -1809,7 +1809,7 @@ void ToolboxFactory::setOrientation(GtkWidget* toolbox, GtkOrientation orientati
GtkWidget* child = gtk_bin_get_child(GTK_BIN(toolbox));
if (child) {
#if DUMP_DETAILS
- GType type2 = GTK_WIDGET_TYPE(child);
+ GType type2 = G_OBJECT_TYPE(child);
g_message(" child [%s]", g_type_name(type2));
#endif // DUMP_DETAILS
@@ -1823,7 +1823,7 @@ void ToolboxFactory::setOrientation(GtkWidget* toolbox, GtkOrientation orientati
for (GList* curr = children; curr; curr = g_list_next(curr)) {
GtkWidget* child2 = GTK_WIDGET(curr->data);
#if DUMP_DETAILS
- GType type3 = GTK_WIDGET_TYPE(child2);
+ GType type3 = G_OBJECT_TYPE(child2);
g_message(" child2 [%s]", g_type_name(type3));
#endif // DUMP_DETAILS
@@ -1833,7 +1833,7 @@ void ToolboxFactory::setOrientation(GtkWidget* toolbox, GtkOrientation orientati
for (GList* curr2 = children2; curr2; curr2 = g_list_next(curr2)) {
GtkWidget* child3 = GTK_WIDGET(curr2->data);
#if DUMP_DETAILS
- GType type4 = GTK_WIDGET_TYPE(child3);
+ GType type4 = G_OBJECT_TYPE(child3);
g_message(" child3 [%s]", g_type_name(type4));
#endif // DUMP_DETAILS
if (GTK_IS_TOOLBAR(child3)) {