2017-09-26 03:44:36 -07:00
|
|
|
/* To compile:
|
|
|
|
* g++ `pkg-config --cflags --libs elementary-cxx eo-cxx efl-cxx eina-cxx ecore-cxx evas-cxx edje-cxx` ./bg_cxx_example_02.cc -o bg_cxx_example_02
|
|
|
|
*
|
|
|
|
* To run:
|
|
|
|
* ./bg_cxx_example_02
|
|
|
|
*/
|
|
|
|
|
2017-11-22 00:17:04 -08:00
|
|
|
#define EFL_CXXPERIMENTAL
|
2019-07-09 01:13:27 -07:00
|
|
|
#ifndef EFL_BETA_API_SUPPORT
|
2019-03-11 08:34:45 -07:00
|
|
|
#define EFL_BETA_API_SUPPORT
|
2019-07-09 01:13:27 -07:00
|
|
|
#endif
|
2017-11-22 00:17:04 -08:00
|
|
|
|
2019-05-02 11:08:04 -07:00
|
|
|
#include <Efl_Ui.hh>
|
2014-12-16 13:04:43 -08:00
|
|
|
|
2017-11-12 18:43:04 -08:00
|
|
|
using efl::eo::instantiate;
|
2014-12-16 13:04:43 -08:00
|
|
|
|
2017-11-22 21:10:24 -08:00
|
|
|
static efl::ui::Win win;
|
2017-09-11 11:12:30 -07:00
|
|
|
|
2017-11-12 18:43:04 -08:00
|
|
|
EAPI_MAIN void
|
2017-11-22 21:10:24 -08:00
|
|
|
efl_main(void *data EINA_UNUSED, const Efl_Event *ev)
|
2017-11-12 18:43:04 -08:00
|
|
|
{
|
2017-11-22 21:10:24 -08:00
|
|
|
Efl_Loop_Arguments *args = static_cast<Efl_Loop_Arguments *>(ev->info);
|
|
|
|
|
2017-11-22 00:17:04 -08:00
|
|
|
win = efl::ui::Win(instantiate);
|
2017-09-26 03:44:36 -07:00
|
|
|
win.text_set("Bg Image");
|
2014-12-16 13:04:43 -08:00
|
|
|
win.autohide_set(true);
|
2017-11-22 21:10:24 -08:00
|
|
|
win.delete_request_event_cb_add([](){ win = nullptr; efl_exit(0); });
|
|
|
|
|
|
|
|
std::string path;
|
|
|
|
if (eina_array_count(args->argv) > 0)
|
|
|
|
path = static_cast<const char *>(eina_array_data_get(args->argv, 0));
|
|
|
|
else
|
|
|
|
path = "performance/background.png";
|
2014-12-16 13:04:43 -08:00
|
|
|
|
efl_ui_bg: remove Efl.Ui.Bg interface and rename Efl.Ui.Bg_Widget class
Summary:
Efl.Ui.Bg interface does not have any new property or method.
Moreover, Efl.Ui.Bg interface is not used by widgets except
Efl.Ui.Bg_Widget and Efl.Ui.Widget_Part_Bg.
Consequently, Efl.Ui.Bg interface can be replaced by other interfaces.
Due to Efl.Ui.Bg interface, the bg widget class name becomes
Efl.UI.Bg_Widget which is not synchronized with other widget names.
Therefore, to keep consistency with other widgets, it would be better to
remove Efl.Ui.Bg interface and rename Efl.Ui.Bg_Widget to Efl.Ui.Bg.
Reviewers: woohyun, segfaultxavi, bu5hm4n, zmike
Reviewed By: segfaultxavi
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D7304
2018-11-19 17:24:05 -08:00
|
|
|
efl::ui::Bg bg(instantiate, win);
|
2019-09-16 02:06:02 -07:00
|
|
|
bg.scale_method_set(EFL_GFX_IMAGE_SCALE_METHOD_FILL);
|
2019-02-27 10:17:09 -08:00
|
|
|
bg.file_set(path);
|
|
|
|
bg.load();
|
2017-09-26 03:44:36 -07:00
|
|
|
win.content_set(bg);
|
2014-12-16 13:04:43 -08:00
|
|
|
|
2017-11-12 18:43:04 -08:00
|
|
|
win.size_set({640, 400});
|
2014-12-16 13:04:43 -08:00
|
|
|
}
|
2017-11-12 18:43:04 -08:00
|
|
|
EFL_MAIN()
|