Second part of the renaming 'quartz' -> 'cocoa'
API break. Not really important for now as that port is in a very bad shape anyway SVN revision: 47340
This commit is contained in:
parent
0b168c9813
commit
43f88cb30d
|
@ -254,7 +254,7 @@ EAPI Ecore_Evas *ecore_evas_software_wince_gdi_new(Ecore_WinCE_Window *paren
|
|||
|
||||
EAPI Ecore_WinCE_Window *ecore_evas_software_wince_window_get(const Ecore_Evas *ee);
|
||||
|
||||
EAPI Ecore_Evas *ecore_evas_quartz_new(const char* name, int w, int h);
|
||||
EAPI Ecore_Evas *ecore_evas_cocoa_new(const char* name, int w, int h);
|
||||
|
||||
/* generic manipulation calls */
|
||||
EAPI const char *ecore_evas_engine_name_get(const Ecore_Evas *ee);
|
||||
|
|
|
@ -32,7 +32,7 @@ static Ecore_Event_Handler *ecore_evas_event_handlers[4] = {
|
|||
static Ecore_Idle_Enterer *ecore_evas_idle_enterer = NULL;
|
||||
static Ecore_Poller *ecore_evas_event = NULL;
|
||||
|
||||
static const char *ecore_evas_quartz_default = "EFL Quartz";
|
||||
static const char *ecore_evas_cocoa_default = "EFL Cocoa";
|
||||
|
||||
@interface EvasView : NSView
|
||||
{
|
||||
|
@ -81,17 +81,17 @@ static NSWindow * main_window;
|
|||
@end
|
||||
|
||||
static Ecore_Evas *
|
||||
_ecore_evas_quartz_match(void)
|
||||
_ecore_evas_cocoa_match(void)
|
||||
{
|
||||
return ecore_evases;
|
||||
}
|
||||
|
||||
static int
|
||||
_ecore_evas_quartz_event_got_focus(void *data __UNUSED__, int type __UNUSED__, void *event)
|
||||
_ecore_evas_cocoa_event_got_focus(void *data __UNUSED__, int type __UNUSED__, void *event)
|
||||
{
|
||||
Ecore_Evas *ee;
|
||||
|
||||
ee = _ecore_evas_quartz_match();
|
||||
ee = _ecore_evas_cocoa_match();
|
||||
|
||||
if (!ee) return 1;
|
||||
ee->prop.focused = 1;
|
||||
|
@ -100,11 +100,11 @@ _ecore_evas_quartz_event_got_focus(void *data __UNUSED__, int type __UNUSED__, v
|
|||
}
|
||||
|
||||
static int
|
||||
_ecore_evas_quartz_event_lost_focus(void *data __UNUSED__, int type __UNUSED__, void *event)
|
||||
_ecore_evas_cocoa_event_lost_focus(void *data __UNUSED__, int type __UNUSED__, void *event)
|
||||
{
|
||||
Ecore_Evas *ee;
|
||||
|
||||
ee = _ecore_evas_quartz_match();
|
||||
ee = _ecore_evas_cocoa_match();
|
||||
|
||||
if (!ee) return 1;
|
||||
ee->prop.focused = 0;
|
||||
|
@ -113,13 +113,13 @@ _ecore_evas_quartz_event_lost_focus(void *data __UNUSED__, int type __UNUSED__,
|
|||
}
|
||||
|
||||
static int
|
||||
_ecore_evas_quartz_event_video_resize(void *data __UNUSED__, int type __UNUSED__, void *event)
|
||||
_ecore_evas_cocoa_event_video_resize(void *data __UNUSED__, int type __UNUSED__, void *event)
|
||||
{
|
||||
/*Ecore_Quartz_Event_Video_Resize *e;
|
||||
/*Ecore_Cocoa_Event_Video_Resize *e;
|
||||
Ecore_Evas *ee;
|
||||
|
||||
e = event;
|
||||
ee = _ecore_evas_quartz_match();
|
||||
ee = _ecore_evas_cocoa_match();
|
||||
|
||||
if (!ee) return 1; // pass on event
|
||||
evas_output_size_set(ee->evas, e->w, e->h);
|
||||
|
@ -128,13 +128,13 @@ _ecore_evas_quartz_event_video_resize(void *data __UNUSED__, int type __UNUSED__
|
|||
}
|
||||
|
||||
static int
|
||||
_ecore_evas_quartz_event_video_expose(void *data __UNUSED__, int type __UNUSED__, void *event __UNUSED__)
|
||||
_ecore_evas_cocoa_event_video_expose(void *data __UNUSED__, int type __UNUSED__, void *event __UNUSED__)
|
||||
{
|
||||
Ecore_Evas *ee;
|
||||
int w;
|
||||
int h;
|
||||
|
||||
ee = _ecore_evas_quartz_match();
|
||||
ee = _ecore_evas_cocoa_match();
|
||||
|
||||
if (!ee) return 1;
|
||||
evas_output_size_get(ee->evas, &w, &h);
|
||||
|
@ -162,15 +162,15 @@ _ecore_evas_idle_enter(void *data __UNUSED__)
|
|||
}
|
||||
|
||||
static int
|
||||
_ecore_evas_quartz_event(void *data)
|
||||
_ecore_evas_cocoa_event(void *data)
|
||||
{
|
||||
ecore_quartz_feed_events();
|
||||
ecore_cocoa_feed_events();
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int
|
||||
_ecore_evas_quartz_init(int w, int h)
|
||||
_ecore_evas_cocoa_init(int w, int h)
|
||||
{
|
||||
_ecore_evas_init_count++;
|
||||
if (_ecore_evas_init_count > 1) return _ecore_evas_init_count;
|
||||
|
@ -181,16 +181,16 @@ _ecore_evas_quartz_init(int w, int h)
|
|||
ecore_evas_event = ecore_poller_add(ECORE_POLLER_CORE, 1, ecore_evas_event, NULL);
|
||||
ecore_poller_poll_interval_set(ECORE_POLLER_CORE, 0.006);
|
||||
|
||||
ecore_evas_event_handlers[0] = ecore_event_handler_add(ECORE_QUARTZ_EVENT_GOT_FOCUS, _ecore_evas_quartz_event_got_focus, NULL);
|
||||
ecore_evas_event_handlers[1] = ecore_event_handler_add(ECORE_QUARTZ_EVENT_LOST_FOCUS, _ecore_evas_quartz_event_lost_focus, NULL);
|
||||
ecore_evas_event_handlers[2] = ecore_event_handler_add(ECORE_QUARTZ_EVENT_RESIZE, _ecore_evas_quartz_event_video_resize, NULL);
|
||||
ecore_evas_event_handlers[3] = ecore_event_handler_add(ECORE_QUARTZ_EVENT_EXPOSE, _ecore_evas_quartz_event_video_expose, NULL);
|
||||
ecore_evas_event_handlers[0] = ecore_event_handler_add(ECORE_COCOA_EVENT_GOT_FOCUS, _ecore_evas_cocoa_event_got_focus, NULL);
|
||||
ecore_evas_event_handlers[1] = ecore_event_handler_add(ECORE_COCOA_EVENT_LOST_FOCUS, _ecore_evas_cocoa_event_lost_focus, NULL);
|
||||
ecore_evas_event_handlers[2] = ecore_event_handler_add(ECORE_COCOA_EVENT_RESIZE, _ecore_evas_cocoa_event_video_resize, NULL);
|
||||
ecore_evas_event_handlers[3] = ecore_event_handler_add(ECORE_COCOA_EVENT_EXPOSE, _ecore_evas_cocoa_event_video_expose, NULL);
|
||||
|
||||
return _ecore_evas_init_count;
|
||||
}
|
||||
|
||||
static int
|
||||
_ecore_evas_quartz_shutdown(void)
|
||||
_ecore_evas_cocoa_shutdown(void)
|
||||
{
|
||||
_ecore_evas_init_count--;
|
||||
if (_ecore_evas_init_count == 0)
|
||||
|
@ -214,12 +214,12 @@ _ecore_evas_quartz_shutdown(void)
|
|||
}
|
||||
|
||||
static void
|
||||
_ecore_evas_quartz_free(Ecore_Evas *ee)
|
||||
_ecore_evas_cocoa_free(Ecore_Evas *ee)
|
||||
{
|
||||
ecore_evases = (Ecore_Evas *) eina_inlist_remove(EINA_INLIST_GET(ecore_evases), EINA_INLIST_GET(ee));
|
||||
ecore_event_window_unregister(0);
|
||||
_ecore_evas_quartz_shutdown();
|
||||
ecore_quartz_shutdown();
|
||||
_ecore_evas_cocoa_shutdown();
|
||||
ecore_cocoa_shutdown();
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -295,9 +295,9 @@ _ecore_evas_object_cursor_set(Ecore_Evas *ee, Evas_Object *obj, int layer, int h
|
|||
evas_object_event_callback_add(obj, EVAS_CALLBACK_DEL, _ecore_evas_object_cursor_del, ee);
|
||||
}
|
||||
|
||||
static Ecore_Evas_Engine_Func _ecore_quartz_engine_func =
|
||||
static Ecore_Evas_Engine_Func _ecore_cocoa_engine_func =
|
||||
{
|
||||
_ecore_evas_quartz_free,
|
||||
_ecore_evas_cocoa_free,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
|
@ -347,7 +347,7 @@ static Ecore_Evas_Engine_Func _ecore_quartz_engine_func =
|
|||
#endif
|
||||
|
||||
EAPI Ecore_Evas *
|
||||
ecore_evas_quartz_new(const char* name, int w, int h)
|
||||
ecore_evas_cocoa_new(const char* name, int w, int h)
|
||||
{
|
||||
#ifdef BUILD_ECORE_EVAS_QUARTZ
|
||||
Evas_Engine_Info_Quartz *einfo;
|
||||
|
@ -355,24 +355,24 @@ ecore_evas_quartz_new(const char* name, int w, int h)
|
|||
int rmethod;
|
||||
|
||||
if (!name)
|
||||
name = ecore_evas_quartz_default;
|
||||
name = ecore_evas_cocoa_default;
|
||||
|
||||
rmethod = evas_render_method_lookup("quartz");
|
||||
if (!rmethod) return NULL;
|
||||
|
||||
if (!ecore_quartz_init(name)) return NULL;
|
||||
if (!ecore_cocoa_init(name)) return NULL;
|
||||
|
||||
ee = calloc(1, sizeof(Ecore_Evas));
|
||||
if (!ee)
|
||||
goto shutdown_ecore_quartz;
|
||||
goto shutdown_ecore_cocoa;
|
||||
|
||||
ECORE_MAGIC_SET(ee, ECORE_MAGIC_EVAS);
|
||||
|
||||
_ecore_evas_quartz_init(w, h);
|
||||
_ecore_evas_cocoa_init(w, h);
|
||||
|
||||
ecore_event_window_register(0, ee, ee->evas, _ecore_evas_mouse_move_process);
|
||||
|
||||
ee->engine.func = (Ecore_Evas_Engine_Func *)&_ecore_quartz_engine_func;
|
||||
ee->engine.func = (Ecore_Evas_Engine_Func *)&_ecore_cocoa_engine_func;
|
||||
|
||||
ee->driver = "quartz";
|
||||
if (name) ee->name = strdup(name);
|
||||
|
@ -452,10 +452,10 @@ ecore_evas_quartz_new(const char* name, int w, int h)
|
|||
free_name:
|
||||
free(ee->name);
|
||||
free_ee:
|
||||
_ecore_evas_quartz_shutdown();
|
||||
_ecore_evas_cocoa_shutdown();
|
||||
free(ee);
|
||||
shutdown_ecore_quartz:
|
||||
ecore_quartz_shutdown();
|
||||
shutdown_ecore_cocoa:
|
||||
ecore_cocoa_shutdown();
|
||||
|
||||
return NULL;
|
||||
#else
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
|
||||
*/
|
||||
|
||||
#ifndef _ECORE_QUARTZ_H
|
||||
#define _ECORE_QUARTZ_H
|
||||
#ifndef _ECORE_COCOA_H
|
||||
#define _ECORE_COCOA_H
|
||||
|
||||
#ifdef EAPI
|
||||
# undef EAPI
|
||||
|
@ -25,13 +25,13 @@ extern "C" {
|
|||
|
||||
typedef struct _Ecore_Cocoa_Window Ecore_Cocoa_Window;
|
||||
|
||||
EAPI extern int ECORE_QUARTZ_EVENT_GOT_FOCUS;
|
||||
EAPI extern int ECORE_QUARTZ_EVENT_LOST_FOCUS;
|
||||
EAPI extern int ECORE_QUARTZ_EVENT_RESIZE;
|
||||
EAPI extern int ECORE_QUARTZ_EVENT_EXPOSE;
|
||||
EAPI extern int ECORE_COCOA_EVENT_GOT_FOCUS;
|
||||
EAPI extern int ECORE_COCOA_EVENT_LOST_FOCUS;
|
||||
EAPI extern int ECORE_COCOA_EVENT_RESIZE;
|
||||
EAPI extern int ECORE_COCOA_EVENT_EXPOSE;
|
||||
|
||||
typedef struct _Ecore_Quartz_Event_Video_Resize Ecore_Quartz_Event_Video_Resize;
|
||||
struct _Ecore_Quartz_Event_Video_Resize
|
||||
typedef struct _Ecore_Cocoa_Event_Video_Resize Ecore_Cocoa_Event_Video_Resize;
|
||||
struct _Ecore_Cocoa_Event_Video_Resize
|
||||
{
|
||||
int w;
|
||||
int h;
|
||||
|
@ -40,9 +40,9 @@ struct _Ecore_Quartz_Event_Video_Resize
|
|||
|
||||
/* Core */
|
||||
|
||||
EAPI int ecore_quartz_init(const char *name);
|
||||
EAPI int ecore_quartz_shutdown(void);
|
||||
EAPI void ecore_quartz_feed_events(void);
|
||||
EAPI int ecore_cocoa_init(const char *name);
|
||||
EAPI int ecore_cocoa_shutdown(void);
|
||||
EAPI void ecore_cocoa_feed_events(void);
|
||||
|
||||
/* Window */
|
||||
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
#ifndef ECORE_QUARTZ_KEYS_H__
|
||||
#define ECORE_QUARTZ_KEYS_H__
|
||||
#ifndef ECORE_COCOA_KEYS_H__
|
||||
#define ECORE_COCOA_KEYS_H__
|
||||
|
||||
struct _ecore_quartz_keys_s
|
||||
struct _ecore_cocoa_keys_s
|
||||
{
|
||||
int code;
|
||||
const char *name;
|
||||
const char *compose;
|
||||
};
|
||||
|
||||
static const struct _ecore_quartz_keys_s keystable[] =
|
||||
static const struct _ecore_cocoa_keys_s keystable[] =
|
||||
{
|
||||
|
||||
{ 0, "0x00", "" },
|
||||
|
@ -282,4 +282,4 @@ static const struct _ecore_quartz_keys_s keystable[] =
|
|||
|
||||
};
|
||||
|
||||
#endif /* ECORE_QUARTZ_KEYS_H__ */
|
||||
#endif /* ECORE_COCOA_KEYS_H__ */
|
||||
|
|
|
@ -13,51 +13,51 @@
|
|||
#include "Ecore_Cocoa.h"
|
||||
#include "Ecore_Cocoa_Keys.h"
|
||||
|
||||
EAPI int ECORE_QUARTZ_EVENT_GOT_FOCUS = 0;
|
||||
EAPI int ECORE_QUARTZ_EVENT_LOST_FOCUS = 0;
|
||||
EAPI int ECORE_QUARTZ_EVENT_RESIZE = 0;
|
||||
EAPI int ECORE_QUARTZ_EVENT_EXPOSE = 0;
|
||||
EAPI int ECORE_COCOA_EVENT_GOT_FOCUS = 0;
|
||||
EAPI int ECORE_COCOA_EVENT_LOST_FOCUS = 0;
|
||||
EAPI int ECORE_COCOA_EVENT_RESIZE = 0;
|
||||
EAPI int ECORE_COCOA_EVENT_EXPOSE = 0;
|
||||
|
||||
static int _ecore_quartz_init_count = 0;
|
||||
static int _ecore_cocoa_init_count = 0;
|
||||
|
||||
static int old_flags;
|
||||
|
||||
EAPI int
|
||||
ecore_quartz_init(const char *name __UNUSED__)
|
||||
ecore_cocoa_init(const char *name __UNUSED__)
|
||||
{
|
||||
if (++_ecore_quartz_init_count != 1)
|
||||
return _ecore_quartz_init_count;
|
||||
if (++_ecore_cocoa_init_count != 1)
|
||||
return _ecore_cocoa_init_count;
|
||||
|
||||
if (!ecore_event_init())
|
||||
return --_ecore_quartz_init_count;
|
||||
return --_ecore_cocoa_init_count;
|
||||
|
||||
ECORE_QUARTZ_EVENT_GOT_FOCUS = ecore_event_type_new();
|
||||
ECORE_QUARTZ_EVENT_LOST_FOCUS = ecore_event_type_new();
|
||||
ECORE_QUARTZ_EVENT_RESIZE = ecore_event_type_new();
|
||||
ECORE_QUARTZ_EVENT_EXPOSE = ecore_event_type_new();
|
||||
ECORE_COCOA_EVENT_GOT_FOCUS = ecore_event_type_new();
|
||||
ECORE_COCOA_EVENT_LOST_FOCUS = ecore_event_type_new();
|
||||
ECORE_COCOA_EVENT_RESIZE = ecore_event_type_new();
|
||||
ECORE_COCOA_EVENT_EXPOSE = ecore_event_type_new();
|
||||
|
||||
return _ecore_quartz_init_count;
|
||||
return _ecore_cocoa_init_count;
|
||||
}
|
||||
|
||||
/**
|
||||
* Shuts down the Ecore_Quartz library.
|
||||
* Shuts down the Ecore_Cocoa library.
|
||||
* @return @c The number of times the system has been initialised without
|
||||
* being shut down.
|
||||
* @ingroup Ecore_Quartz_Library_Group
|
||||
* @ingroup Ecore_Cocoa_Library_Group
|
||||
*/
|
||||
EAPI int
|
||||
ecore_quartz_shutdown(void)
|
||||
ecore_cocoa_shutdown(void)
|
||||
{
|
||||
if (--_ecore_quartz_init_count != 0)
|
||||
return _ecore_quartz_init_count;
|
||||
if (--_ecore_cocoa_init_count != 0)
|
||||
return _ecore_cocoa_init_count;
|
||||
|
||||
ecore_event_shutdown();
|
||||
|
||||
return _ecore_quartz_init_count;
|
||||
return _ecore_cocoa_init_count;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
ecore_quartz_feed_events(void)
|
||||
ecore_cocoa_feed_events(void)
|
||||
{
|
||||
NSDate *date = [NSDate dateWithTimeIntervalSinceNow:0.001];
|
||||
NSEvent *event = [NSApp nextEventMatchingMask:NSAnyEventMask
|
||||
|
@ -156,7 +156,7 @@ ecore_quartz_feed_events(void)
|
|||
if (!ev) return;
|
||||
ev->timestamp = time;
|
||||
|
||||
for (i = 0; i < sizeof (keystable) / sizeof (struct _ecore_quartz_keys_s); ++i)
|
||||
for (i = 0; i < sizeof (keystable) / sizeof (struct _ecore_cocoa_keys_s); ++i)
|
||||
{
|
||||
if (keystable[i].code == tolower([[event charactersIgnoringModifiers] characterAtIndex:0]))
|
||||
{
|
||||
|
@ -179,7 +179,7 @@ ecore_quartz_feed_events(void)
|
|||
if (!ev) return;
|
||||
ev->timestamp = time;
|
||||
|
||||
for (i = 0; i < sizeof (keystable) / sizeof (struct _ecore_quartz_keys_s); ++i)
|
||||
for (i = 0; i < sizeof (keystable) / sizeof (struct _ecore_cocoa_keys_s); ++i)
|
||||
{
|
||||
if (keystable[i].code == tolower([[event charactersIgnoringModifiers] characterAtIndex:0]))
|
||||
{
|
||||
|
@ -259,9 +259,9 @@ ecore_quartz_feed_events(void)
|
|||
case NSAppKitDefined:
|
||||
{
|
||||
if ([event subtype] == NSApplicationActivatedEventType)
|
||||
ecore_event_add(ECORE_QUARTZ_EVENT_GOT_FOCUS, NULL, NULL, NULL);
|
||||
ecore_event_add(ECORE_COCOA_EVENT_GOT_FOCUS, NULL, NULL, NULL);
|
||||
else if ([event subtype] == NSApplicationDeactivatedEventType)
|
||||
ecore_event_add(ECORE_QUARTZ_EVENT_LOST_FOCUS, NULL, NULL, NULL);
|
||||
ecore_event_add(ECORE_COCOA_EVENT_LOST_FOCUS, NULL, NULL, NULL);
|
||||
[NSApp sendEvent:event]; // pass along AppKit events, for window manager
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue