Elementary: Add support for the PSL1GHT engine
[framework/uifw/elementary.git] / src / lib / elm_config.c
index 13a4ff6..3df2272 100644 (file)
@@ -33,6 +33,8 @@ const char *_elm_engines[] = {
    "opengl_sdl",
    "buffer",
    "ews",
+   "opengl_cocoa",
+   "psl1ght",
    NULL
 };
 
@@ -101,7 +103,7 @@ static Eina_Bool
 _prop_all_update_cb(void *data __UNUSED__)
 {
    _prop_config_set();
-   ecore_x_window_prop_string_set(_root_1st, _atom[ATOM_E_PROFILE], 
+   ecore_x_window_prop_string_set(_root_1st, _atom[ATOM_E_PROFILE],
                                   _elm_profile);
    _prop_all_update_timer = NULL;
    return EINA_FALSE;
@@ -166,13 +168,13 @@ _prop_config_set(void)
 {
    unsigned char *config_data = NULL;
    int size = 0;
-   
+
    config_data = eet_data_descriptor_encode(_config_edd, _elm_config, &size);
    if (config_data)
      {
         Ecore_X_Atom atom;
         char buf[512];
-        
+
         snprintf(buf, sizeof(buf), "ELM_CONFIG_%s", _elm_profile);
         atom = ecore_x_atom_get(buf);
         _atom_config = atom;
@@ -188,7 +190,7 @@ static Eina_Bool
 _prop_change_delay_cb(void *data __UNUSED__)
 {
    char *s;
-   
+
    s = ecore_x_window_prop_string_get(_root_1st, _atom[ATOM_E_PROFILE]);
    if (s)
      {
@@ -1159,6 +1161,8 @@ _env_get(void)
         else if ((!strcasecmp(s, "directfb")) ||
                  (!strcasecmp(s, "dfb")))
           eina_stringshare_replace(&_elm_config->engine, ELM_SOFTWARE_DIRECTFB);
+        else if ((!strcasecmp(s, "psl1ght")))
+          eina_stringshare_replace(&_elm_config->engine, ELM_SOFTWARE_PSL1GHT);
         else if ((!strcasecmp(s, "sdl")) ||
                  (!strcasecmp(s, "software-sdl")) ||
                  (!strcasecmp(s, "software_sdl")))
@@ -1172,6 +1176,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")))
@@ -1428,7 +1437,8 @@ _elm_config_sub_shutdown(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
@@ -1444,7 +1454,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
@@ -1514,9 +1525,9 @@ _elm_config_all_update(void)
    if (_prop_all_update_timer) ecore_timer_del(_prop_all_update_timer);
    _prop_all_update_timer = ecore_timer_add(0.1, _prop_all_update_cb, NULL);
    _prop_config_set();
-   ecore_x_window_prop_string_set(_root_1st, _atom[ATOM_E_PROFILE], 
+   ecore_x_window_prop_string_set(_root_1st, _atom[ATOM_E_PROFILE],
                                   _elm_profile);
-#endif   
+#endif
 }
 
 void
@@ -1557,7 +1568,7 @@ _elm_config_shutdown(void)
    if (_prop_change_delay_timer) ecore_timer_del(_prop_change_delay_timer);
    _prop_change_delay_timer = NULL;
 #endif
-   
+
 #define ENGINE_COMPARE(name) (!strcmp(_elm_config->engine, name))
    if (ENGINE_COMPARE(ELM_SOFTWARE_X11) ||
        ENGINE_COMPARE(ELM_SOFTWARE_16_X11) ||