2002-04-25 22:29:14 +00:00
|
|
|
/*
|
|
|
|
* gdkscreen.c
|
|
|
|
*
|
|
|
|
* Copyright 2001 Sun Microsystems Inc.
|
|
|
|
*
|
|
|
|
* Erwann Chenede <erwann.chenede@sun.com>
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
2012-02-27 13:01:10 +00:00
|
|
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
2002-04-25 22:29:14 +00:00
|
|
|
*/
|
|
|
|
|
2008-06-22 14:28:52 +00:00
|
|
|
#include "config.h"
|
2010-10-15 02:05:51 +00:00
|
|
|
|
2012-10-05 14:46:36 +00:00
|
|
|
#include "gdkinternals.h"
|
2010-12-11 05:14:53 +00:00
|
|
|
#include "gdkscreenprivate.h"
|
2010-10-15 02:05:51 +00:00
|
|
|
#include "gdkrectangle.h"
|
|
|
|
#include "gdkwindow.h"
|
2005-08-26 18:49:52 +00:00
|
|
|
#include "gdkintl.h"
|
2010-07-09 00:34:45 +00:00
|
|
|
|
2002-04-25 22:29:14 +00:00
|
|
|
|
2010-11-15 02:51:30 +00:00
|
|
|
/**
|
|
|
|
* SECTION:gdkscreen
|
|
|
|
* @Short_description: Object representing a physical screen
|
|
|
|
* @Title: GdkScreen
|
|
|
|
*
|
2011-02-09 06:32:24 +00:00
|
|
|
* #GdkScreen objects are the GDK representation of the screen on
|
|
|
|
* which windows can be displayed and on which the pointer moves.
|
|
|
|
* X originally identified screens with physical screens, but
|
|
|
|
* nowadays it is more common to have a single #GdkScreen which
|
|
|
|
* combines several physical monitors (see gdk_screen_get_n_monitors()).
|
2010-11-15 02:51:30 +00:00
|
|
|
*
|
2011-02-09 06:32:24 +00:00
|
|
|
* GdkScreen is used throughout GDK and GTK+ to specify which screen
|
2016-11-03 23:02:37 +00:00
|
|
|
* the top level windows are to be displayed on.
|
2010-11-15 02:51:30 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
2006-05-14 03:58:06 +00:00
|
|
|
G_DEFINE_TYPE (GdkScreen, gdk_screen, G_TYPE_OBJECT)
|
2002-04-25 22:29:14 +00:00
|
|
|
|
2002-10-04 16:08:19 +00:00
|
|
|
static void
|
|
|
|
gdk_screen_class_init (GdkScreenClass *klass)
|
2002-10-04 15:58:19 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2005-08-24 03:29:06 +00:00
|
|
|
static void
|
|
|
|
gdk_screen_init (GdkScreen *screen)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2017-11-01 02:26:39 +00:00
|
|
|
void
|
Start implementing display/screen closing scheme; keep a flag for whether
Thu Aug 1 11:26:03 2002 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdisplay.[ch] gdk/gdkscreen.[ch] gdkinternals.h:
Start implementing display/screen closing scheme; keep a
flag for whether displays and screens are closed,
call g_object_run_dispose(). Remove public gdk_screen_close().
* gdk/x11/gdkdisplay-x11.c gdk/x11/gdkscreen-x11.c: Add
dispose() methods; move appropriate parts of the finalize
there.
* gdk/x11/gdkcolor-x11.c gdk/x11/gdkimage-x11.c
gdk/x11/gdkmain-x11.c gdk/x11/gdkpango-x11.c
gdk/x11/gdkpixmap-x11.c gdk/x11/gdkproperty-x11.c
gdk/x11/gdkselection-x11.c gdk/x11/gdkwindow-x11.c:
Start of making everything correctly ignore operations
when a display has been closed.
* gdk/x11/gdkwindow-x11.c (gdk_window_get_decorations):
Handle decorations == NULL.
* gdk/x11/gdkcolor-x11.c (gdk_colormap_remove):
Remove unnecessary hash table creation.
* gdk/x11/gdkinput.c gdk/x11/gdkinput-x11.c gdk/win32/gdkinput.c
Fix up gdk_device_get_history - handle events, n_events == NULL,
etc.
* gdk/x11/gdkproperty-x11.c (gdk_property_get):
Handle failure better.
* gdk/x11/gdkselection-x11.c (gdk_selection_property_get):
Handle failure better, handle data == NULL, move docs
here, remove an excess round trip by asking for
all selection data at once.
* gdk/gdkselection.c gdk/win32/{x11,win32}/gdkselection-{x11,win32}.c
gdk/{x11,win32}/gdkmain-{x11,win32}.c gdk/gdkdisplay.c: Move
gdk_text_property_to_text_list(), gdk_string_to_compound_text(),
gdk_display_set_sm_client_id() to display-independent part of GDK.
* gdk/Makefile.am (gdk_c_sources): Sort gdkdisplay/screen.[ch]
into the right place.
2002-08-01 15:28:40 +00:00
|
|
|
_gdk_screen_close (GdkScreen *screen)
|
2002-04-25 22:29:14 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (GDK_IS_SCREEN (screen));
|
Start implementing display/screen closing scheme; keep a flag for whether
Thu Aug 1 11:26:03 2002 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdisplay.[ch] gdk/gdkscreen.[ch] gdkinternals.h:
Start implementing display/screen closing scheme; keep a
flag for whether displays and screens are closed,
call g_object_run_dispose(). Remove public gdk_screen_close().
* gdk/x11/gdkdisplay-x11.c gdk/x11/gdkscreen-x11.c: Add
dispose() methods; move appropriate parts of the finalize
there.
* gdk/x11/gdkcolor-x11.c gdk/x11/gdkimage-x11.c
gdk/x11/gdkmain-x11.c gdk/x11/gdkpango-x11.c
gdk/x11/gdkpixmap-x11.c gdk/x11/gdkproperty-x11.c
gdk/x11/gdkselection-x11.c gdk/x11/gdkwindow-x11.c:
Start of making everything correctly ignore operations
when a display has been closed.
* gdk/x11/gdkwindow-x11.c (gdk_window_get_decorations):
Handle decorations == NULL.
* gdk/x11/gdkcolor-x11.c (gdk_colormap_remove):
Remove unnecessary hash table creation.
* gdk/x11/gdkinput.c gdk/x11/gdkinput-x11.c gdk/win32/gdkinput.c
Fix up gdk_device_get_history - handle events, n_events == NULL,
etc.
* gdk/x11/gdkproperty-x11.c (gdk_property_get):
Handle failure better.
* gdk/x11/gdkselection-x11.c (gdk_selection_property_get):
Handle failure better, handle data == NULL, move docs
here, remove an excess round trip by asking for
all selection data at once.
* gdk/gdkselection.c gdk/win32/{x11,win32}/gdkselection-{x11,win32}.c
gdk/{x11,win32}/gdkmain-{x11,win32}.c gdk/gdkdisplay.c: Move
gdk_text_property_to_text_list(), gdk_string_to_compound_text(),
gdk_display_set_sm_client_id() to display-independent part of GDK.
* gdk/Makefile.am (gdk_c_sources): Sort gdkdisplay/screen.[ch]
into the right place.
2002-08-01 15:28:40 +00:00
|
|
|
|
|
|
|
if (!screen->closed)
|
|
|
|
{
|
|
|
|
screen->closed = TRUE;
|
|
|
|
g_object_run_dispose (G_OBJECT (screen));
|
|
|
|
}
|
2002-04-25 22:29:14 +00:00
|
|
|
}
|
|
|
|
|
2010-12-06 21:05:13 +00:00
|
|
|
/**
|
|
|
|
* gdk_screen_get_display:
|
|
|
|
* @screen: a #GdkScreen
|
|
|
|
*
|
|
|
|
* Gets the display to which the @screen belongs.
|
|
|
|
*
|
|
|
|
* Returns: (transfer none): the display to which @screen belongs
|
|
|
|
*
|
|
|
|
* Since: 2.2
|
|
|
|
**/
|
|
|
|
GdkDisplay *
|
|
|
|
gdk_screen_get_display (GdkScreen *screen)
|
|
|
|
{
|
2012-02-21 16:19:35 +00:00
|
|
|
g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL);
|
|
|
|
|
|
|
|
return GDK_SCREEN_GET_CLASS (screen)->get_display (screen);
|
2010-12-06 21:05:13 +00:00
|
|
|
}
|