expedite: remove deprecated Evas Quartz backend.
SVN revision: 58356
This commit is contained in:
parent
62c2d26768
commit
3a86dd96a7
|
@ -83,10 +83,6 @@ EXPEDITE_CHECK_ENGINE([fb], [Framebuffer], "yes")
|
|||
# DIRECTFB
|
||||
EXPEDITE_CHECK_ENGINE([directfb], [DirectFB], "yes")
|
||||
|
||||
# Quartz
|
||||
EXPEDITE_CHECK_ENGINE([quartz], [Quartz], "yes", [quartz_libs="-framework Cocoa -framework ApplicationServices"])
|
||||
AC_SUBST(quartz_libs)
|
||||
|
||||
# Software 16bit X11
|
||||
EXPEDITE_CHECK_ENGINE([software-16-x11], [Software 16 bits X11], "yes")
|
||||
|
||||
|
@ -261,7 +257,6 @@ echo " Software SDL.................: ${have_software_sdl}"
|
|||
echo " Open GL SDL..................: ${have_opengl_sdl}"
|
||||
echo " FB...........................: ${have_fb}"
|
||||
echo " DirectFB.....................: ${have_directfb}"
|
||||
echo " Quartz.......................: ${have_quartz}"
|
||||
echo " Software X11 16 bits.........: ${have_software_16_x11}"
|
||||
echo " Software DirectDraw 16 bits..: ${have_software_16_ddraw}"
|
||||
echo " Software WinCE 16 bits.......: ${have_software_16_wince}"
|
||||
|
|
|
@ -116,7 +116,7 @@ proxy_text_random.c
|
|||
|
||||
expedite_CFLAGS = @WIN32_CFLAGS@
|
||||
expedite_CXXFLAGS = @EXPEDITE_CXXFLAGS@
|
||||
expedite_LDADD = @SDL_LIBS@ @x_libs@ @gdi_libs@ @ddraw_libs@ @ddraw_16_libs@ @d3d_libs@ @wince_16_libs@ @glew_libs@ @DIRECTFB_LIBS@ @XCB_LIBS@ @EVAS_LIBS@ @EINA_LIBS@ @EVIL_LIBS@ @quartz_libs@ -lm
|
||||
expedite_LDADD = @SDL_LIBS@ @x_libs@ @gdi_libs@ @ddraw_libs@ @ddraw_16_libs@ @d3d_libs@ @wince_16_libs@ @glew_libs@ @DIRECTFB_LIBS@ @XCB_LIBS@ @EVAS_LIBS@ @EINA_LIBS@ @EVIL_LIBS@ -lm
|
||||
expedite_LDFLAGS = @lt_enable_auto_import@
|
||||
|
||||
if BUILD_SOFTWARE_XLIB
|
||||
|
@ -184,11 +184,6 @@ expedite_SOURCES += \
|
|||
engine_directfb.c engine_directfb.h
|
||||
endif
|
||||
|
||||
if BUILD_QUARTZ
|
||||
expedite_SOURCES += \
|
||||
engine_quartz.m engine_quartz.h
|
||||
endif
|
||||
|
||||
if BUILD_SOFTWARE_16_X11
|
||||
expedite_SOURCES += \
|
||||
engine_software_16_x11.c engine_software_16_x11.h
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
#ifndef ENGINE_QUARTZ_H
|
||||
#define ENGINE_QUARTZ_H
|
||||
|
||||
Eina_Bool engine_quartz_args(const char *engine, int width, int height);
|
||||
void engine_quartz_loop(void);
|
||||
void engine_quartz_shutdown(void);
|
||||
|
||||
#endif
|
|
@ -1,254 +0,0 @@
|
|||
/* NOTE: If you're using Expedite for performance testing,
|
||||
set "Disable Beam Synchronization" in Quartz Debug. */
|
||||
|
||||
#include "main.h"
|
||||
|
||||
#include <Cocoa/Cocoa.h>
|
||||
#include <Evas_Engine_Quartz.h>
|
||||
|
||||
@interface EvasView : NSView
|
||||
{
|
||||
CGContextRef ctx;
|
||||
}
|
||||
@end
|
||||
|
||||
static EvasView * evas_view;
|
||||
static NSWindow * main_window;
|
||||
|
||||
@implementation EvasView
|
||||
|
||||
- (id) init
|
||||
{
|
||||
self = [super init];
|
||||
if (self != nil)
|
||||
{
|
||||
ctx = NULL;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)drawRect:(NSRect)rect
|
||||
{
|
||||
if(ctx != NULL)
|
||||
{
|
||||
evas_damage_rectangle_add(evas, 0, 0, win_w, win_h);
|
||||
return;
|
||||
}
|
||||
|
||||
ctx = [[NSGraphicsContext currentContext] graphicsPort];
|
||||
CGContextRetain(ctx);
|
||||
}
|
||||
|
||||
- (CGContextRef)context
|
||||
{
|
||||
return ctx;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Eina_Bool
|
||||
engine_quartz_args(const char *engine, int width, int height)
|
||||
{
|
||||
Evas_Engine_Info_Quartz *einfo;
|
||||
int i;
|
||||
|
||||
evas_output_method_set(evas, evas_render_method_lookup("quartz"));
|
||||
einfo = (Evas_Engine_Info_Quartz *)evas_engine_info_get(evas);
|
||||
if (!einfo)
|
||||
{
|
||||
printf("Evas does not support the Quartz Engine\n");
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
// Set up the Cocoa runtime
|
||||
[[NSAutoreleasePool alloc] init];
|
||||
[NSApplication sharedApplication];
|
||||
|
||||
// Register ourselves as a full-fledged Cocoa app, instead of a NSUIElement.
|
||||
// This gives benefits like window focus and a dock icon!
|
||||
ProcessSerialNumber psn = { 0, kCurrentProcess };
|
||||
TransformProcessType (&psn, kProcessTransformToForegroundApplication);
|
||||
|
||||
[NSApp finishLaunching];
|
||||
|
||||
// Create our main window, and embed an EvasView in it
|
||||
main_window = [[NSWindow alloc] initWithContentRect:NSMakeRect(20,500,width,height) styleMask:(NSTitledWindowMask | NSClosableWindowMask | NSResizableWindowMask | NSMiniaturizableWindowMask) backing:NSBackingStoreBuffered defer:NO screen:nil];
|
||||
[main_window makeKeyAndOrderFront:NSApp];
|
||||
[main_window setTitle:@"Expedite"];
|
||||
[main_window makeMainWindow];
|
||||
[main_window setAcceptsMouseMovedEvents:YES];
|
||||
[NSApp activateIgnoringOtherApps:YES];
|
||||
|
||||
evas_view = [[EvasView alloc] initWithFrame:NSMakeRect(0,0,width,height)];
|
||||
[[main_window contentView] addSubview:evas_view];
|
||||
|
||||
// drawRect: must be run at least once, to make sure we've set ctx
|
||||
[evas_view display];
|
||||
|
||||
evas_output_size_set(evas, width, height);
|
||||
evas_output_viewport_set(evas, 0, 0, width, height);
|
||||
|
||||
einfo->info.context = [evas_view context];
|
||||
if (!evas_engine_info_set(evas, (Evas_Engine_Info *) einfo))
|
||||
{
|
||||
printf("Evas can not setup the informations of the Quartz Engine\n");
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
void
|
||||
engine_quartz_loop(void)
|
||||
{
|
||||
NSDate *date = [NSDate dateWithTimeIntervalSinceNow:0.001];
|
||||
|
||||
NSEvent *event = [NSApp nextEventMatchingMask:NSAnyEventMask
|
||||
untilDate:date
|
||||
inMode:NSDefaultRunLoopMode
|
||||
dequeue:YES];
|
||||
[date release];
|
||||
|
||||
if (!event) return;
|
||||
|
||||
if([event type] == NSMouseMoved || [event type] == NSLeftMouseDragged || [event type] == NSRightMouseDragged)
|
||||
{
|
||||
evas_event_feed_mouse_move(evas, [event locationInWindow].x, [event locationInWindow].y, 0, NULL);
|
||||
|
||||
// Also notify on entering or leaving the window
|
||||
NSPoint mouseLoc = [[event window] convertBaseToScreen:[event locationInWindow]];
|
||||
|
||||
if(NSPointInRect(mouseLoc, [[event window] frame]))
|
||||
evas_event_feed_mouse_in(evas, 0, NULL);
|
||||
else
|
||||
evas_event_feed_mouse_out(evas, 0, NULL);
|
||||
|
||||
[NSApp sendEvent:event];
|
||||
}
|
||||
else if([event type] == NSLeftMouseDown)
|
||||
{
|
||||
evas_event_feed_mouse_move(evas, [event locationInWindow].x, [event locationInWindow].y, 0, NULL);
|
||||
evas_event_feed_mouse_down(evas, 1, EVAS_BUTTON_NONE, 0, NULL);
|
||||
|
||||
[NSApp sendEvent:event];
|
||||
}
|
||||
else if([event type] == NSLeftMouseUp)
|
||||
{
|
||||
evas_event_feed_mouse_move(evas, [event locationInWindow].x, [event locationInWindow].y, 0, NULL);
|
||||
evas_event_feed_mouse_up(evas, 1, EVAS_BUTTON_NONE, 0, NULL);
|
||||
|
||||
[NSApp sendEvent:event];
|
||||
}
|
||||
else if([event type] == NSRightMouseDown)
|
||||
{
|
||||
evas_event_feed_mouse_move(evas, [event locationInWindow].x, [event locationInWindow].y, 0, NULL);
|
||||
evas_event_feed_mouse_down(evas, 3, EVAS_BUTTON_NONE, 0, NULL);
|
||||
[NSApp sendEvent:event];
|
||||
}
|
||||
else if([event type] == NSRightMouseUp)
|
||||
{
|
||||
evas_event_feed_mouse_move(evas, [event locationInWindow].x, [event locationInWindow].y, 0, NULL);
|
||||
evas_event_feed_mouse_up(evas, 3, EVAS_BUTTON_NONE, 0, NULL);
|
||||
[NSApp sendEvent:event];
|
||||
}
|
||||
else if([event type] == NSKeyDown)
|
||||
{
|
||||
NSString * chars = [event charactersIgnoringModifiers];
|
||||
|
||||
switch([chars characterAtIndex:0])
|
||||
{
|
||||
case NSLeftArrowFunctionKey:
|
||||
evas_event_feed_key_down(evas, "Left", "Left", NULL, NULL, 0, NULL);
|
||||
break;
|
||||
case NSRightArrowFunctionKey:
|
||||
evas_event_feed_key_down(evas, "Right", "Right", NULL, NULL, 0, NULL);
|
||||
break;
|
||||
case NSEnterCharacter:
|
||||
case NSCarriageReturnCharacter:
|
||||
evas_event_feed_key_down(evas, "Return", "Return", NULL, NULL, 0, NULL);
|
||||
break;
|
||||
case 's':
|
||||
case '\e':
|
||||
evas_event_feed_key_down(evas, "Escape", "Escape", NULL, NULL, 0, NULL);
|
||||
break;
|
||||
case 'q':
|
||||
evas_event_feed_key_down(evas, "q", "q", NULL, NULL, 0, NULL);
|
||||
break;
|
||||
}
|
||||
|
||||
[chars release];
|
||||
}
|
||||
else if([event type] == NSKeyUp)
|
||||
{
|
||||
NSString * chars = [event charactersIgnoringModifiers];
|
||||
|
||||
switch([chars characterAtIndex:0])
|
||||
{
|
||||
case NSLeftArrowFunctionKey:
|
||||
evas_event_feed_key_up(evas, "Left", "Left", NULL, NULL, 0, NULL);
|
||||
break;
|
||||
case NSRightArrowFunctionKey:
|
||||
evas_event_feed_key_up(evas, "Right", "Right", NULL, NULL, 0, NULL);
|
||||
break;
|
||||
case NSEnterCharacter:
|
||||
case NSCarriageReturnCharacter:
|
||||
evas_event_feed_key_up(evas, "Return", "Return", NULL, NULL, 0, NULL);
|
||||
break;
|
||||
case '\e':
|
||||
evas_event_feed_key_up(evas, "Escape", "Escape", NULL, NULL, 0, NULL);
|
||||
break;
|
||||
case 'q':
|
||||
if (evas_key_lock_is_set(evas_key_lock_get(evas), "Caps_Lock"))
|
||||
evas_event_feed_key_up(evas, "Q", "Q", NULL, NULL, 0, NULL);
|
||||
else
|
||||
evas_event_feed_key_up(evas, "q", "q", NULL, NULL, 0, NULL);
|
||||
break;
|
||||
}
|
||||
|
||||
[chars release];
|
||||
}
|
||||
else if([event type] == NSFlagsChanged)
|
||||
{
|
||||
int flags = [event modifierFlags];
|
||||
|
||||
// Turn special key flags on
|
||||
if(flags & NSShiftKeyMask)
|
||||
evas_key_modifier_on(evas, "Shift");
|
||||
else if(flags & NSControlKeyMask)
|
||||
evas_key_modifier_on(evas, "Control");
|
||||
else if(flags & NSAlternateKeyMask)
|
||||
evas_key_modifier_on(evas, "Alt");
|
||||
else if(flags & NSCommandKeyMask)
|
||||
evas_key_modifier_on(evas, "Super");
|
||||
else if(flags & NSAlphaShiftKeyMask)
|
||||
{
|
||||
if (evas_key_lock_is_set(evas_key_lock_get(evas), "Caps_Lock"))
|
||||
evas_key_lock_off(evas, "Caps_Lock");
|
||||
else
|
||||
evas_key_lock_on(evas, "Caps_Lock");
|
||||
}
|
||||
|
||||
// Turn special key flags off
|
||||
if(!(flags & NSShiftKeyMask))
|
||||
evas_key_modifier_off(evas, "Shift");
|
||||
else if(!(flags & NSControlKeyMask))
|
||||
evas_key_modifier_off(evas, "Control");
|
||||
else if(!(flags & NSAlternateKeyMask))
|
||||
evas_key_modifier_off(evas, "Alt");
|
||||
else if(!(flags & NSCommandKeyMask))
|
||||
evas_key_modifier_off(evas, "Super");
|
||||
}
|
||||
else
|
||||
{
|
||||
[NSApp sendEvent:event];
|
||||
}
|
||||
|
||||
[event release];
|
||||
[NSAutoreleasePool release];
|
||||
}
|
||||
|
||||
void
|
||||
engine_quartz_shutdown(void)
|
||||
{
|
||||
/* If someone knows what to do here... */
|
||||
}
|
|
@ -1174,9 +1174,6 @@ static const Expedite_Engine engines[] = {
|
|||
#if HAVE_EVAS_DIRECTFB
|
||||
{ "directfb",engine_directfb_args, engine_directfb_loop, engine_directfb_shutdown },
|
||||
#endif
|
||||
#if HAVE_EVAS_QUARTZ
|
||||
{ "quartz",engine_quartz_args, engine_quartz_loop, engine_quartz_shutdown },
|
||||
#endif
|
||||
#if HAVE_EVAS_SOFTWARE_16_X11
|
||||
{ "x11-16",engine_software_16_x11_args, engine_software_16_x11_loop, engine_software_16_x11_shutdown },
|
||||
#endif
|
||||
|
|
|
@ -63,9 +63,6 @@
|
|||
#if HAVE_EVAS_DIRECTFB
|
||||
#include "engine_directfb.h"
|
||||
#endif
|
||||
#if HAVE_EVAS_QUARTZ
|
||||
#include "engine_quartz.h"
|
||||
#endif
|
||||
#if HAVE_EVAS_SOFTWARE_16_X11
|
||||
#include "engine_software_16_x11.h"
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue