[gtk+/wip/otte/gtk4: 20/121] API: gdk: Remove gdk_screen_get_number()



commit 68487622dbbfd48e5c5fc3849e8ef3280131052c
Author: Benjamin Otte <otte redhat com>
Date:   Fri Sep 9 16:34:21 2016 +0200

    API: gdk: Remove gdk_screen_get_number()
    
    It's useless everywhere but in internal X11 code.

 gdk/broadway/gdkscreen-broadway.c |    7 -------
 gdk/gdkscreen.c                   |   19 -------------------
 gdk/gdkscreen.h                   |    2 --
 gdk/gdkscreenprivate.h            |    1 -
 gdk/mir/gdkmirscreen.c            |    9 ---------
 gdk/quartz/gdkscreen-quartz.c     |    7 -------
 gdk/wayland/gdkscreen-wayland.c   |    7 -------
 gdk/win32/gdkscreen-win32.c       |    9 ---------
 gdk/x11/gdkapplaunchcontext-x11.c |    2 +-
 gdk/x11/gdkmain-x11.c             |    2 +-
 gdk/x11/gdkscreen-x11.c           |   10 +---------
 gdk/x11/gdkwindow-x11.c           |    4 ++--
 12 files changed, 5 insertions(+), 74 deletions(-)
---
diff --git a/gdk/broadway/gdkscreen-broadway.c b/gdk/broadway/gdkscreen-broadway.c
index 81e1a58..273e26d 100644
--- a/gdk/broadway/gdkscreen-broadway.c
+++ b/gdk/broadway/gdkscreen-broadway.c
@@ -48,12 +48,6 @@ gdk_broadway_screen_get_display (GdkScreen *screen)
   return GDK_BROADWAY_SCREEN (screen)->display;
 }
 
-static gint
-gdk_broadway_screen_get_number (GdkScreen *screen)
-{
-  return 0;
-}
-
 static GdkWindow *
 gdk_broadway_screen_get_root_window (GdkScreen *screen)
 {
@@ -207,7 +201,6 @@ gdk_broadway_screen_class_init (GdkBroadwayScreenClass *klass)
   object_class->finalize = gdk_broadway_screen_finalize;
 
   screen_class->get_display = gdk_broadway_screen_get_display;
-  screen_class->get_number = gdk_broadway_screen_get_number;
   screen_class->get_root_window = gdk_broadway_screen_get_root_window;
   screen_class->is_composited = gdk_broadway_screen_is_composited;
   screen_class->make_display_name = gdk_broadway_screen_make_display_name;
diff --git a/gdk/gdkscreen.c b/gdk/gdkscreen.c
index d198afc..bbf947b 100644
--- a/gdk/gdkscreen.c
+++ b/gdk/gdkscreen.c
@@ -366,25 +366,6 @@ gdk_screen_get_display (GdkScreen *screen)
 }
 
 /**
- * gdk_screen_get_number:
- * @screen: a #GdkScreen
- *
- * Gets the index of @screen among the screens in the display
- * to which it belongs. (See gdk_screen_get_display())
- *
- * Returns: the index
- *
- * Since: 2.2
- **/
-gint
-gdk_screen_get_number (GdkScreen *screen)
-{
-  g_return_val_if_fail (GDK_IS_SCREEN (screen), 0);
-
-  return GDK_SCREEN_GET_CLASS (screen)->get_number (screen);
-}
-
-/**
  * gdk_screen_get_root_window:
  * @screen: a #GdkScreen
  *
diff --git a/gdk/gdkscreen.h b/gdk/gdkscreen.h
index 5f1d7a1..6d2da06 100644
--- a/gdk/gdkscreen.h
+++ b/gdk/gdkscreen.h
@@ -52,8 +52,6 @@ GDK_AVAILABLE_IN_ALL
 GdkWindow *  gdk_screen_get_root_window       (GdkScreen   *screen);
 GDK_AVAILABLE_IN_ALL
 GdkDisplay * gdk_screen_get_display           (GdkScreen   *screen);
-GDK_AVAILABLE_IN_ALL
-gint         gdk_screen_get_number            (GdkScreen   *screen);
 
 GDK_AVAILABLE_IN_ALL
 GList *      gdk_screen_list_visuals          (GdkScreen   *screen);
diff --git a/gdk/gdkscreenprivate.h b/gdk/gdkscreenprivate.h
index 05a18aa..e4001c6 100644
--- a/gdk/gdkscreenprivate.h
+++ b/gdk/gdkscreenprivate.h
@@ -44,7 +44,6 @@ struct _GdkScreenClass
   GObjectClass parent_class;
 
   GdkDisplay * (* get_display)           (GdkScreen *screen);
-  gint         (* get_number)            (GdkScreen *screen);
   GdkWindow *  (* get_root_window)       (GdkScreen *screen);
   gint         (* get_n_monitors)        (GdkScreen *screen);
   gint         (* get_primary_monitor)   (GdkScreen *screen);
diff --git a/gdk/mir/gdkmirscreen.c b/gdk/mir/gdkmirscreen.c
index b369b03..0061ea1 100644
--- a/gdk/mir/gdkmirscreen.c
+++ b/gdk/mir/gdkmirscreen.c
@@ -236,14 +236,6 @@ gdk_mir_screen_get_height_mm (GdkScreen *screen)
   return height;
 }
 
-static gint
-gdk_mir_screen_get_number (GdkScreen *screen)
-{
-  //g_printerr ("gdk_mir_screen_get_number\n");
-  /* There is only one screen... */
-  return 0;
-}
-
 static GdkWindow *
 gdk_mir_screen_get_root_window (GdkScreen *screen)
 {
@@ -814,7 +806,6 @@ gdk_mir_screen_class_init (GdkMirScreenClass *klass)
   screen_class->get_height = gdk_mir_screen_get_height;
   screen_class->get_width_mm = gdk_mir_screen_get_width_mm;
   screen_class->get_height_mm = gdk_mir_screen_get_height_mm;
-  screen_class->get_number = gdk_mir_screen_get_number;
   screen_class->get_root_window = gdk_mir_screen_get_root_window;
   screen_class->get_n_monitors = gdk_mir_screen_get_n_monitors;
   screen_class->get_primary_monitor = gdk_mir_screen_get_primary_monitor;
diff --git a/gdk/quartz/gdkscreen-quartz.c b/gdk/quartz/gdkscreen-quartz.c
index 6f57627..58ce7a9 100644
--- a/gdk/quartz/gdkscreen-quartz.c
+++ b/gdk/quartz/gdkscreen-quartz.c
@@ -298,12 +298,6 @@ gdk_quartz_screen_get_root_window (GdkScreen *screen)
 }
 
 static gint
