mirror of https://github.com/GNOME/gimp.git
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:
parent
3795f9b9c5
commit
8becbc6568
17
ChangeLog
17
ChangeLog
|
@ -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>
|
||||
|
||||
* libgimpwidgets/gimpchainbutton.c
|
||||
|
|
|
@ -794,7 +794,8 @@ gimp_brush_select_button_open_popup (GimpBrushSelectButton *button,
|
|||
gtk_widget_show (preview);
|
||||
|
||||
/* 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_h = gdk_screen_get_height (screen);
|
||||
|
@ -839,15 +840,17 @@ gimp_brush_select_drag_data_received (GimpBrushSelectButton *button,
|
|||
guint info,
|
||||
guint time)
|
||||
{
|
||||
gint length = gtk_selection_data_get_length (selection);
|
||||
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;
|
||||
}
|
||||
|
||||
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))
|
||||
{
|
||||
|
|
|
@ -426,7 +426,8 @@ confirm_save_dialog (const gchar *message,
|
|||
gimp_window_set_transient (GTK_WINDOW (dialog));
|
||||
|
||||
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_widget_show (hbox);
|
||||
|
||||
|
@ -508,7 +509,8 @@ export_dialog (GSList *actions,
|
|||
gimp_window_set_transient (GTK_WINDOW (dialog));
|
||||
|
||||
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_widget_show (hbox);
|
||||
|
||||
|
|
|
@ -390,15 +390,17 @@ gimp_font_select_drag_data_received (GimpFontSelectButton *button,
|
|||
guint info,
|
||||
guint time)
|
||||
{
|
||||
gint length = gtk_selection_data_get_length (selection);
|
||||
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;
|
||||
}
|
||||
|
||||
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))
|
||||
{
|
||||
|
|
|
@ -530,7 +530,7 @@ gimp_gradient_select_preview_expose (GtkWidget *widget,
|
|||
GtkStyle *style = gtk_widget_get_style (widget);
|
||||
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],
|
||||
event->area.x, y,
|
||||
event->area.width, 1,
|
||||
|
@ -553,15 +553,17 @@ gimp_gradient_select_drag_data_received (GimpGradientSelectButton *button,
|
|||
guint info,
|
||||
guint time)
|
||||
{
|
||||
gint length = gtk_selection_data_get_length (selection);
|
||||
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;
|
||||
}
|
||||
|
||||
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))
|
||||
{
|
||||
|
|
|
@ -190,15 +190,17 @@ gimp_image_combo_box_drag_data_received (GtkWidget *widget,
|
|||
guint info,
|
||||
guint time)
|
||||
{
|
||||
gint length = gtk_selection_data_get_length (selection);
|
||||
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;
|
||||
}
|
||||
|
||||
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))
|
||||
{
|
||||
|
|
|
@ -458,15 +458,17 @@ gimp_item_combo_box_drag_data_received (GtkWidget *widget,
|
|||
guint info,
|
||||
guint time)
|
||||
{
|
||||
gint length = gtk_selection_data_get_length (selection);
|
||||
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;
|
||||
}
|
||||
|
||||
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))
|
||||
{
|
||||
|
|
|
@ -407,15 +407,17 @@ gimp_palette_select_drag_data_received (GimpPaletteSelectButton *button,
|
|||
guint info,
|
||||
guint time)
|
||||
{
|
||||
gint length = gtk_selection_data_get_length (selection);
|
||||
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;
|
||||
}
|
||||
|
||||
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))
|
||||
{
|
||||
|
|
|
@ -593,7 +593,8 @@ gimp_pattern_select_button_open_popup (GimpPatternSelectButton *button,
|
|||
gtk_widget_show (preview);
|
||||
|
||||
/* 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_h = gdk_screen_get_height (screen);
|
||||
|
@ -640,15 +641,17 @@ gimp_pattern_select_drag_data_received (GimpPatternSelectButton *button,
|
|||
guint info,
|
||||
guint time)
|
||||
{
|
||||
gint length = gtk_selection_data_get_length (selection);
|
||||
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!");
|
||||
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))
|
||||
{
|
||||
|
|
|
@ -179,12 +179,12 @@ gimp_window_get_native (GtkWindow *window)
|
|||
|
||||
#ifdef GDK_WINDOWING_WIN32
|
||||
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
|
||||
|
||||
#ifdef GDK_WINDOWING_X11
|
||||
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
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -272,7 +272,7 @@ gimp_window_transient_realized (GtkWidget *window,
|
|||
GdkWindow *parent)
|
||||
{
|
||||
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
|
||||
|
@ -291,7 +291,8 @@ gimp_window_set_transient_for (GtkWindow *window,
|
|||
return;
|
||||
|
||||
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_CALLBACK (gimp_window_transient_realized),
|
||||
|
|
|
@ -573,12 +573,13 @@ gimp_zoom_preview_set_cursor (GimpPreview *preview)
|
|||
|
||||
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);
|
||||
}
|
||||
else
|
||||
{
|
||||
gdk_window_set_cursor (preview->area->window, preview->default_cursor);
|
||||
gdk_window_set_cursor (gtk_widget_get_window (preview->area),
|
||||
preview->default_cursor);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -359,14 +359,16 @@ test_clipboard_paste (GtkClipboard *clipboard,
|
|||
const gchar *target,
|
||||
const gchar *filename)
|
||||
{
|
||||
GtkSelectionData *data;
|
||||
GtkSelectionData *sel_data;
|
||||
|
||||
data = gtk_clipboard_wait_for_contents (clipboard,
|
||||
gdk_atom_intern (target,
|
||||
FALSE));
|
||||
if (data)
|
||||
sel_data = gtk_clipboard_wait_for_contents (clipboard,
|
||||
gdk_atom_intern (target,
|
||||
FALSE));
|
||||
if (sel_data)
|
||||
{
|
||||
gint fd;
|
||||
const guchar *data;
|
||||
gint length;
|
||||
gint fd;
|
||||
|
||||
if (! strcmp (filename, "-"))
|
||||
fd = 1;
|
||||
|
@ -380,7 +382,10 @@ test_clipboard_paste (GtkClipboard *clipboard,
|
|||
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);
|
||||
g_printerr ("%s: write() failed: %s",
|
||||
|
@ -395,7 +400,7 @@ test_clipboard_paste (GtkClipboard *clipboard,
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
gtk_selection_data_free (data);
|
||||
gtk_selection_data_free (sel_data);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
|
@ -420,7 +425,8 @@ test_clipboard_copy_callback (GtkClipboard *clipboard,
|
|||
return;
|
||||
}
|
||||
|
||||
gtk_selection_data_set (selection, selection->target,
|
||||
gtk_selection_data_set (selection,
|
||||
gtk_selection_data_get_target (selection),
|
||||
8, (guchar *) buf, buf_size);
|
||||
|
||||
g_free (buf);
|
||||
|
|
Loading…
Reference in New Issue