summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuciana Magno de Almeida <luciana@expertisesolutions.com.br>2014-12-16 10:56:18 -0200
committerVitor Sousa <vitorsousasilva@gmail.com>2015-01-05 15:54:15 -0200
commit9960a07f010fcebe1650f6bcc8471ec2a12dcd52 (patch)
treed0fe19f18a40b15afba5b2c703740fb5a29b9f8a
parenta11415fb748d4b82af8e2f168d4085c7e1069e14 (diff)
downloadelementary-9960a07f010fcebe1650f6bcc8471ec2a12dcd52.tar.gz
cxx: Added bg_cxx_example_01.cc C++ example
-rw-r--r--src/examples/Makefile.am14
-rw-r--r--src/examples/bg_cxx_example_01.cc49
2 files changed, 58 insertions, 5 deletions
diff --git a/src/examples/Makefile.am b/src/examples/Makefile.am
index 3a36f9088..352a1090b 100644
--- a/src/examples/Makefile.am
+++ b/src/examples/Makefile.am
@@ -20,6 +20,10 @@ AM_CPPFLAGS = \
-DPACKAGE_LIB_DIR=\"$(libdir)\" \
@ELEMENTARY_CFLAGS@
+AM_CXXFLAGS = \
+@ELEMENTARY_CFLAGS@ \
+@ELEMENTARY_CXX_CFLAGS@
+
LDADD = \
@ELEMENTARY_LIBS@ \
$(top_builddir)/src/lib/libelementary.la
@@ -143,7 +147,8 @@ track_example_01.c
if HAVE_CXX11
SRCS += \
-box_cxx_example_02.cc
+box_cxx_example_02.cc \
+bg_cxx_example_01.cc
endif
.edc.edj:
@@ -292,7 +297,8 @@ track_example_01
if HAVE_CXX11
examples_PROGRAMS += \
-box_cxx_example_02
+box_cxx_example_02 \
+bg_cxx_example_01
endif
if ELEMENTARY_WINDOWS_BUILD
@@ -309,9 +315,7 @@ endif
if HAVE_CXX11
box_cxx_example_02_SOURCES = box_cxx_example_02.cc
-box_cxx_example_02_CXXFLAGS = \
-@ELEMENTARY_CFLAGS@ \
-@ELEMENTARY_CXX_CFLAGS@
+bg_cxx_example_01_SOURCES = bg_cxx_example_01.cc
endif
# This variable will hold the list of screenshots that will be made
diff --git a/src/examples/bg_cxx_example_01.cc b/src/examples/bg_cxx_example_01.cc
new file mode 100644
index 000000000..0ea455b36
--- /dev/null
+++ b/src/examples/bg_cxx_example_01.cc
@@ -0,0 +1,49 @@
+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 <elm_win.eo.hh>
+
+#include <Eina.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("bg-plain", "Bg Plain"));
+ win.autohide_set(true);
+
+ win.size_set(320,320);
+ win.visibility_set(true);
+
+ elm_run();
+
+ return 0;
+}
+ELM_MAIN()