Import AppKit.h instead of Quartz.h. Don't use userSpaceScaleFactor for

2007-02-18  Richard Hult  <richard@imendio.com>

	* gdk/quartz/GdkQuartzView.h:
	* gdk/quartz/GdkQuartzWindow.h:
	* gdk/quartz/gdkquartz.h: Import AppKit.h instead of Quartz.h.
	* gdk/quartz/gdkscreen-quartz.c: (get_mm_from_pixels): Don't use 
	userSpaceScaleFactor for 10.3. Those changes bring us closer to working
	on panther, patch from Mathias Hasselmann.
	
	* gdk/quartz/gdkeventloop-quartz.c: Add includes to fix build warnings.

svn path=/trunk/; revision=17323
This commit is contained in:
Richard Hult 2007-02-18 10:26:49 +00:00 committed by Richard Hult
parent 898385a3e0
commit a862e9f6b9
6 changed files with 24 additions and 4 deletions

View File

@ -1,3 +1,14 @@
2007-02-18 Richard Hult <richard@imendio.com>
* gdk/quartz/GdkQuartzView.h:
* gdk/quartz/GdkQuartzWindow.h:
* gdk/quartz/gdkquartz.h: Import AppKit.h instead of Quartz.h.
* gdk/quartz/gdkscreen-quartz.c: (get_mm_from_pixels): Don't use
userSpaceScaleFactor for 10.3. Those changes bring us closer to working
on panther, patch from Mathias Hasselmann.
* gdk/quartz/gdkeventloop-quartz.c: Add includes to fix build warnings.
2007-02-16 Behdad Esfahbod <behdad@gnome.org>
* gdk/gdkpango.c (gdk_pango_layout_get_clip_region): Use PANGO_PIXELS

View File

@ -18,7 +18,7 @@
* Boston, MA 02111-1307, USA.
*/
#import <Quartz/Quartz.h>
#import <AppKit/AppKit.h>
#include "gdkwindow.h"
@interface GdkQuartzView : NSView {

View File

@ -18,7 +18,7 @@
* Boston, MA 02111-1307, USA.
*/
#import <Quartz/Quartz.h>
#import <AppKit/AppKit.h>
#include "gdkwindow.h"
@interface GdkQuartzWindow : NSWindow {

View File

@ -2,6 +2,9 @@
#include <glib.h>
#include <pthread.h>
#include <sys/types.h>
#include <sys/uio.h>
#include <unistd.h>
#include "gdkprivate-quartz.h"

View File

@ -1,7 +1,7 @@
#ifndef __GDK_QUARTZ_H__
#define __GDK_QUARTZ_H__
#include <Quartz/Quartz.h>
#include <AppKit/AppKit.h>
#include "gdk/gdkprivate.h"
#include "gdkprivate-quartz.h"
#include "gdkdrawable-quartz.h"

View File

@ -139,7 +139,13 @@ get_mm_from_pixels (NSScreen *screen, int pixels)
* 72 is the number of points per inch,
* and 25.4 is the number of millimeters per inch.
*/
return ((pixels / [screen userSpaceScaleFactor]) / 72) * 25.4;
#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;
}
gint