Implement those, fixes loading python bindings.

2008-08-07  Richard Hult  <richard@imendio.com>

	* gdk/quartz/gdkscreen-quartz.c: (gdk_screen_get_monitor_plug_name)
	(gdk_screen_get_monitor_height_mm, gdk_screen_get_monitor_width_mm):
	Implement those, fixes loading python bindings.

svn path=/trunk/; revision=21029
This commit is contained in:
Richard Hult 2008-08-07 08:14:12 +00:00 committed by Richard Hult
parent 66459b2502
commit e7d1152a8e
2 changed files with 65 additions and 9 deletions

View File

@ -1,3 +1,9 @@
2008-08-07 Richard Hult <richard@imendio.com>
* gdk/quartz/gdkscreen-quartz.c: (gdk_screen_get_monitor_plug_name)
(gdk_screen_get_monitor_height_mm, gdk_screen_get_monitor_width_mm):
Implement those, fixes loading python bindings.
2008-08-07 Emmanuele Bassi <ebassi@gnome.org>
Bug 545031 list of recently used files is created world-readable

View File

@ -212,30 +212,80 @@ gdk_screen_get_n_monitors (GdkScreen *screen)
return n;
}
void
gdk_screen_get_monitor_geometry (GdkScreen *screen,
gint monitor_num,
GdkRectangle *dest)
static void
screen_get_monitor_geometry (GdkScreen *screen,
gint monitor_num,
GdkRectangle *dest,
gboolean in_mm)
{
NSArray *array;
NSScreen *nsscreen;
NSRect rect;
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);
GDK_QUARTZ_ALLOC_POOL;
array = [NSScreen screens];
rect = [[array objectAtIndex:monitor_num] frame];
nsscreen = [array objectAtIndex:monitor_num];
rect = [nsscreen frame];
dest->x = rect.origin.x;
dest->y = rect.origin.y;
dest->width = rect.size.width;
dest->height = rect.size.height;
if (in_mm)
{
dest->x = get_mm_from_pixels (nsscreen, dest->x);
dest->y = get_mm_from_pixels (nsscreen, dest->y);
dest->width = get_mm_from_pixels (nsscreen, dest->width);
dest->height = get_mm_from_pixels (nsscreen, dest->height);
}
GDK_QUARTZ_RELEASE_POOL;
}
gint
gdk_screen_get_monitor_width_mm (GdkScreen *screen,
gint monitor_num)
{
GdkRectangle rect;
screen_get_monitor_geometry (screen, monitor_num, &rect, TRUE);
return rect.width;
}
gint
gdk_screen_get_monitor_height_mm (GdkScreen *screen,
gint monitor_num)
{
GdkRectangle rect;
screen_get_monitor_geometry (screen, monitor_num, &rect, TRUE);
return rect.height;
}
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);
screen_get_monitor_geometry (screen, monitor_num, dest, FALSE);
}
gchar *
gdk_screen_make_display_name (GdkScreen *screen)
{