Commit 3b6318bf authored by Manish Singh's avatar Manish Singh Committed by Manish Singh
Browse files

Only add FOO_DISABLE_DEPRECATED flags with GTK+ 2.2.x. Add

2003-11-01  Manish Singh  <yosh@gimp.org>

        * configure.in: Only add FOO_DISABLE_DEPRECATED flags with GTK+ 2.2.x.
        Add -DGDK_MULTIHEAD_SAFE.

        * app/config/test-config.c: use guints for strlen()

        * app/gui/gui.c
        * app/gui/info-window.c
        * app/gui/menus.c
        * app/widgets/gimpcontainerview.c
        * app/widgets/gimpcursor.c
        * app/widgets/gimpdevices.c
        * app/widgets/gimpdevicestatus.c
        * app/widgets/gimpimagedock.c
        * app/widgets/gimpitemfactory.c
        * app/widgets/gimpnavigationpreview.c
        * app/widgets/gimptoolbox.c
        * app/widgets/gimptooloptionseditor.c
        * app/widgets/gimpwidgets-utils.c
        * libgimp/gimpbrushmenu.c
        * libgimp/gimppatternmenu.c
        * libgimp/gimpui.c
        * plug-ins/FractalExplorer/Dialogs.c
        * plug-ins/FractalExplorer/FractalExplorer.c
        * plug-ins/common/screenshot.c
        * plug-ins/gimpressionist/gimpressionist.c: more GDK_MULTIHEAD_SAFE
        fixes.

        * plug-ins/common/wmf.c: #undef GDK_MULTIHEAD_SAFE.. this plug-in
        is going away anyway.

        * app/widgets/gimpcursor.h: add #warning about needing a proper
        multihead safe API.

        * app/gui/vectors-commands.c: s/clipoard/clipboard/
parent 8e8c2176
2003-11-01 Manish Singh <yosh@gimp.org>
* configure.in: Only add FOO_DISABLE_DEPRECATED flags with GTK+ 2.2.x.
Add -DGDK_MULTIHEAD_SAFE.
* app/config/test-config.c: use guints for strlen()
* app/gui/gui.c
* app/gui/info-window.c
* app/gui/menus.c
* app/widgets/gimpcontainerview.c
* app/widgets/gimpcursor.c
* app/widgets/gimpdevices.c
* app/widgets/gimpdevicestatus.c
* app/widgets/gimpimagedock.c
* app/widgets/gimpitemfactory.c
* app/widgets/gimpnavigationpreview.c
* app/widgets/gimptoolbox.c
* app/widgets/gimptooloptionseditor.c
* app/widgets/gimpwidgets-utils.c
* libgimp/gimpbrushmenu.c
* libgimp/gimppatternmenu.c
* libgimp/gimpui.c
* plug-ins/FractalExplorer/Dialogs.c
* plug-ins/FractalExplorer/FractalExplorer.c
* plug-ins/common/screenshot.c
* plug-ins/gimpressionist/gimpressionist.c: more GDK_MULTIHEAD_SAFE
fixes.
* plug-ins/common/wmf.c: #undef GDK_MULTIHEAD_SAFE.. this plug-in
is going away anyway.
* app/widgets/gimpcursor.h: add #warning about needing a proper
multihead safe API.
* app/gui/vectors-commands.c: s/clipoard/clipboard/
2003-11-01 Sven Neumann <sven@gimp.org>
 
