2005-11-22 10:03:32 +00:00
|
|
|
/* gdkscreen-quartz.c
|
|
|
|
*
|
|
|
|
* Copyright (C) 2005 Imendio AB
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser 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
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
2008-06-22 14:28:52 +00:00
|
|
|
#include "config.h"
|
2005-11-22 10:03:32 +00:00
|
|
|
#include "gdk.h"
|
2009-10-24 09:48:39 +00:00
|
|
|
#include "gdkscreen-quartz.h"
|
2005-11-22 10:03:32 +00:00
|
|
|
#include "gdkprivate-quartz.h"
|
2009-10-12 07:55:45 +00:00
|
|
|
|
|
|
|
|
2009-10-24 09:48:39 +00:00
|
|
|
static void gdk_screen_quartz_dispose (GObject *object);
|
|
|
|
static void gdk_screen_quartz_finalize (GObject *object);
|
|
|
|
static void gdk_screen_quartz_calculate_layout (GdkScreenQuartz *screen);
|
|
|
|
|
|
|
|
static void display_reconfiguration_callback (CGDirectDisplayID display,
|
|
|
|
CGDisplayChangeSummaryFlags flags,
|
|
|
|
void *userInfo);
|
|
|
|
|
|
|
|
G_DEFINE_TYPE (GdkScreenQuartz, _gdk_screen_quartz, GDK_TYPE_SCREEN);
|
|
|
|
|
|
|
|
static void
|
|
|
|
_gdk_screen_quartz_class_init (GdkScreenQuartzClass *klass)
|
|
|
|
{
|
|
|
|
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
|
|
|
|
|
|
|
object_class->dispose = gdk_screen_quartz_dispose;
|
|
|
|
object_class->finalize = gdk_screen_quartz_finalize;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_gdk_screen_quartz_init (GdkScreenQuartz *screen_quartz)
|
|
|
|
{
|
|
|
|
GdkScreen *screen = GDK_SCREEN (screen_quartz);
|
2009-10-24 09:51:51 +00:00
|
|
|
NSScreen *nsscreen;
|
2009-10-24 09:48:39 +00:00
|
|
|
|
|
|
|
gdk_screen_set_default_colormap (screen,
|
|
|
|
gdk_screen_get_system_colormap (screen));
|
|
|
|
|
2009-10-24 09:51:51 +00:00
|
|
|
nsscreen = [[NSScreen screens] objectAtIndex:0];
|
|
|
|
gdk_screen_set_resolution (screen,
|
|
|
|
72.0 * [nsscreen userSpaceScaleFactor]);
|
|
|
|
|
2009-10-24 09:48:39 +00:00
|
|
|
gdk_screen_quartz_calculate_layout (screen_quartz);
|
|
|
|
|
|
|
|
CGDisplayRegisterReconfigurationCallback (display_reconfiguration_callback,
|
|
|
|
screen);
|
2009-10-24 10:25:29 +00:00
|
|
|
|
|
|
|
screen_quartz->emit_monitors_changed = FALSE;
|
2009-10-24 09:48:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gdk_screen_quartz_dispose (GObject *object)
|
|
|
|
{
|
|
|
|
GdkScreenQuartz *screen = GDK_SCREEN_QUARTZ (object);
|
|
|
|
|
|
|
|
if (screen->default_colormap)
|
|
|
|
{
|
|
|
|
g_object_unref (screen->default_colormap);
|
|
|
|
screen->default_colormap = NULL;
|
|
|
|
}
|
2009-10-24 08:29:43 +00:00
|
|
|
|
2009-10-24 09:48:39 +00:00
|
|
|
if (screen->screen_changed_id)
|
|
|
|
{
|
|
|
|
g_source_remove (screen->screen_changed_id);
|
|
|
|
screen->screen_changed_id = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
CGDisplayRemoveReconfigurationCallback (display_reconfiguration_callback,
|
|
|
|
screen);
|
|
|
|
|
|
|
|
G_OBJECT_CLASS (_gdk_screen_quartz_parent_class)->dispose (object);
|
|
|
|
}
|
2009-10-12 07:55:45 +00:00
|
|
|
|
|
|
|
static void
|
2009-10-24 09:48:39 +00:00
|
|
|
gdk_screen_quartz_screen_rects_free (GdkScreenQuartz *screen)
|
|
|
|
{
|
|
|
|
screen->n_screens = 0;
|
|
|
|
|
|
|
|
if (screen->screen_rects)
|
|
|
|
{
|
|
|
|
g_free (screen->screen_rects);
|
|
|
|
screen->screen_rects = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gdk_screen_quartz_finalize (GObject *object)
|
|
|
|
{
|
|
|
|
GdkScreenQuartz *screen = GDK_SCREEN_QUARTZ (object);
|
|
|
|
|
|
|
|
gdk_screen_quartz_screen_rects_free (screen);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
gdk_screen_quartz_calculate_layout (GdkScreenQuartz *screen)
|
2009-10-12 07:55:45 +00:00
|
|
|
{
|
|
|
|
NSArray *array;
|
|
|
|
NSRect largest_rect;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
GDK_QUARTZ_ALLOC_POOL;
|
|
|
|
|
2009-10-24 09:48:39 +00:00
|
|
|
gdk_screen_quartz_screen_rects_free (screen);
|
2009-10-12 07:55:45 +00:00
|
|
|
|
2009-10-24 09:48:39 +00:00
|
|
|
array = [NSScreen screens];
|
2009-10-12 07:55:45 +00:00
|
|
|
|
2009-10-24 09:48:39 +00:00
|
|
|
/* FIXME: For now we only support screen layouts where the screens are laid
|
|
|
|
* out horizontally. Mac OS X also supports laying out the screens vertically
|
|
|
|
* and the screens having "non-standard" offsets from eachother. In the
|
|
|
|
* future we need a much more sophiscated algorithm to translate these
|
|
|
|
* layouts to GDK coordinate space and GDK screen layout.
|
2009-10-12 07:55:45 +00:00
|
|
|
*/
|
2009-10-24 09:48:39 +00:00
|
|
|
screen->width = 0;
|
|
|
|
screen->height = 0;
|
2009-10-25 20:36:56 +00:00
|
|
|
screen->min_x = 0;
|
|
|
|
screen->min_y = 0;
|
2009-10-24 09:48:39 +00:00
|
|
|
|
|
|
|
for (i = 0; i < [array count]; i++)
|
|
|
|
{
|
|
|
|
NSRect rect = [[array objectAtIndex:i] frame];
|
|
|
|
|
|
|
|
screen->width += rect.size.width;
|
|
|
|
screen->height = MAX (screen->height, rect.size.height);
|
2009-10-25 20:36:56 +00:00
|
|
|
screen->min_x = MIN (screen->min_x, rect.origin.x);
|
|
|
|
screen->min_y = MIN (screen->min_y, rect.origin.y);
|
2009-10-24 09:48:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
screen->n_screens = [array count];
|
|
|
|
screen->screen_rects = g_new0 (GdkRectangle, screen->n_screens);
|
2009-10-12 07:55:45 +00:00
|
|
|
|
|
|
|
/* Find the monitor with the largest height. All monitors should be
|
|
|
|
* offset to this one in the GDK screen space instead of offset to
|
|
|
|
* the screen with the menu bar.
|
|
|
|
*/
|
|
|
|
largest_rect = [[array objectAtIndex:0] frame];
|
|
|
|
for (i = 1; i < [array count]; i++)
|
|
|
|
{
|
|
|
|
NSRect rect = [[array objectAtIndex:i] frame];
|
|
|
|
|
|
|
|
if (rect.size.height > largest_rect.size.height)
|
|
|
|
largest_rect = [[array objectAtIndex:i] frame];
|
|
|
|
}
|
|
|
|
|
2009-10-24 09:48:39 +00:00
|
|
|
for (i = 0; i < screen->n_screens; i++)
|
2009-10-12 07:55:45 +00:00
|
|
|
{
|
|
|
|
NSScreen *nsscreen;
|
|
|
|
NSRect rect;
|
|
|
|
|
|
|
|
nsscreen = [array objectAtIndex:i];
|
|
|
|
rect = [nsscreen frame];
|
|
|
|
|
2009-10-25 20:36:56 +00:00
|
|
|
screen->screen_rects[i].x = rect.origin.x - screen->min_x;
|
2009-10-24 09:48:39 +00:00
|
|
|
screen->screen_rects[i].width = rect.size.width;
|
|
|
|
screen->screen_rects[i].height = rect.size.height;
|
2009-10-12 07:55:45 +00:00
|
|
|
|
|
|
|
if (largest_rect.size.height - rect.size.height == 0)
|
2009-10-24 09:48:39 +00:00
|
|
|
screen->screen_rects[i].y = 0;
|
2009-10-12 07:55:45 +00:00
|
|
|
else
|
2009-10-24 09:48:39 +00:00
|
|
|
screen->screen_rects[i].y = largest_rect.size.height - rect.size.height + largest_rect.origin.y;
|
2009-10-12 07:55:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
GDK_QUARTZ_RELEASE_POOL;
|
|
|
|
}
|
2005-11-22 10:03:32 +00:00
|
|
|
|
2009-10-24 09:48:39 +00:00
|
|
|
|
2009-10-24 08:29:43 +00:00
|
|
|
static void
|
2009-10-24 09:48:39 +00:00
|
|
|
process_display_reconfiguration (GdkScreenQuartz *screen)
|
2009-10-24 08:29:43 +00:00
|
|
|
{
|
2009-10-24 09:48:39 +00:00
|
|
|
int width, height;
|
2009-10-24 08:29:43 +00:00
|
|
|
|
2009-10-24 09:48:39 +00:00
|
|
|
width = gdk_screen_get_width (GDK_SCREEN (screen));
|
|
|
|
height = gdk_screen_get_height (GDK_SCREEN (screen));
|
2009-10-24 08:29:43 +00:00
|
|
|
|
2009-10-24 09:48:39 +00:00
|
|
|
gdk_screen_quartz_calculate_layout (GDK_SCREEN_QUARTZ (screen));
|
2009-10-24 08:29:43 +00:00
|
|
|
|
2009-10-24 10:25:29 +00:00
|
|
|
if (screen->emit_monitors_changed)
|
|
|
|
{
|
|
|
|
g_signal_emit_by_name (screen, "monitors-changed");
|
|
|
|
screen->emit_monitors_changed = FALSE;
|
|
|
|
}
|
2009-10-24 12:53:28 +00:00
|
|
|
|
|
|
|
if (width != gdk_screen_get_width (GDK_SCREEN (screen))
|
|
|
|
|| height != gdk_screen_get_height (GDK_SCREEN (screen)))
|
|
|
|
g_signal_emit_by_name (screen, "size-changed");
|
2009-10-24 08:29:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
screen_changed_idle (gpointer data)
|
|
|
|
{
|
2009-10-24 09:48:39 +00:00
|
|
|
GdkScreenQuartz *screen = data;
|
|
|
|
|
|
|
|
process_display_reconfiguration (data);
|
2009-10-24 08:29:43 +00:00
|
|
|
|
2009-10-24 09:48:39 +00:00
|
|
|
screen->screen_changed_id = 0;
|
2009-10-24 08:29:43 +00:00
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2009-10-24 09:48:39 +00:00
|
|
|
display_reconfiguration_callback (CGDirectDisplayID display,
|
|
|
|
CGDisplayChangeSummaryFlags flags,
|
|
|
|
void *userInfo)
|
2009-10-24 08:29:43 +00:00
|
|
|
{
|
2009-10-24 09:48:39 +00:00
|
|
|
GdkScreenQuartz *screen = userInfo;
|
|
|
|
|
2009-10-24 08:29:43 +00:00
|
|
|
if (flags & kCGDisplayBeginConfigurationFlag)
|
|
|
|
{
|
|
|
|
/* Ignore the begin configuration signal. */
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2009-10-24 10:25:29 +00:00
|
|
|
/* We save information about the changes, so we can emit
|
|
|
|
* ::monitors-changed when appropriate. This signal must be
|
|
|
|
* emitted when the number, size of position of one of the
|
|
|
|
* monitors changes.
|
|
|
|
*/
|
|
|
|
if (flags & kCGDisplayMovedFlag
|
|
|
|
|| flags & kCGDisplayAddFlag
|
|
|
|
|| flags & kCGDisplayRemoveFlag
|
|
|
|
|| flags & kCGDisplayEnabledFlag
|
|
|
|
|| flags & kCGDisplayDisabledFlag)
|
|
|
|
screen->emit_monitors_changed = TRUE;
|
|
|
|
|
2009-10-24 08:29:43 +00:00
|
|
|
/* At this point Cocoa does not know about the new screen data
|
|
|
|
* yet, so we delay our refresh into an idle handler.
|
|
|
|
*/
|
2009-10-24 09:48:39 +00:00
|
|
|
if (!screen->screen_changed_id)
|
|
|
|
screen->screen_changed_id = gdk_threads_add_idle (screen_changed_idle,
|
|
|
|
screen);
|
2009-10-24 08:29:43 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-10-24 09:48:39 +00:00
|
|
|
GdkScreen *
|
|
|
|
_gdk_screen_quartz_new (void)
|
2009-10-07 16:54:47 +00:00
|
|
|
{
|
2009-10-24 09:48:39 +00:00
|
|
|
return g_object_new (GDK_TYPE_SCREEN_QUARTZ, NULL);
|
2009-10-07 16:54:47 +00:00
|
|
|
}
|
|
|
|
|
2005-11-22 10:03:32 +00:00
|
|
|
GdkDisplay *
|
|
|
|
gdk_screen_get_display (GdkScreen *screen)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL);
|
|
|
|
|
|
|
|
return _gdk_display;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
GdkWindow *
|
|
|
|
gdk_screen_get_root_window (GdkScreen *screen)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL);
|
|
|
|
|
|
|
|
return _gdk_root;
|
|
|
|
}
|
|
|
|
|
|
|
|
gint
|
|
|
|
gdk_screen_get_number (GdkScreen *screen)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GDK_IS_SCREEN (screen), 0);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
gchar *
|
|
|
|
_gdk_windowing_substitute_screen_number (const gchar *display_name,
|
|
|
|
int screen_number)
|
|
|
|
{
|
|
|
|
if (screen_number != 0)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
return g_strdup (display_name);
|
|
|
|
}
|
|
|
|
|
|
|
|
GdkColormap*
|
|
|
|
gdk_screen_get_default_colormap (GdkScreen *screen)
|
|
|
|
{
|
2009-10-24 09:48:39 +00:00
|
|
|
g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL);
|
|
|
|
|
|
|
|
return GDK_SCREEN_QUARTZ (screen)->default_colormap;
|
2005-11-22 10:03:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gdk_screen_set_default_colormap (GdkScreen *screen,
|
|
|
|
GdkColormap *colormap)
|
|
|
|
{
|
|
|
|
GdkColormap *old_colormap;
|
|
|
|
|
|
|
|
g_return_if_fail (GDK_IS_SCREEN (screen));
|
|
|
|
g_return_if_fail (GDK_IS_COLORMAP (colormap));
|
|
|
|
|
2009-10-24 09:48:39 +00:00
|
|
|
old_colormap = GDK_SCREEN_QUARTZ (screen)->default_colormap;
|
2005-11-22 10:03:32 +00:00
|
|
|
|
2009-10-24 09:48:39 +00:00
|
|
|
GDK_SCREEN_QUARTZ (screen)->default_colormap = g_object_ref (colormap);
|
2005-11-22 10:03:32 +00:00
|
|
|
|
|
|
|
if (old_colormap)
|
|
|
|
g_object_unref (old_colormap);
|
|
|
|
}
|
|
|
|
|
|
|
|
gint
|
|
|
|
gdk_screen_get_width (GdkScreen *screen)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GDK_IS_SCREEN (screen), 0);
|
|
|
|
|
2009-10-24 09:48:39 +00:00
|
|
|
return GDK_SCREEN_QUARTZ (screen)->width;
|
2005-11-22 10:03:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
gint
|
|
|
|
gdk_screen_get_height (GdkScreen *screen)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GDK_IS_SCREEN (screen), 0);
|
|
|
|
|
2009-10-24 09:48:39 +00:00
|
|
|
return GDK_SCREEN_QUARTZ (screen)->height;
|
2005-11-22 10:03:32 +00:00
|
|
|
}
|
|
|
|
|
2006-01-18 10:06:00 +00:00
|
|
|
static gint
|
|
|
|
get_mm_from_pixels (NSScreen *screen, int pixels)
|
|
|
|
{
|
|
|
|
/* userSpaceScaleFactor is in "pixels per point",
|
|
|
|
* 72 is the number of points per inch,
|
|
|
|
* and 25.4 is the number of millimeters per inch.
|
|
|
|
*/
|
2007-02-18 10:26:49 +00:00
|
|
|
#if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_3
|
|
|
|
float dpi = [screen userSpaceScaleFactor] * 72.0;
|
|
|
|
#else
|
|
|
|
float dpi = 96.0 / 72.0;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
return (pixels / dpi) * 25.4;
|
2006-01-18 10:06:00 +00:00
|
|
|
}
|
|
|
|
|
2009-10-24 09:48:39 +00:00
|
|
|
static NSScreen *
|
|
|
|
get_nsscreen_for_monitor (gint monitor_num)
|
2005-11-22 10:03:32 +00:00
|
|
|
{
|
2006-01-18 10:06:00 +00:00
|
|
|
NSArray *array;
|
2009-10-24 09:48:39 +00:00
|
|
|
NSScreen *screen;
|
2005-11-22 10:03:32 +00:00
|
|
|
|
2007-05-21 19:40:43 +00:00
|
|
|
GDK_QUARTZ_ALLOC_POOL;
|
2006-01-18 10:06:00 +00:00
|
|
|
|
2009-10-24 09:48:39 +00:00
|
|
|
array = [NSScreen screens];
|
|
|
|
screen = [array objectAtIndex:monitor_num];
|
2006-01-18 10:06:00 +00:00
|
|
|
|
2007-05-21 19:40:43 +00:00
|
|
|
GDK_QUARTZ_RELEASE_POOL;
|
2006-01-18 10:06:00 +00:00
|
|
|
|
2009-10-24 09:48:39 +00:00
|
|
|
return screen;
|
2005-11-22 10:03:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
gint
|
2009-10-24 09:48:39 +00:00
|
|
|
gdk_screen_get_width_mm (GdkScreen *screen)
|
2005-11-22 10:03:32 +00:00
|
|
|
{
|
|
|
|
g_return_val_if_fail (GDK_IS_SCREEN (screen), 0);
|
|
|
|
|
2009-10-24 09:48:39 +00:00
|
|
|
return get_mm_from_pixels (get_nsscreen_for_monitor (0),
|
|
|
|
GDK_SCREEN_QUARTZ (screen)->width);
|
2005-11-22 10:03:32 +00:00
|
|
|
}
|
|
|
|
|
2009-10-24 09:48:39 +00:00
|
|
|
gint
|
|
|
|
gdk_screen_get_height_mm (GdkScreen *screen)
|
2005-11-22 10:03:32 +00:00
|
|
|
{
|
2009-10-12 07:55:45 +00:00
|
|
|
g_return_val_if_fail (GDK_IS_SCREEN (screen), 0);
|
2005-11-22 10:03:32 +00:00
|
|
|
|
2009-10-24 09:48:39 +00:00
|
|
|
return get_mm_from_pixels (get_nsscreen_for_monitor (0),
|
|
|
|
GDK_SCREEN_QUARTZ (screen)->height);
|
2005-11-22 10:03:32 +00:00
|
|
|
}
|
|
|
|
|
2009-10-24 09:48:39 +00:00
|
|
|
int
|
|
|
|
gdk_screen_get_n_monitors (GdkScreen *screen)
|
2005-11-22 10:03:32 +00:00
|
|
|
{
|
2009-10-24 09:48:39 +00:00
|
|
|
g_return_val_if_fail (GDK_IS_SCREEN (screen), 0);
|
2009-10-12 07:55:45 +00:00
|
|
|
|
2009-10-24 09:48:39 +00:00
|
|
|
return GDK_SCREEN_QUARTZ (screen)->n_screens;
|
2005-11-22 10:03:32 +00:00
|
|
|
}
|
|
|
|
|
2008-08-07 08:14:12 +00:00
|
|
|
gint
|
|
|
|
gdk_screen_get_monitor_width_mm (GdkScreen *screen,
|
|
|
|
gint monitor_num)
|
|
|
|
{
|
2009-10-12 07:55:45 +00:00
|
|
|
g_return_val_if_fail (GDK_IS_SCREEN (screen), 0);
|
|
|
|
g_return_val_if_fail (monitor_num < gdk_screen_get_n_monitors (screen), 0);
|
|
|
|
g_return_val_if_fail (monitor_num >= 0, 0);
|
2008-08-07 08:14:12 +00:00
|
|
|
|
2009-10-12 07:55:45 +00:00
|
|
|
return get_mm_from_pixels (get_nsscreen_for_monitor (monitor_num),
|
2009-10-24 09:48:39 +00:00
|
|
|
GDK_SCREEN_QUARTZ (screen)->screen_rects[monitor_num].width);
|
2008-08-07 08:14:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
gint
|
|
|
|
gdk_screen_get_monitor_height_mm (GdkScreen *screen,
|
|
|
|
gint monitor_num)
|
|
|
|
{
|
2009-10-12 07:55:45 +00:00
|
|
|
g_return_val_if_fail (GDK_IS_SCREEN (screen), 0);
|
|
|
|
g_return_val_if_fail (monitor_num < gdk_screen_get_n_monitors (screen), 0);
|
|
|
|
g_return_val_if_fail (monitor_num >= 0, 0);
|
2008-08-07 08:14:12 +00:00
|
|
|
|
2009-10-12 07:55:45 +00:00
|
|
|
return get_mm_from_pixels (get_nsscreen_for_monitor (monitor_num),
|
2009-10-24 09:48:39 +00:00
|
|
|
GDK_SCREEN_QUARTZ (screen)->screen_rects[monitor_num].height);
|
2008-08-07 08:14:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
gchar *
|
|
|
|
gdk_screen_get_monitor_plug_name (GdkScreen *screen,
|
|
|
|
gint monitor_num)
|
|
|
|
{
|
|
|
|
/* FIXME: Is there some useful name we could use here? */
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gdk_screen_get_monitor_geometry (GdkScreen *screen,
|
|
|
|
gint monitor_num,
|
|
|
|
GdkRectangle *dest)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GDK_IS_SCREEN (screen));
|
|
|
|
g_return_if_fail (monitor_num < gdk_screen_get_n_monitors (screen));
|
|
|
|
g_return_if_fail (monitor_num >= 0);
|
|
|
|
|
2009-10-24 09:48:39 +00:00
|
|
|
*dest = GDK_SCREEN_QUARTZ (screen)->screen_rects[monitor_num];
|
2008-08-07 08:14:12 +00:00
|
|
|
}
|
|
|
|
|
2005-11-22 10:03:32 +00:00
|
|
|
gchar *
|
|
|
|
gdk_screen_make_display_name (GdkScreen *screen)
|
|
|
|
{
|
|
|
|
return g_strdup (gdk_display_get_name (_gdk_display));
|
|
|
|
}
|
2006-03-08 17:02:34 +00:00
|
|
|
|
|
|
|
GdkWindow *
|
|
|
|
gdk_screen_get_active_window (GdkScreen *screen)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL);
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
GList *
|
|
|
|
gdk_screen_get_window_stack (GdkScreen *screen)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL);
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
2006-04-25 14:27:32 +00:00
|
|
|
|
|
|
|
gboolean
|
|
|
|
gdk_screen_is_composited (GdkScreen *screen)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GDK_IS_SCREEN (screen), FALSE);
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|