summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-08-18 00:29:02 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-08-23 11:16:45 +0900
commit5cfd6988946dbfe84d348653c1fdcbe3356d50a4 (patch)
tree50833a376a9a1f5e171e282a2624f81c3edc2557
parente9dffa723d82ffd4a4538df1d87232963cd8316f (diff)
win: Remove types socket and fake from EO
Fake: This should never have had the fake_canvas_set API. It already can not work after efl_finalize. And Ecore_Evas isn't part of EO API so it doesn't make sense at this point to try to expose the fake window as part of EO API. Socket: This is the only type of window that implements socket_listen. So we can just move this function to a new subclass. NOTE: Socket & plug are currently broken, even in 1.20 (at least for me)! Ref T5322
-rw-r--r--src/Makefile_Elementary.am2
-rw-r--r--src/lib/elementary/Elementary.h1
-rw-r--r--src/lib/elementary/efl_ui_win.c59
-rw-r--r--src/lib/elementary/efl_ui_win.eo29
-rw-r--r--src/lib/elementary/efl_ui_win_socket.c35
-rw-r--r--src/lib/elementary/efl_ui_win_socket.eo31
-rw-r--r--src/lib/elementary/elm_win_legacy.h25
7 files changed, 123 insertions, 59 deletions
diff --git a/src/Makefile_Elementary.am b/src/Makefile_Elementary.am
index f47d8d041d..a99b24d37e 100644
--- a/src/Makefile_Elementary.am
+++ b/src/Makefile_Elementary.am
@@ -75,6 +75,7 @@ elm_public_eolian_files = \
75 lib/elementary/elm_widget.eo \ 75 lib/elementary/elm_widget.eo \
76 lib/elementary/efl_ui_win.eo \ 76 lib/elementary/efl_ui_win.eo \
77 lib/elementary/efl_ui_win_inlined.eo \ 77 lib/elementary/efl_ui_win_inlined.eo \
78 lib/elementary/efl_ui_win_socket.eo \
78 lib/elementary/elm_widget_item.eo \ 79 lib/elementary/elm_widget_item.eo \
79 lib/elementary/elm_color_item.eo \ 80 lib/elementary/elm_color_item.eo \
80 lib/elementary/elm_dayselector_item.eo \ 81 lib/elementary/elm_dayselector_item.eo \
@@ -666,6 +667,7 @@ lib_elementary_libelementary_la_SOURCES = \
666 lib/elementary/elm_widget.c \ 667 lib/elementary/elm_widget.c \
667 lib/elementary/efl_ui_win.c \ 668 lib/elementary/efl_ui_win.c \
668 lib/elementary/efl_ui_win_inlined.c \ 669 lib/elementary/efl_ui_win_inlined.c \
670 lib/elementary/efl_ui_win_socket.c \
669 lib/elementary/elm_helper.c \ 671 lib/elementary/elm_helper.c \
670 lib/elementary/els_box.c \ 672 lib/elementary/els_box.c \
671 lib/elementary/els_cursor.c \ 673 lib/elementary/els_cursor.c \
diff --git a/src/lib/elementary/Elementary.h b/src/lib/elementary/Elementary.h
index 3c1e44c7bb..08f884c1a8 100644
--- a/src/lib/elementary/Elementary.h
+++ b/src/lib/elementary/Elementary.h
@@ -271,6 +271,7 @@ EAPI extern Elm_Version *elm_version;
271# include <efl_ui_image.eo.h> 271# include <efl_ui_image.eo.h>
272# include <efl_ui_win.eo.h> 272# include <efl_ui_win.eo.h>
273# include <efl_ui_win_inlined.eo.h> 273# include <efl_ui_win_inlined.eo.h>
274# include <efl_ui_win_socket.eo.h>
274# include <efl_ui_text_interactive.eo.h> 275# include <efl_ui_text_interactive.eo.h>
275# include <efl_ui_text.eo.h> 276# include <efl_ui_text.eo.h>
276# include <efl_ui_text_editable.eo.h> 277# include <efl_ui_text_editable.eo.h>
diff --git a/src/lib/elementary/efl_ui_win.c b/src/lib/elementary/efl_ui_win.c
index 59e3c9207c..87cbbbe014 100644
--- a/src/lib/elementary/efl_ui_win.c
+++ b/src/lib/elementary/efl_ui_win.c
@@ -6486,18 +6486,6 @@ _efl_ui_win_stack_pop_to(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
6486 // win32/osx ? 6486 // win32/osx ?
6487} 6487}
6488 6488
6489EOLIAN static Eina_Bool
6490_efl_ui_win_socket_listen(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, const char *svcname, int svcnum, Eina_Bool svcsys)
6491{
6492 if (!sd->ee) return EINA_FALSE;
6493 if (sd->type != EFL_UI_WIN_SOCKET_IMAGE) return EINA_FALSE;
6494
6495 if (!ecore_evas_extn_socket_listen(sd->ee, svcname, svcnum, svcsys))
6496 return EINA_FALSE;
6497
6498 return EINA_TRUE;
6499}
6500
6501EAPI Eina_Bool 6489EAPI Eina_Bool
6502elm_win_trap_set(const Elm_Win_Trap *t) 6490elm_win_trap_set(const Elm_Win_Trap *t)
6503{ 6491{
@@ -7901,16 +7889,6 @@ elm_win_window_id_get(const Evas_Object *obj)
7901 return _elm_win_window_id_get(sd); 7889 return _elm_win_window_id_get(sd);
7902} 7890}
7903 7891
7904EAPI void
7905elm_win_fake_canvas_set(Evas_Object *obj, Ecore_Evas *oee)
7906{
7907 Efl_Ui_Win_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS);
7908 if (!sd) return;
7909
7910 sd->ee = oee;
7911 _elm_win_need_frame_adjust(sd, ecore_evas_engine_name_get(oee));
7912}
7913
7914EAPI Evas_Object * 7892EAPI Evas_Object *
7915elm_win_main_menu_get(Evas_Object *obj) 7893elm_win_main_menu_get(Evas_Object *obj)
7916{ 7894{
@@ -7963,17 +7941,29 @@ elm_win_aspect_get(const Eo *obj)
7963 7941
7964/* legacy APIs */ 7942/* legacy APIs */
7965 7943
7944static void
7945_fake_canvas_set(Evas_Object *obj, Ecore_Evas *oee)
7946{
7947 Efl_Ui_Win_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS);
7948 if (!sd) return;
7949
7950 sd->ee = oee;
7951 _elm_win_need_frame_adjust(sd, ecore_evas_engine_name_get(oee));
7952}
7953
7966EAPI Evas_Object * 7954EAPI Evas_Object *
7967elm_win_add(Evas_Object *parent, const char *name, Elm_Win_Type type) 7955elm_win_add(Evas_Object *parent, const char *name, Elm_Win_Type type)
7968{ 7956{
7969 if (type == ELM_WIN_INLINED_IMAGE) 7957 const Efl_Class *klass = MY_CLASS;
7958
7959 switch ((int) type)
7970 { 7960 {
7971 return efl_add(EFL_UI_WIN_INLINED_CLASS, parent, 7961 case ELM_WIN_INLINED_IMAGE: klass = EFL_UI_WIN_INLINED_CLASS; break;
7972 efl_canvas_object_legacy_ctor(efl_added), 7962 case ELM_WIN_SOCKET_IMAGE: klass = EFL_UI_WIN_SOCKET_CLASS; break;
7973 efl_ui_win_name_set(efl_added, name)); 7963 default: break;
7974 } 7964 }
7975 7965
7976 return efl_add(MY_CLASS, parent, 7966 return efl_add(klass, parent,
7977 efl_canvas_object_legacy_ctor(efl_added), 7967 efl_canvas_object_legacy_ctor(efl_added),
7978 efl_ui_win_name_set(efl_added, name), 7968 efl_ui_win_name_set(efl_added, name),
7979 efl_ui_win_type_set(efl_added, type)); 7969 efl_ui_win_type_set(efl_added, type));
@@ -7984,7 +7974,7 @@ elm_win_fake_add(Ecore_Evas *ee)
7984{ 7974{
7985 return efl_add(MY_CLASS, NULL, 7975 return efl_add(MY_CLASS, NULL,
7986 efl_canvas_object_legacy_ctor(efl_added), 7976 efl_canvas_object_legacy_ctor(efl_added),
7987 elm_win_fake_canvas_set(efl_added, ee), 7977 _fake_canvas_set(efl_added, ee),
7988 efl_ui_win_name_set(efl_added, NULL), 7978 efl_ui_win_name_set(efl_added, NULL),
7989 efl_ui_win_type_set(efl_added, ELM_WIN_FAKE)); 7979 efl_ui_win_type_set(efl_added, ELM_WIN_FAKE));
7990} 7980}
@@ -8169,7 +8159,20 @@ elm_win_keygrab_unset(Elm_Win *obj, const char *key,
8169 EFL_INPUT_MODIFIER_NONE); 8159 EFL_INPUT_MODIFIER_NONE);
8170} 8160}
8171 8161
8162EAPI Eina_Bool
8163elm_win_socket_listen(Efl_Ui_Win *obj, const char *svcname, int svcnum, Eina_Bool svcsys)
8164{
8165 return efl_ui_win_socket_listen(obj, svcname, svcnum, svcsys);
8166}
8167
8172// deprecated 8168// deprecated
8169
8170EAPI void
8171elm_win_fake_canvas_set(Evas_Object *obj EINA_UNUSED, Ecore_Evas *oee EINA_UNUSED)
8172{
8173 ERR("Calling deprecrated function '%s'", __FUNCTION__);
8174}
8175
8173EAPI void 8176EAPI void
8174elm_win_name_set(Evas_Object *obj, const char *name) 8177elm_win_name_set(Evas_Object *obj, const char *name)
8175{ 8178{
diff --git a/src/lib/elementary/efl_ui_win.eo b/src/lib/elementary/efl_ui_win.eo
index f9e61f0b40..f0dd119a61 100644
--- a/src/lib/elementary/efl_ui_win.eo
+++ b/src/lib/elementary/efl_ui_win.eo
@@ -39,18 +39,7 @@ enum Efl.Ui.Win.Type
39 dnd, [[Used to indicate the window is a representation of an object being 39 dnd, [[Used to indicate the window is a representation of an object being
40 dragged across different windows, or even applications. Typically 40 dragged across different windows, or even applications. Typically
41 used with elm_win_override_set().]] 41 used with elm_win_override_set().]]
42 42 /* Some types have been removed from EO. Skipping to 17. */
43 /* FIXME: The below types are to be removed */
44 socket_image = 15, [[The window is rendered onto an image buffer and can be shown
45 other process's plug image object. No actual window is
46 created for this type, instead the window and all of its
47 contents will be rendered to an image buffer and can be
48 shown other process's plug image object.
49 ]]
50 fake = 16, [[This window was created using a pre-existing canvas. The window
51 widget can be deleted, but the canvas must be managed externally.
52 @since 1.13
53 ]]
54 naviframe_basic = 17 [[Used for naviframe style replacement with a back 43 naviframe_basic = 17 [[Used for naviframe style replacement with a back
55 button instead of a close button. 44 button instead of a close button.
56 @since 1.19 45 @since 1.19
@@ -788,22 +777,6 @@ class Efl.Ui.Win (Elm.Widget, Efl.Canvas, Elm.Interface.Atspi.Window,
788 This will try and delete all the windows in the stack that 777 This will try and delete all the windows in the stack that
789 are above the window.]] 778 are above the window.]]
790 } 779 }
791 socket_listen {
792 [[Create a socket to provide the service for Plug widget.]]
793 return: bool; [[$true on success, $false otherwise]]
794 params {
795 @in svcname: string; [[The name of the service to be advertised.
796 Eensure that it is unique (when combined with
797 $svcnum) otherwise creation may fail.]]
798 @in svcnum: int; [[A number (any value, 0 being the common default) to
799 differentiate multiple instances of services with
800 the same name.]]
801 @in svcsys: bool; [[A boolean that if true, specifies to create a
802 system-wide service all users can connect to,
803 otherwise the service is private to the user
804 id that created the service.]]
805 }
806 }
807 activate { 780 activate {
808 [[Activate a window object. 781 [[Activate a window object.
809 782
diff --git a/src/lib/elementary/efl_ui_win_socket.c b/src/lib/elementary/efl_ui_win_socket.c
new file mode 100644
index 0000000000..8c0485a08c
--- /dev/null
+++ b/src/lib/elementary/efl_ui_win_socket.c
@@ -0,0 +1,35 @@
1#ifdef HAVE_CONFIG_H
2# include "elementary_config.h"
3#endif
4
5#define EFL_UI_WIN_PROTECTED
6#define EFL_UI_WIN_SOCKET_PROTECTED
7
8#include <Elementary.h>
9
10#define MY_CLASS EFL_UI_WIN_SOCKET_CLASS
11#define MY_CLASS_NAME "Efl.Ui.Win_Socket"
12
13typedef struct
14{
15} Efl_Ui_Win_Socket_Data;
16
17EOLIAN static Efl_Object *
18_efl_ui_win_socket_efl_object_finalize(Eo *obj, Efl_Ui_Win_Socket_Data *pd EINA_UNUSED)
19{
20 efl_ui_win_type_set(obj, ELM_WIN_SOCKET_IMAGE);
21 obj = efl_finalize(efl_super(obj, MY_CLASS));
22
23 return obj;
24}
25
26EOLIAN static Eina_Bool
27_efl_ui_win_socket_socket_listen(Eo *obj, Efl_Ui_Win_Socket_Data *pd EINA_UNUSED, const char *svcname, int svcnum, Eina_Bool svcsys)
28{
29 Ecore_Evas *ee = ecore_evas_ecore_evas_get(evas_object_evas_get(obj));
30
31 if (!ee) return EINA_FALSE;
32 return ecore_evas_extn_socket_listen(ee, svcname, svcnum, svcsys);
33}
34
35#include "efl_ui_win_socket.eo.c"
diff --git a/src/lib/elementary/efl_ui_win_socket.eo b/src/lib/elementary/efl_ui_win_socket.eo
new file mode 100644
index 0000000000..154ae706f0
--- /dev/null
+++ b/src/lib/elementary/efl_ui_win_socket.eo
@@ -0,0 +1,31 @@
1class Efl.Ui.Win_Socket (Efl.Ui.Win)
2{
3 [[An off-screen window to be displayed in a remote process.
4
5 The window is rendered onto an image buffer to be displayed in another
6 process' plug image object. No actual window is created for this type. The
7 window contents can then be sent over a socket so that another process
8 displays it inside a plug image.
9 ]]
10 methods {
11 socket_listen {
12 [[Create a socket to provide the service for Plug widget.]]
13 return: bool; [[$true on success, $false otherwise]]
14 params {
15 @in svcname: string; [[The name of the service to be advertised.
16 Ensure that it is unique (when combined with
17 $svcnum) otherwise creation may fail.]]
18 @in svcnum: int; [[A number (any value, 0 being the common default)
19 to differentiate multiple instances of services
20 with the same name.]]
21 @in svcsys: bool; [[A boolean that if true, specifies to create a
22 system-wide service all users can connect to,
23 otherwise the service is private to the user
24 id that created the service.]]
25 }
26 }
27 }
28 implements {
29 Efl.Object.finalize;
30 }
31}
diff --git a/src/lib/elementary/elm_win_legacy.h b/src/lib/elementary/elm_win_legacy.h
index eb44321305..591c5164d9 100644
--- a/src/lib/elementary/elm_win_legacy.h
+++ b/src/lib/elementary/elm_win_legacy.h
@@ -68,8 +68,8 @@ typedef Efl_Ui_Win_Type Elm_Win_Type;
68#define ELM_WIN_COMBO EFL_UI_WIN_COMBO 68#define ELM_WIN_COMBO EFL_UI_WIN_COMBO
69#define ELM_WIN_DND EFL_UI_WIN_DND 69#define ELM_WIN_DND EFL_UI_WIN_DND
70#define ELM_WIN_INLINED_IMAGE 14 70#define ELM_WIN_INLINED_IMAGE 14
71#define ELM_WIN_SOCKET_IMAGE EFL_UI_WIN_SOCKET_IMAGE 71#define ELM_WIN_SOCKET_IMAGE 15
72#define ELM_WIN_FAKE EFL_UI_WIN_FAKE 72#define ELM_WIN_FAKE 16 /**< See elm_win_fake_add(). @since 1.13 */
73#define ELM_WIN_NAVIFRAME_BASIC EFL_UI_WIN_NAVIFRAME_BASIC 73#define ELM_WIN_NAVIFRAME_BASIC EFL_UI_WIN_NAVIFRAME_BASIC
74 74
75typedef Efl_Ui_Win_Keyboard_Mode Elm_Win_Keyboard_Mode; 75typedef Efl_Ui_Win_Keyboard_Mode Elm_Win_Keyboard_Mode;
@@ -1028,8 +1028,10 @@ EAPI Evas_Object *elm_win_inlined_image_object_get(const Evas_Object *obj);
1028 * @param[in] oee 1028 * @param[in] oee
1029 * 1029 *
1030 * @ingroup Elm_Win 1030 * @ingroup Elm_Win
1031 *
1032 * @deprecated
1031 */ 1033 */
1032EAPI void elm_win_fake_canvas_set(Evas_Object *obj, Ecore_Evas *oee); 1034EAPI void elm_win_fake_canvas_set(Evas_Object *obj, Ecore_Evas *oee) EINA_DEPRECATED;
1033 1035
1034/** 1036/**
1035 * Get the Ecore_Window of an Evas_Object 1037 * Get the Ecore_Window of an Evas_Object
@@ -1129,3 +1131,20 @@ EAPI Eina_Bool elm_win_keygrab_unset(Elm_Win *obj, const char *key, Evas_Modifie
1129 * @since 1.20 1131 * @since 1.20
1130 */ 1132 */
1131EAPI Evas_Object *elm_win_get(Evas_Object *obj); 1133EAPI Evas_Object *elm_win_get(Evas_Object *obj);
1134
1135/**
1136 * @brief Create a socket to provide the service for Plug widget.
1137 *
1138 * @param[in] svcname The name of the service to be advertised. Eensure that it
1139 * is unique (when combined with @c svcnum) otherwise creation may fail.
1140 * @param[in] svcnum A number (any value, 0 being the common default) to
1141 * differentiate multiple instances of services with the same name.
1142 * @param[in] svcsys A boolean that if true, specifies to create a system-wide
1143 * service all users can connect to, otherwise the service is private to the
1144 * user id that created the service.
1145 *
1146 * @return @c true on success, @c false otherwise
1147 *
1148 * @ingroup Efl_Ui_Win
1149 */
1150EAPI Eina_Bool elm_win_socket_listen(Efl_Ui_Win *obj, const char *svcname, int svcnum, Eina_Bool svcsys);