* app/composite/Makefile.am (EXTRA_PROGRAMS): removed
......@@ -196,7 +196,7 @@ vectors_copy_cmd_callback (GtkWidget *widget,
return_if_no_vectors (gimage, active_vectors, data);
#ifdef __GNUC__
#warning FIXME: need vectors clipoard
#warning FIXME: need vectors clipboard
#endif
}
......@@ -208,7 +208,7 @@ vectors_paste_cmd_callback (GtkWidget *widget,
return_if_no_image (gimage, data);
#ifdef __GNUC__
#warning FIXME: need vectors clipoard
#warning FIXME: need vectors clipboard
#endif
}
......
......@@ -164,7 +164,7 @@ main (int argc,
return EXIT_FAILURE;
}
g_print ("OK (%d bytes)\n", result ? strlen (result) : 0);
g_print ("OK (%u bytes)\n", result ? (guint) strlen (result) : 0);
}
g_free (result);
......
......@@ -535,7 +535,11 @@ info_window_update (GimpDisplay *gdisp)
}
{
GdkVisual *visual = gdk_rgb_get_visual ();
GdkScreen *screen;
GdkVisual *visual;
screen = gtk_widget_get_screen (GTK_WIDGET (shell));
visual = gdk_screen_get_rgb_visual (screen);
/* visual class */
g_snprintf (iwd->visual_class_str, MAX_BUF, "%s",
......
......@@ -185,7 +185,8 @@ gui_init (Gimp *gimp,
gboolean no_splash,
gboolean no_splash_image)
{
GimpInitStatusFunc status_callback = NULL;
GimpInitStatusFunc status_callback = NULL;
GdkScreen *screen;
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
g_return_val_if_fail (the_gui_gimp == NULL, NULL);
......@@ -197,7 +198,8 @@ gui_init (Gimp *gimp,
gdk_rgb_set_min_colors (CLAMP (gimp->config->min_colors, 27, 256));
gdk_rgb_set_install (gimp->config->install_cmap);
gtk_widget_set_default_colormap (gdk_rgb_get_colormap ());
screen = gdk_screen_get_default ();
gtk_widget_set_default_colormap (gdk_screen_get_rgb_colormap (screen));
if (! no_splash)
{
......
......@@ -535,7 +535,11 @@ info_window_update (GimpDisplay *gdisp)
}
{
GdkVisual *visual = gdk_rgb_get_visual ();
GdkScreen *screen;
GdkVisual *visual;
screen = gtk_widget_get_screen (GTK_WIDGET (shell));
visual = gdk_screen_get_rgb_visual (screen);
/* visual class */
g_snprintf (iwd->visual_class_str, MAX_BUF, "%s",
......
......@@ -516,7 +516,7 @@ menus_last_opened_reorder (GimpContainer *container,
static void
menu_can_change_accels (GimpGuiConfig *config)
{
g_object_set (gtk_settings_get_default (),
g_object_set (gtk_settings_get_for_screen (gdk_screen_get_default ()),
"gtk-can-change-accels", config->can_change_accels,
NULL);
}
......@@ -196,7 +196,7 @@ vectors_copy_cmd_callback (GtkWidget *widget,
return_if_no_vectors (gimage, active_vectors, data);
#ifdef __GNUC__
#warning FIXME: need vectors clipoard
#warning FIXME: need vectors clipboard
#endif
}
......@@ -208,7 +208,7 @@ vectors_paste_cmd_callback (GtkWidget *widget,
return_if_no_image (gimage, data);
#ifdef __GNUC__
#warning FIXME: need vectors clipoard
#warning FIXME: need vectors clipboard
#endif
}
......
......@@ -516,7 +516,7 @@ menus_last_opened_reorder (GimpContainer *container,
static void
menu_can_change_accels (GimpGuiConfig *config)
{
g_object_set (gtk_settings_get_default (),
g_object_set (gtk_settings_get_for_screen (gdk_screen_get_default ()),
"gtk-can-change-accels", config->can_change_accels,
NULL);
}
......@@ -786,6 +786,7 @@ gimp_container_view_get_preview (GimpDocked *docked,
{
GimpContainerView *view = GIMP_CONTAINER_VIEW (docked);
GtkWidget *preview;
GdkScreen *screen;
gint width;
gint height;
gint border_width = 1;
......@@ -793,7 +794,9 @@ gimp_container_view_get_preview (GimpDocked *docked,
g_return_val_if_fail (view->container != NULL, NULL);
gtk_icon_size_lookup (size, &width, &height);
screen = gtk_widget_get_screen (GTK_WIDGET (view));
gtk_icon_size_lookup_for_settings (gtk_settings_get_for_screen (screen),
size, &width, &height);
prop_name = gimp_context_type_to_prop_name (view->container->children_type);
......
......@@ -440,7 +440,7 @@ gimp_cursor_new (GimpCursorType cursor_type,
g_return_val_if_fail (cursor_type < GIMP_LAST_CURSOR_ENTRY, NULL);
if (cursor_type <= GDK_LAST_CURSOR)
return gdk_cursor_new (cursor_type);
return gdk_cursor_new_for_display (gdk_display_get_default (), cursor_type);
g_return_val_if_fail (cursor_type >= GIMP_MOUSE_CURSOR, NULL);
......
......@@ -19,6 +19,9 @@
#ifndef __GIMP_CURSOR_H__
#define __GIMP_CURSOR_H__
#ifdef __GNUC__
#warning FIXME: need a new API that passes a display for gimp_cursor_new()
#endif
GdkCursor * gimp_cursor_new (GimpCursorType curtype,
GimpToolCursorType tool_cursor,
......
......@@ -67,11 +67,13 @@ gimp_devices_init (Gimp *gimp,
GdkDevice *device;
GimpDeviceInfo *device_info;
GList *list;
GdkDisplay *display;
g_return_if_fail (GIMP_IS_GIMP (gimp));
g_return_if_fail (gimp_device_manager_get (gimp) == NULL);
display = gdk_display_get_default ();
manager = g_new0 (GimpDeviceManager, 1);
g_object_set_data_full (G_OBJECT (gimp),
......@@ -80,11 +82,11 @@ gimp_devices_init (Gimp *gimp,
manager->device_info_list = gimp_list_new (GIMP_TYPE_DEVICE_INFO,
GIMP_CONTAINER_POLICY_STRONG);
manager->current_device = gdk_display_get_core_pointer (gdk_display_get_default ());
manager->current_device = gdk_display_get_core_pointer (display);
manager->change_notify = change_notify;
/* create device info structures for present devices */
for (list = gdk_devices_list (); list; list = g_list_next (list))
for (list = gdk_display_list_devices (display); list; list = list->next)
{
device = (GdkDevice *) list->data;
......
......@@ -130,12 +130,15 @@ gimp_device_status_class_init (GimpDeviceStatusClass *klass)
static void
gimp_device_status_init (GimpDeviceStatus *status)
{
GList *list;
gint i;
GdkDisplay *display;
GList *list;
gint i;
display = gtk_widget_get_display (GTK_WIDGET (status));
status->gimp = NULL;
status->current_device = NULL;
status->num_devices = g_list_length (gdk_devices_list ());
status->num_devices = g_list_length (gdk_display_list_devices (display));
status->entries = g_new0 (GimpDeviceStatusEntry,
status->num_devices);
......@@ -149,9 +152,9 @@ gimp_device_status_init (GimpDeviceStatus *status)
gtk_container_add (GTK_CONTAINER (status), status->table);
gtk_widget_show (status->table);
for (list = gdk_devices_list (), i = 0;
for (list = gdk_display_list_devices (display), i = 0;
list;
list = g_list_next (list), i++)
list = list->next, i++)
{
GimpDeviceInfo *device_info;
GimpContext *context;
......
......@@ -234,6 +234,7 @@ gimp_image_dock_style_set (GtkWidget *widget,
GimpImageDock *image_dock;
gint minimal_width;
GtkIconSize menu_preview_size;
GdkScreen *screen;
gint menu_preview_width = 18;
gint menu_preview_height = 18;
gint focus_line_width;
......@@ -250,9 +251,11 @@ gimp_image_dock_style_set (GtkWidget *widget,
"menu_preview_size", &menu_preview_size,
NULL);
gtk_icon_size_lookup (menu_preview_size,
&menu_preview_width,
&menu_preview_height);
screen = gtk_widget_get_screen (image_dock->menu);
gtk_icon_size_lookup_for_settings (gtk_settings_get_for_screen (screen),
menu_preview_size,
&menu_preview_width,
&menu_preview_height);
gtk_widget_style_get (image_dock->auto_button,
"focus_line_width", &focus_line_width,
......@@ -385,6 +388,7 @@ gimp_image_dock_new (GimpDialogFactory *dialog_factory,
{
GimpImageDock *image_dock;
GimpContext *context;
GdkScreen *screen;
gint menu_preview_width;
gint menu_preview_height;
......@@ -436,8 +440,11 @@ gimp_image_dock_new (GimpDialogFactory *dialog_factory,
image_dock,
0);
gtk_icon_size_lookup (DEFAULT_MENU_PREVIEW_SIZE,
&menu_preview_width, &menu_preview_height);
screen = gtk_widget_get_screen (GTK_WIDGET (image_dock));
gtk_icon_size_lookup_for_settings (gtk_settings_get_for_screen (screen),
DEFAULT_MENU_PREVIEW_SIZE,
&menu_preview_width,
&menu_preview_height);
image_dock->menu = gimp_container_menu_new (image_container, context,
menu_preview_height, 1);
......
......@@ -528,6 +528,7 @@ gimp_item_factory_set_color (GtkItemFactory *factory,
GtkWidget *widget;
GtkWidget *area = NULL;
GtkWidget *label = NULL;
GdkScreen *screen;
g_return_if_fail (GTK_IS_ITEM_FACTORY (factory));
g_return_if_fail (path != NULL);
......@@ -568,7 +569,9 @@ gimp_item_factory_set_color (GtkItemFactory *factory,
area = gimp_color_area_new (color, GIMP_COLOR_AREA_SMALL_CHECKS, 0);
gimp_color_area_set_draw_border (GIMP_COLOR_AREA (area), TRUE);
gtk_icon_size_lookup (GTK_ICON_SIZE_MENU, &width, &height);
screen = gtk_widget_get_screen (area);
gtk_icon_size_lookup_for_settings (gtk_settings_get_for_screen (screen),
GTK_ICON_SIZE_MENU, &width, &height);
gtk_widget_set_size_request (area, width, height);
gtk_box_pack_start (GTK_BOX (hbox), area, FALSE, FALSE, 0);
......
......@@ -234,6 +234,7 @@ gimp_image_dock_style_set (GtkWidget *widget,
GimpImageDock *image_dock;
gint minimal_width;
GtkIconSize menu_preview_size;
GdkScreen *screen;
gint menu_preview_width = 18;
gint menu_preview_height = 18;
gint focus_line_width;
......@@ -250,9 +251,11 @@ gimp_image_dock_style_set (GtkWidget *widget,
"menu_preview_size", &menu_preview_size,
NULL);
gtk_icon_size_lookup (menu_preview_size,
&menu_preview_width,
&menu_preview_height);
screen = gtk_widget_get_screen (image_dock->menu);
gtk_icon_size_lookup_for_settings (gtk_settings_get_for_screen (screen),
menu_preview_size,
&menu_preview_width,
&menu_preview_height);
gtk_widget_style_get (image_dock->auto_button,
"focus_line_width", &focus_line_width,
......@@ -385,6 +388,7 @@ gimp_image_dock_new (GimpDialogFactory *dialog_factory,
{
GimpImageDock *image_dock;
GimpContext *context;
GdkScreen *screen;
gint menu_preview_width;
gint menu_preview_height;
......@@ -436,8 +440,11 @@ gimp_image_dock_new (GimpDialogFactory *dialog_factory,
image_dock,
0);
gtk_icon_size_lookup (DEFAULT_MENU_PREVIEW_SIZE,
&menu_preview_width, &menu_preview_height);
screen = gtk_widget_get_screen (GTK_WIDGET (image_dock));
gtk_icon_size_lookup_for_settings (gtk_settings_get_for_screen (screen),
DEFAULT_MENU_PREVIEW_SIZE,
&menu_preview_width,
&menu_preview_height);
image_dock->menu = gimp_container_menu_new (image_container, context,
menu_preview_height, 1);
......
......@@ -290,9 +290,10 @@ gimp_navigation_preview_move_to (GimpNavigationPreview *nav_preview,
void
gimp_navigation_preview_grab_pointer (GimpNavigationPreview *nav_preview)
{
GtkWidget *widget;
GdkCursor *cursor;
GdkWindow *window;
GtkWidget *widget;
GdkDisplay *display;
GdkCursor *cursor;
GdkWindow *window;
widget = GTK_WIDGET (nav_preview);
......@@ -300,7 +301,8 @@ gimp_navigation_preview_grab_pointer (GimpNavigationPreview *nav_preview)
gtk_grab_add (widget);
cursor = gdk_cursor_new (GDK_FLEUR);
display = gtk_widget_get_display (widget);
cursor = gdk_cursor_new_for_display (display, GDK_FLEUR);
window = GIMP_PREVIEW (nav_preview)->event_window;
......@@ -320,6 +322,7 @@ gimp_navigation_preview_button_press (GtkWidget *widget,
{
GimpNavigationPreview *nav_preview;
gint tx, ty;
GdkDisplay *display;
nav_preview = GIMP_NAVIGATION_PREVIEW (widget);
......@@ -344,7 +347,8 @@ gimp_navigation_preview_button_press (GtkWidget *widget,
gimp_navigation_preview_move_to (nav_preview, tx, ty);
cursor = gdk_cursor_new (GDK_FLEUR);
display = gtk_widget_get_display (widget);
cursor = gdk_cursor_new_for_display (display, GDK_FLEUR);
gdk_window_set_cursor (GIMP_PREVIEW (widget)->event_window, cursor);
gdk_cursor_unref (cursor);
}
......@@ -444,7 +448,10 @@ gimp_navigation_preview_motion_notify (GtkWidget *widget,
if (! nav_preview->has_grab)
{
GdkCursor *cursor;
GdkCursor *cursor;
GdkDisplay *display;
display = gtk_widget_get_display (widget);
if (nav_preview->p_x == 0 &&
nav_preview->p_y == 0 &&
......@@ -459,11 +466,11 @@ gimp_navigation_preview_motion_notify (GtkWidget *widget,
mevent->x < nav_preview->p_x + nav_preview->p_width &&
mevent->y < nav_preview->p_y + nav_preview->p_height)
{
cursor = gdk_cursor_new (GDK_FLEUR);
cursor = gdk_cursor_new_for_display (display, GDK_FLEUR);
}
else
{
cursor = gdk_cursor_new (GDK_HAND2);
cursor = gdk_cursor_new_for_display (display, GDK_HAND2);
}
gdk_window_set_cursor (preview->event_window, cursor);
......
......@@ -290,9 +290,10 @@ gimp_navigation_preview_move_to (GimpNavigationPreview *nav_preview,
void
gimp_navigation_preview_grab_pointer (GimpNavigationPreview *nav_preview)
{
GtkWidget *widget;
GdkCursor *cursor;
GdkWindow *window;
GtkWidget *widget;
GdkDisplay *display;
GdkCursor *cursor;
GdkWindow *window;
widget = GTK_WIDGET (nav_preview);
......@@ -300,7 +301,8 @@ gimp_navigation_preview_grab_pointer (GimpNavigationPreview *nav_preview)
gtk_grab_add (widget);
cursor = gdk_cursor_new (GDK_FLEUR);
display = gtk_widget_get_display (widget);
cursor = gdk_cursor_new_for_display (display, GDK_FLEUR);
window = GIMP_PREVIEW (nav_preview)->event_window;
......@@ -320,6 +322,7 @@ gimp_navigation_preview_button_press (GtkWidget *widget,
{
GimpNavigationPreview *nav_preview;
gint tx, ty;
GdkDisplay *display;
nav_preview = GIMP_NAVIGATION_PREVIEW (widget);
......@@ -344,7 +347,8 @@ gimp_navigation_preview_button_press (GtkWidget *widget,
gimp_navigation_preview_move_to (nav_preview, tx, ty);
cursor = gdk_cursor_new (GDK_FLEUR);
display = gtk_widget_get_display (widget);
cursor = gdk_cursor_new_for_display (display, GDK_FLEUR);
gdk_window_set_cursor (GIMP_PREVIEW (widget)->event_window, cursor);
gdk_cursor_unref (cursor);
}
......@@ -444,7 +448,10 @@ gimp_navigation_preview_motion_notify (GtkWidget *widget,
if (! nav_preview->has_grab)
{
GdkCursor *cursor;
GdkCursor *cursor;
GdkDisplay *display;
display = gtk_widget_get_display (widget);
if (nav_preview->p_x == 0 &&
nav_preview->p_y == 0 &&
......@@ -459,11 +466,11 @@ gimp_navigation_preview_motion_notify (GtkWidget *widget,
mevent->x < nav_preview->p_x + nav_preview->p_width &&
mevent->y < nav_preview->p_y + nav_preview->p_height)
{
cursor = gdk_cursor_new (GDK_FLEUR);
cursor = gdk_cursor_new_for_display (display, GDK_FLEUR);
}
else
{
cursor = gdk_cursor_new (GDK_HAND2);
cursor = gdk_cursor_new_for_display (display, GDK_HAND2);
}
gdk_window_set_cursor (preview->event_window, cursor);
......
......@@ -428,6 +428,7 @@ gimp_toolbox_new (GimpDialogFactory *dialog_factory,
{
GimpContext *context;
GimpToolbox *toolbox;
GdkDisplay *display;
GList *list;
g_return_val_if_fail (GIMP_IS_DIALOG_FACTORY (dialog_factory), NULL);
......@@ -449,7 +450,8 @@ gimp_toolbox_new (GimpDialogFactory *dialog_factory,
* device would change to that and not change back. So we check
* manually that all devices have a cursor, before establishing the check.
*/
for (list = gdk_devices_list (); list; list = g_list_next (list))
display = gtk_widget_get_display (GTK_WIDGET (toolbox));
for (list = gdk_display_list_devices (display); list; list = list->next)
{
if (! ((GdkDevice *) (list->data))->has_cursor)
break;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment