elementary: Add ecore_cocoa backend to elementary
authorcaptainigloo <captainigloo@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 2 Nov 2011 19:26:29 +0000 (19:26 +0000)
committerMike McCormack <mj.mccormack@samsung.com>
Fri, 18 Nov 2011 02:42:09 +0000 (11:42 +0900)
git-svn-id: https://svn.enlightenment.org/svn/e/trunk/elementary@64657 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

configure.ac
src/lib/elm_config.c
src/lib/elm_main.c
src/lib/elm_priv.h
src/lib/elm_win.c

index 86b972a..149a499 100755 (executable)
@@ -349,6 +349,29 @@ if test "x$want_elementary_sdl" = "xyes" -a "x$have_elementary_sdl" = "xno"; the
     AC_MSG_ERROR([ecore-sdl support requested, but not found by pkg-config.])
 fi
 
+have_elementary_cocoa="no"
+want_elementary_cocoa="auto"
+AC_ARG_ENABLE([ecore-cocoa],
+   [AC_HELP_STRING([--disable-ecore-cocoa], [disable ecore-cocoa support. @<:@default=detect@:>@])],
+   [want_elementary_cocoa=$enableval], [])
+
+if test "x$want_elementary_cocoa" != "xno"; then
+   PKG_CHECK_MODULES([ELEMENTARY_COCOA],
+      [ecore-cocoa >= 1.0.0],
+      [
+       AC_DEFINE(HAVE_ELEMENTARY_COCOA, 1, [COCOA support for Elementary])
+       have_elementary_cocoa="yes"
+       requirement_elm="ecore-cocoa >= 1.0.0 ${requirement_elm}"
+      ],
+      [have_elementary_cocoa="no"]
+   )
+else
+    have_elementary_cocoa="no"
+fi
+if test "x$want_elementary_cocoa" = "xyes" -a "x$have_elementary_cocoa" = "xno"; then
+    AC_MSG_ERROR([ecore-cocoa support requested, but not found by pkg-config.])
+fi
+
 have_elementary_win32="no"
 want_elementary_win32="auto"
 AC_ARG_ENABLE([ecore-win32],
@@ -692,6 +715,7 @@ echo "  Engines:"
 echo "    X11....................: ${have_elementary_x}"
 echo "    Framebuffer............: ${have_elementary_fb}"
 echo "    SDL....................: ${have_elementary_sdl}"
+echo "    Cocoa..................: ${have_elementary_cocoa}"
 echo "    Windows XP.............: ${have_elementary_win32}"
 echo "    Windows CE.............: ${have_elementary_wince}"
 echo
index f67a163..1dcc17e 100644 (file)
@@ -30,6 +30,9 @@ const char *_elm_engines[] = {
    "sdl",
    "software_16_sdl",
    "opengl_sdl",
+   "buffer",
+   "ews",
+   "opengl_cocoa",
    NULL
 };
 
@@ -1474,6 +1477,11 @@ _env_get(void)
                  (!strcasecmp(s, "gl-sdl")) ||
                  (!strcasecmp(s, "gl_sdl")))
           eina_stringshare_replace(&_elm_config->engine, ELM_OPENGL_SDL);
+        else if ((!strcasecmp(s, "opengl-cocoa")) ||
+                 (!strcasecmp(s, "opengl_cocoa")) ||
+                 (!strcasecmp(s, "gl-cocoa")) ||
+                 (!strcasecmp(s, "gl_cocoa")))
+          eina_stringshare_replace(&_elm_config->engine, ELM_OPENGL_COCOA);
         else if ((!strcasecmp(s, "gdi")) ||
                  (!strcasecmp(s, "software-gdi")) ||
                  (!strcasecmp(s, "software_gdi")))
@@ -1712,7 +1720,8 @@ _elm_config_sub_init(void)
    if (ENGINE_COMPARE(ELM_SOFTWARE_X11) ||
        ENGINE_COMPARE(ELM_SOFTWARE_16_X11) ||
        ENGINE_COMPARE(ELM_XRENDER_X11) ||
-       ENGINE_COMPARE(ELM_OPENGL_X11))
+       ENGINE_COMPARE(ELM_OPENGL_X11) ||
+       ENGINE_COMPARE(ELM_OPENGL_COCOA))
 #undef ENGINE_COMPARE
      {
 #ifdef HAVE_ELEMENTARY_X
index 427bbb4..b2ad65b 100644 (file)
@@ -480,6 +480,7 @@ elm_quicklaunch_sub_shutdown(void)
             ENGINE_COMPARE(ELM_SOFTWARE_SDL) ||
             ENGINE_COMPARE(ELM_SOFTWARE_16_SDL) ||
             ENGINE_COMPARE(ELM_OPENGL_SDL) ||
+            ENGINE_COMPARE(ELM_OPENGL_COCOA) ||
             ENGINE_COMPARE(ELM_SOFTWARE_WIN32) ||
             ENGINE_COMPARE(ELM_SOFTWARE_16_WINCE))
 #undef ENGINE_COMPARE
index 4a63c57..06c28e7 100644 (file)
@@ -73,6 +73,9 @@ extern const char *_elm_engines[];
 #define ELM_SOFTWARE_SDL      (_elm_engines[9])
 #define ELM_SOFTWARE_16_SDL   (_elm_engines[10])
 #define ELM_OPENGL_SDL        (_elm_engines[11])
+#define ELM_BUFFER            (_elm_engines[12])
+#define ELM_EWS               (_elm_engines[13])
+#define ELM_OPENGL_COCOA      (_elm_engines[14])
 
 #define ELM_FONT_TOKEN_STYLE ":style="
 
index 4b159c0..556ec87 100644 (file)
@@ -680,7 +680,8 @@ _elm_win_xwindow_get(Elm_Win *win)
             ENGINE_COMPARE(ELM_SOFTWARE_16_WINCE) ||
             ENGINE_COMPARE(ELM_SOFTWARE_SDL) ||
             ENGINE_COMPARE(ELM_SOFTWARE_16_SDL) ||
-            ENGINE_COMPARE(ELM_OPENGL_SDL))
+            ENGINE_COMPARE(ELM_OPENGL_SDL) ||
+           ENGINE_COMPARE(ELM_OPENGL_COCOA))
      {
      }
    else if (ENGINE_COMPARE(ELM_SOFTWARE_16_X11))
@@ -1472,6 +1473,19 @@ elm_win_add(Evas_Object *parent, const char *name, Elm_Win_Type type)
              win->ee = ecore_evas_gl_sdl_new(NULL, 1, 1, 0, 0);
              FALLBACK_TRY("OpenGL SDL");
           }
+        else if (ENGINE_COMPARE(ELM_OPENGL_COCOA))
+          {
+             win->ee = ecore_evas_cocoa_new(NULL, 1, 1, 0, 0);
+             FALLBACK_TRY("OpenGL Cocoa");
+          }
+        else if (ENGINE_COMPARE(ELM_BUFFER))
+          {
+             win->ee = ecore_evas_buffer_new(1, 1);
+          }
+        else if (ENGINE_COMPARE(ELM_EWS))
+          {
+             win->ee = ecore_evas_ews_new(0, 0, 1, 1);
+          }
         else if (!strncmp(_elm_config->engine, "shot:", 5))
           {
              win->ee = ecore_evas_buffer_new(1, 1);