diff options
author | Luciana Magno de Almeida <luciana@expertisesolutions.com.br> | 2014-12-16 19:04:43 -0200 |
---|---|---|
committer | Felipe Magno de Almeida <felipe@expertisesolutions.com.br> | 2015-08-25 03:42:34 -0300 |
commit | cf4d84c85b48d32fd85deeafdc7aee4543875725 (patch) | |
tree | 0c5c7a61507819bff113eb8ee8883c7026f33465 /src/examples/icon_cxx_example_01.cc | |
parent | dfb979950cfcebc21d1b0e933d4f02ab2084e304 (diff) | |
download | elementary-cf4d84c85b48d32fd85deeafdc7aee4543875725.tar.gz |
cxx: Added examples and tutorial for C++ binding
Summary:
Added the following examples:
* bg_cxx_example_01
* bg_cxx_example_02
* bubble_cxx_example_01
* button_cxx_example_00
* button_cxx_example_01
* calendar_cxx_example_01
* calendar_cxx_example_02
* calendar_cxx_example_03
* calendar_cxx_example_04
* calendar_cxx_example_05
* clock_cxx_example
* datetime_cxx_example
* glview_cxx_example_01
* hoversel_cxx_example_01
* icon_cxx_example_01
* location_cxx_example_01
* menu_cxx_example_01
* popup_cxx_example_01
* radio_cxx_example_01
* separator_cxx_example_01
* slider_cxx_example
* spinner_cxx_example
* table_cxx_example_01
* table_cxx_example_02
* thumb_cxx_example_01
Added documentation for the above examples, as well as how using lambdas
with C++ elm binding. How to use autohide feature and how to use the C++
wrappers to create windows, widgets and call Eo functions from them with
automatic C++ type conversion and how to use signals from C++.
Diffstat (limited to 'src/examples/icon_cxx_example_01.cc')
-rw-r--r-- | src/examples/icon_cxx_example_01.cc | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/examples/icon_cxx_example_01.cc b/src/examples/icon_cxx_example_01.cc new file mode 100644 index 000000000..399c080bb --- /dev/null +++ b/src/examples/icon_cxx_example_01.cc @@ -0,0 +1,38 @@ +#include <Elementary.hh> + +EAPI_MAIN int +elm_main (int argc, char *argv[]) +{ + elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN); + + ::elm::win win(elm_win_util_standard_add("icon", "Icon")); + win.autohide_set(true); + + ::elm::icon icon(efl::eo::parent = win); + icon.order_lookup_set(ELM_ICON_LOOKUP_THEME_FDO); + icon.standard_set("home"); + + const char *path, *group; + icon.file_get(&path, &group); + std::cout << "path = " << path << ", group = "<< group; + + efl::eina::optional<std::string> name; + name = icon.standard_get(); + std::cout << ", name = " << *name << std::endl; + + icon.no_scale_set(true); + icon.resizable_set(false, true); + icon.smooth_set(false); + icon.fill_outside_set(true); + + icon.size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + win.resize_object_add(icon); + icon.visible_set(true); + + win.size_set(320, 320); + win.visible_set(true); + + elm_run(); + return 0; +} +ELM_MAIN() |