mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-10 02:40:11 +00:00
Set the resolution.
2007-05-21 Richard Hult <richard@imendio.com> * gdk/quartz/gdkdisplay-quartz.c: (gdk_display_open): Set the resolution. * gdk/quartz/gdkscreen-quartz.c: Use the autorelease pool macros. svn path=/trunk/; revision=17887
This commit is contained in:
parent
b3ce266b6e
commit
e8071ea7c9
@ -1,3 +1,10 @@
|
||||
2007-05-21 Richard Hult <richard@imendio.com>
|
||||
|
||||
* gdk/quartz/gdkdisplay-quartz.c: (gdk_display_open): Set the
|
||||
resolution.
|
||||
|
||||
* gdk/quartz/gdkscreen-quartz.c: Use the autorelease pool macros.
|
||||
|
||||
2007-05-21 Michael Natterer <mitch@imendio.com>
|
||||
|
||||
* gtk/gtkcombobox.c (gtk_combo_box_set_model): revert last change.
|
||||
|
@ -45,11 +45,15 @@ gdk_display_open (const gchar *display_name)
|
||||
if (_gdk_display != NULL)
|
||||
return NULL;
|
||||
|
||||
/* Initialize application */
|
||||
[NSApplication sharedApplication];
|
||||
|
||||
_gdk_display = g_object_new (GDK_TYPE_DISPLAY, NULL);
|
||||
_gdk_screen = g_object_new (GDK_TYPE_SCREEN, NULL);
|
||||
|
||||
/* Initialize application */
|
||||
[NSApplication sharedApplication];
|
||||
NSScreen *nsscreen;
|
||||
nsscreen = [[NSScreen screens] objectAtIndex:0];
|
||||
gdk_screen_set_resolution (_gdk_screen, 72.0 * [nsscreen userSpaceScaleFactor]);
|
||||
|
||||
_gdk_visual_init ();
|
||||
gdk_screen_set_default_colormap (_gdk_screen,
|
||||
|
@ -88,11 +88,10 @@ gdk_screen_get_width (GdkScreen *screen)
|
||||
int i;
|
||||
int width;
|
||||
NSArray *array;
|
||||
NSAutoreleasePool *pool;
|
||||
|
||||
g_return_val_if_fail (GDK_IS_SCREEN (screen), 0);
|
||||
|
||||
pool = [[NSAutoreleasePool alloc] init];
|
||||
GDK_QUARTZ_ALLOC_POOL;
|
||||
array = [NSScreen screens];
|
||||
|
||||
width = 0;
|
||||
@ -102,7 +101,7 @@ gdk_screen_get_width (GdkScreen *screen)
|
||||
width += rect.size.width;
|
||||
}
|
||||
|
||||
[pool release];
|
||||
GDK_QUARTZ_RELEASE_POOL;
|
||||
|
||||
return width;
|
||||
}
|
||||
@ -113,11 +112,10 @@ gdk_screen_get_height (GdkScreen *screen)
|
||||
int i;
|
||||
int height;
|
||||
NSArray *array;
|
||||
NSAutoreleasePool *pool;
|
||||
|
||||
g_return_val_if_fail (GDK_IS_SCREEN (screen), 0);
|
||||
|
||||
pool = [[NSAutoreleasePool alloc] init];
|
||||
GDK_QUARTZ_ALLOC_POOL;
|
||||
array = [NSScreen screens];
|
||||
|
||||
height = 0;
|
||||
@ -127,7 +125,7 @@ gdk_screen_get_height (GdkScreen *screen)
|
||||
height = MAX (height, rect.size.height);
|
||||
}
|
||||
|
||||
[pool release];
|
||||
GDK_QUARTZ_RELEASE_POOL;
|
||||
|
||||
return height;
|
||||
}
|
||||
@ -154,11 +152,10 @@ gdk_screen_get_width_mm (GdkScreen *screen)
|
||||
int i;
|
||||
gint width;
|
||||
NSArray *array;
|
||||
NSAutoreleasePool *pool;
|
||||
|
||||
g_return_val_if_fail (GDK_IS_SCREEN (screen), 0);
|
||||
|
||||
pool = [[NSAutoreleasePool alloc] init];
|
||||
GDK_QUARTZ_ALLOC_POOL;
|
||||
array = [NSScreen screens];
|
||||
|
||||
width = 0;
|
||||
@ -169,7 +166,7 @@ gdk_screen_get_width_mm (GdkScreen *screen)
|
||||
width += get_mm_from_pixels (screen, rect.size.width);
|
||||
}
|
||||
|
||||
[pool release];
|
||||
GDK_QUARTZ_RELEASE_POOL;
|
||||
|
||||
return width;
|
||||
}
|
||||
@ -180,11 +177,10 @@ gdk_screen_get_height_mm (GdkScreen *screen)
|
||||
int i;
|
||||
gint height;
|
||||
NSArray *array;
|
||||
NSAutoreleasePool *pool;
|
||||
|
||||
g_return_val_if_fail (GDK_IS_SCREEN (screen), 0);
|
||||
|
||||
pool = [[NSAutoreleasePool alloc] init];
|
||||
GDK_QUARTZ_ALLOC_POOL;
|
||||
array = [NSScreen screens];
|
||||
|
||||
height = 0;
|
||||
@ -196,7 +192,7 @@ gdk_screen_get_height_mm (GdkScreen *screen)
|
||||
height = MAX (height, h);
|
||||
}
|
||||
|
||||
[pool release];
|
||||
GDK_QUARTZ_RELEASE_POOL;
|
||||
|
||||
return height;
|
||||
}
|
||||
@ -205,6 +201,7 @@ int
|
||||
gdk_screen_get_n_monitors (GdkScreen *screen)
|
||||
{
|
||||
int n;
|
||||
|
||||
GDK_QUARTZ_ALLOC_POOL;
|
||||
NSArray *array = [NSScreen screens];
|
||||
|
||||
@ -222,13 +219,12 @@ gdk_screen_get_monitor_geometry (GdkScreen *screen,
|
||||
{
|
||||
NSArray *array;
|
||||
NSRect rect;
|
||||
NSAutoreleasePool *pool;
|
||||
|
||||
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);
|
||||
|
||||
pool = [[NSAutoreleasePool alloc] init];
|
||||
GDK_QUARTZ_ALLOC_POOL;
|
||||
array = [NSScreen screens];
|
||||
rect = [[array objectAtIndex:monitor_num] frame];
|
||||
|
||||
@ -237,7 +233,7 @@ gdk_screen_get_monitor_geometry (GdkScreen *screen,
|
||||
dest->width = rect.size.width;
|
||||
dest->height = rect.size.height;
|
||||
|
||||
[pool release];
|
||||
GDK_QUARTZ_RELEASE_POOL;
|
||||
}
|
||||
|
||||
gchar *
|
||||
|
Loading…
Reference in New Issue
Block a user