diff options
author | Slava Barinov <v.barinov@samsung.com> | 2016-04-13 15:17:34 +0300 |
---|---|---|
committer | Slava Barinov <v.barinov@samsung.com> | 2016-04-13 15:28:39 +0300 |
commit | b2a43e9c05e0da1a9b9c33fb691a9e8753f9a738 (patch) | |
tree | 3e6d647928125b5a014cfedb944d0336540ae5a4 | |
parent | d358f8024bfdb1af060ad08db861bc08e1008d5d (diff) | |
download | app-core-sandbox/vbarinov/vis.tar.gz app-core-sandbox/vbarinov/vis.tar.bz2 app-core-sandbox/vbarinov/vis.zip |
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
-rw-r--r-- | CMakeLists.txt | 4 | ||||
-rw-r--r-- | include/appcore-common.h | 31 | ||||
-rw-r--r-- | include/appcore-efl.h | 15 | ||||
-rw-r--r-- | include/appcore-internal.h | 29 |
4 files changed, 47 insertions, 32 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 75894a0..e0ed4fb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,8 +11,9 @@ SET(VERSION "${VERSION_MAJOR}.1") INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include) ADD_DEFINITIONS("-DPREFIX=\"${PREFIX}\"") +ADD_DEFINITIONS("-DEXPORT_API=__attribute__((visibility(\"default\")))") -SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fvisibility=hidden") +SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fvisibility=hidden -flto") SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -g -Wall") SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -Wl,--as-needed") SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -Werror") @@ -109,4 +110,3 @@ INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${APPCORE_EFL}.pc DESTINATION ${LIB_IN FOREACH(hfile ${HEADERS_efl}) INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/${hfile} DESTINATION include/appcore) ENDFOREACH(hfile) - diff --git a/include/appcore-common.h b/include/appcore-common.h index a130336..c4ab26f 100644 --- a/include/appcore-common.h +++ b/include/appcore-common.h @@ -63,6 +63,11 @@ extern "C" { * System global events related to the application * @see appcore_set_event_callback() */ + +#ifndef EXPORT_API +#define EXPORT_API +#endif /* EXPORT_API */ + enum appcore_event { APPCORE_EVENT_UNKNOWN, /**< Unknown event */ @@ -209,7 +214,7 @@ int add_callbacks(struct appdata *data) * @endcode * */ -int appcore_set_event_callback(enum appcore_event event, +EXPORT_API int appcore_set_event_callback(enum appcore_event event, int (*cb)(void *, void *), void *data); /** @@ -264,7 +269,7 @@ static int _rot_cb(enum appcore_rm, void *); * @endcode * */ -int appcore_set_rotation_cb(int (*cb) (void *event_info, enum appcore_rm, void *), +EXPORT_API int appcore_set_rotation_cb(int (*cb) (void *event_info, enum appcore_rm, void *), void *data); /** @@ -301,7 +306,7 @@ int appcore_set_rotation_cb(int (*cb) (void *event_info, enum appcore_rm, void * * @endcode * */ -int appcore_unset_rotation_cb(void); +EXPORT_API int appcore_unset_rotation_cb(void); /** * @par Description: @@ -347,7 +352,7 @@ int appcore_unset_rotation_cb(void); * @endcode * */ -int appcore_get_rotation_state(enum appcore_rm *curr); +EXPORT_API int appcore_get_rotation_state(enum appcore_rm *curr); /** * @par Description: @@ -393,7 +398,7 @@ int appcore_get_rotation_state(enum appcore_rm *curr); * @endcode * */ -int appcore_get_timeformat(enum appcore_time_format *timeformat); +EXPORT_API int appcore_get_timeformat(enum appcore_time_format *timeformat); /** * @par Description: @@ -444,7 +449,7 @@ int appcore_get_timeformat(enum appcore_time_format *timeformat); * @endcode * */ -int appcore_set_i18n(const char *domainname, const char *dirname); +EXPORT_API int appcore_set_i18n(const char *domainname, const char *dirname); /** * @par Description: @@ -485,7 +490,7 @@ int appcore_set_i18n(const char *domainname, const char *dirname); * @endcode * */ -void appcore_measure_start(void); +EXPORT_API void appcore_measure_start(void); /** * @par Description: @@ -530,7 +535,7 @@ void appcore_measure_start(void); * @endcode * */ -int appcore_measure_time(void); +EXPORT_API int appcore_measure_time(void); /** * @par Description: @@ -579,7 +584,7 @@ int appcore_measure_time(void); * @endcode * */ -int appcore_measure_time_from(const char *envnm); +EXPORT_API int appcore_measure_time_from(const char *envnm); /** * Appcore UI operaions. Internal use only. @@ -610,7 +615,7 @@ struct ui_ops; * @remarks Internal use only. * */ -int appcore_init(const char *name, const struct ui_ops *ops, +EXPORT_API int appcore_init(const char *name, const struct ui_ops *ops, int argc, char **argv); /** @@ -626,7 +631,7 @@ int appcore_init(const char *name, const struct ui_ops *ops, * @remarks Internal use only. * */ -void appcore_exit(void); +EXPORT_API void appcore_exit(void); /** @@ -673,7 +678,7 @@ void appcore_exit(void); * @endcode * */ -int appcore_flush_memory(void); +EXPORT_API int appcore_flush_memory(void); /** * @par Description: @@ -712,7 +717,7 @@ static int _open_cb(enum appcore_rm, void *); * @endcode * */ -int appcore_set_open_cb(int (*cb) (void *), void *data); +EXPORT_API int appcore_set_open_cb(int (*cb) (void *), void *data); #ifdef __cplusplus diff --git a/include/appcore-efl.h b/include/appcore-efl.h index f3ab3b6..9077082 100644 --- a/include/appcore-efl.h +++ b/include/appcore-efl.h @@ -52,10 +52,15 @@ extern "C" { #endif -int appcore_efl_init(const char *name, int *argc, char ***argv, +#ifndef EXPORT_API +#define EXPORT_API +#endif /* EXPORT_API */ + + +EXPORT_API int appcore_efl_init(const char *name, int *argc, char ***argv, struct appcore_ops *ops); -void appcore_efl_fini(void); +EXPORT_API void appcore_efl_fini(void); /** @@ -123,7 +128,7 @@ int main(int argc, char *argv[]) * @endcode * */ -int appcore_efl_main(const char *name, int *argc, char ***argv, +EXPORT_API int appcore_efl_main(const char *name, int *argc, char ***argv, struct appcore_ops *ops); /** @@ -162,9 +167,9 @@ int _create(void *data) * @endcode * */ -int appcore_set_system_resource_reclaiming(bool enable); +EXPORT_API int appcore_set_system_resource_reclaiming(bool enable); -int appcore_set_preinit_window_name(const char *win_name); +EXPORT_API int appcore_set_preinit_window_name(const char *win_name); #ifdef __cplusplus } diff --git a/include/appcore-internal.h b/include/appcore-internal.h index 7bd3db8..2760bcc 100644 --- a/include/appcore-internal.h +++ b/include/appcore-internal.h @@ -94,6 +94,11 @@ /** * Appcore internal state */ + +#ifndef EXPORT_API +#define EXPORT_API +#endif /* EXPORT_API */ + enum app_state { AS_NONE, AS_CREATED, @@ -163,20 +168,20 @@ struct ui_ops { }; /* appcore-i18n.c */ -extern void update_lang(void); -extern int set_i18n(const char *domainname, const char *dirname); -void update_region(void); +EXPORT_API extern void update_lang(void); +EXPORT_API extern int set_i18n(const char *domainname, const char *dirname); +EXPORT_API void update_region(void); /* appcore-X.c */ -extern int x_raise_win(pid_t pid); -extern int x_pause_win(pid_t pid); +EXPORT_API extern int x_raise_win(pid_t pid); +EXPORT_API extern int x_pause_win(pid_t pid); /* appcore-util.c */ /* extern void stack_trim(void);*/ -int appcore_pause_rotation_cb(void); -int appcore_resume_rotation_cb(void); +EXPORT_API int appcore_pause_rotation_cb(void); +EXPORT_API int appcore_resume_rotation_cb(void); struct ui_wm_rotate { int (*set_rotation_cb) (int (*cb)(void *event_info, enum appcore_rm, void *), void *data); @@ -185,15 +190,15 @@ struct ui_wm_rotate { int (*pause_rotation_cb) (void); int (*resume_rotation_cb) (void); }; -int appcore_set_wm_rotation(struct ui_wm_rotate* wm_rotate); +EXPORT_API int appcore_set_wm_rotation(struct ui_wm_rotate* wm_rotate); -void appcore_group_attach(); -void appcore_group_lower(); -unsigned int appcore_get_main_window(void); +EXPORT_API void appcore_group_attach(); +EXPORT_API void appcore_group_lower(); +EXPORT_API unsigned int appcore_get_main_window(void); #if defined(WAYLAND) unsigned int appcore_get_main_surface(void); #endif -void appcore_get_app_core(struct appcore **ac); +EXPORT_API void appcore_get_app_core(struct appcore **ac); #ifdef _APPFW_FEATURE_BACKGROUND_MANAGEMENT int _appcore_init_suspend_dbus_handler(void *data); #endif |