Index: library_sql_parser/include/myx_sql_parser_public_interface.h =================================================================== --- library_sql_parser/include/myx_sql_parser_public_interface.h (revision 1224) +++ library_sql_parser/include/myx_sql_parser_public_interface.h (working copy) @@ -83,7 +83,6 @@ void *user_data, int mode); -MYX_PUBLIC_FUNC void myx_set_parser_input(std::istream *sqlstream); MYX_PUBLIC_FUNC void myx_set_parser_source(const char *sql); MYX_PUBLIC_FUNC void myx_free_parser_source(); MYX_PUBLIC_FUNC void myx_parse(); @@ -92,6 +91,7 @@ #ifdef __cplusplus } +MYX_PUBLIC_FUNC void myx_set_parser_input(std::istream *sqlstream); MYX_PUBLIC_FUNC void myx_set_parser_source(std::istream *sql); #endif /* __cplusplus */ Index: library_grt/source/myx_grt_php.c =================================================================== --- library_grt/source/myx_grt_php.c (revision 1224) +++ library_grt/source/myx_grt_php.c (working copy) @@ -222,7 +222,8 @@ char *content_struct_name= g_strdup(content_struct_name_tmp + strlen(PHPGRTCLASSPREFIX)); MYX_GRT_ERROR error; MYX_GRT_VALUE_TYPE content_type= myx_get_value_type_from_string(content_type_name, &error); - jint item_count= php_eval_long("$%s->size();", var_name); +// jint item_count= php_eval_long("$%s->size();", var_name); + int item_count= php_eval_long("$%s->size();", var_name); int i; g_free(content_struct_name_tmp); @@ -964,6 +965,12 @@ // register the callback functions zend_startup_module(&php_grt_module_entry); + // ask the current directory + if (getenv("GRT_VERBOSE")) + g_message("php current directory: %s", php_eval_string("getcwd()")); + + // php_eval_string("phpinfo()"); + // set the current directory php_eval_string("chdir('./php')"); @@ -993,7 +1000,7 @@ * The php_grt_module_shutdown function is called explicitly because * there are known issues with using the MSHUTDOWN function *****************************************************************************/ -static void finialize_php(void) +static void finalize_php(void) { php_grt_module_shutdown(); @@ -1040,7 +1047,8 @@ *****************************************************************************/ static int php_ub_write(const char *str, unsigned int str_length TSRMLS_DC) { - printf("%.*s\n", str_length, str); +//printf("%.*s\n", str_length, str); + printf("%.*s", str_length, str); return str_length; } @@ -1055,7 +1063,8 @@ *****************************************************************************/ static void php_log_message(char *message) { - printf("log_message: %s\n", message); +//printf("log_message: %s\n", message); + printf("log_message: %s", message); } /** @@ -1072,7 +1081,8 @@ *****************************************************************************/ static void php_sapi_error(int type, const char* fmt, ...) { - printf("sapi_error: %d, %s\n", type, fmt); +//printf("sapi_error: %d, %s\n", type, fmt); + printf("sapi_error: %d, %s", type, fmt); } /** @@ -1200,7 +1210,8 @@ char *extends= NULL; char *ptr; unsigned int i; - const char *module_filename= file+6; //remove ./php +//const char *module_filename= file+6; //remove ./php + const char *module_filename= file; // call class::getModuleinfo(); class_name = g_path_get_basename(file); Index: library_grt/source/Makefile.am =================================================================== --- library_grt/source/Makefile.am (revision 1224) +++ library_grt/source/Makefile.am (working copy) @@ -13,6 +13,9 @@ libgrttextui_a_SOURCES=lua_dialogs.c endif +if BUILD_PHP +myx_grt_php=myx_grt_php.c +endif INCLUDES=-I$(top_srcdir)/library_grt/include @GLIB_CFLAGS@\ -I$(top_srcdir)/library_util/include\ @@ -35,6 +38,7 @@ myx_grt_lua_shell.c\ myx_grt_lua_shell_help.c\ lxp/lxplib.c\ + $(myx_grt_php)\ myx_grt_python.c\ myx_grt_python_common.c\ myx_grt_python_shell.c\ Index: configure.in =================================================================== --- configure.in (revision 1224) +++ configure.in (working copy) @@ -169,6 +169,28 @@ ENABLED_MODULES="$ENABLED_MODULES -DENABLE_LUA_MODULES" fi +# PHP headers +AC_ARG_ENABLE(php-modules, +[ --enable-php-modules whether to support PHP scripting], + enable_php=$enableval, enable_php=no) + +if test $enable_php = yes; then + AC_MSG_CHECKING(for php) + PHP_LIBS="[$(php-config --libs)]" + if test "$PHP_LIBS" = ""; then + AC_MSG_RESULT(not found) + else +# php-config --prefix ? + PHP_LIBS="/usr/lib/php5/lib/libphp5.a -L[$(php-config --extension-dir)] $PHP_LIBS" +# PHP_LIBS="/usr/lib/php4/lib/libphp4.a -L[$(php-config --extension-dir)] $PHP_LIBS" + PHP_CFLAGS=[$(php-config --includes)] + ENABLED_MODULES="$ENABLED_MODULES -DENABLE_PHP_MODULES" + AC_MSG_RESULT($PHP_LIBS) + fi +fi +GRT_CFLAGS="$GRT_CFLAGS $PHP_CFLAGS" +GRT_LIBS="$GRT_LIBS $PHP_LIBS" + # Python headers AC_ARG_ENABLE(python-modules, [ --enable-python-modules whether to support Python scripting], @@ -220,6 +242,7 @@ AM_CONDITIONAL(BUILD_GTK, test "x$enable_gtk" = "xyes") AM_CONDITIONAL(BUILD_GRT, test "x$enable_grt" = "xyes") AM_CONDITIONAL(BUILD_GC, test "x$enable_canvas" = "xyes") +AM_CONDITIONAL(BUILD_PHP, test "x$enable_php" = "xyes") AM_CONDITIONAL(BUILD_NEWT, ! test "x$SLANG_LIB" = "x") AM_CONDITIONAL(USE_READLINE, test "x$use_readline" = "xyes") @@ -295,6 +318,8 @@ source/grtsh/Makefile source/linux/Makefile source/lua/Makefile +source/php/Makefile +source/php/modules/Makefile images/Makefile images/png/Makefile images/icons/Makefile Index: source/linux/MySQLGRT/MGRTTableEditor.cc =================================================================== --- source/linux/MySQLGRT/MGRTTableEditor.cc (revision 1224) +++ source/linux/MySQLGRT/MGRTTableEditor.cc (working copy) @@ -19,9 +19,14 @@ #include "myg_gtkutils.h" #include "MGGladeXML.h" -#ifdef GTK_VERSION_GE(2,4) +#if GTK_VERSION_GE(2,4) +#define HAS_COMBO_CELL +#else +#ifndef GTK_MAJOR_VERSION +#warning "GTK_MAJOR_VERSION is undefined!" #define HAS_COMBO_CELL #endif +#endif /** * @file MGRTTableEditor.cc Index: source/linux/MySQLGRT/MGRTShell.cc =================================================================== --- source/linux/MySQLGRT/MGRTShell.cc (revision 1224) +++ source/linux/MySQLGRT/MGRTShell.cc (working copy) @@ -40,6 +40,12 @@ _top_box.pack_start(_paned, true, true); + Pango::FontDescription font; + font.set_family("bitstream vera sans mono"); + font.set_size(Pango::SCALE*9); + + _text.modify_font(font); + _text_scroll.add(_text); _text_scroll.set_policy(Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC); _text_scroll.set_shadow_type(Gtk::SHADOW_IN); Index: source/linux/MySQLGRT/MGRT.cc =================================================================== --- source/linux/MySQLGRT/MGRT.cc (revision 1224) +++ source/linux/MySQLGRT/MGRT.cc (working copy) @@ -139,7 +139,7 @@ { if (!_result.isValid() && !_null_ok) { - grt->out_text(ufmt("Error: function %s.%s returned unexpected NULL result", + grt->out_text(ufmt("Error: function %s.%s returned unexpected NULL result.\n", _module.c_str(), _function.c_str())); error= true; } @@ -216,7 +216,7 @@ if (myx_grt_setup_shell(_grt, MYX_GRT_SHELL_LUA) != MYX_GRT_NO_ERROR) { - out_text("could not initialize shell"); + out_text("could not initialize shell\n"); _thread_ready.unlock(); return; } @@ -233,7 +233,7 @@ #ifdef ENABLE_JAVA_MODULES // java modules - out_text("Loading Java modules..."); + out_text("Loading Java modules...\n"); loader= myx_java_init_loader(_grt, NULL, &error, NULL, std::string(resourcePath+"/").c_str()); if (loader) @@ -255,7 +255,7 @@ #ifdef ENABLE_PHP_MODULES // php modules - out_text("Loading PHP modules..."); + out_text("Loading PHP modules...\n"); loader= myx_php_init_loader(_grt, &error); if (loader) { @@ -263,20 +263,21 @@ out_text("Error registering PHP module loader\n"); else { - i= myx_grt_scan_for_modules(_grt, - std::string(resourcePath+"/php/modules").c_str()); + int i= myx_grt_scan_for_modules(_grt, + std::string(resourcePath+"/php/modules").c_str(), + &error); if (error != MYX_GRT_NO_ERROR) out_text(ufmt("Error scanning PHP modules (%i)\n", error)); else - out_text("Registered %i PHP modules\n", i); + out_text(ufmt("Registered %i PHP modules\n", i)); } } else - out_text("Error initializing PHP module loader (%i)\n",error); + out_text(ufmt("Error initializing PHP module loader (%i)\n",error)); #endif // lua modules - out_text("Loading Lua modules..."); + out_text("Loading Lua modules...\n"); loader= myx_lua_init_loader(_grt, &error, std::string(resourcePath+"/lua").c_str()); if (loader) { @@ -295,7 +296,7 @@ out_text(ufmt("Error initializing Lua module loader (%i)\n",error)); // builtin c++ - out_text("Initializing C++ loader..."); + out_text("Initializing C++ loader...\n"); setup_loader(); // this will "signal" the main thread that init is done @@ -505,7 +506,7 @@ } else { - out_text(ufmt("Registered %i modules\n", i)); + out_text(ufmt("Registered %i modules in %s\n", i, path.c_str())); return true; } } @@ -940,9 +941,9 @@ error= myx_grt_add_module(_grt, module); if (error != MYX_GRT_NO_ERROR) - out_text("Registration ok"); + out_text(ufmt("Built-in C++ module %s registration failed (%i)\n", module->name, error)); else - out_text(ufmt("C++ loader registration failed (%i)", error)); + out_text(ufmt("Built-in C++ module {%s} registered\n", module->name)); GRT_LEAVE(_grt); } Index: source/grtsh/Makefile.am =================================================================== --- source/grtsh/Makefile.am (revision 1224) +++ source/grtsh/Makefile.am (working copy) @@ -5,6 +5,10 @@ agentest_SOURCES= agentest.cc +if BUILD_PHP +php_a=/usr/lib/php5/lib/libphp5.a +endif + if BUILD_NEWT newt_libs= $(top_builddir)/library_grt/source/libgrttextui.a $(top_builddir)/library_grt/newt/libmnewt.a @SLANG_LIB@ -ltermcap -lncurses newt_flag= -DENABLE_TEXTUI @@ -33,6 +37,7 @@ $(top_builddir)/library_grt/source/libgrt.a \ $(top_builddir)/library/source/libmysqlx.a \ $(top_builddir)/library_util/source/libguiutil.a \ + $(php_a)\ @GTHREAD_LIBS@ @MYSQL_LIBS@ @PCRE_LIBS@ \ @GRT_LIBS@\ $(newt_libs)\ Index: source/grtsh/grtsh.cc =================================================================== --- source/grtsh/grtsh.cc (revision 1224) +++ source/grtsh/grtsh.cc (working copy) @@ -25,7 +25,9 @@ #endif #include +#ifdef ENABLE_JAVA_MODULES #include +#endif #include #include @@ -274,7 +276,7 @@ g_warning("Error while scanning for struct definitions (%i).", error); } else if (interactive) - printf("Registered %i struct definition files.\n", c); + printf("Registered %i struct definition xml files.\n", c); if (interactive) printf("Initializing Builtin modules...\n"); @@ -325,7 +327,7 @@ g_warning("Error while scanning for Java modules (%i).", error); } else if (interactive) - printf("Registered %i modules.\n", c); + printf("Registered %i Java modules.\n", c); } } } @@ -360,7 +362,7 @@ g_warning("Error while scanning for PHP modules (%i).", error); } else if (interactive) - printf("Registered %i modules.\n", c); + printf("Registered %i php modules.\n", c); } } } @@ -394,7 +396,7 @@ g_warning("Error while scanning for Python modules (%i).", error); } else if (interactive) - printf("Registered %i modules.\n", c); + printf("Registered %i Python modules.\n", c); } } } @@ -431,7 +433,7 @@ g_warning("Error while scanning for Lua modules (%i).", error); } else if (interactive) - printf("Registered %i modules.\n", c); + printf("Registered %i Lua modules.\n", c); } } @@ -711,7 +713,7 @@ c= myx_grt_scan_for_modules(grt, module_dir, &status); if (interactive) - g_message("Initialized %i modules", c); + g_message("Initialized %i plugin modules", c); } //g_assert(lua_gettop(myx_grt_lua_shell_get_lua(grt))==0); Index: source/Makefile.am =================================================================== --- source/Makefile.am (revision 1224) +++ source/Makefile.am (working copy) @@ -1,9 +1,14 @@ if BUILD_GRT grtstuff=grtsh lua + +if BUILD_PHP +phpstuff=php +endif + endif if BUILD_GTK gtkstuff=linux endif -SUBDIRS=$(gtkstuff) $(grtstuff) +SUBDIRS=$(gtkstuff) $(grtstuff) $(phpstuff) Index: library_gc/source/myx_gc_connection.cpp =================================================================== --- library_gc/source/myx_gc_connection.cpp (revision 1224) +++ library_gc/source/myx_gc_connection.cpp (working copy) @@ -548,7 +548,7 @@ TAction* CConnectionInstance::executeAssociatedActions(TMouseButton button, TMouseEvent event, TModifierKey modifiers, TVertex& coords) { TAction* lastAction = NULL; - + g_warning("Line 551: TAction* CConnectionInstance::executeAssociatedActions(TMouseButton button, TMouseEvent event, TModifierKey modifiers, TVertex& coords)"); // End points. They are always assigned. lastAction = FEnd1->executeAssociatedActions(button, event, modifiers, coords); if (lastAction == NULL) @@ -558,15 +558,15 @@ if (lastAction == NULL && FEnd1Decoration != NULL) lastAction = FEnd1Decoration->executeAssociatedActions(button, event, modifiers, coords); if (lastAction == NULL && FEnd1Label != NULL) - lastAction = FEnd1Label->executeAssociatedActions(button, event, modifiers, coords - FLabel1Offset); + g_warning("lastAction = FEnd1Label->executeAssociatedActions(button, event, modifiers, coords - FLabel1Offset);"); if (lastAction == NULL && FCenterDecoration != NULL) lastAction = FCenterDecoration->executeAssociatedActions(button, event, modifiers, coords); if (lastAction == NULL && FCenterLabel != NULL) - lastAction = FCenterLabel->executeAssociatedActions(button, event, modifiers, coords - FCenterLabelOffset); + g_warning("lastAction = FCenterLabel->executeAssociatedActions(button, event, modifiers, coords - FCenterLabelOffset);"); if (lastAction == NULL && FEnd2Decoration != NULL) lastAction = FEnd2Decoration->executeAssociatedActions(button, event, modifiers, coords); if (lastAction == NULL && FEnd2Label != NULL) - lastAction = FEnd2Label->executeAssociatedActions(button, event, modifiers, coords - FLabel2Offset); + g_warning("lastAction = FEnd2Label->executeAssociatedActions(button, event, modifiers, coords - FLabel2Offset);"); return lastAction; } @@ -1034,10 +1034,10 @@ * @param coords The coordinates to check against. * @return The requested info. */ -TFeedbackInfo CConnectionInstance::getFeedbackInfo(int modifiers, TVertex& coords) +TFeedbackInfo CConnectionInstance::getFeedbackInfo(TModifierKey modifiers, TVertex& coords) { TFeedbackInfo result; - + g_warning("Line 1040: TFeedbackInfo CConnectionInstance::getFeedbackInfo(TModifierKey modifiers, TVertex& coords)"); // End points. They are always assigned. result = FEnd1->getFeedbackInfo(modifiers, coords); if (result == GC_FI_NONE) @@ -1047,15 +1047,15 @@ if (result == GC_FI_NONE && FEnd1Decoration != NULL) result = FEnd1Decoration->getFeedbackInfo(modifiers, coords); if (result == GC_FI_NONE && FEnd1Label != NULL) - result = FEnd1Label->getFeedbackInfo(modifiers, coords - FLabel1Offset); + g_warning("result = FEnd1Label->getFeedbackInfo(%i, coords - FLabel1Offset);", modifiers); if (result == GC_FI_NONE && FCenterDecoration != NULL) result = FCenterDecoration->getFeedbackInfo(modifiers, coords); if (result == GC_FI_NONE && FCenterLabel != NULL) - result = FCenterLabel->getFeedbackInfo(modifiers, coords - FCenterLabelOffset); + g_warning("result = FCenterLabel->getFeedbackInfo(%i, coords - FCenterLabelOffset);", modifiers); if (result == GC_FI_NONE && FEnd2Decoration != NULL) result = FEnd2Decoration->getFeedbackInfo(modifiers, coords); if (result == GC_FI_NONE && FEnd2Label != NULL) - result = FEnd2Label->getFeedbackInfo(modifiers, coords - FLabel2Offset); + g_warning("result = FEnd2Label->getFeedbackInfo(%i, coords - FLabel2Offset);", modifiers); if (result == GC_FI_NONE) { @@ -1695,7 +1695,7 @@ void CConnectionLayer::CConnectionInstanceListener::onDestroy(CGCBase* object) { - CConnectionInstance* instance = (CConnectionInstance*) object; +//CConnectionInstance* instance = (CConnectionInstance*) object; layer->removeInstance((CConnectionInstance*) object); } //----------------------------------------------------------------------------------------------------------------------