aboutsummaryrefslogtreecommitdiffstats
path: root/legacy/elementary/src/lib/elm_win.c
diff options
context:
space:
mode:
authorVincent Torri <vincent dot torri at gmail dot com>2015-10-15 23:13:42 +0200
committerCedric BAIL <cedric@osg.samsung.com>2015-12-03 11:36:50 -0800
commit8042bc82d348a4c871ae953826d8e1ba3d0f90d1 (patch)
tree72b5e95a4eba422cd7ab989ef83a75a1abe08b6f /legacy/elementary/src/lib/elm_win.c
parentelementary_test: fix memory leak (diff)
downloadefl-8042bc82d348a4c871ae953826d8e1ba3d0f90d1.tar.gz
cnp: add Copy & Paste support for Windows
It needs the clipboard management in Ecore_Win32 @feature Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Diffstat (limited to 'legacy/elementary/src/lib/elm_win.c')
-rw-r--r--legacy/elementary/src/lib/elm_win.c84
1 files changed, 84 insertions, 0 deletions
diff --git a/legacy/elementary/src/lib/elm_win.c b/legacy/elementary/src/lib/elm_win.c
index 2bf97e28a1..3fbe2bf6a2 100644
--- a/legacy/elementary/src/lib/elm_win.c
+++ b/legacy/elementary/src/lib/elm_win.c
@@ -123,6 +123,12 @@ struct _Elm_Win_Data
Ecore_Cocoa_Window *win;
} cocoa;
#endif
+#ifdef HAVE_ELEMENTARY_WIN32
+ struct
+ {
+ Ecore_Win32_Window *win;
+ } win32;
+#endif
Ecore_Job *deferred_resize_job;
Ecore_Job *deferred_child_eval_job;
@@ -2193,6 +2199,28 @@ _elm_ee_cocoa_win_get(const Ecore_Evas *ee)
engine_name = ecore_evas_engine_name_get(ee);
if (EINA_UNLIKELY(!engine_name)) return NULL;
+ if ((!strcmp(engine_name, ELM_SOFTWARE_WIN32)) ||
+ (!strcmp(engine_name, ELM_SOFTWARE_DDRAW)))
+ {
+ return ecore_evas_win32_window_get(ee);
+ }
+#else
+ (void)ee;
+#endif
+ return NULL;
+}
+
+Ecore_Win32_Window *
+_elm_ee_win32win_get(const Ecore_Evas *ee)
+{
+#ifdef HAVE_ELEMENTARY_WIN32
+ const char *engine_name;
+
+ if (!ee) return NULL;
+
+ engine_name = ecore_evas_engine_name_get(ee);
+ if (EINA_UNLIKELY(!engine_name)) return NULL;
+
if (!strcmp(engine_name, "opengl_cocoa") ||
!strcmp(engine_name, "gl_cocoa"))
return ecore_evas_cocoa_window_get(ee);
@@ -2210,6 +2238,14 @@ _elm_win_cocoawindow_get(Elm_Win_Data *sd)
}
#endif
+#ifdef HAVE_ELEMENTARY_WIN32
+static void
+_internal_elm_win_win32window_get(Elm_Win_Data *sd)
+{
+ sd->win32.win = _elm_ee_win32win_get(sd->ee);
+}
+#endif
+
#ifdef HAVE_ELEMENTARY_X
static void
_elm_win_xwin_update(Elm_Win_Data *sd)
@@ -3756,6 +3792,9 @@ _elm_win_finalize_internal(Eo *obj, Elm_Win_Data *sd, const char *name, Elm_Win_
#ifdef HAVE_ELEMENTARY_COCOA
_elm_win_cocoawindow_get(sd);
#endif
+#ifdef HAVE_ELEMENTARY_WIN32
+ _internal_elm_win_win32window_get(sd);
+#endif
if ((_elm_config->bgpixmap)
#ifdef HAVE_ELEMENTARY_X
@@ -5472,6 +5511,41 @@ _elm_win_wl_window_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
return NULL;
}
+EAPI Ecore_Win32_Window *
+elm_win_win32_window_get(const Evas_Object *obj)
+{
+ ELM_WIN_CHECK(obj) NULL;
+ ELM_WIN_DATA_GET_OR_RETURN_VAL(obj, sd, NULL);
+ const char *engine_name = ecore_evas_engine_name_get(sd->ee);
+
+ if (!(engine_name &&
+ ((!strcmp(engine_name, ELM_SOFTWARE_WIN32)) ||
+ (!strcmp(engine_name, ELM_SOFTWARE_DDRAW)))))
+ return NULL;
+
+ if (!evas_object_smart_type_check_ptr(obj, MY_CLASS_NAME_LEGACY))
+ {
+ Ecore_Evas *ee = ecore_evas_ecore_evas_get(evas_object_evas_get(obj));
+ return _elm_ee_win32win_get(ee);
+ }
+
+ Ecore_Win32_Window *ret = NULL;
+ eo_do((Eo *) obj, ret = elm_obj_win_win32_window_get());
+ return ret;
+}
+
+EOLIAN static Ecore_Win32_Window *
+_elm_win_win32_window_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
+{
+#if HAVE_ELEMENTARY_WIN32
+ if (sd->win32.win) return sd->win32.win;
+ if (sd->parent) return elm_win_win32_window_get(sd->parent);
+#else
+ (void)sd;
+#endif
+ return NULL;
+}
+
EAPI Eina_Bool
elm_win_trap_set(const Elm_Win_Trap *t)
{
@@ -5567,6 +5641,16 @@ _elm_win_window_id_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
}
#endif
}
+ else if ((engine_name &&
+ ((!strcmp(engine_name, ELM_SOFTWARE_WIN32)) ||
+ (!strcmp(engine_name, ELM_SOFTWARE_DDRAW)))))
+ {
+#ifdef HAVE_ELEMENTARY_WIN32
+ _internal_elm_win_win32window_get(sd);
+ if (sd->win32.win) return (Ecore_Window)sd->win32.win;
+ if (sd->parent) return (Ecore_Window)elm_win_win32_window_get(sd->parent);
+#endif
+ }
return 0;
}