summaryrefslogtreecommitdiff
path: root/gtk
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2002-06-18 20:59:44 +0000
committerOwen Taylor <otaylor@src.gnome.org>2002-06-18 20:59:44 +0000
commit621fb7466a984a45b5d2fc267eac0024d6218030 (patch)
tree3f760dd49587cfc84b71c6989daf5be2b0cbb13d /gtk
parent1371ded54cb57c793a09ccf14c1dfcdcdd6e4a47 (diff)
downloadgtk+-621fb7466a984a45b5d2fc267eac0024d6218030.tar.gz
Replace gdk_cursor_new_for_screen() with gdk_cursor_new_for_display().
Tue Jun 18 14:41:48 2002 Owen Taylor <otaylor@redhat.com> * gdk/gdkcursor.[ch] gdk/x11/gdkcursor-x11.c gdk/x11/gdkprivate-x11.h gdk/win32/gdkcursor-win32.c: Replace gdk_cursor_new_for_screen() with gdk_cursor_new_for_display(). (#85671) * gtk/gtkclist.c gtk/gtkcombo.c gtk/gtkcurve.c gtk/gtkdnd.c gtk/gtkentry.c gtk/gtkhandlebox.c gtk/gtkhsv.c gtk/gtklabel.c gtk/gtkpaned.c gtk/gtktext.c gtk/gtktextview.c gtk/gtktipsquery.c gtk/gtktreeviewcolumn.c: Adapt to above change.
Diffstat (limited to 'gtk')
-rw-r--r--gtk/gtkclist.c4
-rw-r--r--gtk/gtkcombo.c4
-rw-r--r--gtk/gtkcurve.c2
-rw-r--r--gtk/gtkdnd.c26
-rw-r--r--gtk/gtkentry.c4
-rw-r--r--gtk/gtkhandlebox.c4
-rw-r--r--gtk/gtkhsv.c4
-rw-r--r--gtk/gtklabel.c4
-rw-r--r--gtk/gtkpaned.c4
-rw-r--r--gtk/gtktext.c2
-rw-r--r--gtk/gtktextview.c8
-rw-r--r--gtk/gtktipsquery.c4
-rw-r--r--gtk/gtktreeviewcolumn.c4
13 files changed, 35 insertions, 39 deletions
diff --git a/gtk/gtkclist.c b/gtk/gtkclist.c
index 77b69a7523..f66a12d72f 100644
--- a/gtk/gtkclist.c
+++ b/gtk/gtkclist.c
@@ -4545,8 +4545,8 @@ gtk_clist_realize (GtkWidget *widget)
GDK_POINTER_MOTION_MASK |
GDK_POINTER_MOTION_HINT_MASK);
attributes_mask = GDK_WA_CURSOR;
- attributes.cursor = gdk_cursor_new_for_screen (gtk_widget_get_screen (widget),
- GDK_SB_H_DOUBLE_ARROW);
+ attributes.cursor = gdk_cursor_new_for_display (gtk_widget_get_display (widget),
+ GDK_SB_H_DOUBLE_ARROW);
clist->cursor_drag = attributes.cursor;
attributes.x = LIST_WIDTH (clist) + 1;
diff --git a/gtk/gtkcombo.c b/gtk/gtkcombo.c
index a425d9800c..3c4e6cd637 100644
--- a/gtk/gtkcombo.c
+++ b/gtk/gtkcombo.c
@@ -757,8 +757,8 @@ gtk_combo_list_key_press (GtkWidget * widget, GdkEventKey * event, GtkCombo * co
static void
combo_event_box_realize (GtkWidget *widget)
{
- GdkCursor *cursor = gdk_cursor_new_for_screen (gtk_widget_get_screen (widget),
- GDK_TOP_LEFT_ARROW);
+ GdkCursor *cursor = gdk_cursor_new_for_display (gtk_widget_get_display (widget),
+ GDK_TOP_LEFT_ARROW);
gdk_window_set_cursor (widget->window, cursor);
gdk_cursor_destroy (cursor);
}
diff --git a/gtk/gtkcurve.c b/gtk/gtkcurve.c
index f3fb148ffe..5f20d177bf 100644
--- a/gtk/gtkcurve.c
+++ b/gtk/gtkcurve.c
@@ -652,7 +652,7 @@ gtk_curve_graph_events (GtkWidget *widget, GdkEvent *event, GtkCurve *c)
c->cursor_type = new_type;
- cursor = gdk_cursor_new_for_screen (gtk_widget_get_screen (w),
+ cursor = gdk_cursor_new_for_display (gtk_widget_get_display (w),
c->cursor_type);
gdk_window_set_cursor (w->window, cursor);
gdk_cursor_destroy (cursor);
diff --git a/gtk/gtkdnd.c b/gtk/gtkdnd.c
index 09af044ad8..ca6c833bdf 100644
--- a/gtk/gtkdnd.c
+++ b/gtk/gtkdnd.c
@@ -182,7 +182,7 @@ static void gtk_drag_get_event_actions (GdkEvent *event,
GdkDragAction actions,
GdkDragAction *suggested_action,
GdkDragAction *possible_actions);
-static GdkCursor * gtk_drag_get_cursor (GdkScreen *screen,
+static GdkCursor * gtk_drag_get_cursor (GdkDisplay *display,
GdkDragAction action);
static GtkWidget *gtk_drag_get_ipc_widget (GdkScreen *screen);
static void gtk_drag_release_ipc_widget (GtkWidget *widget);
@@ -552,7 +552,7 @@ gtk_drag_get_event_actions (GdkEvent *event,
}
static GdkCursor *
-gtk_drag_get_cursor (GdkScreen *screen,
+gtk_drag_get_cursor (GdkDisplay *display,
GdkDragAction action)
{
gint i;
@@ -562,7 +562,7 @@ gtk_drag_get_cursor (GdkScreen *screen,
break;
if (drag_cursors[i].cursor != NULL)
{
- if (screen != gdk_cursor_get_screen (drag_cursors[i].cursor))
+ if (display != gdk_cursor_get_display (drag_cursors[i].cursor))
{
gdk_cursor_unref (drag_cursors[i].cursor);
drag_cursors[i].cursor = NULL;
@@ -571,21 +571,17 @@ gtk_drag_get_cursor (GdkScreen *screen,
if (drag_cursors[i].cursor == NULL)
{
- GdkColormap *colormap;
- GdkColor fg, bg;
+ GdkColor bg = { 0, 0xffff, 0xffff, 0xffff };
+ GdkColor fg = { 0, 0x0000, 0x0000, 0x0000 };
+ GdkScreen *screen = gdk_display_get_default_screen (display);
+ GdkWindow *window = gdk_screen_get_root_window (screen);
GdkPixmap *pixmap =
- gdk_bitmap_create_from_data (gdk_screen_get_root_window (screen),
- drag_cursors[i].bits, CURSOR_WIDTH, CURSOR_HEIGHT);
+ gdk_bitmap_create_from_data (window, drag_cursors[i].bits, CURSOR_WIDTH, CURSOR_HEIGHT);
GdkPixmap *mask =
- gdk_bitmap_create_from_data (gdk_screen_get_root_window (screen),
- drag_cursors[i].mask, CURSOR_WIDTH, CURSOR_HEIGHT);
+ gdk_bitmap_create_from_data (window, drag_cursors[i].mask, CURSOR_WIDTH, CURSOR_HEIGHT);
- colormap = gdk_screen_get_system_colormap (screen);
- gdk_color_white (colormap, &bg);
- gdk_color_black (colormap, &fg);
-
drag_cursors[i].cursor = gdk_cursor_new_from_pixmap (pixmap, mask, &fg, &bg, 0, 0);
gdk_pixmap_unref (pixmap);
@@ -1843,7 +1839,7 @@ gtk_drag_begin (GtkWidget *widget,
gtk_drag_get_event_actions (event, info->button, actions,
&suggested_action, &possible_actions);
- info->cursor = gtk_drag_get_cursor (gtk_widget_get_screen (widget), suggested_action);
+ info->cursor = gtk_drag_get_cursor (gtk_widget_get_display (widget), suggested_action);
/* Set cur_x, cur_y here so if the "drag_begin" signal shows
* the drag icon, it will be in the right place
@@ -2467,7 +2463,7 @@ _gtk_drag_source_handle_event (GtkWidget *widget,
}
else if (info->have_grab)
{
- cursor = gtk_drag_get_cursor (gtk_widget_get_screen (widget),
+ cursor = gtk_drag_get_cursor (gtk_widget_get_display (widget),
event->dnd.context->action);
if (info->cursor != cursor)
{
diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c
index d8d6f7a65b..8231f940d5 100644
--- a/gtk/gtkentry.c
+++ b/gtk/gtkentry.c
@@ -972,7 +972,7 @@ gtk_entry_realize (GtkWidget *widget)
get_text_area_size (entry, &attributes.x, &attributes.y, &attributes.width, &attributes.height);
- attributes.cursor = gdk_cursor_new_for_screen (gtk_widget_get_screen (widget), GDK_XTERM);
+ attributes.cursor = gdk_cursor_new_for_display (gtk_widget_get_display (widget), GDK_XTERM);
attributes_mask |= GDK_WA_CURSOR;
entry->text_area = gdk_window_new (widget->window, &attributes, attributes_mask);
@@ -1435,7 +1435,7 @@ gtk_entry_motion_notify (GtkWidget *widget,
{
GdkCursor *cursor;
- cursor = gdk_cursor_new_for_screen (gtk_widget_get_screen (widget), GDK_XTERM);
+ cursor = gdk_cursor_new_for_display (gtk_widget_get_display (widget), GDK_XTERM);
gdk_window_set_cursor (entry->text_area, cursor);
gdk_cursor_unref (cursor);
entry->mouse_cursor_obscured = FALSE;
diff --git a/gtk/gtkhandlebox.c b/gtk/gtkhandlebox.c
index da46d0a651..73e198c18e 100644
--- a/gtk/gtkhandlebox.c
+++ b/gtk/gtkhandlebox.c
@@ -990,8 +990,8 @@ gtk_handle_box_button_changed (GtkWidget *widget,
hb->attach_allocation.height = height;
hb->in_drag = TRUE;
- fleur = gdk_cursor_new_for_screen (gdk_drawable_get_screen (widget->window),
- GDK_FLEUR);
+ fleur = gdk_cursor_new_for_display (gtk_widget_get_display (widget),
+ GDK_FLEUR);
if (gdk_pointer_grab (widget->window,
FALSE,
(GDK_BUTTON1_MOTION_MASK |
diff --git a/gtk/gtkhsv.c b/gtk/gtkhsv.c
index a2a77f1358..a950ea5d54 100644
--- a/gtk/gtkhsv.c
+++ b/gtk/gtkhsv.c
@@ -753,8 +753,8 @@ set_cross_grab (GtkHSV *hsv,
priv = hsv->priv;
- cursor = gdk_cursor_new_for_screen (gtk_widget_get_screen (GTK_WIDGET (hsv)),
- GDK_CROSSHAIR);
+ cursor = gdk_cursor_new_for_display (gtk_widget_get_display (GTK_WIDGET (hsv)),
+ GDK_CROSSHAIR);
gdk_pointer_grab (priv->window, FALSE,
(GDK_POINTER_MOTION_MASK
| GDK_POINTER_MOTION_HINT_MASK
diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c
index 936662539c..8b9ca6aceb 100644
--- a/gtk/gtklabel.c
+++ b/gtk/gtklabel.c
@@ -2292,8 +2292,8 @@ gtk_label_create_window (GtkLabel *label)
attributes.window_type = GDK_WINDOW_TEMP;
attributes.wclass = GDK_INPUT_ONLY;
attributes.override_redirect = TRUE;
- attributes.cursor = gdk_cursor_new_for_screen (gtk_widget_get_screen (widget),
- GDK_XTERM);
+ attributes.cursor = gdk_cursor_new_for_display (gtk_widget_get_display (widget),
+ GDK_XTERM);
attributes.event_mask = gtk_widget_get_events (widget) |
GDK_BUTTON_PRESS_MASK |
GDK_BUTTON_RELEASE_MASK |
diff --git a/gtk/gtkpaned.c b/gtk/gtkpaned.c
index 53051f3d34..7e28dc7dd9 100644
--- a/gtk/gtkpaned.c
+++ b/gtk/gtkpaned.c
@@ -459,8 +459,8 @@ gtk_paned_realize (GtkWidget *widget)
attributes.y = paned->handle_pos.y;
attributes.width = paned->handle_pos.width;
attributes.height = paned->handle_pos.height;
- attributes.cursor = gdk_cursor_new_for_screen (gtk_widget_get_screen (widget),
- paned->cursor_type);
+ attributes.cursor = gdk_cursor_new_for_display (gtk_widget_get_display (widget),
+ paned->cursor_type);
attributes.event_mask = gtk_widget_get_events (widget);
attributes.event_mask |= (GDK_BUTTON_PRESS_MASK |
GDK_BUTTON_RELEASE_MASK |
diff --git a/gtk/gtktext.c b/gtk/gtktext.c
index f1519173aa..b9eff75392 100644
--- a/gtk/gtktext.c
+++ b/gtk/gtktext.c
@@ -1344,7 +1344,7 @@ gtk_text_realize (GtkWidget *widget)
attributes.width = MAX (1, (gint)widget->allocation.width - (gint)attributes.x * 2);
attributes.height = MAX (1, (gint)widget->allocation.height - (gint)attributes.y * 2);
- attributes.cursor = gdk_cursor_new_for_screen (gtk_widget_get_screen (widget), GDK_XTERM);
+ attributes.cursor = gdk_cursor_new_for_display (gtk_widget_get_display (widget), GDK_XTERM);
attributes_mask |= GDK_WA_CURSOR;
text->text_area = gdk_window_new (widget->window, &attributes, attributes_mask);
diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c
index 4a8c69f522..099809f522 100644
--- a/gtk/gtktextview.c
+++ b/gtk/gtktextview.c
@@ -3987,8 +3987,8 @@ gtk_text_view_motion_event (GtkWidget *widget, GdkEventMotion *event)
{
GdkCursor *cursor;
- cursor = gdk_cursor_new_for_screen (gtk_widget_get_screen (widget),
- GDK_XTERM);
+ cursor = gdk_cursor_new_for_display (gtk_widget_get_display (widget),
+ GDK_XTERM);
gdk_window_set_cursor (text_view->text_window->bin_window, cursor);
gdk_cursor_unref (cursor);
text_view->mouse_cursor_obscured = FALSE;
@@ -6581,8 +6581,8 @@ text_window_realize (GtkTextWindow *win,
if (win->type == GTK_TEXT_WINDOW_TEXT)
{
/* I-beam cursor */
- cursor = gdk_cursor_new_for_screen (gdk_drawable_get_screen (parent),
- GDK_XTERM);
+ cursor = gdk_cursor_new_for_display (gdk_drawable_get_display (parent),
+ GDK_XTERM);
gdk_window_set_cursor (win->bin_window, cursor);
gdk_cursor_unref (cursor);
diff --git a/gtk/gtktipsquery.c b/gtk/gtktipsquery.c
index faab09c07b..98f1c05306 100644
--- a/gtk/gtktipsquery.c
+++ b/gtk/gtktipsquery.c
@@ -342,8 +342,8 @@ gtk_tips_query_real_start_query (GtkTipsQuery *tips_query)
g_return_if_fail (GTK_IS_TIPS_QUERY (tips_query));
- tips_query->query_cursor = gdk_cursor_new_for_screen (gtk_widget_get_screen (GTK_WIDGET (tips_query)),
- GDK_QUESTION_ARROW);
+ tips_query->query_cursor = gdk_cursor_new_for_display (gtk_widget_get_display (GTK_WIDGET (tips_query)),
+ GDK_QUESTION_ARROW);
failure = gdk_pointer_grab (GTK_WIDGET (tips_query)->window,
TRUE,
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK |
diff --git a/gtk/gtktreeviewcolumn.c b/gtk/gtktreeviewcolumn.c
index 74cd5d794f..c876a1eaa6 100644
--- a/gtk/gtktreeviewcolumn.c
+++ b/gtk/gtktreeviewcolumn.c
@@ -980,8 +980,8 @@ _gtk_tree_view_column_realize_button (GtkTreeViewColumn *column)
GDK_POINTER_MOTION_HINT_MASK |
GDK_KEY_PRESS_MASK);
attributes_mask = GDK_WA_CURSOR | GDK_WA_X | GDK_WA_Y;
- attr.cursor = gdk_cursor_new_for_screen (gdk_drawable_get_screen (tree_view->priv->header_window),
- GDK_SB_H_DOUBLE_ARROW);
+ attr.cursor = gdk_cursor_new_for_display (gdk_drawable_get_display (tree_view->priv->header_window),
+ GDK_SB_H_DOUBLE_ARROW);
attr.y = 0;
attr.width = TREE_VIEW_DRAG_WIDTH;
attr.height = tree_view->priv->header_height;