diff --git a/legacy/ecore/src/lib/ecore_quartz/Ecore_Cocoa.h b/legacy/ecore/src/lib/ecore_quartz/Ecore_Cocoa.h deleted file mode 100644 index a3a11fda39..0000000000 --- a/legacy/ecore/src/lib/ecore_quartz/Ecore_Cocoa.h +++ /dev/null @@ -1,137 +0,0 @@ -/* -* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 -*/ - -#ifndef _ECORE_COCOA_H -#define _ECORE_COCOA_H - -#ifdef EAPI -# undef EAPI -#endif - -# ifdef __GNUC__ -# if __GNUC__ >= 4 -# define EAPI __attribute__ ((visibility("default"))) -# else -# define EAPI -# endif -# else -# define EAPI -# endif - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct _Ecore_Cocoa_Window Ecore_Cocoa_Window; - -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_Cocoa_Event_Video_Resize Ecore_Cocoa_Event_Video_Resize; -struct _Ecore_Cocoa_Event_Video_Resize -{ - int w; - int h; -}; - - -/* Core */ - -EAPI int ecore_cocoa_init(const char *name); -EAPI int ecore_cocoa_shutdown(void); -EAPI void ecore_cocoa_feed_events(void); - -/* Window */ - -EAPI Ecore_Cocoa_Window *ecore_cocoa_window_new(int x, - int y, - int width, - int height); - -EAPI void ecore_cocoa_window_free(Ecore_Cocoa_Window *window); - -EAPI void *ecore_cocoa_window_hwnd_get(Ecore_Cocoa_Window *window); - -EAPI void ecore_cocoa_window_move(Ecore_Cocoa_Window *window, - int x, - int y); - -EAPI void ecore_cocoa_window_resize(Ecore_Cocoa_Window *window, - int width, - int height); - -EAPI void ecore_cocoa_window_move_resize(Ecore_Cocoa_Window *window, - int x, - int y, - int width, - int height); - -EAPI void ecore_cocoa_window_geometry_get(Ecore_Cocoa_Window *window, - int *x, - int *y, - int *width, - int *height); - -EAPI void ecore_cocoa_window_size_get(Ecore_Cocoa_Window *window, - int *width, - int *height); - -EAPI void ecore_cocoa_window_size_min_set(Ecore_Cocoa_Window *window, - unsigned int min_width, - unsigned int min_height); - -EAPI void ecore_cocoa_window_size_min_get(Ecore_Cocoa_Window *window, - unsigned int *min_width, - unsigned int *min_height); - -EAPI void ecore_cocoa_window_size_max_set(Ecore_Cocoa_Window *window, - unsigned int max_width, - unsigned int max_height); - -EAPI void ecore_cocoa_window_size_max_get(Ecore_Cocoa_Window *window, - unsigned int *max_width, - unsigned int *max_height); - -EAPI void ecore_cocoa_window_size_base_set(Ecore_Cocoa_Window *window, - unsigned int base_width, - unsigned int base_height); - -EAPI void ecore_cocoa_window_size_base_get(Ecore_Cocoa_Window *window, - unsigned int *base_width, - unsigned int *base_height); - -EAPI void ecore_cocoa_window_size_step_set(Ecore_Cocoa_Window *window, - unsigned int step_width, - unsigned int step_height); - -EAPI void ecore_cocoa_window_size_step_get(Ecore_Cocoa_Window *window, - unsigned int *step_width, - unsigned int *step_height); - -EAPI void ecore_cocoa_window_show(Ecore_Cocoa_Window *window); - -EAPI void ecore_cocoa_window_hide(Ecore_Cocoa_Window *window); - -EAPI void ecore_cocoa_window_raise(Ecore_Cocoa_Window *window); - -EAPI void ecore_cocoa_window_lower(Ecore_Cocoa_Window *window); - -EAPI void ecore_cocoa_window_title_set(Ecore_Cocoa_Window *window, - const char *title); - -EAPI void ecore_cocoa_window_focus_set(Ecore_Cocoa_Window *window); - -EAPI void ecore_cocoa_window_iconified_set(Ecore_Cocoa_Window *window, - int on); - -EAPI void ecore_cocoa_window_borderless_set(Ecore_Cocoa_Window *window, - int on); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/legacy/ecore/src/lib/ecore_quartz/Ecore_Cocoa_Keys.h b/legacy/ecore/src/lib/ecore_quartz/Ecore_Cocoa_Keys.h deleted file mode 100644 index cafd50325e..0000000000 --- a/legacy/ecore/src/lib/ecore_quartz/Ecore_Cocoa_Keys.h +++ /dev/null @@ -1,285 +0,0 @@ -#ifndef ECORE_COCOA_KEYS_H__ -#define ECORE_COCOA_KEYS_H__ - -struct _ecore_cocoa_keys_s -{ - int code; - const char *name; - const char *compose; -}; - -static const struct _ecore_cocoa_keys_s keystable[] = -{ - -{ 0, "0x00", "" }, -{ 0, "First", "" }, -{ 3, "Return", "\015" }, -{ 8, "BackSpace", "\010" }, -{ 9, "Tab", "\011" }, -{ 12, "Clear", "" }, -{ 13, "Return", "\015" }, -{ 19, "Pause", "" }, -{ 25, "BackTab", ""}, -{ 27, "Escape", "" }, -{ 32, "space", " " }, -{ 33, "exclam", "!" }, -{ 34, "quotedbl", "\"" }, -{ 35, "numbersign", "#" }, -{ 36, "dollar", "$" }, -{ 37, "percent", "%%" }, -{ 38, "ampersand", "&" }, -{ 39, "apostrophe", "'" }, -{ 40, "parenleft", "(" }, -{ 41, "parenright", ")" }, -{ 42, "asterik", "*" }, -{ 43, "plus", "+" }, -{ 44, "comma", "," }, -{ 45, "minus", "-" }, -{ 46, "period", "." }, -{ 47, "slash", "/" }, -{ 48, "0", "0" }, -{ 49, "1", "1" }, -{ 50, "2", "2" }, -{ 51, "3", "3" }, -{ 52, "4", "4" }, -{ 53, "5", "5" }, -{ 54, "6", "6" }, -{ 55, "7", "7" }, -{ 56, "8", "8" }, -{ 57, "9", "9" }, -{ 58, "colon", ";" }, -{ 59, "semicolon", ";" }, -{ 60, "less", "<" }, -{ 61, "equal", "=" }, -{ 62, "greater", ">" }, -{ 63, "question", "?" }, -{ 64, "at", "@" }, - -{ 91, "bracketleft", "[" }, -{ 92, "backslash", "\\" }, -{ 93, "bracketright", "]" }, -{ 94, "asciicircumm", "^" }, -{ 95, "underscore", "_" }, -{ 96, "backquote", "`" }, -{ 97, "a", "a" }, -{ 98, "b", "b" }, -{ 99, "c", "c" }, -{ 100, "d", "d" }, -{ 101, "e", "e" }, -{ 102, "f", "f" }, -{ 103, "g", "g" }, -{ 104, "h", "h" }, -{ 105, "i", "i" }, -{ 106, "j", "j" }, -{ 107, "k", "k" }, -{ 108, "l", "l" }, -{ 109, "m", "m" }, -{ 110, "n", "n" }, -{ 111, "o", "o" }, -{ 112, "p", "p" }, -{ 113, "q", "q" }, -{ 114, "r", "r" }, -{ 115, "s", "s" }, -{ 116, "t", "t" }, -{ 117, "u", "u" }, -{ 118, "v", "v" }, -{ 119, "w", "w" }, -{ 120, "x", "x" }, -{ 121, "y", "y" }, -{ 122, "z", "z" }, -{ 123, "braceleft", "" }, -{ 124, "pipe", "" }, -{ 125, "braceright", "" }, -{ 127, "Delete", "\177" }, -{ 126, "asciitilde", "~" }, - -{ 160, "w0", "" }, -{ 161, "w1", "" }, -{ 162, "w2", "" }, -{ 163, "w3", "" }, -{ 164, "w4", "" }, -{ 165, "w5", "" }, -{ 166, "w6", "" }, -{ 167, "w7", "" }, -{ 168, "w8", "" }, -{ 169, "w9", "" }, -{ 170, "w10", "" }, -{ 171, "w11", "" }, -{ 172, "w12", "" }, -{ 173, "w13", "" }, -{ 174, "w14", "" }, -{ 175, "w15", "" }, -{ 176, "w16", "" }, -{ 177, "w17", "" }, -{ 178, "w18", "" }, -{ 179, "w19", "" }, -{ 180, "w20", "" }, -{ 181, "w21", "" }, -{ 182, "w22", "" }, -{ 183, "w23", "" }, -{ 184, "w24", "" }, -{ 185, "w25", "" }, -{ 186, "w26", "" }, -{ 187, "w27", "" }, -{ 188, "w28", "" }, -{ 189, "w29", "" }, -{ 190, "w30", "" }, -{ 191, "w31", "" }, -{ 192, "w32", "" }, -{ 193, "w33", "" }, -{ 194, "w34", "" }, -{ 195, "w35", "" }, -{ 196, "w36", "" }, -{ 197, "w37", "" }, -{ 198, "w38", "" }, -{ 199, "w39", "" }, -{ 200, "w40", "" }, -{ 201, "w41", "" }, -{ 202, "w42", "" }, -{ 203, "w43", "" }, -{ 204, "w44", "" }, -{ 205, "w45", "" }, -{ 206, "w46", "" }, -{ 207, "w47", "" }, -{ 208, "w48", "" }, -{ 209, "w49", "" }, -{ 210, "w50", "" }, -{ 211, "w51", "" }, -{ 212, "w52", "" }, -{ 213, "w53", "" }, -{ 214, "w54", "" }, -{ 215, "w55", "" }, -{ 216, "w56", "" }, -{ 217, "w57", "" }, -{ 218, "w58", "" }, -{ 219, "w59", "" }, -{ 220, "w60", "" }, -{ 221, "w61", "" }, -{ 222, "w62", "" }, -{ 223, "w63", "" }, -{ 224, "w64", "" }, -{ 225, "w65", "" }, -{ 226, "w66", "" }, -{ 227, "w67", "" }, -{ 228, "w68", "" }, -{ 229, "w69", "" }, -{ 230, "w70", "" }, -{ 231, "w71", "" }, -{ 232, "w72", "" }, -{ 233, "w73", "" }, -{ 234, "w74", "" }, -{ 235, "w75", "" }, -{ 236, "w76", "" }, -{ 237, "w77", "" }, -{ 238, "w78", "" }, -{ 239, "w79", "" }, -{ 240, "w80", "" }, -{ 241, "w81", "" }, -{ 242, "w82", "" }, -{ 243, "w83", "" }, -{ 244, "w84", "" }, -{ 245, "w85", "" }, -{ 246, "w86", "" }, -{ 247, "w87", "" }, -{ 248, "w88", "" }, -{ 249, "w89", "" }, -{ 250, "w90", "" }, -{ 251, "w91", "" }, -{ 252, "w92", "" }, -{ 253, "w93", "" }, -{ 254, "w94", "" }, -{ 255, "w95", "" }, - -{ 256, "KP0", "0" }, -{ 257, "KP1", "1" }, -{ 258, "KP2", "2" }, -{ 259, "KP3", "3" }, -{ 260, "KP4", "4" }, -{ 261, "KP5", "5" }, -{ 262, "KP6", "6" }, -{ 263, "KP7", "7" }, -{ 264, "KP8", "8" }, -{ 265, "KP9", "9" }, -{ 266, "period", "." }, -{ 267, "KP_Divide", "/" }, -{ 268, "KP_Multiply", "*" }, -{ 269, "KP_Minus", "-" }, -{ 270, "KP_Plus", "+" }, -{ 271, "KP_Enter", "\015" }, -{ 272, "KP_Equals", "=" }, - -{ NSUpArrowFunctionKey, "Up", "" }, -{ NSDownArrowFunctionKey, "Down", "" }, -{ NSRightArrowFunctionKey, "Right", "" }, -{ NSLeftArrowFunctionKey, "Left", "" }, -{ NSInsertFunctionKey, "Insert", "" }, -{ NSHomeFunctionKey, "Home", "" }, -{ NSEndFunctionKey, "End", "" }, -{ NSPageUpFunctionKey, "Page_Up", "" }, -{ NSPageDownFunctionKey, "Page_Down", "" }, - -{ NSF1FunctionKey, "F1", "" }, -{ NSF2FunctionKey, "F2", "" }, -{ NSF3FunctionKey, "F3", "" }, -{ NSF4FunctionKey, "F4", "" }, -{ NSF5FunctionKey, "F5", "" }, -{ NSF6FunctionKey, "F6", "" }, -{ NSF7FunctionKey, "F7", "" }, -{ NSF8FunctionKey, "F8", "" }, -{ NSF9FunctionKey, "F9", "" }, -{ NSF10FunctionKey, "F10", "" }, -{ NSF11FunctionKey, "F11", "" }, -{ NSF12FunctionKey, "F12", "" }, -{ NSF13FunctionKey, "F13", "" }, -{ NSF14FunctionKey, "F14", "" }, -{ NSF15FunctionKey, "F15", "" }, -{ NSF16FunctionKey, "F16", "" }, -{ NSF17FunctionKey, "F17", "" }, -{ NSF18FunctionKey, "F18", "" }, -{ NSF19FunctionKey, "F19", "" }, -{ NSF20FunctionKey, "F20", "" }, -{ NSF21FunctionKey, "F21", "" }, -{ NSF22FunctionKey, "F22", "" }, -{ NSF23FunctionKey, "F23", "" }, -{ NSF24FunctionKey, "F24", "" }, -{ NSF25FunctionKey, "F25", "" }, -{ NSF26FunctionKey, "F26", "" }, -{ NSF27FunctionKey, "F27", "" }, -{ NSF28FunctionKey, "F28", "" }, -{ NSF29FunctionKey, "F29", "" }, -{ NSF30FunctionKey, "F30", "" }, -{ NSF31FunctionKey, "F31", "" }, -{ NSF32FunctionKey, "F32", "" }, -{ NSF33FunctionKey, "F33", "" }, -{ NSF34FunctionKey, "F34", "" }, -{ NSF35FunctionKey, "F35", "" }, - -{ NSClearLineFunctionKey, "Num_Lock", "" }, -{ 301, "Caps_Lock", "" }, -{ NSScrollLockFunctionKey, "Scroll_Lock", "" }, -{ 303, "Shift_R", "" }, -{ 304, "Shift_L", "" }, -{ 305, "Control_R", "" }, -{ 306, "Control_L", "" }, -{ 307, "Alt_R", "" }, -{ 308, "Alt_L", "" }, -{ 309, "Meta_R", "" }, -{ 310, "Meta_L", "" }, -{ 311, "Super_L", "" }, -{ 312, "Super_R", "" }, - -{ NSModeSwitchFunctionKey, "Mode", "" }, -{ 314, "Compose", "" }, - -{ NSHelpFunctionKey, "Help", "" }, -{ NSPrintFunctionKey, "Print", "" }, -{ NSSysReqFunctionKey, "SysReq", "" }, -{ NSBreakFunctionKey, "Break", "" }, -{ NSMenuFunctionKey, "Menu", "" }, -{ 320, "Power", "" }, -{ 321, "Euro", "" }, -{ NSUndoFunctionKey, "Undo", "" } - -}; - -#endif /* ECORE_COCOA_KEYS_H__ */ diff --git a/legacy/ecore/src/lib/ecore_quartz/Makefile.am b/legacy/ecore/src/lib/ecore_quartz/Makefile.am deleted file mode 100644 index 697787b837..0000000000 --- a/legacy/ecore/src/lib/ecore_quartz/Makefile.am +++ /dev/null @@ -1,32 +0,0 @@ -MAINTAINERCLEANFILES = Makefile.in - -AM_CPPFLAGS = \ --I$(top_srcdir)/src/lib/ecore \ --I$(top_srcdir)/src/lib/ecore_input \ --I$(top_builddir)/src/lib/ecore \ --I$(top_builddir)/src/lib/ecore_input \ -@EVAS_CFLAGS@ \ -@EINA_CFLAGS@ - -if BUILD_ECORE_QUARTZ - -lib_LTLIBRARIES = libecore_cocoa.la -include_HEADERS = \ -Ecore_Cocoa.h \ -Ecore_Cocoa_Keys.h - -libecore_cocoa_la_SOURCES = \ -ecore_cocoa.m \ -ecore_cocoa_window.m - -libecore_cocoa_la_LIBADD = \ -$(top_builddir)/src/lib/ecore/libecore.la \ -$(top_builddir)/src/lib/ecore_input/libecore_input.la \ -@EVAS_LIBS@ \ -@EINA_LIBS@ - -libecore_cocoa_la_LDFLAGS = @quartz_ldflags@ -version-info @version_info@ @ecore_quartz_release_info@ - -endif - -EXTRA_DIST = ecore_cocoa_private.h diff --git a/legacy/ecore/src/lib/ecore_quartz/ecore_cocoa.m b/legacy/ecore/src/lib/ecore_quartz/ecore_cocoa.m deleted file mode 100644 index ad2e767339..0000000000 --- a/legacy/ecore/src/lib/ecore_quartz/ecore_cocoa.m +++ /dev/null @@ -1,280 +0,0 @@ -#ifdef HAVE_CONFIG_H -# include -#endif - -#include - -#include - -#include -#include -#include - -#include "Ecore_Cocoa.h" -#include "Ecore_Cocoa_Keys.h" - -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_cocoa_init_count = 0; - -static int old_flags; - -EAPI int -ecore_cocoa_init(const char *name __UNUSED__) -{ - if (++_ecore_cocoa_init_count != 1) - return _ecore_cocoa_init_count; - - if (!ecore_event_init()) - return --_ecore_cocoa_init_count; - - 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_cocoa_init_count; -} - -/** - * Shuts down the Ecore_Cocoa library. - * @return @c The number of times the system has been initialised without - * being shut down. - * @ingroup Ecore_Cocoa_Library_Group - */ -EAPI int -ecore_cocoa_shutdown(void) -{ - if (--_ecore_cocoa_init_count != 0) - return _ecore_cocoa_init_count; - - ecore_event_shutdown(); - - return _ecore_cocoa_init_count; -} - -EAPI void -ecore_cocoa_feed_events(void) -{ - NSDate *date = [NSDate dateWithTimeIntervalSinceNow:0.001]; - NSEvent *event = [NSApp nextEventMatchingMask:NSAnyEventMask - untilDate:date - inMode:NSDefaultRunLoopMode - dequeue:YES]; - [date release]; - if (!event) return; // SDL loops until null; maybe we should do that too. or not. - - unsigned int time = (unsigned int)((unsigned long long)(ecore_time_get() * 1000.0) & 0xffffffff); - - switch([event type]) - { - case NSMouseMoved: - case NSLeftMouseDragged: - case NSRightMouseDragged: - case NSOtherMouseDragged: - { - Ecore_Event_Mouse_Move * ev = calloc(1, sizeof(Ecore_Event_Mouse_Move)); - if (!ev) return; - ev->x = [event locationInWindow].x; - ev->y = [event locationInWindow].y; - ev->root.x = ev->x; - ev->root.y = ev->y; - ev->timestamp = time; - ev->window = [event window]; - ev->modifiers = 0; /* FIXME: keep modifier around. */ - - ecore_event_add(ECORE_EVENT_MOUSE_MOVE, ev, NULL, NULL); - - [NSApp sendEvent:event]; // pass along mouse events, for window manager - break; - } - case NSLeftMouseDown: - case NSRightMouseDown: - case NSOtherMouseDown: - { - Ecore_Event_Mouse_Button * ev = calloc(1, sizeof(Ecore_Event_Mouse_Button)); - if (!ev) return; - ev->x = [event locationInWindow].x; - ev->y = [event locationInWindow].y; - ev->root.x = ev->x; - ev->root.y = ev->y; - ev->timestamp = time; - ev->buttons = [event buttonNumber] + 1; // Apple indexes buttons from 0 - - if ([event clickCount] == 2) - ev->double_click = 1; - else - ev->double_click = 0; - - if ([event clickCount] >= 3) - ev->triple_click = 1; - else - ev->triple_click = 0; - - ecore_event_add(ECORE_EVENT_MOUSE_BUTTON_DOWN, ev, NULL, NULL); - - [NSApp sendEvent:event]; // pass along mouse events, for window manager - break; - } - case NSLeftMouseUp: - case NSRightMouseUp: - case NSOtherMouseUp: - { - Ecore_Event_Mouse_Button * ev = calloc(1, sizeof(Ecore_Event_Mouse_Button)); - if (!ev) return; - ev->x = [event locationInWindow].x; - ev->y = [event locationInWindow].y; - ev->root.x = ev->x; - ev->root.y = ev->y; - ev->timestamp = time; - ev->buttons = [event buttonNumber] + 1; // Apple indexes buttons from 0 - - if ([event clickCount] == 2) - ev->double_click = 1; - else - ev->double_click = 0; - - if ([event clickCount] >= 3) - ev->triple_click = 1; - else - ev->triple_click = 0; - - ecore_event_add(ECORE_EVENT_MOUSE_BUTTON_UP, ev, NULL, NULL); - - [NSApp sendEvent:event]; // pass along mouse events, for window manager - break; - } - case NSKeyDown: - { - Ecore_Event_Key *ev; - unsigned int i; - - ev = calloc(1, sizeof (Ecore_Event_Key)); - if (!ev) return; - ev->timestamp = time; - - for (i = 0; i < sizeof (keystable) / sizeof (struct _ecore_cocoa_keys_s); ++i) - { - if (keystable[i].code == tolower([[event charactersIgnoringModifiers] characterAtIndex:0])) - { - ev->keyname = keystable[i].name; - ev->string = keystable[i].compose; - - ecore_event_add(ECORE_EVENT_KEY_DOWN, ev, NULL, NULL); - return; - } - } - - break; - } - case NSKeyUp: - { - Ecore_Event_Key *ev; - unsigned int i; - - ev = calloc(1, sizeof (Ecore_Event_Key)); - if (!ev) return; - ev->timestamp = time; - - for (i = 0; i < sizeof (keystable) / sizeof (struct _ecore_cocoa_keys_s); ++i) - { - if (keystable[i].code == tolower([[event charactersIgnoringModifiers] characterAtIndex:0])) - { - ev->keyname = keystable[i].name; - ev->string = keystable[i].compose; - - ecore_event_add(ECORE_EVENT_KEY_UP, ev, NULL, NULL); - return; - } - } - - break; - } - case NSFlagsChanged: - { - int flags = [event modifierFlags]; - - Ecore_Event_Key *evDown = NULL; - Ecore_Event_Key *evUp = NULL; - - evDown = calloc(1, sizeof (Ecore_Event_Key)); - if (!evDown) return; - - evUp = calloc(1, sizeof (Ecore_Event_Key)); - if (!evUp) - { - free(evDown); - return; - } - - // Turn special key flags on - if (flags & NSShiftKeyMask) - evDown->keyname = "Shift_L"; - else if (flags & NSControlKeyMask) - evDown->keyname = "Control_L"; - else if (flags & NSAlternateKeyMask) - evDown->keyname = "Alt_L"; - else if (flags & NSCommandKeyMask) - evDown->keyname = "Super_L"; - else if (flags & NSAlphaShiftKeyMask) - evDown->keyname = "Caps_Lock"; - - if (evDown->keyname) - { - evDown->timestamp = time; - evDown->string = ""; - ecore_event_add(ECORE_EVENT_KEY_DOWN, evDown, NULL, NULL); - old_flags = flags; - break; - } - - int changed_flags = flags ^ old_flags; - - // Turn special key flags off - if (changed_flags & NSShiftKeyMask) - evUp->keyname = "Shift_L"; - else if (changed_flags & NSControlKeyMask) - evUp->keyname = "Control_L"; - else if (changed_flags & NSAlternateKeyMask) - evUp->keyname = "Alt_L"; - else if (changed_flags & NSCommandKeyMask) - evUp->keyname = "Super_L"; - else if (changed_flags & NSAlphaShiftKeyMask) - evUp->keyname = "Caps_Lock"; - - if (evUp->keyname) - { - evUp->timestamp = time; - evUp->string = ""; - ecore_event_add(ECORE_EVENT_KEY_UP, evUp, NULL, NULL); - old_flags = flags; - break; - } - - break; - } - case NSAppKitDefined: - { - if ([event subtype] == NSApplicationActivatedEventType) - ecore_event_add(ECORE_COCOA_EVENT_GOT_FOCUS, NULL, NULL, NULL); - else if ([event subtype] == NSApplicationDeactivatedEventType) - ecore_event_add(ECORE_COCOA_EVENT_LOST_FOCUS, NULL, NULL, NULL); - [NSApp sendEvent:event]; // pass along AppKit events, for window manager - break; - } - case NSScrollWheel: - { - break; - } - default: - { - [NSApp sendEvent:event]; - break; - } - } - - [event release]; -} diff --git a/legacy/ecore/src/lib/ecore_quartz/ecore_cocoa_private.h b/legacy/ecore/src/lib/ecore_quartz/ecore_cocoa_private.h deleted file mode 100644 index 05bdc1f715..0000000000 --- a/legacy/ecore/src/lib/ecore_quartz/ecore_cocoa_private.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef _ECORE_COCOA_PRIVATE_H -#define _ECORE_COCOA_PRIVATE_H - - -struct _Ecore_Cocoa_Window -{ - NSWindow *window; - - unsigned int borderless : 1; -}; - - -#endif diff --git a/legacy/ecore/src/lib/ecore_quartz/ecore_cocoa_window.m b/legacy/ecore/src/lib/ecore_quartz/ecore_cocoa_window.m deleted file mode 100644 index 751bde4fc3..0000000000 --- a/legacy/ecore/src/lib/ecore_quartz/ecore_cocoa_window.m +++ /dev/null @@ -1,110 +0,0 @@ -#ifdef HAVE_CONFIG_H -# include -#endif - -#include - -#include "Ecore_Cocoa.h" - -Ecore_Cocoa_Window * -ecore_cocoa_window_new(int x, - int y, - int width, - int height) -{ - NSWindow *window; - - window = [[NSWindow alloc] - initWithContentRect:NSMakeRect(x, y, width, height) - styleMask:(NSTitledWindowMask | - NSClosableWindowMask | - NSResizableWindowMask | - NSMiniaturizableWindowMask) - backing:NSBackingStoreBuffered - defer:NO - screen:nil - ]; - if (!window) - return NULL; - - return window; -} - -void -ecore_cocoa_window_free(Ecore_Cocoa_Window *window) -{ - if (!window) - return; - - [window release]; -} - -void -ecore_cocoa_window_move(Ecore_Cocoa_Window *window, - int x, - int y) -{ - if (!window) - return; -} - -void -ecore_cocoa_window_resize(Ecore_Cocoa_Window *window, - int width, - int height) -{ - if (!window) - return; - - [window setContentSize: NSMakeSize(width, height)]; -} - -void -ecore_cocoa_window_move_resize(Ecore_Cocoa_Window *window, - int x, - int y, - int width, - int height) -{ - if (!window) - return; -} - -void -ecore_cocoa_window_title_set(Ecore_Cocoa_Window *window, const char *title) -{ - if (!window || !title) - return; - - [window setTitle:[NSString stringWithUTF8String:title]]; -} - -void -ecore_cocoa_window_show(Ecore_Cocoa_Window *window) -{ - if (!window || [window isVisible]) - return; - - [window orderFront:NSApp]; -} - -void -ecore_cocoa_window_hide(Ecore_Cocoa_Window *window) -{ - if (!window || ![window isVisible]) - return; - - [window orderOut:NSApp]; -} - -void -ecore_cocoa_window_borderless_set(Ecore_Cocoa_Window *window, - int on) -{ - if (!window) - return; - - if (on) - [window setContentBorderThickness:0.0 - forEdje:NSMinXEdge | NSMinYEdge | NSMaxXEdge | NSMaxYEdge]; -}