Commits

Anonymous committed 0f53d3c

Extrapolated essential framework

  • Participants
  • Parent commits 9fe06ae

Comments (0)

Files changed (17)

File essential/.gitignore

+.sconsign.dblite
+.*.swp
+build_debug/*

File essential/SConstruct

+SConscript('main.scons', variant_dir='build_debug', duplicate=0, exports={'MODE':'debug'})

File essential/examples/01-hello/SConstruct

+SConscript('main.scons', variant_dir='build_debug', duplicate=0, exports={'MODE':'debug'})

File essential/examples/01-hello/build_debug/hello

Binary file added.

File essential/examples/01-hello/errors.log

+In file included from /usr/include/c++/4.6/ext/new_allocator.h:34:0,
+                 from /usr/include/c++/4.6/x86_64-linux-gnu/./bits/c++allocator.h:34,
+                 from /usr/include/c++/4.6/bits/allocator.h:48,
+                 from /usr/include/c++/4.6/vector:62,
+                 from ../../include/Reactor.hpp:35,
+                 from ../../include/Essential.hpp:32,
+                 from hello.cpp:28:
+/usr/include/c++/4.6/new:93:54: error: 'void* Essential::operator new(Essential::std::size_t)' may not be declared within a namespace
+/usr/include/c++/4.6/new:94:56: error: 'void* Essential::operator new [](Essential::std::size_t)' may not be declared within a namespace
+/usr/include/c++/4.6/new:95:35: error: 'void Essential::operator delete(void*)' may not be declared within a namespace
+/usr/include/c++/4.6/new:96:37: error: 'void Essential::operator delete [](void*)' may not be declared within a namespace
+/usr/include/c++/4.6/new:97:62: error: 'void* Essential::operator new(Essential::std::size_t, const Essential::std::nothrow_t&)' may not be declared within a namespace
+/usr/include/c++/4.6/new:98:64: error: 'void* Essential::operator new [](Essential::std::size_t, const Essential::std::nothrow_t&)' may not be declared within a namespace
+/usr/include/c++/4.6/new:99:58: error: 'void Essential::operator delete(void*, const Essential::std::nothrow_t&)' may not be declared within a namespace
+/usr/include/c++/4.6/new:100:60: error: 'void Essential::operator delete [](void*, const Essential::std::nothrow_t&)' may not be declared within a namespace
+/usr/include/c++/4.6/new:103:57: error: 'void* Essential::operator new(Essential::std::size_t, void*)' may not be declared within a namespace
+/usr/include/c++/4.6/new:104:59: error: 'void* Essential::operator new [](Essential::std::size_t, void*)' may not be declared within a namespace
+/usr/include/c++/4.6/new:107:52: error: 'void Essential::operator delete(void*, void*)' may not be declared within a namespace
+/usr/include/c++/4.6/new:108:52: error: 'void Essential::operator delete [](void*, void*)' may not be declared within a namespace
+In file included from /usr/include/c++/4.6/bits/postypes.h:42:0,
+                 from /usr/include/c++/4.6/bits/char_traits.h:42,
+                 from /usr/include/c++/4.6/string:42,
+                 from ../../include/Reactor.hpp:37,
+                 from ../../include/Essential.hpp:32,
+                 from hello.cpp:28:
+/usr/include/c++/4.6/cwchar:66:11: error: '::mbstate_t' has not been declared
+/usr/include/c++/4.6/cwchar:141:11: error: '::wint_t' has not been declared
+/usr/include/c++/4.6/cwchar:143:11: error: '::btowc' has not been declared
+/usr/include/c++/4.6/cwchar:144:11: error: '::fgetwc' has not been declared
+/usr/include/c++/4.6/cwchar:145:11: error: '::fgetws' has not been declared
+/usr/include/c++/4.6/cwchar:146:11: error: '::fputwc' has not been declared
+/usr/include/c++/4.6/cwchar:147:11: error: '::fputws' has not been declared
+/usr/include/c++/4.6/cwchar:148:11: error: '::fwide' has not been declared
+/usr/include/c++/4.6/cwchar:149:11: error: '::fwprintf' has not been declared
+/usr/include/c++/4.6/cwchar:150:11: error: '::fwscanf' has not been declared
+/usr/include/c++/4.6/cwchar:151:11: error: '::getwc' has not been declared
+/usr/include/c++/4.6/cwchar:152:11: error: '::getwchar' has not been declared
+/usr/include/c++/4.6/cwchar:153:11: error: '::mbrlen' has not been declared
+/usr/include/c++/4.6/cwchar:154:11: error: '::mbrtowc' has not been declared
+/usr/include/c++/4.6/cwchar:155:11: error: '::mbsinit' has not been declared
+/usr/include/c++/4.6/cwchar:156:11: error: '::mbsrtowcs' has not been declared
+/usr/include/c++/4.6/cwchar:157:11: error: '::putwc' has not been declared
+/usr/include/c++/4.6/cwchar:158:11: error: '::putwchar' has not been declared
+/usr/include/c++/4.6/cwchar:160:11: error: '::swprintf' has not been declared
+/usr/include/c++/4.6/cwchar:162:11: error: '::swscanf' has not been declared
+/usr/include/c++/4.6/cwchar:163:11: error: '::ungetwc' has not been declared
+/usr/include/c++/4.6/cwchar:164:11: error: '::vfwprintf' has not been declared
+/usr/include/c++/4.6/cwchar:166:11: error: '::vfwscanf' has not been declared
+/usr/include/c++/4.6/cwchar:169:11: error: '::vswprintf' has not been declared
+/usr/include/c++/4.6/cwchar:172:11: error: '::vswscanf' has not been declared
+/usr/include/c++/4.6/cwchar:174:11: error: '::vwprintf' has not been declared
+/usr/include/c++/4.6/cwchar:176:11: error: '::vwscanf' has not been declared
+/usr/include/c++/4.6/cwchar:178:11: error: '::wcrtomb' has not been declared
+/usr/include/c++/4.6/cwchar:179:11: error: '::wcscat' has not been declared
+/usr/include/c++/4.6/cwchar:180:11: error: '::wcscmp' has not been declared
+/usr/include/c++/4.6/cwchar:181:11: error: '::wcscoll' has not been declared
+/usr/include/c++/4.6/cwchar:182:11: error: '::wcscpy' has not been declared
+/usr/include/c++/4.6/cwchar:183:11: error: '::wcscspn' has not been declared
+/usr/include/c++/4.6/cwchar:184:11: error: '::wcsftime' has not been declared
+/usr/include/c++/4.6/cwchar:185:11: error: '::wcslen' has not been declared
+/usr/include/c++/4.6/cwchar:186:11: error: '::wcsncat' has not been declared
+/usr/include/c++/4.6/cwchar:187:11: error: '::wcsncmp' has not been declared
+/usr/include/c++/4.6/cwchar:188:11: error: '::wcsncpy' has not been declared
+/usr/include/c++/4.6/cwchar:189:11: error: '::wcsrtombs' has not been declared
+/usr/include/c++/4.6/cwchar:190:11: error: '::wcsspn' has not been declared
+/usr/include/c++/4.6/cwchar:191:11: error: '::wcstod' has not been declared
+/usr/include/c++/4.6/cwchar:193:11: error: '::wcstof' has not been declared
+/usr/include/c++/4.6/cwchar:195:11: error: '::wcstok' has not been declared
+/usr/include/c++/4.6/cwchar:196:11: error: '::wcstol' has not been declared
+/usr/include/c++/4.6/cwchar:197:11: error: '::wcstoul' has not been declared
+/usr/include/c++/4.6/cwchar:198:11: error: '::wcsxfrm' has not been declared
+/usr/include/c++/4.6/cwchar:199:11: error: '::wctob' has not been declared
+/usr/include/c++/4.6/cwchar:200:11: error: '::wmemcmp' has not been declared
+/usr/include/c++/4.6/cwchar:201:11: error: '::wmemcpy' has not been declared
+/usr/include/c++/4.6/cwchar:202:11: error: '::wmemmove' has not been declared
+/usr/include/c++/4.6/cwchar:203:11: error: '::wmemset' has not been declared
+/usr/include/c++/4.6/cwchar:204:11: error: '::wprintf' has not been declared
+/usr/include/c++/4.6/cwchar:205:11: error: '::wscanf' has not been declared
+/usr/include/c++/4.6/cwchar:206:11: error: '::wcschr' has not been declared
+/usr/include/c++/4.6/cwchar:207:11: error: '::wcspbrk' has not been declared
+/usr/include/c++/4.6/cwchar:208:11: error: '::wcsrchr' has not been declared
+/usr/include/c++/4.6/cwchar:209:11: error: '::wcsstr' has not been declared
+/usr/include/c++/4.6/cwchar:210:11: error: '::wmemchr' has not been declared
+/usr/include/c++/4.6/cwchar:250:11: error: '::wcstold' has not been declared
+/usr/include/c++/4.6/cwchar:259:11: error: '::wcstoll' has not been declared
+/usr/include/c++/4.6/cwchar:260:11: error: '::wcstoull' has not been declared
+/usr/include/c++/4.6/cwchar:266:11: error: '::__gnu_cxx' has not been declared
+/usr/include/c++/4.6/cwchar:267:11: error: '::__gnu_cxx' has not been declared
+/usr/include/c++/4.6/cwchar:268:11: error: '::__gnu_cxx' has not been declared
+In file included from /usr/include/c++/4.6/string:42:0,
+                 from ../../include/Reactor.hpp:37,
+                 from ../../include/Essential.hpp:32,
+                 from hello.cpp:28:
+/usr/include/c++/4.6/bits/char_traits.h:65:15: error: 'mbstate_t' in namespace 'Essential::std' does not name a type
+In file included from /usr/include/c++/4.6/x86_64-linux-gnu/./bits/c++locale.h:42:0,
+                 from /usr/include/c++/4.6/bits/localefwd.h:42,
+                 from /usr/include/c++/4.6/string:45,
+                 from ../../include/Reactor.hpp:37,
+                 from ../../include/Essential.hpp:32,
+                 from hello.cpp:28:
+/usr/include/c++/4.6/clocale:55:11: error: '::lconv' has not been declared
+/usr/include/c++/4.6/clocale:56:11: error: '::setlocale' has not been declared
+/usr/include/c++/4.6/clocale:57:11: error: '::localeconv' has not been declared
+In file included from /usr/include/c++/4.6/bits/localefwd.h:44:0,
+                 from /usr/include/c++/4.6/string:45,
+                 from ../../include/Reactor.hpp:37,
+                 from ../../include/Essential.hpp:32,
+                 from hello.cpp:28:
+/usr/include/c++/4.6/cctype:66:11: error: '::isalnum' has not been declared
+/usr/include/c++/4.6/cctype:67:11: error: '::isalpha' has not been declared
+/usr/include/c++/4.6/cctype:68:11: error: '::iscntrl' has not been declared
+/usr/include/c++/4.6/cctype:69:11: error: '::isdigit' has not been declared
+/usr/include/c++/4.6/cctype:70:11: error: '::isgraph' has not been declared
+/usr/include/c++/4.6/cctype:71:11: error: '::islower' has not been declared
+/usr/include/c++/4.6/cctype:72:11: error: '::isprint' has not been declared
+/usr/include/c++/4.6/cctype:73:11: error: '::ispunct' has not been declared
+/usr/include/c++/4.6/cctype:74:11: error: '::isspace' has not been declared
+/usr/include/c++/4.6/cctype:75:11: error: '::isupper' has not been declared
+/usr/include/c++/4.6/cctype:76:11: error: '::isxdigit' has not been declared
+/usr/include/c++/4.6/cctype:77:11: error: '::tolower' has not been declared
+/usr/include/c++/4.6/cctype:78:11: error: '::toupper' has not been declared
+scons: *** [build_debug/hello.o] Error 1

File essential/examples/01-hello/hello.cpp

+/*
+ * Copyright (c) 2012, Alfredo Di Napoli
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above copyright
+ *       notice, this list of conditions and the following disclaimer in the
+ *       documentation and/or other materials provided with the distribution.
+ *     * Neither the name of the authors nor the
+ *       names of its contributors may be used to endorse or promote products
+ *       derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ALFREDO DI NAPOLI ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL ALFREDO DI NAPOLI BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "../../include/Essential.hpp"
+
+using namespace Essential;
+
+EAPI_MAIN
+int elm_main(int argc, char** argv)
+{
+    //Create the reactor
+    Reactor reactor;
+
+    //Register any gadget you want to
+    reactor.run();
+
+    //Shutdown is implicit
+}
+ELM_MAIN()

File essential/examples/01-hello/main.scons

+env = Environment()
+
+env.Append(CPPPATH = [
+    './include',
+    '/usr/local/include',
+    '/usr/include/elementary-1',
+    '/usr/include/eina-1',
+    '/usr/include/eina-1/eina',
+    '/usr/include/eet-1',
+    '/usr/include/evas-1',
+    '/usr/include/ecore-1',
+    '/usr/include/edje-1',
+    '/usr/include/e_dbus-1',
+    '/usr/include/dbus-1.0',
+    '/usr/lib/x86_64-linux-gnu/dbus-1.0/include',
+    '/usr/include/efreet-1',
+    '/usr/include/ethumb-1'
+])
+
+env.Append(CPATH = [
+    './include',
+    '/usr/local/include',
+    '/usr/include/elementary-1',
+    '/usr/include/eina-1',
+    '/usr/include/eina-1/eina',
+    '/usr/include/eet-1',
+    '/usr/include/evas-1',
+    '/usr/include/ecore-1',
+    '/usr/include/edje-1',
+    '/usr/include/e_dbus-1',
+    '/usr/include/dbus-1.0',
+    '/usr/lib/x86_64-linux-gnu/dbus-1.0/include',
+    '/usr/include/efreet-1',
+    '/usr/include/ethumb-1'
+])
+
+env.Append(LIBPATH = [
+  '../../../build_debug'
+])
+
+env.Append(LINKFLAGS = [
+  '-L../../../build_debug'
+])
+
+env.Append(LIBS = [
+  'essential'
+])
+
+env.Program(target = "hello", source = ["hello.cpp"])
+env.ParseConfig('pkg-config elementary --cflags --libs')
+

File essential/include/Essential.hpp

+/*
+ * Copyright (c) 2012, Alfredo Di Napoli
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above copyright
+ *       notice, this list of conditions and the following disclaimer in the
+ *       documentation and/or other materials provided with the distribution.
+ *     * Neither the name of the authors nor the
+ *       names of its contributors may be used to endorse or promote products
+ *       derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ALFREDO DI NAPOLI ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL ALFREDO DI NAPOLI BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef Essential_hpp
+#define Essential_hpp
+
+#include "Reactor.hpp"
+
+#endif

File essential/include/Reactor.hpp

+/*
+ * Copyright (c) 2012, Alfredo Di Napoli
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above copyright
+ *       notice, this list of conditions and the following disclaimer in the
+ *       documentation and/or other materials provided with the distribution.
+ *     * Neither the name of the authors nor the
+ *       names of its contributors may be used to endorse or promote products
+ *       derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ALFREDO DI NAPOLI ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL ALFREDO DI NAPOLI BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef Reactor_hpp
+#define Reactor_hpp
+
+#include <Elementary.h>
+#include <vector>
+#include <map>
+#include <string>
+
+namespace Essential
+{
+    class Reactor
+    {
+        public:
+            Reactor();
+
+            /**
+             * Call the elm_shutdown function
+             */
+            ~Reactor();
+
+            /**
+             * Start the Reactor. This means that
+             * the Reactor will simply call the Elementary
+             * main loop, acting like an invokation of the
+             * main loop
+             */
+            void run();
+            void registerWidget(Evas_Object*);
+
+        private:
+            std::vector<Evas_Object*> widgets_;
+            std::map<std::string, Evas_Object*> widget2obj_;
+    };
+}
+#endif

File essential/main.scons

+env = Environment()
+
+lib_target  = "essential"
+lib_sources = Glob("src/*.cpp")
+
+env.ParseConfig('pkg-config elementary --cflags --libs')
+env.SharedLibrary(target = lib_target, source = lib_sources)
+
+env.Append(CPPPATH = [
+    './include',
+    '/usr/local/include',
+    '/usr/include/elementary-1',
+    '/usr/include/eina-1',
+    '/usr/include/eina-1/eina',
+    '/usr/include/eet-1',
+    '/usr/include/evas-1',
+    '/usr/include/ecore-1',
+    '/usr/include/edje-1',
+    '/usr/include/e_dbus-1',
+    '/usr/include/dbus-1.0',
+    '/usr/lib/x86_64-linux-gnu/dbus-1.0/include',
+    '/usr/include/efreet-1',
+    '/usr/include/ethumb-1'
+])
+
+env.Append(CPATH = [
+    './include',
+    '/usr/local/include',
+    '/usr/include/elementary-1',
+    '/usr/include/eina-1',
+    '/usr/include/eina-1/eina',
+    '/usr/include/eet-1',
+    '/usr/include/evas-1',
+    '/usr/include/ecore-1',
+    '/usr/include/edje-1',
+    '/usr/include/e_dbus-1',
+    '/usr/include/dbus-1.0',
+    '/usr/lib/x86_64-linux-gnu/dbus-1.0/include',
+    '/usr/include/efreet-1',
+    '/usr/include/ethumb-1'
+])

File essential/src/Reactor.cpp

+/*
+ * Copyright (c) 2012, Alfredo Di Napoli
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above copyright
+ *       notice, this list of conditions and the following disclaimer in the
+ *       documentation and/or other materials provided with the distribution.
+ *     * Neither the name of the authors nor the
+ *       names of its contributors may be used to endorse or promote products
+ *       derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ALFREDO DI NAPOLI ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL ALFREDO DI NAPOLI BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "Reactor.hpp"
+
+namespace Essential
+{
+    Reactor::Reactor()
+    {
+        //NO-OP
+    }
+
+    Reactor::~Reactor()
+    {
+        //Invoke Elementary Shutdown
+        elm_shutdown();
+    }
+
+    void Reactor::run()
+    {
+        elm_run();
+    }
+}

File examples/toolbar/SConstruct

+env = Environment()
+env.Program(target='toolbar', source=['toolbar.c'])
+env.ParseConfig('pkg-config elementary --cflags --libs')
+
+env.Append(CPPATH = [
+    '/usr/local/include/',
+    '/usr/include/elementary-1',
+    '/usr/include/eina-1',
+    '/usr/include/eina-1/eina',
+    '/usr/include/eet-1',
+    '/usr/include/evas-1',
+    '/usr/include/ecore-1',
+    '/usr/include/edje-1',
+    '/usr/include/e_dbus-1',
+    '/usr/include/dbus-1.0',
+    '/usr/lib/x86_64-linux-gnu/dbus-1.0/include',
+    '/usr/include/efreet-1',
+    '/usr/include/ethumb-1'
+])
+env.Append(CPPPATH = [
+    '/usr/local/include/',
+    '/usr/include/elementary-1',
+    '/usr/include/eina-1',
+    '/usr/include/eina-1/eina',
+    '/usr/include/eet-1',
+    '/usr/include/evas-1',
+    '/usr/include/ecore-1',
+    '/usr/include/edje-1',
+    '/usr/include/e_dbus-1',
+    '/usr/include/dbus-1.0',
+    '/usr/lib/x86_64-linux-gnu/dbus-1.0/include',
+    '/usr/include/efreet-1',
+    '/usr/include/ethumb-1'
+])

File examples/toolbar/toolbar

Binary file added.

File examples/toolbar/toolbar.c

+#include <Elementary.h>
+
+static void
+_on_done(void *data,
+         Evas_Object *obj,
+         void *event_info)
+{
+   elm_exit();
+}
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+   Evas_Object *win, *bg, *bx, *tb, *bt, *menu;
+   Elm_Object_Item *tb_it;
+
+   win = elm_win_add(NULL, "toolbar", ELM_WIN_BASIC);
+   elm_win_title_set(win, "Toolbar Example");
+   evas_object_smart_callback_add(win, "delete,request", _on_done, NULL);
+
+   bg = elm_bg_add(win);
+   elm_win_resize_object_add(win, bg);
+   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_show(bg);
+
+   bx = elm_box_add(win);
+   elm_win_resize_object_add(win, bx);
+   evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   evas_object_show(bx);
+
+   bt = elm_button_add(win);
+   evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   elm_object_text_set(bt, "Button");
+   evas_object_show(bt);
+
+   tb = elm_toolbar_add(win);
+   evas_object_size_hint_weight_set(tb, 0.0, 0.0);
+   evas_object_size_hint_align_set(tb, EVAS_HINT_FILL, 0.0);
+   evas_object_show(tb);
+
+   elm_toolbar_item_append(tb, "document-print", "Print", NULL, NULL);
+   elm_toolbar_item_append(tb, "folder-new", "Folder", NULL, NULL);
+   elm_toolbar_item_append(tb, "clock", "Clock", NULL, NULL);
+   elm_toolbar_item_append(tb, "refresh", "Update", NULL, NULL);
+
+   elm_toolbar_menu_parent_set(tb, win);
+
+   tb_it = elm_toolbar_item_append(tb, "mail-send", "Send Mail", NULL, NULL);
+   elm_toolbar_item_menu_set(tb_it, EINA_TRUE);
+
+   menu = elm_toolbar_item_menu_get(tb_it);
+   elm_menu_item_add(menu, NULL, "emptytrash", "Empty Trash", NULL, NULL);
+   elm_menu_item_add(menu, NULL, "trashcan_full", "Full Trash", NULL, NULL);
+
+   elm_toolbar_item_priority_set(tb_it, 10);
+
+   elm_box_pack_end(bx, tb);
+   elm_box_pack_end(bx, bt);
+
+   evas_object_resize(win, 230, 200);
+   evas_object_show(win);
+
+   elm_run();
+   elm_shutdown();
+
+   return 0;
+}
+ELM_MAIN()

File src/.gitignore

+.*.swp

File src/toolbar.cpp

+#include "toolbar.hpp"
+
+namespace Kensho
+{
+    Toolbar::Toolbar()
+    {
+        //NO-OP
+    }
+
+    Toolbar::~Toolbar()
+    {
+        //NO-OP
+    }
+
+    void append_item(void)
+    {
+        //TODO
+    }
+}

File src/toolbar.hpp

+#include <Elementary.h>
+#include <vector>
+
+namespace Kensho
+{
+    class Toolbar
+    {
+        public:
+
+            Toolbar();
+            ~Toolbar();
+            void append_item(void);
+
+        private:
+
+            //The current appended items
+            std::vector<Evas_Object*> items_;
+    };
+}