From 83e0c44a49047693bec15b7182cfb046b59b61f2 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Thu, 15 Jan 2009 14:48:07 +0100 Subject: [PATCH] (irrelevant) fixes to make the dummy/demo build work again --- src/gui/gtk-lumiera.cpp | 8 +- src/gui/gtk-lumiera.hpp | 2 + src/tool/SConscript | 2 +- tests/SConscript | 2 +- tests/plugin/examplepluginc/example_plugin.c | 169 +----------------- .../plugin/test-cpp-plugin/example_plugin.cpp | 129 ------------- 6 files changed, 11 insertions(+), 301 deletions(-) delete mode 100644 tests/plugin/test-cpp-plugin/example_plugin.cpp diff --git a/src/gui/gtk-lumiera.cpp b/src/gui/gtk-lumiera.cpp index 102c424dd..4d8f9bda5 100644 --- a/src/gui/gtk-lumiera.cpp +++ b/src/gui/gtk-lumiera.cpp @@ -37,7 +37,11 @@ extern "C" void start_dummy_gui () { - NOTICE(gui, "This is a placeholder for the Lumiera GTK-GUI starting...."); + NOTICE(gui, "Dummy Lumiera GTK-GUI starting...."); + + int argc =0; + char *argv[] = {}; // faked command line for GTK + gui::application().main(argc, argv); } @@ -90,7 +94,7 @@ void WorkspaceWindow::create_ui() { //----- Configure the Window -----// - set_title(AppTitle); + set_title(GtkLumiera::AppTitle); set_default_size(1024, 768); //----- Set up the UI Manager -----// diff --git a/src/gui/gtk-lumiera.hpp b/src/gui/gtk-lumiera.hpp index c4efb6259..832a460ad 100644 --- a/src/gui/gtk-lumiera.hpp +++ b/src/gui/gtk-lumiera.hpp @@ -16,6 +16,8 @@ #include #include +#include + extern "C" { #include diff --git a/src/tool/SConscript b/src/tool/SConscript index 0ca19490d..f5c22a478 100644 --- a/src/tool/SConscript +++ b/src/tool/SConscript @@ -16,7 +16,7 @@ rsvg = envGtk.Program('#$BINDIR/rsvg-convert','rsvg-convert.c') # build additional test and administrative tools.... artifacts['tools'] = [ env.Program('#$BINDIR/hello-world','hello.c') #### hello world (checks C build) + env.Program('#$BINDIR/try', 'try.cpp') #### to try out some feature... - + luidgen +# + luidgen + vgsuppr + rsvg ] diff --git a/tests/SConscript b/tests/SConscript index e914ca001..65ac7aa79 100644 --- a/tests/SConscript +++ b/tests/SConscript @@ -55,7 +55,7 @@ moduledirs = globRootdirs('*') -artifacts['testsuite'] = ts = ( [ testExecutable(env, dir) for dir in ['lib','components'] ] +artifacts['testsuite'] = ts = ( [ testExecutable(env, dir) for dir in ['bugs'] ] # was: ['lib','components'] + [ testCollection(env, dir) for dir in moduledirs if not dir in specials] + createPlugins(envPlu, 'plugin') ) diff --git a/tests/plugin/examplepluginc/example_plugin.c b/tests/plugin/examplepluginc/example_plugin.c index 60992745d..b18212522 100644 --- a/tests/plugin/examplepluginc/example_plugin.c +++ b/tests/plugin/examplepluginc/example_plugin.c @@ -1,50 +1,11 @@ /* - example_plugin - example plugin for testing the interface/plugin system - - Copyright (C) Lumiera.org - 2008, Christian Thaeter - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + example_plugin - dummy example plugin * *****************************************************/ #include -#include "common/interfacedescriptor.h" -#include "common/config_interface.h" - -#include "tests/common/hello_interface.h" - - -LUMIERA_PLUGIN_INTERFACEHANDLE; - -LumieraInterface -myopen (LumieraInterface self, LumieraInterface interfaces) -{ - LUMIERA_PLUGIN_STORE_INTERFACEHANDLE (interfaces); - - fprintf (stderr, "opened %p global interfaces %p\n", self, interfaces); - return self; -} - -void -myclose (LumieraInterface self) -{ - fprintf (stderr, "closed %p\n", self); -} void hallo (void) { @@ -66,131 +27,3 @@ void bye (const char* m) printf ("Bye %s\n", m); } - -void yeahbabe (void) -{ - LUMIERA_INTERFACE_HANDLE (lumieraorg_testhello, 0) german = - LUMIERA_INTERFACE_OPEN (lumieraorg_testhello, 0, 0, lumieraorg_hello_german); - - LUMIERA_INTERFACE_HANDLE (lumieraorg_testhello, 0) english = - LUMIERA_INTERFACE_OPEN (lumieraorg_testhello, 0, 0, lumieraorg_hello_english); - - LUMIERA_INTERFACE_HANDLE (lumieraorg_configuration, 0) config = - LUMIERA_INTERFACE_OPEN (lumieraorg_configuration, 0, 0, lumieraorg_configuration); - - const char* path; - if (config->wordlist_get ("config.path", &path)) - printf ("config path is: %s\n", path); - if (config->wordlist_get ("plugin.path", &path)) - printf ("plugin path is: %s\n", path); - - LUMIERA_INTERFACE_CLOSE (config); - - german->hello (); - english->hello (); - english->goodbye ("World!"); - german->goodbye ("Welt!"); - - LUMIERA_INTERFACE_CLOSE (german); - LUMIERA_INTERFACE_CLOSE (english); -} - - - -LUMIERA_INTERFACE_INSTANCE (lumieraorg_interfacedescriptor, 0, - lumieraorg_exampleplugin_descriptor, - NULL, NULL, NULL, - LUMIERA_INTERFACE_INLINE (name, "\003\307\005\305\201\304\175\377\120\105\332\016\136\354\251\022", - const char*, (LumieraInterface iface), - {return "LumieraTest";} - ), - LUMIERA_INTERFACE_INLINE (brief, "\303\047\265\010\242\210\365\340\024\030\350\310\067\171\170\260", - const char*, (LumieraInterface iface), - {return "Lumiera Test suite examples";} - ), - LUMIERA_INTERFACE_INLINE (homepage, "\363\125\352\312\056\255\274\322\351\245\051\350\120\024\115\263", - const char*, (LumieraInterface iface), - {return "http://www.lumiera.org/develompent.html";} - ), - LUMIERA_INTERFACE_INLINE (version, "\114\043\133\175\354\011\232\002\117\240\107\141\234\157\217\176", - const char*, (LumieraInterface iface), - {return "No Version";} - ), - LUMIERA_INTERFACE_INLINE (author, "\313\300\055\156\126\320\144\247\140\023\261\002\270\367\017\267", - const char*, (LumieraInterface iface), - {return "Christian Thaeter";} - ), - LUMIERA_INTERFACE_INLINE (email, "\163\051\312\276\137\317\267\305\237\274\133\012\276\006\255\160", - const char*, (LumieraInterface iface), - {return "ct@pipapo.org";} - ), - LUMIERA_INTERFACE_INLINE (copyright, "\160\246\161\204\123\262\375\351\157\276\333\073\355\036\062\341", - const char*, (LumieraInterface iface), - { - return - "Copyright (C) Lumiera.org\n" - " 2008 Christian Thaeter "; - } - ), - LUMIERA_INTERFACE_INLINE (license, "\007\311\044\214\064\223\201\326\331\111\233\356\055\264\211\201", - const char*, (LumieraInterface iface), - { - return - "This program is free software; you can redistribute it and/or modify\n" - "it under the terms of the GNU General Public License as published by\n" - "the Free Software Foundation; either version 2 of the License, or\n" - "(at your option) any later version.\n" - "\n" - "This program is distributed in the hope that it will be useful,\n" - "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" - "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" - "GNU General Public License for more details.\n" - "\n" - "You should have received a copy of the GNU General Public License\n" - "along with this program; if not, write to the Free Software\n" - "Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA"; - } - ), - - LUMIERA_INTERFACE_INLINE (state, "\331\353\126\162\067\376\340\242\232\175\167\105\122\177\306\354", - int, (LumieraInterface iface), - {return LUMIERA_INTERFACE_EXPERIMENTAL;} - ), - - LUMIERA_INTERFACE_INLINE (versioncmp, "\363\145\363\224\325\104\177\057\344\023\367\111\376\221\152\135", - int, (const char* a, const char* b), - {return 0;} - ) - ); - - -LUMIERA_EXPORT( - LUMIERA_INTERFACE_DEFINE (lumieraorg_testhello, 0, - lumieraorg_hello_german, - LUMIERA_INTERFACE_REF (lumieraorg_interfacedescriptor, 0, lumieraorg_exampleplugin_descriptor), - myopen, - myclose, - LUMIERA_INTERFACE_MAP (hello, "\167\012\306\023\031\151\006\362\026\003\125\017\170\022\100\333", - hallo), - LUMIERA_INTERFACE_MAP (goodbye, "\324\267\214\166\340\213\155\053\157\125\064\264\167\235\020\223", - tschuess) - ), - LUMIERA_INTERFACE_DEFINE (lumieraorg_testhello, 0, - lumieraorg_hello_english, - LUMIERA_INTERFACE_REF (lumieraorg_interfacedescriptor, 0, lumieraorg_exampleplugin_descriptor), - myopen, - myclose, - LUMIERA_INTERFACE_MAP (hello, "\326\247\370\247\032\103\223\357\262\007\356\042\051\330\073\116", - hello), - LUMIERA_INTERFACE_MAP (goodbye, "\365\141\371\047\101\230\050\106\071\231\022\235\325\112\354\241", - bye) - ), - LUMIERA_INTERFACE_DEFINE (lumieraorg_testtest, 0, - lumieraorg_test_both, - LUMIERA_INTERFACE_REF (lumieraorg_interfacedescriptor, 0, lumieraorg_exampleplugin_descriptor), - myopen, - myclose, - LUMIERA_INTERFACE_MAP (testit, "\101\060\122\277\370\023\164\257\347\247\164\325\157\266\323\370", - yeahbabe) - ) - ) diff --git a/tests/plugin/test-cpp-plugin/example_plugin.cpp b/tests/plugin/test-cpp-plugin/example_plugin.cpp deleted file mode 100644 index b99d951d3..000000000 --- a/tests/plugin/test-cpp-plugin/example_plugin.cpp +++ /dev/null @@ -1,129 +0,0 @@ -/* - example_plugin.cpp - example plugin (C++) for testing the interface/plugin system - - Copyright (C) Lumiera.org - 2008, Christian Thaeter , - Hermann Vosseler - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -* *****************************************************/ - - -#include -#include - -#include "common/interfacedescriptor.h" -#include "common/config_interface.h" - -extern "C" { -#include "common/interface.h" -#include "common/interfacedescriptor.h" - -#include "tests/common/hello_interface.h" -} - -using boost::format; -using std::cout; -using std::endl; - - - -class example_plugin - { - public: - static LumieraInterface - myopen (LumieraInterface self, LumieraInterface interfaces) - { - static format fmt("opened %x global interfaces %x"); - cout << fmt % self % interfaces << endl; - return self; - } - - static void - myclose (LumieraInterface) - { - std::cout << "closed" << endl; - } - }; - - -class example_plugin_de - : public example_plugin - { - public: - static void - griazi () - { - std::cout << "Hallo Welt!" << endl; - } - - static void - servus (const char* m) - { - std::cout << "Tschuess " << m << endl; - } - }; - - -class example_plugin_en - : public example_plugin - { - public: - static void - hello () - { - std::cout << "Hello World!" << endl; - } - - static void - bye (const char* m) - { - std::cout << "Bye " << m << endl; - } - }; - - - - -extern "C" { /* ================== define two lumieraorg_testhello instance ======================= */ - - - - LUMIERA_EXPORT( /* ===================== PLUGIN EXPORTS ================================== */ - - LUMIERA_INTERFACE_DEFINE (lumieraorg_testhello, 0 - ,lumieraorg_hello_german_cpp - , NULL /* no descriptor given */ - , example_plugin::myopen - , example_plugin::myclose - , LUMIERA_INTERFACE_MAP (hello, "\300\244\125\265\235\312\175\263\335\044\371\047\247\263\015\322", - example_plugin_de::griazi) - , LUMIERA_INTERFACE_MAP (goodbye, "\115\365\126\102\201\104\012\257\153\232\006\210\010\346\076\070", - example_plugin_de::servus) - ), - LUMIERA_INTERFACE_DEFINE (lumieraorg_testhello, 0 - ,lumieraorg_hello_english_cpp - , NULL /* no descriptor given */ - , example_plugin::myopen - , example_plugin::myclose - , LUMIERA_INTERFACE_MAP (hello, "\303\367\107\154\077\063\237\066\034\034\050\136\170\220\260\226", - example_plugin_en::hello) - , LUMIERA_INTERFACE_MAP (goodbye, "\107\207\072\105\101\102\150\201\322\043\104\110\232\023\205\161", - example_plugin_en::bye) - ) - ); - -} // extern "C"