Remove individual class BETA guards

Summary:
Eolian adds a per-class BETA guard (like EFL_UI_WIN_BETA) to any method tagged
as @beta. This means that any app (and the EFL code) wanting to use BETA features
has to enable them class by class, which is cumbersome.
This commit replaces the individual guards with the global EFL_BETA_API_SUPPORT
guard, so apps only need to define one symbol to access BETA features.

Any usage of the per-class guards has been removed from the EFL code and examples.
When building EFL the global guard is defined by configure, so all EFL methods
already have access to BETA API.
Efl_Core.h and Efl_Ui.h no longer define EFL_BETA_API_SUPPORT. Apps wanting to
use BETA API have to define this symbol before including any EFL header
(It has been added to the examples requiring it).

Test Plan:
make && make check && make examples still work, but there's a lot less #defines
in the code

Reviewers: zmike, bu5hm4n, q66

Reviewed By: q66

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T6788

Differential Revision: https://phab.enlightenment.org/D7924
This commit is contained in:
Xavi Artigas 2019-02-13 11:58:33 +01:00
parent 56f06d21c1
commit 6b7346b7b2
59 changed files with 28 additions and 65 deletions

View File

@ -92,7 +92,7 @@ _gen_func(const Eolian_State *state, const Eolian_Function *fid,
/* this one will never be satisfied in legacy */
if (eolian_function_is_beta(fid))
eina_strbuf_append_printf(buf, "#ifdef %s_BETA\n", cnameu);
eina_strbuf_append(buf, "#ifdef EFL_BETA_API_SUPPORT\n");
/* XXX: is this right? we expose potentially internal stuff into legacy */
if (!legacy && (fsc == EOLIAN_SCOPE_PROTECTED))
eina_strbuf_append_printf(buf, "#ifdef %s_PROTECTED\n", cnameu);
@ -174,10 +174,10 @@ _gen_func(const Eolian_State *state, const Eolian_Function *fid,
}
eina_strbuf_append(buf, ";\n");
if (eolian_function_is_beta(fid))
eina_strbuf_append_printf(buf, "#endif\n");
if (!legacy && (fsc == EOLIAN_SCOPE_PROTECTED))
eina_strbuf_append_printf(buf, "#endif\n");
if (eolian_function_is_beta(fid))
eina_strbuf_append_printf(buf, "#endif /* EFL_BETA_API_SUPPORT */\n");
}
void
@ -267,7 +267,7 @@ events:
if (eolian_event_is_beta(ev))
{
eina_strbuf_append_printf(buf, "\n#ifdef %s_BETA\n", cnameu);
eina_strbuf_append(buf, "#ifdef EFL_BETA_API_SUPPORT\n");
}
if (evs == EOLIAN_SCOPE_PROTECTED)
{
@ -292,7 +292,7 @@ events:
if (evs == EOLIAN_SCOPE_PROTECTED)
eina_strbuf_append(buf, "#endif\n");
if (eolian_event_is_beta(ev))
eina_strbuf_append(buf, "#endif\n");
eina_strbuf_append(buf, "#endif /* EFL_BETA_API_SUPPORT */\n");
eina_stringshare_del(evn);
}

View File

@ -1,3 +1,4 @@
#define EFL_BETA_API_SUPPORT 1
#include <Efl_Core.h>
#include <stdlib.h>
#include <errno.h>

View File

@ -1,3 +1,4 @@
#define EFL_BETA_API_SUPPORT
#include <Efl_Net.h>
#include <Ecore_Getopt.h>

View File

@ -1,3 +1,4 @@
#define EFL_BETA_API_SUPPORT
#include <Efl_Net.h>
#include <Ecore_Getopt.h>
#include <fcntl.h>

View File

@ -1,3 +1,4 @@
#define EFL_BETA_API_SUPPORT
#include <Efl_Core.h>
static void

View File

@ -1,3 +1,4 @@
#define EFL_BETA_API_SUPPORT
#include <Efl_Net.h>
#include <Ecore_Getopt.h>

