summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Torri <vincent dot torri at gmail dot com>2015-10-15 23:13:42 +0200
committerNicolas Aguirre <aguirre.nicolas@gmail.com>2015-11-12 10:47:44 +0100
commit544021fe270237fb06dc44be236b217dc16e84be (patch)
treec88749cf6418b381c872be28fff4f3d4a0301bb2
parentdb3eba449066ce4c1455d2aba0114590b12190e4 (diff)
Add Copy & Paste in Elementary on Windows
it needs the clipboard management in Ecore_Win32 @feature
-rw-r--r--src/lib/elm_cnp.c341
-rw-r--r--src/lib/elm_config.c5
-rw-r--r--src/lib/elm_priv.h3
-rw-r--r--src/lib/elm_win.c85
-rw-r--r--src/lib/elm_win.eo10
-rw-r--r--src/lib/elm_win_legacy.h17
6 files changed, 459 insertions, 2 deletions
diff --git a/src/lib/elm_cnp.c b/src/lib/elm_cnp.c
index fb3f2ae86..b255fb755 100644
--- a/src/lib/elm_cnp.c
+++ b/src/lib/elm_cnp.c
@@ -2928,7 +2928,7 @@ _wl_elm_drag_start(Evas_Object *obj, Elm_Sel_Format format, const char *data,
2928 parent = ecore_evas_wayland_window_get(ee); 2928 parent = ecore_evas_wayland_window_get(ee);
2929 } 2929 }
2930 2930
2931 ecore_wl_dnd_drag_start(ecore_wl_input_get(), parent, 2931 ecore_wl_dnd_drag_start(ecore_wl_input_get(), parent,
2932 elm_win_wl_window_get(dragwin), 2932 elm_win_wl_window_get(dragwin),
2933 x3, y3, w, h); 2933 x3, y3, w, h);
2934 2934
@@ -3683,6 +3683,320 @@ _local_elm_selection_selection_has_owner(Evas_Object *obj EINA_UNUSED)
3683} 3683}
3684#endif 3684#endif
3685 3685
3686// win32 specific stuff
3687////////////////////////////////////////////////////////////////////////////
3688#ifdef HAVE_ELEMENTARY_WIN32
3689
3690typedef struct _Win32_Cnp_Selection Win32_Cnp_Selection;
3691
3692struct _Win32_Cnp_Selection
3693{
3694 const char *debug;
3695 Evas_Object *widget;
3696 char *selbuf;
3697 Evas_Object *requestwidget;
3698 void *udata;
3699 Elm_Sel_Format requestformat;
3700 Elm_Drop_Cb datacb;
3701 Eina_Bool (*set)(Ecore_Win32_Window *window, const void *data, int size);
3702 Eina_Bool (*clear)(Ecore_Win32_Window *window);
3703 Eina_Bool (*get)(Ecore_Win32_Window *window , void **data, int *size);
3704 Elm_Selection_Loss_Cb loss_cb;
3705 void *loss_data;
3706
3707 Elm_Sel_Format format;
3708 Ecore_Win32_Selection ecore_sel;
3709 Ecore_Win32_Window *win;
3710 Elm_Xdnd_Action action;
3711
3712 Eina_Bool active : 1;
3713};
3714
3715#define ARRAYINIT(foo) [foo] =
3716
3717static Win32_Cnp_Selection _win32_selections[ELM_SEL_TYPE_CLIPBOARD + 1] =
3718{
3719 ARRAYINIT(ELM_SEL_TYPE_PRIMARY)
3720 {
3721 .debug = "Primary",
3722 .ecore_sel = ECORE_WIN32_SELECTION_PRIMARY,
3723 .set = ecore_win32_clipboard_set,
3724 .clear = ecore_win32_clipboard_clear,
3725 .get = ecore_win32_clipboard_get,
3726 },
3727 ARRAYINIT(ELM_SEL_TYPE_SECONDARY)
3728 {
3729 .debug = "Secondary",
3730 .ecore_sel = ECORE_WIN32_SELECTION_OTHER,
3731 },
3732 ARRAYINIT(ELM_SEL_TYPE_XDND)
3733 {
3734 .debug = "XDnD",
3735 .ecore_sel = ECORE_WIN32_SELECTION_OTHER,
3736 },
3737 ARRAYINIT(ELM_SEL_TYPE_CLIPBOARD)
3738 {
3739 .debug = "Clipboard",
3740 .ecore_sel = ECORE_WIN32_SELECTION_CLIPBOARD,
3741 .set = ecore_win32_clipboard_set,
3742 .clear = ecore_win32_clipboard_clear,
3743 .get = ecore_win32_clipboard_get,
3744 }
3745};
3746
3747
3748static void
3749_win32_sel_obj_del(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
3750{
3751 Win32_Cnp_Selection *sel = data;
3752 if (sel->widget == obj) sel->widget = NULL;
3753 if (dragwidget == obj) dragwidget = NULL;
3754}
3755
3756static void
3757_win32_sel_obj_del2(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
3758{
3759 Win32_Cnp_Selection *sel = data;
3760 if (sel->requestwidget == obj) sel->requestwidget = NULL;
3761}
3762
3763static Eina_Bool
3764_win32_elm_cnp_init(void)
3765{
3766 static int _init_count = 0;
3767
3768 if (_init_count > 0) return EINA_TRUE;
3769 _init_count++;
3770 return EINA_TRUE;
3771}
3772
3773static Ecore_Win32_Window *
3774_win32_elm_widget_window_get(const Evas_Object *obj)
3775{
3776 Evas_Object *top;
3777 Ecore_Win32_Window *win = NULL;
3778
3779 if (elm_widget_is(obj))
3780 {
3781 top = elm_widget_top_get(obj);
3782 if (!top)
3783 {
3784 Evas_Object *par;
3785 par = elm_widget_parent_widget_get(obj);
3786 if (par) top = elm_widget_top_get(par);
3787 }
3788 if (top && (eo_isa(top, ELM_WIN_CLASS)))
3789 win = elm_win_win32_window_get(top);
3790 }
3791
3792 if (!win)
3793 {
3794 Ecore_Evas *ee;
3795 Evas *evas;
3796 const char *engine_name;
3797
3798 evas = evas_object_evas_get(obj);
3799 if (!evas) return NULL;
3800
3801 ee = ecore_evas_ecore_evas_get(evas);
3802 if (!ee) return NULL;
3803
3804 engine_name = ecore_evas_engine_name_get(ee);
3805 if (!strcmp(engine_name, ELM_BUFFER))
3806 {
3807 ee = ecore_evas_buffer_ecore_evas_parent_get(ee);
3808 if (!ee) return NULL;
3809 win = ecore_evas_win32_window_get(ee);
3810 }
3811 else
3812 {
3813 if ((strcmp(engine_name, ELM_SOFTWARE_WIN32) == 0) ||
3814 (strcmp(engine_name, ELM_SOFTWARE_DDRAW) == 0))
3815 return ecore_evas_win32_window_get(ee);
3816 }
3817 }
3818
3819 return win;
3820}
3821
3822static Eina_Bool
3823_win32_elm_cnp_selection_set(Ecore_Win32_Window *win, Evas_Object *obj, Elm_Sel_Type selection, Elm_Sel_Format format, const void *selbuf, size_t buflen)
3824{
3825 Win32_Cnp_Selection *sel;
3826
3827 if (selection != ELM_SEL_TYPE_CLIPBOARD)
3828 return EINA_FALSE;
3829
3830 _win32_elm_cnp_init();
3831 if ((!selbuf) && (format != ELM_SEL_FORMAT_IMAGE))
3832 return elm_object_cnp_selection_clear(obj, selection);
3833
3834 sel = _win32_selections + selection;
3835 if (sel->widget != obj && sel->loss_cb) sel->loss_cb(sel->loss_data, selection);
3836 if (sel->widget)
3837 evas_object_event_callback_del_full(sel->widget, EVAS_CALLBACK_DEL,
3838 _win32_sel_obj_del, sel);
3839 sel->active = EINA_TRUE;
3840 sel->widget = obj;
3841 sel->win = win;
3842 if (sel->set) sel->set(win, selbuf, buflen);
3843 sel->format = format;
3844 sel->loss_cb = NULL;
3845 sel->loss_data = NULL;
3846
3847 evas_object_event_callback_add
3848 (sel->widget, EVAS_CALLBACK_DEL, _win32_sel_obj_del, sel);
3849
3850 ELM_SAFE_FREE(sel->selbuf, free);
3851 if (selbuf)
3852 {
3853 if (format == ELM_SEL_FORMAT_IMAGE)
3854 {
3855 // selbuf is actual image data, not text/string
3856 sel->selbuf = malloc(buflen + 1);
3857 if (!sel->selbuf)
3858 {
3859 elm_object_cnp_selection_clear(obj, selection);
3860 return EINA_FALSE;
3861 }
3862 memcpy(sel->selbuf, selbuf, buflen);
3863 sel->selbuf[buflen] = 0;
3864 }
3865 else
3866 sel->selbuf = strdup((char*)selbuf);
3867 }
3868
3869 return EINA_TRUE;
3870}
3871
3872static void
3873_win32_elm_cnp_selection_loss_callback_set(Evas_Object *obj EINA_UNUSED, Elm_Sel_Type selection, Elm_Selection_Loss_Cb func, const void *data)
3874{
3875 Win32_Cnp_Selection *sel;
3876
3877 if (selection != ELM_SEL_TYPE_CLIPBOARD)
3878 return;
3879
3880 _win32_elm_cnp_init();
3881 sel = _win32_selections + selection;
3882 sel->loss_cb = func;
3883 sel->loss_data = (void *)data;
3884}
3885
3886static Eina_Bool
3887_win32_elm_object_cnp_selection_clear(Ecore_Win32_Window *win, Evas_Object *obj, Elm_Sel_Type selection)
3888{
3889 Win32_Cnp_Selection *sel;
3890
3891 if (selection != ELM_SEL_TYPE_CLIPBOARD)
3892 return EINA_FALSE;
3893
3894 _win32_elm_cnp_init();
3895
3896 sel = _win32_selections + selection;
3897
3898 /* No longer this selection: Consider it gone! */
3899 if ((!sel->active) || (sel->widget != obj))
3900 return EINA_TRUE;
3901
3902 if (sel->widget)
3903 evas_object_event_callback_del_full(sel->widget, EVAS_CALLBACK_DEL,
3904 _win32_sel_obj_del, sel);
3905 if (sel->requestwidget)
3906 evas_object_event_callback_del_full(sel->requestwidget, EVAS_CALLBACK_DEL,
3907 _win32_sel_obj_del2, sel);
3908 sel->widget = NULL;
3909 sel->requestwidget = NULL;
3910 sel->loss_cb = NULL;
3911 sel->loss_data = NULL;
3912
3913 sel->active = EINA_FALSE;
3914 ELM_SAFE_FREE(sel->selbuf, free);
3915 /* sel->clear(win); */
3916
3917 return EINA_TRUE;
3918}
3919
3920static Eina_Bool
3921_win32_elm_cnp_selection_get(Ecore_Win32_Window *win,
3922 const Evas_Object *obj,
3923 Elm_Sel_Type selection,
3924 Elm_Sel_Format format,
3925 Elm_Drop_Cb datacb,
3926 void *udata)
3927{
3928 Win32_Cnp_Selection *sel;
3929 void *data;
3930 int size;
3931
3932 if (selection != ELM_SEL_TYPE_CLIPBOARD)
3933 return EINA_FALSE;
3934
3935 _win32_elm_cnp_init();
3936
3937 sel = _win32_selections + selection;
3938
3939 if (sel->requestwidget)
3940 evas_object_event_callback_del_full(sel->requestwidget, EVAS_CALLBACK_DEL,
3941 _win32_sel_obj_del2, sel);
3942 sel->requestformat = format;
3943 sel->requestwidget = (Evas_Object *)obj;
3944 sel->win = win;
3945 sel->get(win, &data, &size);
3946 sel->datacb = datacb;
3947 sel->udata = udata;
3948
3949 if (!data || (size <= 0))
3950 goto cb_add;
3951
3952 if ((sel->format & ELM_SEL_FORMAT_MARKUP) ||
3953 (sel->format & ELM_SEL_FORMAT_HTML))
3954 {
3955 char *str;
3956
3957 str = (char *)malloc(size + 1);
3958 if (str)
3959 {
3960 memcpy(str, data, size);
3961 str[size] = '\0';
3962 data = _elm_util_mkup_to_text(str);
3963 free(str);
3964 if (data)
3965 size = strlen(data);
3966 else
3967 size = 0;
3968 }
3969 else
3970 {
3971 free(data);
3972 data = NULL;
3973 }
3974 }
3975
3976 if (sel->datacb && data && (size > 0))
3977 {
3978 Elm_Selection_Data sdata;
3979
3980 sdata.x = sdata.y = 0;
3981 sdata.format = ELM_SEL_FORMAT_TEXT;
3982 sdata.data = data;
3983 sdata.len = size;
3984 sdata.action = sel->action;
3985 sel->datacb(sel->udata, sel->requestwidget, &sdata);
3986 }
3987
3988 if (data)
3989 free(data);
3990
3991 cb_add:
3992 evas_object_event_callback_add
3993 (sel->requestwidget, EVAS_CALLBACK_DEL, _win32_sel_obj_del2, sel);
3994
3995 return EINA_TRUE;
3996}
3997
3998#endif /* HAVE_ELEMENTARY_WIN32 */
3999
3686// common internal funcs 4000// common internal funcs
3687//////////////////////////////////////////////////////////////////////////// 4001////////////////////////////////////////////////////////////////////////////
3688static Eina_Bool 4002static Eina_Bool
@@ -3823,6 +4137,13 @@ elm_cnp_selection_set(Evas_Object *obj, Elm_Sel_Type selection,
3823 if (_wl_elm_widget_window_get(obj)) 4137 if (_wl_elm_widget_window_get(obj))
3824 return _wl_elm_cnp_selection_set(obj, selection, format, selbuf, buflen); 4138 return _wl_elm_cnp_selection_set(obj, selection, format, selbuf, buflen);
3825#endif 4139#endif
4140#ifdef HAVE_ELEMENTARY_WIN32
4141 Ecore_Win32_Window *win;
4142
4143 win = _win32_elm_widget_window_get(obj);
4144 if (win)
4145 return _win32_elm_cnp_selection_set(win, obj, selection, format, selbuf, buflen);
4146#endif
3826 return _local_elm_cnp_selection_set(obj, selection, format, selbuf, buflen); 4147 return _local_elm_cnp_selection_set(obj, selection, format, selbuf, buflen);
3827} 4148}
3828 4149
@@ -3841,6 +4162,10 @@ elm_cnp_selection_loss_callback_set(Evas_Object *obj, Elm_Sel_Type selection,
3841 if (_wl_elm_widget_window_get(obj)) 4162 if (_wl_elm_widget_window_get(obj))
3842 _wl_elm_cnp_selection_loss_callback_set(obj, selection, func, data); 4163 _wl_elm_cnp_selection_loss_callback_set(obj, selection, func, data);
3843#endif 4164#endif
4165#ifdef HAVE_ELEMENTARY_WIN32
4166 if (_win32_elm_widget_window_get(obj))
4167 _win32_elm_cnp_selection_loss_callback_set(obj, selection, func, data);
4168#endif
3844 _local_elm_cnp_selection_loss_callback_set(obj, selection, func, data); 4169 _local_elm_cnp_selection_loss_callback_set(obj, selection, func, data);
3845} 4170}
3846 4171
@@ -3857,6 +4182,13 @@ elm_object_cnp_selection_clear(Evas_Object *obj, Elm_Sel_Type selection)
3857 if (_wl_elm_widget_window_get(obj)) 4182 if (_wl_elm_widget_window_get(obj))
3858 return _wl_elm_cnp_selection_clear(obj, selection); 4183 return _wl_elm_cnp_selection_clear(obj, selection);
3859#endif 4184#endif
4185#ifdef HAVE_ELEMENTARY_WIN32
4186 Ecore_Win32_Window *win;
4187
4188 win = _win32_elm_widget_window_get(obj);
4189 if (win)
4190 return _win32_elm_object_cnp_selection_clear(win, obj, selection);
4191#endif
3860 return _local_elm_object_cnp_selection_clear(obj, selection); 4192 return _local_elm_object_cnp_selection_clear(obj, selection);
3861} 4193}
3862 4194
@@ -3875,6 +4207,13 @@ elm_cnp_selection_get(const Evas_Object *obj, Elm_Sel_Type selection,
3875 if (_wl_elm_widget_window_get(obj)) 4207 if (_wl_elm_widget_window_get(obj))
3876 return _wl_elm_cnp_selection_get(obj, selection, format, datacb, udata); 4208 return _wl_elm_cnp_selection_get(obj, selection, format, datacb, udata);
3877#endif 4209#endif
4210#ifdef HAVE_ELEMENTARY_WIN32
4211 Ecore_Win32_Window *win;
4212
4213 win = _win32_elm_widget_window_get(obj);
4214 if (win)
4215 return _win32_elm_cnp_selection_get(win, obj, selection, format, datacb, udata);
4216#endif
3878 return _local_elm_cnp_selection_get(obj, selection, format, datacb, udata); 4217 return _local_elm_cnp_selection_get(obj, selection, format, datacb, udata);
3879} 4218}
3880 4219
diff --git a/src/lib/elm_config.c b/src/lib/elm_config.c
index 29ef12de6..2e7c8df54 100644
--- a/src/lib/elm_config.c
+++ b/src/lib/elm_config.c
@@ -3350,7 +3350,7 @@ _elm_config_file_monitor_cb(void *data EINA_UNUSED,
3350void 3350void
3351_elm_config_sub_init(void) 3351_elm_config_sub_init(void)
3352{ 3352{
3353#if defined(HAVE_ELEMENTARY_X) || defined(HAVE_ELEMENTARY_WAYLAND) 3353#if defined(HAVE_ELEMENTARY_X) || defined(HAVE_ELEMENTARY_WAYLAND) || defined(HAVE_ELEMENTARY_WIN32)
3354 const char *ev = getenv("ELM_DISPLAY"); 3354 const char *ev = getenv("ELM_DISPLAY");
3355#endif 3355#endif
3356 3356
@@ -3416,6 +3416,9 @@ _elm_config_sub_init(void)
3416 ecore_wl_init(NULL); 3416 ecore_wl_init(NULL);
3417 } 3417 }
3418#endif 3418#endif
3419#ifdef HAVE_ELEMENTARY_WIN32
3420 ecore_win32_init();
3421#endif
3419 char buf[PATH_MAX]; 3422 char buf[PATH_MAX];
3420 size_t len; 3423 size_t len;
3421 int ok = 0; 3424 int ok = 0;
diff --git a/src/lib/elm_priv.h b/src/lib/elm_priv.h
index be92f1513..bf226cb8c 100644
--- a/src/lib/elm_priv.h
+++ b/src/lib/elm_priv.h
@@ -12,6 +12,9 @@
12#ifdef HAVE_ELEMENTARY_DRM 12#ifdef HAVE_ELEMENTARY_DRM
13#include <Ecore_Drm.h> 13#include <Ecore_Drm.h>
14#endif 14#endif
15#ifdef HAVE_ELEMENTARY_WIN32
16#include <Ecore_Win32.h>
17#endif
15 18
16#include <Eio.h> 19#include <Eio.h>
17 20
diff --git a/src/lib/elm_win.c b/src/lib/elm_win.c
index a1d38cc91..e5bb1357b 100644
--- a/src/lib/elm_win.c
+++ b/src/lib/elm_win.c
@@ -118,6 +118,12 @@ struct _Elm_Win_Data
118 Eina_Bool opaque_dirty : 1; 118 Eina_Bool opaque_dirty : 1;
119 } wl; 119 } wl;
120#endif 120#endif
121#ifdef HAVE_ELEMENTARY_WIN32
122 struct
123 {
124 Ecore_Win32_Window *win;
125 } win32;
126#endif
121 127
122 Ecore_Job *deferred_resize_job; 128 Ecore_Job *deferred_resize_job;
123 Ecore_Job *deferred_child_eval_job; 129 Ecore_Job *deferred_child_eval_job;
@@ -2155,6 +2161,36 @@ _elm_win_wlwindow_get(Elm_Win_Data *sd)
2155} 2161}
2156#endif 2162#endif
2157 2163
2164Ecore_Win32_Window *
2165_elm_ee_win32win_get(const Ecore_Evas *ee)
2166{
2167#ifdef HAVE_ELEMENTARY_WIN32
2168 const char *engine_name;
2169
2170 if (!ee) return NULL;
2171
2172 engine_name = ecore_evas_engine_name_get(ee);
2173 if (EINA_UNLIKELY(!engine_name)) return NULL;
2174
2175 if ((!strcmp(engine_name, ELM_SOFTWARE_WIN32)) ||
2176 (!strcmp(engine_name, ELM_SOFTWARE_DDRAW)))
2177 {
2178 return ecore_evas_win32_window_get(ee);
2179 }
2180#else
2181 (void)ee;
2182#endif
2183 return NULL;
2184}
2185
2186#ifdef HAVE_ELEMENTARY_WIN32
2187static void
2188_internal_elm_win_win32window_get(Elm_Win_Data *sd)
2189{
2190 sd->win32.win = _elm_ee_win32win_get(sd->ee);
2191}
2192#endif
2193
2158#ifdef HAVE_ELEMENTARY_X 2194#ifdef HAVE_ELEMENTARY_X
2159static void 2195static void
2160_elm_win_xwin_update(Elm_Win_Data *sd) 2196_elm_win_xwin_update(Elm_Win_Data *sd)
@@ -3717,6 +3753,10 @@ _elm_win_finalize_internal(Eo *obj, Elm_Win_Data *sd, const char *name, Elm_Win_
3717 _elm_win_wlwindow_get(sd); 3753 _elm_win_wlwindow_get(sd);
3718#endif 3754#endif
3719 3755
3756#ifdef HAVE_ELEMENTARY_WIN32
3757 _internal_elm_win_win32window_get(sd);
3758#endif
3759
3720 if ((_elm_config->bgpixmap) 3760 if ((_elm_config->bgpixmap)
3721#ifdef HAVE_ELEMENTARY_X 3761#ifdef HAVE_ELEMENTARY_X
3722 && 3762 &&
@@ -5418,6 +5458,41 @@ _elm_win_wl_window_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
5418 return NULL; 5458 return NULL;
5419} 5459}
5420 5460
5461EAPI Ecore_Win32_Window *
5462elm_win_win32_window_get(const Evas_Object *obj)
5463{
5464 ELM_WIN_CHECK(obj) NULL;
5465 ELM_WIN_DATA_GET_OR_RETURN_VAL(obj, sd, NULL);
5466 const char *engine_name = ecore_evas_engine_name_get(sd->ee);
5467
5468 if (!(engine_name &&
5469 ((!strcmp(engine_name, ELM_SOFTWARE_WIN32)) ||
5470 (!strcmp(engine_name, ELM_SOFTWARE_DDRAW)))))
5471 return NULL;
5472
5473 if (!evas_object_smart_type_check_ptr(obj, MY_CLASS_NAME_LEGACY))
5474 {
5475 Ecore_Evas *ee = ecore_evas_ecore_evas_get(evas_object_evas_get(obj));
5476 return _elm_ee_win32win_get(ee);
5477 }
5478
5479 Ecore_Win32_Window *ret = NULL;
5480 eo_do((Eo *) obj, ret = elm_obj_win_win32_window_get());
5481 return ret;
5482}
5483
5484EOLIAN static Ecore_Win32_Window *
5485_elm_win_win32_window_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
5486{
5487#if HAVE_ELEMENTARY_WIN32
5488 if (sd->win32.win) return sd->win32.win;
5489 if (sd->parent) return elm_win_win32_window_get(sd->parent);
5490#else
5491 (void)sd;
5492#endif
5493 return NULL;
5494}
5495
5421EAPI Eina_Bool 5496EAPI Eina_Bool
5422elm_win_trap_set(const Elm_Win_Trap *t) 5497elm_win_trap_set(const Elm_Win_Trap *t)
5423{ 5498{
@@ -5497,6 +5572,16 @@ _elm_win_window_id_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
5497 if (sd->parent) return (Ecore_Window)elm_win_xwindow_get(sd->parent); 5572 if (sd->parent) return (Ecore_Window)elm_win_xwindow_get(sd->parent);
5498#endif 5573#endif
5499 } 5574 }
5575 else if ((engine_name &&
5576 ((!strcmp(engine_name, ELM_SOFTWARE_WIN32)) ||
5577 (!strcmp(engine_name, ELM_SOFTWARE_DDRAW)))))
5578 {
5579#ifdef HAVE_ELEMENTARY_WIN32
5580 _internal_elm_win_win32window_get(sd);
5581 if (sd->win32.win) return (Ecore_Window)sd->win32.win;
5582 if (sd->parent) return (Ecore_Window)elm_win_win32_window_get(sd->parent);
5583#endif
5584 }
5500 5585
5501 return 0; 5586 return 0;
5502} 5587}
diff --git a/src/lib/elm_win.eo b/src/lib/elm_win.eo
index 45410bb1a..4a2b23876 100644
--- a/src/lib/elm_win.eo
+++ b/src/lib/elm_win.eo
@@ -961,6 +961,16 @@ class Elm.Win (Elm.Widget, Elm_Interface_Atspi_Window,
961 legacy: null; 961 legacy: null;
962 } 962 }
963 } 963 }
964 @property win32_window {
965 get {
966 [[Get the Ecore_Win32_Window of an Evas_Object
967
968 @since 1.16
969 ]]
970 return: Ecore_Win32_Window *; [[The Ecore_Win32_Window of $obj.]]
971 legacy: null;
972 }
973 }
964 @property window_id { 974 @property window_id {
965 get { 975 get {
966 [[Get the Ecore_Window of an Evas_Object 976 [[Get the Ecore_Window of an Evas_Object
diff --git a/src/lib/elm_win_legacy.h b/src/lib/elm_win_legacy.h
index 883b3756d..e9a79da41 100644
--- a/src/lib/elm_win_legacy.h
+++ b/src/lib/elm_win_legacy.h
@@ -197,6 +197,23 @@ EAPI void elm_win_render(Evas_Object *obj);
197 */ 197 */
198EAPI Ecore_Wl_Window *elm_win_wl_window_get(const Evas_Object *obj); 198EAPI Ecore_Wl_Window *elm_win_wl_window_get(const Evas_Object *obj);
199 199
200/* Windows specific call - returns NULL on non-Windows engines */
201/**
202 * Get the Ecore_Win32_Window of an Evas_Object
203 *
204 * Do not use this function if you'd like your application/library be portable.
205 * You have been warned.
206 *
207 * @param obj the object
208 *
209 * @return The Ecore_Win32_Window of @p obj
210 *
211 * @ingroup Win
212 *
213 * @since 1.16
214 */
215EAPI Ecore_Win32_Window *elm_win_win32_window_get(const Evas_Object *obj);
216
200/** 217/**
201 * Set the preferred rotation value. 218 * Set the preferred rotation value.
202 * 219 *