elm_win_standard: Add elm_win_standard class

This commit adds the Eolian class elm_win_standard.
It is basically a derivation from elm_win that creates a default background.

The intent is to replace the legacy functions elm_win_util_standard_add and
elm_win_util_dialog_add by functions accessible via Eo API functions such as
eo_add and eo_do.

To fully replace an elm_win_util_standard_add call, use:

  eo_add(ELM_WIN_STANDARD_CLASS, NULL,
         elm_obj_win_name_set("example"),
         elm_obj_win_type_set(ELM_WIN_BASIC),
         elm_obj_win_title_set("Example"));
This commit is contained in:
Vitor Sousa 2015-04-17 19:28:51 -03:00
parent 7d21b7beb1
commit 06bfb7cb94
5 changed files with 52 additions and 0 deletions

View File

@ -261,6 +261,7 @@ EAPI extern Elm_Version *elm_version;
#include <elm_video.h>
#include <elm_web.h>
#include <elm_win.h>
#include <elm_win_standard.h>
/* include deprecated calls last of all */
#include <elm_deprecated.h>

View File

@ -385,6 +385,8 @@ elm_win.h \
elm_win_common.h \
elm_win_eo.h \
elm_win_legacy.h \
elm_win_standard.h \
elm_win_standard.eo.h \
elm_helper.h
includesubdir = $(includedir)/elementary-@VMAJ@/
@ -502,6 +504,7 @@ elm_video.c \
elm_web2.c \
elm_widget.c \
elm_win.c \
elm_win_standard.c \
elm_helper.c \
els_box.c \
els_cursor.c \
@ -619,6 +622,7 @@ elm_video.eo \
elm_web.eo \
elm_widget.eo \
elm_win.eo \
elm_win_standard.eo \
elm_widget_item.eo \
elm_color_item.eo \
elm_dayselector_item.eo \
@ -747,6 +751,7 @@ elementaryeolianfiles_DATA = \
elm_video.eo \
elm_web.eo \
elm_win.eo \
elm_win_standard.eo \
elm_widget_item.eo \
elm_color_item.eo \
elm_dayselector_item.eo \

View File

@ -0,0 +1,36 @@
#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 ELM_WIN_STANDARD_CLASS
EOLIAN static Eo *
_elm_win_standard_eo_base_finalize(Eo *obj, void *pd EINA_UNUSED)
{
eo_do_super(obj, MY_CLASS, obj = eo_finalize());
if (!obj)
return NULL;
Evas_Object *bg = eo_add(ELM_BG_CLASS, obj);
if (!bg)
{
ERR("Cannot create background.");
evas_object_del(obj);
return NULL;
}
eo_do(bg, evas_obj_size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND));
eo_do(obj, elm_obj_win_resize_object_add(bg));
eo_do(bg, efl_gfx_visible_set(EINA_TRUE));
return obj;
}
#include "elm_win_standard.eo.c"

View File

@ -0,0 +1,7 @@
class Elm.Win_Standard (Elm.Win)
{
data: null;
implements {
Eo.Base.finalize;
}
}

View File

@ -0,0 +1,3 @@
#ifdef EFL_EO_API_SUPPORT
#include <elm_win_standard.eo.h>
#endif