View File

@ -1,6 +1,7 @@
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#define EFL_BETA_API_SUPPORT
#include <Efl_Net.h>
#include <Ecore_Getopt.h>
#include <ctype.h>

View File

@ -1,3 +1,4 @@
#define EFL_BETA_API_SUPPORT
#include <Efl_Net.h>
#include <Ecore_Getopt.h>
#include <fcntl.h>

View File

@ -1,3 +1,4 @@
#define EFL_BETA_API_SUPPORT
#include <Efl_Net.h>
#include <Ecore_Getopt.h>
#include <fcntl.h>

View File

@ -1,3 +1,4 @@
#define EFL_BETA_API_SUPPORT
#include <Efl_Net.h>
#include <Ecore_Getopt.h>
#include <fcntl.h>

View File

@ -1,3 +1,4 @@
#define EFL_BETA_API_SUPPORT
#include <Efl_Net.h>
#include <Ecore_Getopt.h>
#include <fcntl.h>

View File

@ -1,3 +1,4 @@
#define EFL_BETA_API_SUPPORT
#include <Efl_Net.h>
#include <Ecore_Getopt.h>
#include <fcntl.h>

View File

@ -1,3 +1,4 @@
#define EFL_BETA_API_SUPPORT
#include <Efl_Net.h>
#include <Ecore_Getopt.h>
#include <fcntl.h>

View File

@ -1,3 +1,4 @@
#define EFL_BETA_API_SUPPORT
#include <Efl_Net.h>
#include <Ecore_Getopt.h>
#include <fcntl.h>

View File

@ -1,3 +1,4 @@
#define EFL_BETA_API_SUPPORT
#include <Efl_Net.h>
#include <Ecore_Getopt.h>
#include <fcntl.h>

View File

@ -1,3 +1,4 @@
#define EFL_BETA_API_SUPPORT
#include <Efl_Net.h>
#include <Ecore_Getopt.h>

View File

@ -1,3 +1,4 @@
#define EFL_BETA_API_SUPPORT
#include <Efl_Net.h>
#include <Ecore_Getopt.h>
#include <fcntl.h>

View File

@ -1,3 +1,4 @@
#define EFL_BETA_API_SUPPORT
#include <Efl_Net.h>
#include <Ecore_Getopt.h>
#include <fcntl.h>

View File

@ -1,4 +1,3 @@
#define EFL_GFX_FILTER_BETA
#define EFL_GFX_SIZE_HINT_PROTECTED
#include "edje_private.h"

View File

@ -9,7 +9,6 @@
#define _EDJE_EDIT_EO_CLASS_TYPE
#define EFL_CANVAS_GROUP_PROTECTED
#define EFL_CANVAS_GROUP_BETA
#include "edje_private.h"

View File

@ -40,7 +40,6 @@
#endif
// auto_unref
#define EFL_CANVAS_LAYOUT_BETA
#define EFL_CANVAS_OBJECT_PROTECTED
#define EFL_LAYOUT_CALC_PROTECTED

View File

@ -1,5 +1,4 @@
#define EFL_CANVAS_GROUP_PROTECTED
#define EFL_CANVAS_GROUP_BETA
#define EFL_PART_PROTECTED
#include "edje_private.h"

View File

@ -2,9 +2,7 @@
# include <config.h>
#endif
#define EFL_CANVAS_SCENE_BETA
#define EFL_UI_SCROLLBAR_PROTECTED
#define EFL_UI_SCROLLBAR_BETA
#define EFL_PART_PROTECTED
#include "eo_internal.h"

View File

@ -21,7 +21,6 @@
# include <config.h>
#endif
#define EIO_SENTRY_BETA 1
#include <Eo.h>
#include "Ecore.h"

View File

@ -3,7 +3,6 @@
#endif
#define EFL_ACCESS_ACTION_PROTECTED
#define EFL_ACCESS_ACTION_BETA
#include <Elementary.h>
#include "elm_widget.h"

View File

