summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@free.fr>2011-04-05 12:10:51 +0000
committerCedric BAIL <cedric.bail@free.fr>2011-04-05 12:10:51 +0000
commit3a86dd96a7a4beb9ece511bf6781bab03333f213 (patch)
treea15ac5efc41a04403cbc4141fb0099521c12df87
parent62c2d26768b51a6bcc3fdffdc4606ada2b3494e1 (diff)
expedite: remove deprecated Evas Quartz backend.
SVN revision: 58356
-rw-r--r--configure.ac5
-rw-r--r--src/bin/Makefile.am7
-rw-r--r--src/bin/engine_quartz.h8
-rw-r--r--src/bin/engine_quartz.m254
-rw-r--r--src/bin/main.c3
-rw-r--r--src/bin/main.h3
6 files changed, 1 insertions, 279 deletions
diff --git a/configure.ac b/configure.ac
index 4ed57ea..c4fb2bc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -83,10 +83,6 @@ EXPEDITE_CHECK_ENGINE([fb], [Framebuffer], "yes")
83# DIRECTFB 83# DIRECTFB
84EXPEDITE_CHECK_ENGINE([directfb], [DirectFB], "yes") 84EXPEDITE_CHECK_ENGINE([directfb], [DirectFB], "yes")
85 85
86# Quartz
87EXPEDITE_CHECK_ENGINE([quartz], [Quartz], "yes", [quartz_libs="-framework Cocoa -framework ApplicationServices"])
88AC_SUBST(quartz_libs)
89
90# Software 16bit X11 86# Software 16bit X11
91EXPEDITE_CHECK_ENGINE([software-16-x11], [Software 16 bits X11], "yes") 87EXPEDITE_CHECK_ENGINE([software-16-x11], [Software 16 bits X11], "yes")
92 88
@@ -261,7 +257,6 @@ echo " Software SDL.................: ${have_software_sdl}"
261echo " Open GL SDL..................: ${have_opengl_sdl}" 257echo " Open GL SDL..................: ${have_opengl_sdl}"
262echo " FB...........................: ${have_fb}" 258echo " FB...........................: ${have_fb}"
263echo " DirectFB.....................: ${have_directfb}" 259echo " DirectFB.....................: ${have_directfb}"
264echo " Quartz.......................: ${have_quartz}"
265echo " Software X11 16 bits.........: ${have_software_16_x11}" 260echo " Software X11 16 bits.........: ${have_software_16_x11}"
266echo " Software DirectDraw 16 bits..: ${have_software_16_ddraw}" 261echo " Software DirectDraw 16 bits..: ${have_software_16_ddraw}"
267echo " Software WinCE 16 bits.......: ${have_software_16_wince}" 262echo " Software WinCE 16 bits.......: ${have_software_16_wince}"
diff --git a/src/bin/Makefile.am b/src/bin/Makefile.am
index bad365c..78d8914 100644
--- a/src/bin/Makefile.am
+++ b/src/bin/Makefile.am
@@ -116,7 +116,7 @@ proxy_text_random.c
116 116
117expedite_CFLAGS = @WIN32_CFLAGS@ 117expedite_CFLAGS = @WIN32_CFLAGS@
118expedite_CXXFLAGS = @EXPEDITE_CXXFLAGS@ 118expedite_CXXFLAGS = @EXPEDITE_CXXFLAGS@
119expedite_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 119expedite_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
120expedite_LDFLAGS = @lt_enable_auto_import@ 120expedite_LDFLAGS = @lt_enable_auto_import@
121 121
122if BUILD_SOFTWARE_XLIB 122if BUILD_SOFTWARE_XLIB
@@ -184,11 +184,6 @@ expedite_SOURCES += \
184engine_directfb.c engine_directfb.h 184engine_directfb.c engine_directfb.h
185endif 185endif
186 186
187if BUILD_QUARTZ
188expedite_SOURCES += \
189engine_quartz.m engine_quartz.h
190endif
191
192if BUILD_SOFTWARE_16_X11 187if BUILD_SOFTWARE_16_X11
193expedite_SOURCES += \ 188expedite_SOURCES += \
194engine_software_16_x11.c engine_software_16_x11.h 189engine_software_16_x11.c engine_software_16_x11.h
diff --git a/src/bin/engine_quartz.h b/src/bin/engine_quartz.h
deleted file mode 100644
index 434c5d3..0000000
--- a/src/bin/engine_quartz.h
+++ /dev/null
@@ -1,8 +0,0 @@
1#ifndef ENGINE_QUARTZ_H
2#define ENGINE_QUARTZ_H
3
4Eina_Bool engine_quartz_args(const char *engine, int width, int height);
5void engine_quartz_loop(void);
6void engine_quartz_shutdown(void);
7
8#endif
diff --git a/src/bin/engine_quartz.m b/src/bin/engine_quartz.m
deleted file mode 100644
index 8eaed60..0000000
--- a/src/bin/engine_quartz.m
+++ /dev/null
@@ -1,254 +0,0 @@
1/* NOTE: If you're using Expedite for performance testing,
2 set "Disable Beam Synchronization" in Quartz Debug. */
3
4#include "main.h"
5
6#include <Cocoa/Cocoa.h>
7#include <Evas_Engine_Quartz.h>
8
9@interface EvasView : NSView
10{
11 CGContextRef ctx;
12}
13@end
14
15static EvasView * evas_view;
16static NSWindow * main_window;
17
18@implementation EvasView
19
20- (id) init
21{
22 self = [super init];
23 if (self != nil)
24 {
25 ctx = NULL;
26 }
27 return self;
28}
29
30- (void)drawRect:(NSRect)rect
31{
32 if(ctx != NULL)
33 {
34 evas_damage_rectangle_add(evas, 0, 0, win_w, win_h);
35 return;
36 }
37
38 ctx = [[NSGraphicsContext currentContext] graphicsPort];
39 CGContextRetain(ctx);
40}
41
42- (CGContextRef)context
43{
44 return ctx;
45}
46
47@end
48
49Eina_Bool
50engine_quartz_args(const char *engine, int width, int height)
51{
52 Evas_Engine_Info_Quartz *einfo;
53 int i;
54
55 evas_output_method_set(evas, evas_render_method_lookup("quartz"));
56 einfo = (Evas_Engine_Info_Quartz *)evas_engine_info_get(evas);
57 if (!einfo)
58 {
59 printf("Evas does not support the Quartz Engine\n");
60 return EINA_FALSE;
61 }
62
63 // Set up the Cocoa runtime
64 [[NSAutoreleasePool alloc] init];
65 [NSApplication sharedApplication];
66
67 // Register ourselves as a full-fledged Cocoa app, instead of a NSUIElement.
68 // This gives benefits like window focus and a dock icon!
69 ProcessSerialNumber psn = { 0, kCurrentProcess };
70 TransformProcessType (&psn, kProcessTransformToForegroundApplication);
71
72 [NSApp finishLaunching];
73
74 // Create our main window, and embed an EvasView in it
75 main_window = [[NSWindow alloc] initWithContentRect:NSMakeRect(20,500,width,height) styleMask:(NSTitledWindowMask | NSClosableWindowMask | NSResizableWindowMask | NSMiniaturizableWindowMask) backing:NSBackingStoreBuffered defer:NO screen:nil];
76 [main_window makeKeyAndOrderFront:NSApp];
77 [main_window setTitle:@"Expedite"];
78 [main_window makeMainWindow];
79 [main_window setAcceptsMouseMovedEvents:YES];
80 [NSApp activateIgnoringOtherApps:YES];
81
82 evas_view = [[EvasView alloc] initWithFrame:NSMakeRect(0,0,width,height)];
83 [[main_window contentView] addSubview:evas_view];
84
85 // drawRect: must be run at least once, to make sure we've set ctx
86 [evas_view display];
87
88 evas_output_size_set(evas, width, height);
89 evas_output_viewport_set(evas, 0, 0, width, height);
90
91 einfo->info.context = [evas_view context];
92 if (!evas_engine_info_set(evas, (Evas_Engine_Info *) einfo))
93 {
94 printf("Evas can not setup the informations of the Quartz Engine\n");
95 return EINA_FALSE;
96 }
97
98 return EINA_TRUE;
99}
100
101void
102engine_quartz_loop(void)
103{
104 NSDate *date = [NSDate dateWithTimeIntervalSinceNow:0.001];
105
106 NSEvent *event = [NSApp nextEventMatchingMask:NSAnyEventMask
107 untilDate:date
108 inMode:NSDefaultRunLoopMode
109 dequeue:YES];
110 [date release];
111
112 if (!event) return;
113
114 if([event type] == NSMouseMoved || [event type] == NSLeftMouseDragged || [event type] == NSRightMouseDragged)
115 {
116 evas_event_feed_mouse_move(evas, [event locationInWindow].x, [event locationInWindow].y, 0, NULL);
117
118 // Also notify on entering or leaving the window
119 NSPoint mouseLoc = [[event window] convertBaseToScreen:[event locationInWindow]];
120
121 if(NSPointInRect(mouseLoc, [[event window] frame]))
122 evas_event_feed_mouse_in(evas, 0, NULL);
123 else
124 evas_event_feed_mouse_out(evas, 0, NULL);
125
126 [NSApp sendEvent:event];
127 }
128 else if([event type] == NSLeftMouseDown)
129 {
130 evas_event_feed_mouse_move(evas, [event locationInWindow].x, [event locationInWindow].y, 0, NULL);
131 evas_event_feed_mouse_down(evas, 1, EVAS_BUTTON_NONE, 0, NULL);
132
133 [NSApp sendEvent:event];
134 }
135 else if([event type] == NSLeftMouseUp)
136 {
137 evas_event_feed_mouse_move(evas, [event locationInWindow].x, [event locationInWindow].y, 0, NULL);
138 evas_event_feed_mouse_up(evas, 1, EVAS_BUTTON_NONE, 0, NULL);
139
140 [NSApp sendEvent:event];
141 }
142 else if([event type] == NSRightMouseDown)
143 {
144 evas_event_feed_mouse_move(evas, [event locationInWindow].x, [event locationInWindow].y, 0, NULL);
145 evas_event_feed_mouse_down(evas, 3, EVAS_BUTTON_NONE, 0, NULL);
146 [NSApp sendEvent:event];
147 }
148 else if([event type] == NSRightMouseUp)
149 {
150 evas_event_feed_mouse_move(evas, [event locationInWindow].x, [event locationInWindow].y, 0, NULL);
151 evas_event_feed_mouse_up(evas, 3, EVAS_BUTTON_NONE, 0, NULL);
152 [NSApp sendEvent:event];
153 }
154 else if([event type] == NSKeyDown)
155 {
156 NSString * chars = [event charactersIgnoringModifiers];
157
158 switch([chars characterAtIndex:0])
159 {
160 case NSLeftArrowFunctionKey:
161 evas_event_feed_key_down(evas, "Left", "Left", NULL, NULL, 0, NULL);
162 break;
163 case NSRightArrowFunctionKey:
164 evas_event_feed_key_down(evas, "Right", "Right", NULL, NULL, 0, NULL);
165 break;
166 case NSEnterCharacter:
167 case NSCarriageReturnCharacter:
168 evas_event_feed_key_down(evas, "Return", "Return", NULL, NULL, 0, NULL);
169 break;
170 case 's':
171 case '\e':
172 evas_event_feed_key_down(evas, "Escape", "Escape", NULL, NULL, 0, NULL);
173 break;
174 case 'q':
175 evas_event_feed_key_down(evas, "q", "q", NULL, NULL, 0, NULL);
176 break;
177 }
178
179 [chars release];
180 }
181 else if([event type] == NSKeyUp)
182 {
183 NSString * chars = [event charactersIgnoringModifiers];
184
185 switch([chars characterAtIndex:0])
186 {
187 case NSLeftArrowFunctionKey:
188 evas_event_feed_key_up(evas, "Left", "Left", NULL, NULL, 0, NULL);
189 break;
190 case NSRightArrowFunctionKey:
191 evas_event_feed_key_up(evas, "Right", "Right", NULL, NULL, 0, NULL);
192 break;
193 case NSEnterCharacter:
194 case NSCarriageReturnCharacter:
195 evas_event_feed_key_up(evas, "Return", "Return", NULL, NULL, 0, NULL);
196 break;
197 case '\e':
198 evas_event_feed_key_up(evas, "Escape", "Escape", NULL, NULL, 0, NULL);
199 break;
200 case 'q':
201 if (evas_key_lock_is_set(evas_key_lock_get(evas), "Caps_Lock"))
202 evas_event_feed_key_up(evas, "Q", "Q", NULL, NULL, 0, NULL);
203 else
204 evas_event_feed_key_up(evas, "q", "q", NULL, NULL, 0, NULL);
205 break;
206 }
207
208 [chars release];
209 }
210 else if([event type] == NSFlagsChanged)
211 {
212 int flags = [event modifierFlags];
213
214 // Turn special key flags on
215 if(flags & NSShiftKeyMask)
216 evas_key_modifier_on(evas, "Shift");
217 else if(flags & NSControlKeyMask)
218 evas_key_modifier_on(evas, "Control");
219 else if(flags & NSAlternateKeyMask)
220 evas_key_modifier_on(evas, "Alt");
221 else if(flags & NSCommandKeyMask)
222 evas_key_modifier_on(evas, "Super");
223 else if(flags & NSAlphaShiftKeyMask)
224 {
225 if (evas_key_lock_is_set(evas_key_lock_get(evas), "Caps_Lock"))
226 evas_key_lock_off(evas, "Caps_Lock");
227 else
228 evas_key_lock_on(evas, "Caps_Lock");
229 }
230
231 // Turn special key flags off
232 if(!(flags & NSShiftKeyMask))
233 evas_key_modifier_off(evas, "Shift");
234 else if(!(flags & NSControlKeyMask))
235 evas_key_modifier_off(evas, "Control");
236 else if(!(flags & NSAlternateKeyMask))
237 evas_key_modifier_off(evas, "Alt");
238 else if(!(flags & NSCommandKeyMask))
239 evas_key_modifier_off(evas, "Super");
240 }
241 else
242 {
243 [NSApp sendEvent:event];
244 }
245
246 [event release];
247 [NSAutoreleasePool release];
248}
249
250void
251engine_quartz_shutdown(void)
252{
253 /* If someone knows what to do here... */
254}
diff --git a/src/bin/main.c b/src/bin/main.c
index 8e406ae..ab564a1 100644
--- a/src/bin/main.c
+++ b/src/bin/main.c
@@ -1174,9 +1174,6 @@ static const Expedite_Engine engines[] = {
1174#if HAVE_EVAS_DIRECTFB 1174#if HAVE_EVAS_DIRECTFB
1175 { "directfb",engine_directfb_args, engine_directfb_loop, engine_directfb_shutdown }, 1175 { "directfb",engine_directfb_args, engine_directfb_loop, engine_directfb_shutdown },
1176#endif 1176#endif
1177#if HAVE_EVAS_QUARTZ
1178 { "quartz",engine_quartz_args, engine_quartz_loop, engine_quartz_shutdown },
1179#endif
1180#if HAVE_EVAS_SOFTWARE_16_X11 1177#if HAVE_EVAS_SOFTWARE_16_X11
1181 { "x11-16",engine_software_16_x11_args, engine_software_16_x11_loop, engine_software_16_x11_shutdown }, 1178 { "x11-16",engine_software_16_x11_args, engine_software_16_x11_loop, engine_software_16_x11_shutdown },
1182#endif 1179#endif
diff --git a/src/bin/main.h b/src/bin/main.h
index 1102783..54c3ce0 100644
--- a/src/bin/main.h
+++ b/src/bin/main.h
@@ -63,9 +63,6 @@
63#if HAVE_EVAS_DIRECTFB 63#if HAVE_EVAS_DIRECTFB
64#include "engine_directfb.h" 64#include "engine_directfb.h"
65#endif 65#endif
66#if HAVE_EVAS_QUARTZ
67#include "engine_quartz.h"
68#endif
69#if HAVE_EVAS_SOFTWARE_16_X11 66#if HAVE_EVAS_SOFTWARE_16_X11
70#include "engine_software_16_x11.h" 67#include "engine_software_16_x11.h"
71#endif 68#endif