libgimp/gimpbrushselectbutton.c libgimp/gimpexport.c

2009-03-22  Michael Natterer  <mitch@gimp.org>

	* libgimp/gimpbrushselectbutton.c
	* libgimp/gimpexport.c
	* libgimp/gimpfontselectbutton.c
	* libgimp/gimpgradientselectbutton.c
	* libgimp/gimpimagecombobox.c
	* libgimp/gimpitemcombobox.c
	* libgimp/gimppaletteselectbutton.c
	* libgimp/gimppatternselectbutton.c
	* libgimp/gimpprogressbar.c
	* libgimp/gimpui.c
	* libgimp/gimpzoompreview.c
	* tools/test-clipboard.c: use accessors for various members of
	GTK+ structures that don't exist any longer when GSEAL_ENABLE is
	defined.


svn path=/trunk/; revision=28191
This commit is contained in:
Michael Natterer 2009-03-22 15:49:13 +00:00 committed by Michael Natterer
parent 3795f9b9c5
commit 8becbc6568
13 changed files with 83 additions and 40 deletions

View File

@ -1,3 +1,20 @@
2009-03-22 Michael Natterer <mitch@gimp.org>
* libgimp/gimpbrushselectbutton.c
* libgimp/gimpexport.c
* libgimp/gimpfontselectbutton.c
* libgimp/gimpgradientselectbutton.c
* libgimp/gimpimagecombobox.c
* libgimp/gimpitemcombobox.c
* libgimp/gimppaletteselectbutton.c
* libgimp/gimppatternselectbutton.c
* libgimp/gimpprogressbar.c
* libgimp/gimpui.c
* libgimp/gimpzoompreview.c
* tools/test-clipboard.c: use accessors for various members of
GTK+ structures that don't exist any longer when GSEAL_ENABLE is
defined.
2009-03-22 Michael Natterer <mitch@gimp.org> 2009-03-22 Michael Natterer <mitch@gimp.org>
* libgimpwidgets/gimpchainbutton.c * libgimpwidgets/gimpchainbutton.c

View File

@ -794,7 +794,8 @@ gimp_brush_select_button_open_popup (GimpBrushSelectButton *button,
gtk_widget_show (preview); gtk_widget_show (preview);
/* decide where to put the popup */ /* decide where to put the popup */
gdk_window_get_origin (priv->preview->window, &x_org, &y_org); gdk_window_get_origin (gtk_widget_get_window (priv->preview),
&x_org, &y_org);
scr_w = gdk_screen_get_width (screen); scr_w = gdk_screen_get_width (screen);
scr_h = gdk_screen_get_height (screen); scr_h = gdk_screen_get_height (screen);
@ -839,15 +840,17 @@ gimp_brush_select_drag_data_received (GimpBrushSelectButton *button,
guint info, guint info,
guint time) guint time)
{ {
gint length = gtk_selection_data_get_length (selection);
gchar *str; gchar *str;
if ((selection->format != 8) || (selection->length < 1)) if (gtk_selection_data_get_format (selection) != 8 || length < 1)
{ {
g_warning ("Received invalid brush data!"); g_warning ("%s: received invalid brush data", G_STRFUNC);
return; return;
} }
str = g_strndup ((const gchar *) selection->data, selection->length); str = g_strndup ((const gchar *) gtk_selection_data_get_data (selection),
length);
if (g_utf8_validate (str, -1, NULL)) if (g_utf8_validate (str, -1, NULL))
{ {

View File

@ -426,7 +426,8 @@ confirm_save_dialog (const gchar *message,
gimp_window_set_transient (GTK_WINDOW (dialog)); gimp_window_set_transient (GTK_WINDOW (dialog));
hbox = gtk_hbox_new (FALSE, 12); hbox = gtk_hbox_new (FALSE, 12);
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), hbox); gtk_container_add (GTK_CONTAINER (gtk_dialog_get_content_area (GTK_DIALOG (dialog))),
hbox);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 12); gtk_container_set_border_width (GTK_CONTAINER (hbox), 12);
gtk_widget_show (hbox); gtk_widget_show (hbox);
@ -508,7 +509,8 @@ export_dialog (GSList *actions,
gimp_window_set_transient (GTK_WINDOW (dialog)); gimp_window_set_transient (GTK_WINDOW (dialog));
hbox = gtk_hbox_new (FALSE, 12); hbox = gtk_hbox_new (FALSE, 12);
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), hbox); gtk_container_add (GTK_CONTAINER (gtk_dialog_get_content_area (GTK_DIALOG (dialog))),
hbox);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 12); gtk_container_set_border_width (GTK_CONTAINER (hbox), 12);
gtk_widget_show (hbox); gtk_widget_show (hbox);

View File

@ -390,15 +390,17 @@ gimp_font_select_drag_data_received (GimpFontSelectButton *button,
guint info, guint info,
guint time) guint time)
{ {
gint length = gtk_selection_data_get_length (selection);
gchar *str; gchar *str;
if ((selection->format != 8) || (selection->length < 1)) if (gtk_selection_data_get_format (selection) != 8 || length < 1)
{ {
g_warning ("Received invalid font data!"); g_warning ("%s: received invalid font data", G_STRFUNC);
return; return;
} }
str = g_strndup ((const gchar *) selection->data, selection->length); str = g_strndup ((const gchar *) gtk_selection_data_get_data (selection),
length);
if (g_utf8_validate (str, -1, NULL)) if (g_utf8_validate (str, -1, NULL))
{ {

View File

@ -530,7 +530,7 @@ gimp_gradient_select_preview_expose (GtkWidget *widget,
GtkStyle *style = gtk_widget_get_style (widget); GtkStyle *style = gtk_widget_get_style (widget);
guchar *buf = ((y / GIMP_CHECK_SIZE_SM) & 1) ? odd : even; guchar *buf = ((y / GIMP_CHECK_SIZE_SM) & 1) ? odd : even;
gdk_draw_rgb_image_dithalign (widget->window, gdk_draw_rgb_image_dithalign (gtk_widget_get_window (widget),
style->fg_gc[widget->state], style->fg_gc[widget->state],
event->area.x, y, event->area.x, y,
event->area.width, 1, event->area.width, 1,
@ -553,15 +553,17 @@ gimp_gradient_select_drag_data_received (GimpGradientSelectButton *button,
guint info, guint info,
guint time) guint time)
{ {
gint length = gtk_selection_data_get_length (selection);
gchar *str; gchar *str;
if ((selection->format != 8) || (selection->length < 1)) if (gtk_selection_data_get_format (selection) != 8 || length < 1)
{ {
g_warning ("Received invalid gradient data!"); g_warning ("%s: received invalid gradient data", G_STRFUNC);
return; return;
} }
str = g_strndup ((const gchar *) selection->data, selection->length); str = g_strndup ((const gchar *) gtk_selection_data_get_data (selection),
length);
if (g_utf8_validate (str, -1, NULL)) if (g_utf8_validate (str, -1, NULL))
{ {

View File

@ -190,15 +190,17 @@ gimp_image_combo_box_drag_data_received (GtkWidget *widget,
guint info, guint info,
guint time) guint time)
{ {
gint length = gtk_selection_data_get_length (selection);
gchar *str; gchar *str;
if ((selection->format != 8) || (selection->length < 1)) if (gtk_selection_data_get_format (selection) != 8 || length < 1)
{ {
g_warning ("Received invalid image ID data!"); g_warning ("%s: received invalid image ID data", G_STRFUNC);
return; return;
} }
str = g_strndup ((const gchar *) selection->data, selection->length); str = g_strndup ((const gchar *) gtk_selection_data_get_data (selection),
length);
if (g_utf8_validate (str, -1, NULL)) if (g_utf8_validate (str, -1, NULL))
{ {

View File

@ -458,15 +458,17 @@ gimp_item_combo_box_drag_data_received (GtkWidget *widget,
guint info, guint info,
guint time) guint time)
{ {
gint length = gtk_selection_data_get_length (selection);
gchar *str; gchar *str;
if ((selection->format != 8) || (selection->length < 1)) if (gtk_selection_data_get_format (selection) != 8 || length < 1)
{ {
g_warning ("Received invalid item ID data!"); g_warning ("%s: received invalid item ID data", G_STRFUNC);
return; return;
} }
str = g_strndup ((const gchar *) selection->data, selection->length); str = g_strndup ((const gchar *) gtk_selection_data_get_data (selection),
length);
if (g_utf8_validate (str, -1, NULL)) if (g_utf8_validate (str, -1, NULL))
{ {

View File

@ -407,15 +407,17 @@ gimp_palette_select_drag_data_received (GimpPaletteSelectButton *button,
guint info, guint info,
guint time) guint time)
{ {
gint length = gtk_selection_data_get_length (selection);
gchar *str; gchar *str;
if ((selection->format != 8) || (selection->length < 1)) if (gtk_selection_data_get_format (selection) != 8 || length < 1)
{ {
g_warning ("Received invalid palette data!"); g_warning ("%s: received invalid palette data", G_STRFUNC);
return; return;
} }
str = g_strndup ((const gchar *) selection->data, selection->length); str = g_strndup ((const gchar *) gtk_selection_data_get_data (selection),
length);
if (g_utf8_validate (str, -1, NULL)) if (g_utf8_validate (str, -1, NULL))
{ {

View File

@ -593,7 +593,8 @@ gimp_pattern_select_button_open_popup (GimpPatternSelectButton *button,
gtk_widget_show (preview); gtk_widget_show (preview);
/* decide where to put the popup */ /* decide where to put the popup */
gdk_window_get_origin (priv->preview->window, &x_org, &y_org); gdk_window_get_origin (gtk_widget_get_window (priv->preview),
&x_org, &y_org);
scr_w = gdk_screen_get_width (screen); scr_w = gdk_screen_get_width (screen);
scr_h = gdk_screen_get_height (screen); scr_h = gdk_screen_get_height (screen);
@ -640,15 +641,17 @@ gimp_pattern_select_drag_data_received (GimpPatternSelectButton *button,
guint info, guint info,
guint time) guint time)
{ {
gint length = gtk_selection_data_get_length (selection);
gchar *str; gchar *str;
if ((selection->format != 8) || (selection->length < 1)) if (gtk_selection_data_get_format (selection) != 8 || length < 1)
{ {
g_warning ("Received invalid pattern data!"); g_warning ("Received invalid pattern data!");
return; return;
} }
str = g_strndup ((const gchar *) selection->data, selection->length); str = g_strndup ((const gchar *) gtk_selection_data_get_data (selection),
length);
if (g_utf8_validate (str, -1, NULL)) if (g_utf8_validate (str, -1, NULL))
{ {

View File

@ -179,12 +179,12 @@ gimp_window_get_native (GtkWindow *window)
#ifdef GDK_WINDOWING_WIN32 #ifdef GDK_WINDOWING_WIN32
if (window && GTK_WIDGET_REALIZED (window)) if (window && GTK_WIDGET_REALIZED (window))
return GDK_WINDOW_HWND (GTK_WIDGET (window)->window); return GDK_WINDOW_HWND (gtk_widget_get_window (GTK_WIDGET (window)));
#endif #endif
#ifdef GDK_WINDOWING_X11 #ifdef GDK_WINDOWING_X11
if (window && GTK_WIDGET_REALIZED (window)) if (window && GTK_WIDGET_REALIZED (window))
return GDK_WINDOW_XID (GTK_WIDGET (window)->window); return GDK_WINDOW_XID (gtk_widget_get_window (GTK_WIDGET (window)));
#endif #endif
return 0; return 0;

View File

@ -272,7 +272,7 @@ gimp_window_transient_realized (GtkWidget *window,
GdkWindow *parent) GdkWindow *parent)
{ {
if (GTK_WIDGET_REALIZED (window)) if (GTK_WIDGET_REALIZED (window))
gdk_window_set_transient_for (window->window, parent); gdk_window_set_transient_for (gtk_widget_get_window (window), parent);
} }
static void static void
@ -291,7 +291,8 @@ gimp_window_set_transient_for (GtkWindow *window,
return; return;
if (GTK_WIDGET_REALIZED (window)) if (GTK_WIDGET_REALIZED (window))
gdk_window_set_transient_for (GTK_WIDGET (window)->window, parent); gdk_window_set_transient_for (gtk_widget_get_window (GTK_WIDGET (window)),
parent);
g_signal_connect_object (window, "realize", g_signal_connect_object (window, "realize",
G_CALLBACK (gimp_window_transient_realized), G_CALLBACK (gimp_window_transient_realized),

View File

@ -573,12 +573,13 @@ gimp_zoom_preview_set_cursor (GimpPreview *preview)
if (gimp_zoom_preview_get_factor (GIMP_ZOOM_PREVIEW (preview)) > 1.0) if (gimp_zoom_preview_get_factor (GIMP_ZOOM_PREVIEW (preview)) > 1.0)
{ {
gdk_window_set_cursor (preview->area->window, gdk_window_set_cursor (gtk_widget_get_window (preview->area),
GIMP_SCROLLED_PREVIEW (preview)->cursor_move); GIMP_SCROLLED_PREVIEW (preview)->cursor_move);
} }
else else
{ {
gdk_window_set_cursor (preview->area->window, preview->default_cursor); gdk_window_set_cursor (gtk_widget_get_window (preview->area),
preview->default_cursor);
} }
} }

View File

@ -359,14 +359,16 @@ test_clipboard_paste (GtkClipboard *clipboard,
const gchar *target, const gchar *target,
const gchar *filename) const gchar *filename)
{ {
GtkSelectionData *data; GtkSelectionData *sel_data;
data = gtk_clipboard_wait_for_contents (clipboard, sel_data = gtk_clipboard_wait_for_contents (clipboard,
gdk_atom_intern (target, gdk_atom_intern (target,
FALSE)); FALSE));
if (data) if (sel_data)
{ {
gint fd; const guchar *data;
gint length;
gint fd;
if (! strcmp (filename, "-")) if (! strcmp (filename, "-"))
fd = 1; fd = 1;
@ -380,7 +382,10 @@ test_clipboard_paste (GtkClipboard *clipboard,
return FALSE; return FALSE;
} }
if (write (fd, data->data, data->length) < data->length) data = gtk_selection_data_get_data (sel_data);
length = gtk_selection_data_get_length (sel_data);
if (write (fd, data, length) < length)
{ {
close (fd); close (fd);
g_printerr ("%s: write() failed: %s", g_printerr ("%s: write() failed: %s",
@ -395,7 +400,7 @@ test_clipboard_paste (GtkClipboard *clipboard,
return FALSE; return FALSE;
} }
gtk_selection_data_free (data); gtk_selection_data_free (sel_data);
} }
return TRUE; return TRUE;
@ -420,7 +425,8 @@ test_clipboard_copy_callback (GtkClipboard *clipboard,
return; return;
} }
gtk_selection_data_set (selection, selection->target, gtk_selection_data_set (selection,
gtk_selection_data_get_target (selection),
8, (guchar *) buf, buf_size); 8, (guchar *) buf, buf_size);
g_free (buf); g_free (buf);