@ -3,7 +3,6 @@
#endif
#define EFL_ACCESS_COMPONENT_PROTECTED
#define EFL_ACCESS_COMPONENT_BETA
#define EFL_ACCESS_OBJECT_PROTECTED
#include <Elementary.h>

View File

@ -4,7 +4,6 @@
#define EFL_ACCESS_ACTION_PROTECTED
#define EFL_ACCESS_WIDGET_ACTION_PROTECTED
#define EFL_ACCESS_ACTION_BETA
#include <Elementary.h>
#include "elm_widget.h"

View File

@ -3,7 +3,6 @@
#endif
#define EFL_UI_POPUP_PROTECTED
#define EFL_UI_ANCHOR_POPUP_BETA
#include <Elementary.h>

View File

@ -7,7 +7,6 @@
#define ELM_INTERFACE_ATSPI_TEXT_EDITABLE_PROTECTED
#define ELM_LAYOUT_PROTECTED
#define EFL_UI_SELECTION_MANAGER_BETA
#include <Elementary.h>
#include <Elementary_Cursor.h>

View File

@ -5,7 +5,6 @@
#define ELM_LAYOUT_PROTECTED
#define EFL_UI_SCROLL_MANAGER_PROTECTED
#define EFL_UI_SCROLLBAR_PROTECTED
#define EFL_UI_SCROLLBAR_BETA
#include <Elementary.h>
#include "elm_priv.h"

View File

@ -6,7 +6,6 @@
#define EFL_ACCESS_WIDGET_ACTION_PROTECTED
#define EFL_UI_SCROLL_MANAGER_PROTECTED
#define EFL_UI_SCROLLBAR_PROTECTED
#define EFL_UI_SCROLLBAR_BETA
#include <Elementary.h>

View File

@ -5,7 +5,6 @@
#define ELM_LAYOUT_PROTECTED
#define EFL_UI_SCROLL_MANAGER_PROTECTED
#define EFL_UI_SCROLLBAR_PROTECTED
#define EFL_UI_SCROLLBAR_BETA
#ifdef HAVE_CONFIG_H
# include "elementary_config.h"

View File

@ -5,7 +5,6 @@
#define ELM_LAYOUT_PROTECTED
#define EFL_UI_SCROLL_MANAGER_PROTECTED
#define EFL_UI_SCROLLBAR_PROTECTED
#define EFL_UI_SCROLLBAR_BETA
#include <Elementary.h>
#include "elm_priv.h"

View File

@ -5,7 +5,6 @@
#define EFL_ACCESS_SELECTION_PROTECTED
#define EFL_UI_SCROLL_MANAGER_PROTECTED
#define EFL_UI_SCROLLBAR_PROTECTED
#define EFL_UI_SCROLLBAR_BETA
#define EFL_UI_FOCUS_COMPOSITION_PROTECTED
#define EFL_UI_WIDGET_FOCUS_MANAGER_PROTECTED

View File

@ -2,7 +2,6 @@
# include "elementary_config.h"
#endif
#define EFL_UI_SCROLL_ALERT_POPUP_BETA
#define EFL_PART_PROTECTED
#include <Elementary.h>

View File

@ -4,7 +4,6 @@
#define EFL_UI_SCROLL_MANAGER_PROTECTED
#define EFL_UI_SCROLLBAR_PROTECTED
#define EFL_UI_SCROLLBAR_BETA
#include <Elementary.h>
#include "elm_priv.h"

View File

@ -5,7 +5,6 @@
#define ELM_LAYOUT_PROTECTED
#define EFL_UI_SCROLL_MANAGER_PROTECTED
#define EFL_UI_SCROLLBAR_PROTECTED
#define EFL_UI_SCROLLBAR_BETA
#include <Elementary.h>
#include "elm_priv.h"

View File

@ -2,7 +2,6 @@
# include "elementary_config.h"
#endif
#define EFL_UI_SELECTION_MANAGER_BETA
#include <Elementary.h>
#include "elm_priv.h"

