osx: Compilation fixes

Replace deprecated symbols with the correct ones.
This commit is contained in:
Emmanuele Bassi 2010-10-10 09:31:55 +01:00
parent 981fed1f63
commit f8af2da4c8
3 changed files with 77 additions and 37 deletions

View File

@ -43,12 +43,18 @@ clutter_backend_osx_post_parse (ClutterBackend *backend,
NSSize size; NSSize size;
[[prop valueForKey:@"NSDeviceResolution"] getValue:&size]; [[prop valueForKey:@"NSDeviceResolution"] getValue:&size];
CLUTTER_OSX_POOL_RELEASE(); CLUTTER_OSX_POOL_RELEASE();
/* setting dpi for backend, it needs by font rendering library */ /* setting dpi for backend, it needs by font rendering library */
if (size.height > 0) if (size.height > 0)
{ {
clutter_backend_set_resolution (backend, size.height); ClutterSettings *settings = clutter_settings_get_default ();
int font_dpi = size.height * 1024;
g_object_set (settings, "font-dpi", font_dpi, NULL);
return TRUE; return TRUE;
} }
return FALSE; return FALSE;
} }

View File

@ -25,7 +25,7 @@
#include "clutter-stage-osx.h" #include "clutter-stage-osx.h"
#import <AppKit/AppKit.h> #import <AppKit/AppKit.h>
#include <glib/gmain.h> #include <glib/glib.h>
#include <clutter/clutter-debug.h> #include <clutter/clutter-debug.h>
#include <clutter/clutter-private.h> #include <clutter/clutter-private.h>
#include <clutter/clutter-keysyms.h> #include <clutter/clutter-keysyms.h>
@ -112,32 +112,57 @@ static GPollFunc old_poll_func = NULL;
{ {
/* these should be fairly standard */ /* these should be fairly standard */
/* (maybe add 0x0008 (Ctrl+H) for backspace too) */ /* (maybe add 0x0008 (Ctrl+H) for backspace too) */
case 0x000d: return CLUTTER_Return; case 0x000d:
case 0x001b: return CLUTTER_Escape; return CLUTTER_KEY_Return;
case 0x007f: return CLUTTER_BackSpace; case 0x001b:
return CLUTTER_KEY_Escape;
case 0x007f:
return CLUTTER_KEY_BackSpace;
/* Defined in NSEvent.h */ /* Defined in NSEvent.h */
case NSUpArrowFunctionKey: return CLUTTER_Up; case NSUpArrowFunctionKey:
case NSDownArrowFunctionKey: return CLUTTER_Down; return CLUTTER_KEY_Up;
case NSLeftArrowFunctionKey: return CLUTTER_Left; case NSDownArrowFunctionKey:
case NSRightArrowFunctionKey: return CLUTTER_Right; return CLUTTER_KEY_Down;
case NSF1FunctionKey: return CLUTTER_F1; case NSLeftArrowFunctionKey:
case NSF2FunctionKey: return CLUTTER_F2; return CLUTTER_KEY_Left;
case NSF3FunctionKey: return CLUTTER_F3; case NSRightArrowFunctionKey:
case NSF4FunctionKey: return CLUTTER_F4; return CLUTTER_KEY_Right;
case NSF5FunctionKey: return CLUTTER_F5; case NSF1FunctionKey:
case NSF6FunctionKey: return CLUTTER_F6; return CLUTTER_KEY_F1;
case NSF7FunctionKey: return CLUTTER_F7; case NSF2FunctionKey:
case NSF8FunctionKey: return CLUTTER_F8; return CLUTTER_KEY_F2;
case NSF9FunctionKey: return CLUTTER_F9; case NSF3FunctionKey:
case NSF10FunctionKey: return CLUTTER_F10; return CLUTTER_KEY_F3;
case NSF11FunctionKey: return CLUTTER_F11; case NSF4FunctionKey:
case NSF12FunctionKey: return CLUTTER_F12; return CLUTTER_KEY_F4;
case NSInsertFunctionKey: return CLUTTER_Insert; case NSF5FunctionKey:
case NSDeleteFunctionKey: return CLUTTER_Delete; return CLUTTER_KEY_F5;
case NSHomeFunctionKey: return CLUTTER_Home; case NSF6FunctionKey:
case NSEndFunctionKey: return CLUTTER_End; return CLUTTER_KEY_F6;
case NSPageUpFunctionKey: return CLUTTER_Page_Up; case NSF7FunctionKey:
case NSPageDownFunctionKey: return CLUTTER_Page_Down; return CLUTTER_KEY_F7;
case NSF8FunctionKey:
return CLUTTER_KEY_F8;
case NSF9FunctionKey:
return CLUTTER_KEY_F9;
case NSF10FunctionKey:
return CLUTTER_KEY_F10;
case NSF11FunctionKey:
return CLUTTER_KEY_F11;
case NSF12FunctionKey:
return CLUTTER_KEY_F12;
case NSInsertFunctionKey:
return CLUTTER_KEY_Insert;
case NSDeleteFunctionKey:
return CLUTTER_KEY_Delete;
case NSHomeFunctionKey:
return CLUTTER_KEY_Home;
case NSEndFunctionKey:
return CLUTTER_KEY_End;
case NSPageUpFunctionKey:
return CLUTTER_KEY_Page_Up;
case NSPageDownFunctionKey:
return CLUTTER_KEY_Page_Down;
} }
CLUTTER_NOTE (BACKEND, "unhandled unicode key 0x%x (%d)", c, c); CLUTTER_NOTE (BACKEND, "unhandled unicode key 0x%x (%d)", c, c);
@ -147,15 +172,24 @@ static GPollFunc old_poll_func = NULL;
*/ */
switch ([self keyCode]) switch ([self keyCode])
{ {
case 115: return CLUTTER_Home; case 115:
case 116: return CLUTTER_Page_Up; return CLUTTER_KEY_Home;
case 117: return CLUTTER_Delete; case 116:
case 119: return CLUTTER_End; return CLUTTER_KEY_Page_Up;
case 121: return CLUTTER_Page_Down; case 117:
case 123: return CLUTTER_Left; return CLUTTER_KEY_Delete;
case 124: return CLUTTER_Right; case 119:
case 125: return CLUTTER_Down; return CLUTTER_KEY_End;
case 126: return CLUTTER_Up; case 121:
return CLUTTER_KEY_Page_Down;
case 123:
return CLUTTER_KEY_Left;
case 124:
return CLUTTER_KEY_Right;
case 125:
return CLUTTER_KEY_Down;
case 126:
return CLUTTER_KEY_Up;
} }
return 0; return 0;

View File

@ -400,7 +400,7 @@ clutter_stage_osx_resize (ClutterStageWindow *stage_window,
ClutterActor *actor = clutter_stage_osx_get_wrapper (stage_window); ClutterActor *actor = clutter_stage_osx_get_wrapper (stage_window);
guint min_width, min_height; guint min_width, min_height;
clutter_stage_get_minimum_size (actor, clutter_stage_get_minimum_size (CLUTTER_STAGE (actor),
&min_width, &min_width,
&min_height); &min_height);
[self->window setContentMinSize:NSMakeSize(min_width, min_height)]; [self->window setContentMinSize:NSMakeSize(min_width, min_height)];