summaryrefslogtreecommitdiff
path: root/src/examples/icon_cxx_example_01.cc
blob: f06992bc4aa2b000b14ed9522c3a1cba6cc6cca9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
extern "C"
{
#ifdef HAVE_CONFIG_H
# include <elementary_config.h>
#endif

#define ELM_INTERNAL_API_ARGESFSDFEFC
#define ELM_INTERFACE_ATSPI_ACCESSIBLE_PROTECTED
#define ELM_INTERFACE_ATSPI_COMPONENT_PROTECTED
#define ELM_INTERFACE_ATSPI_ACTION_PROTECTED
#define ELM_INTERFACE_ATSPI_VALUE_PROTECTED
#define ELM_INTERFACE_ATSPI_EDITABLE_TEXT_PROTECTED
#define ELM_INTERFACE_ATSPI_TEXT_PROTECTED
#define ELM_INTERFACE_ATSPI_SELECTION_PROTECTED
#define ELM_INTERFACE_ATSPI_IMAGE_PROTECTED
#define ELM_INTERFACE_ATSPI_WIDGET_ACTION_PROTECTED

#include <Eo.h>
#include <Evas.h>
#include <Elementary.h>
#include <elm_widget.h>

#include "elm_interface_atspi_accessible.h"
#include "elm_interface_atspi_widget_action.h"
#include "elm_interface_atspi_text.h"
#include "elm_interface_scrollable.h"
}

#include <Elementary.hh>
#include <Eina.hh>

#include <string>

EAPI_MAIN int
elm_main (int argc, char *argv[])
{
  const char *path, *group;
  efl::eina::optional<std::string> name;
  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");
 	
  icon.file_get(&path, &group);
  name = icon.standard_get();
  std::cout << "path = " << path << ", group = " << group <<  ", 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.visibility_set(true);

  win.size_set(320, 320);
  win.visibility_set(true);

  elm_run();
 
  return 0;
}
ELM_MAIN()