View File

@ -2,7 +2,6 @@
# include "elementary_config.h"
#endif
#define EFL_UI_TAB_BAR_BETA
#include <Elementary.h>
#include "elm_priv.h"

View File

@ -2,7 +2,6 @@
# include "elementary_config.h"
#endif
#define EFL_UI_TAB_BAR_BETA
#include <Elementary.h>
#include "elm_priv.h"

View File

@ -6,7 +6,6 @@
#define EFL_ACCESS_COMPONENT_PROTECTED
#define ELM_WIDGET_PROTECTED
#define ELM_WIDGET_ITEM_PROTECTED
#define EFL_CANVAS_OBJECT_BETA
#define EFL_INPUT_EVENT_PROTECTED
#define EFL_UI_L10N_PROTECTED
#define EFL_UI_FOCUS_OBJECT_PROTECTED

View File

@ -7,13 +7,10 @@
#define EFL_ACCESS_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_L10N_PROTECTED
#define EFL_UI_WIN_INLINED_PROTECTED
#define EFL_UI_FOCUS_OBJECT_PROTECTED
#define EFL_UI_WIN_BETA
#define EFL_CANVAS_SCENE_BETA
#define EFL_UI_WIDGET_FOCUS_MANAGER_PROTECTED
#define EFL_PART_PROTECTED
#define IPA_YLNO_ESU_LANRETNI_MLE

View File

@ -5,7 +5,6 @@
#define EFL_ACCESS_OBJECT_PROTECTED
#define EFL_ACCESS_WIDGET_ACTION_PROTECTED
#define EFL_UI_WIDGET_PROTECTED
//#define EFL_UI_WIDGET_BETA
#define ELM_WIDGET_ITEM_PROTECTED
#define EFL_UI_L10N_PROTECTED
#define EFL_PART_PROTECTED

View File

@ -11,7 +11,6 @@
#define EFL_ACCESS_OBJECT_PROTECTED
#define EFL_ACCESS_WIDGET_ACTION_PROTECTED
#define ELM_INTERFACE_FILESELECTOR_BETA
#define EFL_PART_PROTECTED
#define EFL_UI_FOCUS_COMPOSITION_PROTECTED

View File

@ -3,7 +3,6 @@
#endif
#define EFL_ACCESS_OBJECT_PROTECTED
#define ELM_INTERFACE_FILESELECTOR_BETA
#include <Elementary.h>
#include "Eio_Eo.h"

View File

@ -4,7 +4,6 @@
#endif
#define EFL_ACCESS_OBJECT_PROTECTED
#define ELM_INTERFACE_FILESELECTOR_BETA
#define EFL_PART_PROTECTED
#include <Elementary.h>

View File

@ -11,17 +11,7 @@
#if defined(ELEMENTARY_BUILD) || defined(ELM_INTERNAL_API_ARGESFSDFEFC)
#define EFL_UI_WIDGET_PROTECTED
#define EFL_UI_WIDGET_BETA
#define EFL_CANVAS_OBJECT_PROTECTED
#define EFL_CANVAS_GROUP_PROTECTED
#define EFL_CANVAS_GROUP_BETA
#define EFL_ACCESS_OBJECT_BETA
#define EFL_ACCESS_COMPONENT_BETA
#define EFL_ACCESS_EDITABLE_TEXT_BETA
#define EFL_ACCESS_IMAGE_BETA
#define EFL_ACCESS_SELECTION_BETA
#define EFL_ACCESS_TEXT_BETA
#define EFL_ACCESS_VALUE_BETA
#define EFL_ACCESS_WIDGET_ACTION_BETA
#define EFL_UI_FOCUS_OBJECT_PROTECTED
#endif

View File

@ -10,7 +10,6 @@
#define EFL_ACCESS_TEXT_PROTECTED
#define EFL_ACCESS_EDITABLE_TEXT_PROTECTED
#define EFL_ACCESS_ACTION_BETA
#include "atspi/atspi-constants.h"

