]> Pileus Git - ~andy/gtk/blob - gdk/win32/gdkdisplay-win32.c
Changes multihead reorganizing code for win32 support, mostly from a patch
[~andy/gtk] / gdk / win32 / gdkdisplay-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 "gdkdisplay.h"
21 #include "gdkscreen.h"
22 #include "gdkprivate-win32.h"
23
24 GdkDisplay *_gdk_display = NULL;
25 GdkScreen  *_gdk_screen  = NULL;
26
27 void
28 _gdk_windowing_set_default_display (GdkDisplay *display)
29 {
30   g_assert (_gdk_display == display);
31 }
32
33 GdkDisplay *
34 gdk_open_display (const gchar *display_name)
35 {
36   if (_gdk_display != NULL)
37     return NULL; /* single display only */
38
39   _gdk_display = g_object_new (GDK_TYPE_DISPLAY, NULL);
40   _gdk_screen = g_object_new (GDK_TYPE_SCREEN, NULL);
41
42   gdk_set_default_display (_gdk_display);
43
44   _gdk_visual_init ();
45   _gdk_windowing_window_init ();
46   _gdk_windowing_image_init ();
47   _gdk_events_init ();
48   _gdk_input_init ();
49   _gdk_dnd_init ();
50
51   return _gdk_display;
52 }
53
54 G_CONST_RETURN gchar*
55 gdk_display_get_display_name (GdkDisplay *display)
56 {
57   return gdk_get_display_arg_name ();
58 }
59
60 static gint
61 gdk_display_get_n_screens (GdkDisplay * display)
62 {
63   return 1;
64 }
65
66 static GdkScreen *
67 gdk_display_get_screen (GdkDisplay *display,
68                         gint        screen_num)
69 {
70   g_return_if_fail (screen_num == 0);
71   
72   return _gdk_screen;
73 }
74
75 static GdkScreen *
76 gdk_display_get_default_screen (GdkDisplay * display)
77 {
78   return _gdk_screen;
79 }
80