aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-05-16 21:47:52 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-05-17 10:39:43 +0900
commit093938e5d900ba60d795c7bfdcd745e2815ba1c2 (patch)
treedc8fe380c53c0b78ad3818570188c01ab98bcea6
parentEfl.Ui.Autorepeat: add 'autorepeat' prefix to methods. (diff)
downloadefl-093938e5d900ba60d795c7bfdcd745e2815ba1c2.tar.gz
win: Remove special class Efl.Ui.Win.Standard
All windows should be standard, really. Except when using legacy elm_win_add() or if type_set() was called with a specific type. I dislike type_set... Ref https://phab.enlightenment.org/T5322
-rw-r--r--src/Makefile_Elementary.am3
-rw-r--r--src/bin/elementary/test_bg.c2
-rw-r--r--src/bin/elementary/test_evas_mask.c2
-rw-r--r--src/bin/elementary/test_evas_snapshot.c2
-rw-r--r--src/bin/elementary/test_gfx_filters.c2
-rw-r--r--src/bin/elementary/test_glview.c2
-rw-r--r--src/bin/elementary/test_grid_static.c2
-rw-r--r--src/bin/elementary/test_win_dialog.c6
-rw-r--r--src/lib/elementary/Elementary.h2
-rw-r--r--src/lib/elementary/efl_ui_win.c85
-rw-r--r--src/lib/elementary/efl_ui_win.eo1
-rw-r--r--src/lib/elementary/efl_ui_win_standard.c25
-rw-r--r--src/lib/elementary/efl_ui_win_standard.eo8
-rw-r--r--src/lib/elementary/elm_win_standard.h3
14 files changed, 70 insertions, 75 deletions
diff --git a/src/Makefile_Elementary.am b/src/Makefile_Elementary.am
index db6dfa2b2c..2f55fad000 100644
--- a/src/Makefile_Elementary.am
+++ b/src/Makefile_Elementary.am
@@ -74,7 +74,6 @@ elm_public_eolian_files = \
lib/elementary/elm_web.eo \
lib/elementary/elm_widget.eo \
lib/elementary/efl_ui_win.eo \
- lib/elementary/efl_ui_win_standard.eo \
lib/elementary/elm_widget_item.eo \
lib/elementary/elm_color_item.eo \
lib/elementary/elm_dayselector_item.eo \
@@ -526,7 +525,6 @@ includesub_HEADERS = \
lib/elementary/elm_win_common.h \
lib/elementary/elm_win_eo.h \
lib/elementary/elm_win_legacy.h \
- lib/elementary/elm_win_standard.h \
lib/elementary/elm_helper.h \
lib/elementary/elm_part_helper.h \
$(NULL)
@@ -657,7 +655,6 @@ lib_elementary_libelementary_la_SOURCES = \
lib/elementary/elm_web2.c \
lib/elementary/elm_widget.c \
lib/elementary/efl_ui_win.c \
- lib/elementary/efl_ui_win_standard.c \
lib/elementary/elm_helper.c \
lib/elementary/els_box.c \
lib/elementary/els_cursor.c \
diff --git a/src/bin/elementary/test_bg.c b/src/bin/elementary/test_bg.c
index 300dfd9dc0..dc5c7a22b4 100644
--- a/src/bin/elementary/test_bg.c
+++ b/src/bin/elementary/test_bg.c
@@ -328,7 +328,7 @@ test_bg_window(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
Evas_Object *win, *box;
char buf[PATH_MAX];
- win = efl_add(EFL_UI_WIN_STANDARD_CLASS, NULL,
+ win = efl_add(EFL_UI_WIN_CLASS, NULL,
efl_text_set(efl_added, "Bg EOAPI (Efl.Ui.Win)"),
efl_ui_win_autodel_set(efl_added, EINA_TRUE),
efl_ui_win_alpha_set(efl_added, 1));
diff --git a/src/bin/elementary/test_evas_mask.c b/src/bin/elementary/test_evas_mask.c
index 1cfba27bb7..33b8d9bd42 100644
--- a/src/bin/elementary/test_evas_mask.c
+++ b/src/bin/elementary/test_evas_mask.c
@@ -108,7 +108,7 @@ test_evas_mask(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
Elm_Genlist_Item_Class *itc;
char buf[PATH_MAX];
- win = efl_add(EFL_UI_WIN_STANDARD_CLASS, NULL,
+ win = efl_add(EFL_UI_WIN_CLASS, NULL,
efl_text_set(efl_added, "Evas masking demo"),
efl_ui_win_autodel_set(efl_added, 1));
diff --git a/src/bin/elementary/test_evas_snapshot.c b/src/bin/elementary/test_evas_snapshot.c
index 20a872dbc7..2a32277819 100644
--- a/src/bin/elementary/test_evas_snapshot.c
+++ b/src/bin/elementary/test_evas_snapshot.c
@@ -123,7 +123,7 @@ test_evas_snapshot(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *e
Eo *win, *grid, *o, *snap, *box;
const char *path;
- win = efl_add(EFL_UI_WIN_STANDARD_CLASS, NULL,
+ win = efl_add(EFL_UI_WIN_CLASS, NULL,
efl_text_set(efl_added, "Evas Snapshot"),
efl_ui_win_autodel_set(efl_added, 1));
diff --git a/src/bin/elementary/test_gfx_filters.c b/src/bin/elementary/test_gfx_filters.c
index 600e931ffc..dfa8a084fb 100644
--- a/src/bin/elementary/test_gfx_filters.c
+++ b/src/bin/elementary/test_gfx_filters.c
@@ -325,7 +325,7 @@ test_gfx_filters(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve
{
Eo *win, *box, *box2, *o, *text = NULL, *spinner, *code, *split, *flip, *tb;
- win = efl_add(EFL_UI_WIN_STANDARD_CLASS, NULL,
+ win = efl_add(EFL_UI_WIN_CLASS, NULL,
efl_text_set(efl_added, "Gfx Filter Editor"),
efl_ui_win_autodel_set(efl_added, 1));
diff --git a/src/bin/elementary/test_glview.c b/src/bin/elementary/test_glview.c
index 1a3432ee63..45d9c849a7 100644
--- a/src/bin/elementary/test_glview.c
+++ b/src/bin/elementary/test_glview.c
@@ -641,7 +641,7 @@ _test_glview_do(Evas_GL_Context_Version version)
elm_config_accel_preference_set(accel);
eina_stringshare_del(accel);
#else
- win = efl_add(EFL_UI_WIN_STANDARD_CLASS, NULL,
+ win = efl_add(EFL_UI_WIN_CLASS, NULL,
efl_ui_win_name_set(efl_added, "glview"),
efl_text_set(efl_added, "GLView"),
efl_ui_win_accel_preference_set(efl_added, "gl:depth"));
diff --git a/src/bin/elementary/test_grid_static.c b/src/bin/elementary/test_grid_static.c
index 07aa8e96f2..c424956540 100644
--- a/src/bin/elementary/test_grid_static.c
+++ b/src/bin/elementary/test_grid_static.c
@@ -104,7 +104,7 @@ test_grid_static(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve
Eo *win, *gd, *bt, *rc, *en;
api_data *api = calloc(1, sizeof(*api));
- win = efl_add(EFL_UI_WIN_STANDARD_CLASS, NULL,
+ win = efl_add(EFL_UI_WIN_CLASS, NULL,
efl_ui_win_name_set(efl_added, "grid"),
efl_text_set(efl_added, "Grid"),
efl_ui_win_autodel_set(efl_added, EINA_TRUE),
diff --git a/src/bin/elementary/test_win_dialog.c b/src/bin/elementary/test_win_dialog.c
index ba299b73fb..c49dcf51d1 100644
--- a/src/bin/elementary/test_win_dialog.c
+++ b/src/bin/elementary/test_win_dialog.c
@@ -27,7 +27,7 @@ _bt2_clicked_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_
{
Efl_Canvas_Object *dia, *lb, *parent = data;
- dia = efl_add(EFL_UI_WIN_STANDARD_CLASS, parent,
+ dia = efl_add(EFL_UI_WIN_CLASS, parent,
efl_ui_win_type_set(efl_added, EFL_UI_WIN_DIALOG_BASIC),
efl_ui_win_name_set(efl_added, "window-dia-2"),
efl_ui_win_autodel_set(efl_added, EINA_TRUE),
@@ -76,7 +76,7 @@ _bt3_clicked_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_
{
Efl_Canvas_Object *dia, *lb, *parent = data;
- dia = efl_add(EFL_UI_WIN_STANDARD_CLASS, parent,
+ dia = efl_add(EFL_UI_WIN_CLASS, parent,
efl_ui_win_type_set(efl_added, EFL_UI_WIN_DIALOG_BASIC),
efl_ui_win_name_set(efl_added, "window-dia-3"),
efl_ui_win_autodel_set(efl_added, EINA_TRUE),
@@ -104,7 +104,7 @@ _bt4_clicked_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *even
{
Efl_Canvas_Object *dia, *lb;
- dia = efl_add(EFL_UI_WIN_STANDARD_CLASS, NULL,
+ dia = efl_add(EFL_UI_WIN_CLASS, NULL,
efl_ui_win_type_set(efl_added, EFL_UI_WIN_DIALOG_BASIC),
efl_ui_win_name_set(efl_added, "window-dia-4"),
efl_ui_win_autodel_set(efl_added, EINA_TRUE),
diff --git a/src/lib/elementary/Elementary.h b/src/lib/elementary/Elementary.h
index db56d7e2ce..2b840cf77d 100644
--- a/src/lib/elementary/Elementary.h
+++ b/src/lib/elementary/Elementary.h
@@ -263,7 +263,6 @@ EAPI extern Elm_Version *elm_version;
#include <elm_view_form.h>
#include <elm_web.h>
#include <elm_win.h>
-#include <elm_win_standard.h>
#ifdef EFL_EO_API_SUPPORT
# include <efl_config_global.eo.h>
@@ -274,7 +273,6 @@ EAPI extern Elm_Version *elm_version;
# include <efl_ui_grid_static.eo.h>
# include <efl_ui_image.eo.h>
# include <efl_ui_win.eo.h>
-# include <efl_ui_win_standard.eo.h>
# include <efl_ui_text_interactive.eo.h>
# include <efl_ui_text.eo.h>
# 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 0c7f244501..ed5fa28234 100644
--- a/src/lib/elementary/efl_ui_win.c
+++ b/src/lib/elementary/efl_ui_win.c
@@ -7,6 +7,8 @@
#define ELM_INTERFACE_ATSPI_WIDGET_ACTION_PROTECTED
#define EFL_INPUT_EVENT_PROTECTED
#define EFL_GFX_SIZE_HINT_PROTECTED
+#define EFL_CANVAS_OBJECT_BETA
+#define EFL_CANVAS_OBJECT_PROTECTED
#define EFL_UI_WIN_BETA
#include <Elementary.h>
@@ -242,6 +244,7 @@ struct _Efl_Ui_Win_Data
Eina_Bool forbidden : 1; /**< Marks some legacy APIs as not allowed. */
Eina_Bool bg_must_swallow : 1; /**< Legacy theme compatibility (elm_bg for standard window) */
Eina_Bool bg_must_swallow_init : 1;
+ Eina_Bool ctor : 1; /**< legacy constructor: elm_win~add */
} legacy;
Eina_Bool first_draw : 1;
@@ -4485,21 +4488,6 @@ _elm_x_io_err(void *data EINA_UNUSED)
}
#endif
-EAPI Evas_Object *
-elm_win_add(Evas_Object *parent,
- const char *name,
- Elm_Win_Type type)
-{
- Evas_Object *obj = efl_add(MY_CLASS, parent, efl_ui_win_name_set(efl_added, name), efl_ui_win_type_set(efl_added, type));
- return obj;
-}
-
-EAPI Evas_Object *
-elm_win_fake_add(Ecore_Evas *ee)
-{
- return efl_add(MY_CLASS, NULL, elm_win_fake_canvas_set(efl_added, ee), efl_ui_win_name_set(efl_added, NULL), efl_ui_win_type_set(efl_added, ELM_WIN_FAKE));
-}
-
static void
_elm_win_cb_hide(void *data EINA_UNUSED,
Evas *e EINA_UNUSED,
@@ -5240,18 +5228,37 @@ _elm_win_finalize_internal(Eo *obj, Efl_Ui_Win_Data *sd, const char *name, Elm_W
_elm_win_resize_job(obj);
_elm_win_move(sd->ee);
}
+
+ // All normal windows are "standard" windows with EO API
+ if (!sd->legacy.ctor)
+ {
+ switch (type)
+ {
+ case EFL_UI_WIN_UNKNOWN:
+ case EFL_UI_WIN_BASIC:
+ case EFL_UI_WIN_DIALOG_BASIC:
+ _elm_win_standard_init(obj);
+ break;
+ default: break;
+ }
+ }
+
return obj;
}
EOLIAN static Eo *
-_efl_ui_win_efl_object_finalize(Eo *obj, Efl_Ui_Win_Data *_pd)
+_efl_ui_win_efl_object_finalize(Eo *obj, Efl_Ui_Win_Data *sd)
{
- obj = _elm_win_finalize_internal(obj, _pd, _pd->name, _pd->type);
- if (obj)
- {
- obj = efl_finalize(efl_super(obj, MY_CLASS));
- }
- return obj;
+ obj = _elm_win_finalize_internal(obj, sd, sd->name, sd->type);
+ if (!obj) return NULL;
+ return efl_finalize(efl_super(obj, MY_CLASS));
+}
+
+EOLIAN static void
+_efl_ui_win_efl_canvas_object_legacy_ctor(Eo *obj, Efl_Ui_Win_Data *sd)
+{
+ sd->legacy.ctor = EINA_TRUE;
+ efl_canvas_object_legacy_ctor(efl_super(obj, MY_CLASS));
}
EOLIAN static Eo *
@@ -7828,11 +7835,38 @@ elm_win_aspect_get(const Eo *obj)
/* legacy APIs */
EAPI Evas_Object *
+elm_win_add(Evas_Object *parent, const char *name, Elm_Win_Type type)
+{
+ return efl_add(MY_CLASS, parent,
+ efl_canvas_object_legacy_ctor(efl_added),
+ efl_ui_win_name_set(efl_added, name),
+ efl_ui_win_type_set(efl_added, type));
+}
+
+EAPI Evas_Object *
+elm_win_fake_add(Ecore_Evas *ee)
+{
+ return efl_add(MY_CLASS, NULL,
+ efl_canvas_object_legacy_ctor(efl_added),
+ elm_win_fake_canvas_set(efl_added, ee),
+ efl_ui_win_name_set(efl_added, NULL),
+ efl_ui_win_type_set(efl_added, ELM_WIN_FAKE));
+}
+
+EAPI Evas_Object *
elm_win_util_standard_add(const char *name, const char *title)
{
- return efl_add(EFL_UI_WIN_STANDARD_CLASS, NULL,
- efl_text_set(efl_added, title),
- efl_ui_win_name_set(efl_added, name));
+ Evas_Object *win;
+
+ win = efl_add(EFL_UI_WIN_CLASS, NULL,
+ efl_canvas_object_legacy_ctor(efl_added),
+ efl_text_set(efl_added, title),
+ efl_ui_win_name_set(efl_added, name),
+ efl_ui_win_type_set(efl_added, EFL_UI_WIN_BASIC));
+ if (!win) return NULL;
+
+ _elm_win_standard_init(win);
+ return win;
}
EAPI Evas_Object *
@@ -7841,6 +7875,7 @@ elm_win_util_dialog_add(Evas_Object *parent, const char *name, const char *title
Evas_Object *win;
win = efl_add(EFL_UI_WIN_CLASS, parent,
+ efl_canvas_object_legacy_ctor(efl_added),
efl_text_set(efl_added, title),
efl_ui_win_name_set(efl_added, name),
efl_ui_win_type_set(efl_added, EFL_UI_WIN_DIALOG_BASIC));
diff --git a/src/lib/elementary/efl_ui_win.eo b/src/lib/elementary/efl_ui_win.eo
index b99aa757fd..8d1f2aa065 100644
--- a/src/lib/elementary/efl_ui_win.eo
+++ b/src/lib/elementary/efl_ui_win.eo
@@ -966,6 +966,7 @@ class Efl.Ui.Win (Elm.Widget, Efl.Canvas, Elm.Interface.Atspi.Window,
Efl.Container.content { get; set; }
Efl.Container.content_unset;
Efl.Part.part;
+ Efl.Canvas.Object.legacy_ctor;
}
constructors {
.name;
diff --git a/src/lib/elementary/efl_ui_win_standard.c b/src/lib/elementary/efl_ui_win_standard.c
deleted file mode 100644
index e35ee304a0..0000000000
--- a/src/lib/elementary/efl_ui_win_standard.c
+++ /dev/null
@@ -1,25 +0,0 @@
-#ifdef HAVE_CONFIG_H
-# include "elementary_config.h"
-#endif
-
-#define ELM_INTERFACE_ATSPI_ACCESSIBLE_PROTECTED
-#define ELM_INTERFACE_ATSPI_WIDGET_ACTION_PROTECTED
-#define ELM_WIN_PROTECTED
-
-#include <Elementary.h>
-
-#include "elm_priv.h"
-
-#define MY_CLASS EFL_UI_WIN_STANDARD_CLASS
-
-EOLIAN static Eo *
-_efl_ui_win_standard_efl_object_finalize(Eo *obj, void *pd EINA_UNUSED)
-{
- obj = efl_finalize(efl_super(obj, MY_CLASS));
- if (!obj) return NULL;
-
- _elm_win_standard_init(obj);
- return obj;
-}
-
-#include "efl_ui_win_standard.eo.c"
diff --git a/src/lib/elementary/efl_ui_win_standard.eo b/src/lib/elementary/efl_ui_win_standard.eo
deleted file mode 100644
index ef4d790697..0000000000
--- a/src/lib/elementary/efl_ui_win_standard.eo
+++ /dev/null
@@ -1,8 +0,0 @@
-class Efl.Ui.Win.Standard (Efl.Ui.Win)
-{
- [[Efl UI standard window class]]
- data: null;
- implements {
- Efl.Object.finalize;
- }
-}
diff --git a/src/lib/elementary/elm_win_standard.h b/src/lib/elementary/elm_win_standard.h
deleted file mode 100644
index 3de5ce4a36..0000000000
--- a/src/lib/elementary/elm_win_standard.h
+++ /dev/null
@@ -1,3 +0,0 @@
-#ifdef EFL_EO_API_SUPPORT
-#include <efl_ui_win_standard.eo.h>
-#endif