View File

@ -2,7 +2,6 @@
# include "elementary_config.h"
#endif
#define ELM_INTERFACE_FILESELECTOR_BETA
#include <Elementary.h>
#include "Eio_Eo.h"

View File

@ -4,7 +4,6 @@
#define EFL_CANVAS_OBJECT_PROTECTED
#define EFL_CANVAS_GROUP_PROTECTED
#define EFL_CANVAS_GROUP_BETA
#include <Evas.h>
#include <Ecore.h>

View File

@ -1,5 +1,3 @@
#define EFL_CANVAS_OBJECT_BETA
#define EVAS_CANVAS_BETA
#include "evas_common_private.h"
#include "evas_private.h"

View File

@ -1,4 +1,3 @@
#define EFL_CANVAS_OBJECT_BETA
#include "evas_image_private.h"
#include "evas_image.eo.h"

View File

@ -1,4 +1,3 @@
#define EVAS_CANVAS_BETA
#define EFL_INPUT_EVENT_PROTECTED
#include "evas_common_private.h"

View File

@ -1,5 +1,4 @@
#define EFL_CANVAS_GROUP_PROTECTED
#define EFL_CANVAS_GROUP_BETA
#include "evas_common_private.h"
#include "evas_private.h"

View File

@ -1,5 +1,4 @@
#define EFL_CANVAS_OBJECT_PROTECTED
#define EFL_CANVAS_OBJECT_BETA
#define EFL_GFX_SIZE_HINT_PROTECTED
#include "evas_common_private.h"

View File

@ -1,5 +1,4 @@
#define EFL_CANVAS_GROUP_PROTECTED
#define EFL_CANVAS_GROUP_BETA
#include "evas_common_private.h"
#include "evas_private.h"

View File

@ -1,6 +1,4 @@
#define EFL_CANVAS_OBJECT_BETA
#define EFL_CANVAS_GROUP_PROTECTED
#define EFL_CANVAS_GROUP_BETA
#include "evas_common_private.h"
#include "evas_private.h"

View File

@ -62,7 +62,6 @@
* @todo write @ref textblock_layout
*/
#define EFL_CANVAS_OBJECT_BETA
#define EFL_CANVAS_FILTER_INTERNAL_PROTECTED
#include "evas_common_private.h"

View File

@ -41,7 +41,7 @@ EWAPI extern long BAZ;
EWAPI const Efl_Class *class_simple_class_get(void);
#ifdef CLASS_SIMPLE_BETA
#ifdef EFL_BETA_API_SUPPORT
/**
* @brief Common desc for a
*
@ -55,9 +55,9 @@ EWAPI const Efl_Class *class_simple_class_get(void);
* @ingroup Class_Simple
*/
EOAPI Eina_Bool efl_canvas_object_simple_a_set(Eo *obj, int value);
#endif
#endif /* EFL_BETA_API_SUPPORT */
#ifdef CLASS_SIMPLE_BETA
#ifdef EFL_BETA_API_SUPPORT
/**
* @brief Common desc for a
*
@ -68,11 +68,11 @@ EOAPI Eina_Bool efl_canvas_object_simple_a_set(Eo *obj, int value);
* @ingroup Class_Simple
*/
EOAPI int efl_canvas_object_simple_a_get(const Eo *obj);
#endif
#endif /* EFL_BETA_API_SUPPORT */
EOAPI void efl_canvas_object_simple_b_set(Eo *obj);
#ifdef CLASS_SIMPLE_BETA
#ifdef EFL_BETA_API_SUPPORT
/**
* @brief comment foo
*
@ -87,7 +87,7 @@ EOAPI void efl_canvas_object_simple_b_set(Eo *obj);
* @ingroup Class_Simple
*/
EOAPI char *efl_canvas_object_simple_foo(Eo *obj, int a, char *b, double *c, int *d);
#endif
#endif /* EFL_BETA_API_SUPPORT */
EOAPI int *efl_canvas_object_simple_bar(Eo *obj, int x);