]> Pileus Git - ~andy/gtk/blob - gdk/win32/gdkscreen-win32.c
gdk/win32/gdkcolor-win32.c gdk/win32/gdkscreen-win32.c Whitespace
[~andy/gtk] / gdk / win32 / gdkscreen-win32.c
1 /* GDK - The GIMP Drawing Kit
2  * Copyright (C) 2002 Hans Breuer
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  */
19
20 #include <config.h>
21 #include "gdk.h"
22 #include "gdkprivate-win32.h"
23
24 static GdkColormap *default_colormap = NULL;
25
26 GdkDisplay *
27 gdk_screen_get_display (GdkScreen *screen)
28 {
29   return _gdk_display;
30 }
31
32 GdkWindow *
33 gdk_screen_get_root_window (GdkScreen *screen)
34 {
35   return _gdk_root;
36 }
37
38 GdkColormap *
39 gdk_screen_get_default_colormap (GdkScreen *screen)
40 {
41   return default_colormap;
42 }
43
44 void
45 gdk_screen_set_default_colormap (GdkScreen   *screen,
46                                  GdkColormap *colormap)
47 {
48   GdkColormap *old_colormap;
49   
50   g_return_if_fail (screen == _gdk_screen);
51   g_return_if_fail (GDK_IS_COLORMAP (colormap));
52
53   old_colormap = default_colormap;
54
55   default_colormap = g_object_ref (colormap);
56   
57   if (old_colormap)
58     g_object_unref (old_colormap);
59 }
60
61 gint
62 gdk_screen_get_n_monitors (GdkScreen *screen)
63 {
64   g_return_val_if_fail (screen == _gdk_screen, 0);
65
66   return _gdk_num_monitors;
67 }
68
69 void
70 gdk_screen_get_monitor_geometry (GdkScreen    *screen, 
71                                  gint          num_monitor,
72                                  GdkRectangle *dest)
73 {
74   g_return_if_fail (screen == _gdk_screen);
75   g_return_if_fail (num_monitor < _gdk_num_monitors);
76   g_return_if_fail (num_monitor >= 0);
77
78   *dest = _gdk_monitors[num_monitor];
79 }
80
81 GdkColormap *
82 gdk_screen_get_rgba_colormap (GdkScreen *screen)
83 {
84   g_return_val_if_fail (screen == _gdk_screen, NULL);
85
86   return NULL;
87 }
88   
89 GdkVisual *
90 gdk_screen_get_rgba_visual (GdkScreen *screen)
91 {
92   g_return_val_if_fail (screen == _gdk_screen, NULL);
93
94   return NULL;
95 }
96   
97 gint
98 gdk_screen_get_number (GdkScreen *screen)
99 {
100   g_return_val_if_fail (screen == _gdk_screen, 0);  
101   
102   return 0;
103 }
104
105 gchar * 
106 _gdk_windowing_substitute_screen_number (const gchar *display_name,
107                                          int          screen_number)
108 {
109   if (screen_number != 0)
110     return NULL;
111
112   return g_strdup (display_name);
113 }
114
115 gchar *
116 gdk_screen_make_display_name (GdkScreen *screen)
117 {
118   return g_strdup (gdk_display_get_name (_gdk_display));
119 }