-gdk_quartz_screen_get_number (GdkScreen *screen)
-{
-  return 0;
-}
-
-static gint
 gdk_quartz_screen_get_width (GdkScreen *screen)
 {
   return GDK_QUARTZ_SCREEN (screen)->width;
@@ -496,7 +490,6 @@ gdk_quartz_screen_class_init (GdkQuartzScreenClass *klass)
   screen_class->get_height = gdk_quartz_screen_get_height;
   screen_class->get_width_mm = gdk_quartz_screen_get_width_mm;
   screen_class->get_height_mm = gdk_quartz_screen_get_height_mm;
-  screen_class->get_number = gdk_quartz_screen_get_number;
   screen_class->get_root_window = gdk_quartz_screen_get_root_window;
   screen_class->get_n_monitors = gdk_quartz_screen_get_n_monitors;
   screen_class->get_primary_monitor = gdk_quartz_screen_get_primary_monitor;
diff --git a/gdk/wayland/gdkscreen-wayland.c b/gdk/wayland/gdkscreen-wayland.c
index 8d0a19b..bb35bff 100644
--- a/gdk/wayland/gdkscreen-wayland.c
+++ b/gdk/wayland/gdkscreen-wayland.c
@@ -111,12 +111,6 @@ gdk_wayland_screen_get_display (GdkScreen *screen)
   return GDK_WAYLAND_SCREEN (screen)->display;
 }
 
-static gint
-gdk_wayland_screen_get_number (GdkScreen *screen)
-{
-  return 0;
-}
-
 static GdkWindow *
 gdk_wayland_screen_get_root_window (GdkScreen *screen)
 {
@@ -820,7 +814,6 @@ _gdk_wayland_screen_class_init (GdkWaylandScreenClass *klass)
   object_class->finalize = gdk_wayland_screen_finalize;
 
   screen_class->get_display = gdk_wayland_screen_get_display;
-  screen_class->get_number = gdk_wayland_screen_get_number;
   screen_class->get_root_window = gdk_wayland_screen_get_root_window;
   screen_class->get_system_visual = gdk_wayland_screen_get_system_visual;
   screen_class->get_rgba_visual = gdk_wayland_screen_get_rgba_visual;
diff --git a/gdk/win32/gdkscreen-win32.c b/gdk/win32/gdkscreen-win32.c
index de6e5ae..138f0a2 100644
--- a/gdk/win32/gdkscreen-win32.c
+++ b/gdk/win32/gdkscreen-win32.c
@@ -386,14 +386,6 @@ gdk_win32_screen_get_root_window (GdkScreen *screen)
   return GDK_WIN32_SCREEN (screen)->root_window;
 }
 
-static gint
-gdk_win32_screen_get_number (GdkScreen *screen)
-{
-  g_return_val_if_fail (screen == gdk_display_get_default_screen (gdk_display_get_default ()), 0);
-
-  return 0;
-}
-
 static gchar *
 gdk_win32_screen_make_display_name (GdkScreen *screen)
 {
@@ -549,7 +541,6 @@ gdk_win32_screen_class_init (GdkWin32ScreenClass *klass)
   object_class->finalize = gdk_win32_screen_finalize;
 
   screen_class->get_display = gdk_win32_screen_get_display;
-  screen_class->get_number = gdk_win32_screen_get_number;
   screen_class->get_root_window = gdk_win32_screen_get_root_window;
   screen_class->is_composited = gdk_win32_screen_is_composited;
   screen_class->make_display_name = gdk_win32_screen_make_display_name;
diff --git a/gdk/x11/gdkapplaunchcontext-x11.c b/gdk/x11/gdkapplaunchcontext-x11.c
index bb38e62..b7fa648 100644
--- a/gdk/x11/gdkapplaunchcontext-x11.c
+++ b/gdk/x11/gdkapplaunchcontext-x11.c
@@ -346,7 +346,7 @@ gdk_x11_app_launch_context_get_startup_notify_id (GAppLaunchContext *context,
   if (timestamp == GDK_CURRENT_TIME)
     timestamp = gdk_x11_display_get_user_time (display);
 
-  screen_str = g_strdup_printf ("%d", gdk_screen_get_number (screen));
+  screen_str = g_strdup_printf ("%d", gdk_x11_screen_get_screen_number (screen));
   if (ctx->workspace > -1)
     workspace_str = g_strdup_printf ("%d", ctx->workspace);
   else
diff --git a/gdk/x11/gdkmain-x11.c b/gdk/x11/gdkmain-x11.c
index 6e44515..dff0a35 100644
--- a/gdk/x11/gdkmain-x11.c
+++ b/gdk/x11/gdkmain-x11.c
@@ -434,7 +434,7 @@ gdk_x11_ungrab_server (void)
 gint
 gdk_x11_get_default_screen (void)
 {
-  return gdk_screen_get_number (gdk_screen_get_default ());
+  return gdk_x11_screen_get_screen_number (gdk_screen_get_default ());
 }
 
 /**
diff --git a/gdk/x11/gdkscreen-x11.c b/gdk/x11/gdkscreen-x11.c
index 95c005c..92359b7 100644
--- a/gdk/x11/gdkscreen-x11.c
+++ b/gdk/x11/gdkscreen-x11.c
@@ -79,12 +79,6 @@ gdk_x11_screen_get_display (GdkScreen *screen)
   return GDK_X11_SCREEN (screen)->display;
 }
 
-static gint
-gdk_x11_screen_get_number (GdkScreen *screen)
-{
-  return GDK_X11_SCREEN (screen)->screen_num;
-}
-
 static GdkWindow *
 gdk_x11_screen_get_root_window (GdkScreen *screen)
 {
@@ -118,7 +112,6 @@ gdk_x11_screen_dispose (GObject *object)
 
   x11_screen->xdisplay = NULL;
   x11_screen->xscreen = NULL;
-  x11_screen->screen_num = -1;
   x11_screen->xroot_window = None;
   x11_screen->wmspec_check_window = None;
 }
@@ -1085,7 +1078,7 @@ gdk_x11_screen_make_display_name (GdkScreen *screen)
   old_display = gdk_display_get_name (gdk_screen_get_display (screen));
 
   return substitute_screen_number (old_display,
-                                   gdk_screen_get_number (screen));
+                                   gdk_x11_screen_get_screen_number (screen));
 }
 
 static GdkWindow *
@@ -1476,7 +1469,6 @@ gdk_x11_screen_class_init (GdkX11ScreenClass *klass)
   object_class->finalize = gdk_x11_screen_finalize;
 
   screen_class->get_display = gdk_x11_screen_get_display;
-  screen_class->get_number = gdk_x11_screen_get_number;
   screen_class->get_root_window = gdk_x11_screen_get_root_window;
   screen_class->get_system_visual = _gdk_x11_screen_get_system_visual;
   screen_class->get_rgba_visual = gdk_x11_screen_get_rgba_visual;
diff --git a/gdk/x11/gdkwindow-x11.c b/gdk/x11/gdkwindow-x11.c
index fe311a7..14dfdd9 100644
--- a/gdk/x11/gdkwindow-x11.c
+++ b/gdk/x11/gdkwindow-x11.c
@@ -2103,7 +2103,7 @@ gdk_window_x11_restack_toplevel (GdkWindow *window,
   changes.stack_mode = above ? Above : Below;
   XReconfigureWMWindow (GDK_WINDOW_XDISPLAY (window),
                        GDK_WINDOW_XID (window),
-                       gdk_screen_get_number (GDK_WINDOW_SCREEN (window)),
+                       gdk_x11_screen_get_screen_number (GDK_WINDOW_SCREEN (window)),
                        CWStackMode | CWSibling, &changes);
 }
 
@@ -4003,7 +4003,7 @@ gdk_x11_window_iconify (GdkWindow *window)
     {  
       XIconifyWindow (GDK_WINDOW_XDISPLAY (window),
                      GDK_WINDOW_XID (window),
-                     gdk_screen_get_number (GDK_WINDOW_SCREEN (window)));
+                     gdk_x11_screen_get_screen_number (GDK_WINDOW_SCREEN (window)));
     }
   else
     {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]