Thread: [Jsmooth-cvs] jsmooth/skeletons/simplewrap description.skel, 1.10, 1.11 Makefile.win, 1.14, 1.15 ma
Status: Beta
Brought to you by:
reyes
From: Rodrigo R. <re...@us...> - 2007-05-27 09:14:55
|
Update of /cvsroot/jsmooth/jsmooth/skeletons/simplewrap In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv14482/skeletons/simplewrap Modified Files: description.skel Makefile.win main.cpp Log Message: splash screen support and small overall refactoring Index: description.skel =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/simplewrap/description.skel,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** description.skel 18 May 2007 21:34:00 -0000 1.10 --- description.skel 27 May 2007 09:14:51 -0000 1.11 *************** *** 44,47 **** --- 44,54 ---- </skeletonProperties> <skeletonProperties> + <description>SKEL_GENERIC_PROPERTY_SPLASH_DESCRIPTION</description> + <idName>SplashImg</idName> + <label>SKEL_GENERIC_PROPERTY_SPLASH</label> + <type>imgselector</type> + <value></value> + </skeletonProperties> + <skeletonProperties> <description>SKEL_GENERIC_PROPERTY_DEBUG_DESCRIPTION</description> <idName>Debug</idName> Index: main.cpp =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/simplewrap/main.cpp,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** main.cpp 20 May 2007 21:05:39 -0000 1.32 --- main.cpp 27 May 2007 09:14:51 -0000 1.33 *************** *** 29,32 **** --- 29,36 ---- #include "SingleInstanceManager.h" + #include "JniSmoothRegister.h" + #include "splashhelper.h" + #include "JVMBase.h" + ResourceManager* globalResMan; DebugConsole *DEBUGCONSOLE = 0; *************** *** 44,47 **** --- 48,52 ---- if (DEBUGCONSOLE != NULL) DEBUGCONSOLE->writeline(text); + printf("%s\n",text.c_str()); fflush(stdout); } *************** *** 51,55 **** DEBUGCONSOLE->waitKey(); } ! int WINAPI WinMain (HINSTANCE hThisInstance, HINSTANCE hPrevInstance, --- 56,68 ---- DEBUGCONSOLE->waitKey(); } ! ! class JVMListener : public JVMSetUpListener ! { ! virtual void jvmHasPid(int pid) ! { ! splashwindow_setProcessId(pid); ! } ! }; ! int WINAPI WinMain (HINSTANCE hThisInstance, HINSTANCE hPrevInstance, *************** *** 57,72 **** int nFunsterStil) { ! atexit(lastExit); ! SingleInstanceManager instanceman; ! globalResMan = new ResourceManager("JAVA", PROPID, JARID, JNISMOOTHID); ! // sets up the command line arguments ! // not sure if lpszArgument can be null on Windows... ! if ((lpszArgument!=NULL) && (strlen(lpszArgument)>0)) ! { ! std::vector<std::string> args = StringUtils::split(lpszArgument, " \t\n\r", "\"'", false); ! globalResMan->setUserArguments( args ); ! } --- 70,88 ---- int nFunsterStil) { ! atexit(lastExit); ! SingleInstanceManager instanceman; ! vector<JNIRegister*> jnireg; ! jnireg.push_back(new JniSmoothRegister()); ! globalResMan = new ResourceManager("JAVA", PROPID, JARID, JNISMOOTHID); ! ! // sets up the command line arguments ! // not sure if lpszArgument can be null on Windows... ! if ((lpszArgument!=NULL) && (strlen(lpszArgument)>0)) ! { ! std::vector<std::string> args = StringUtils::split(lpszArgument, " \t\n\r", "\"'", false); ! globalResMan->setUserArguments( args ); ! } *************** *** 78,84 **** } ! if (DEBUGCONSOLE!=0) ! globalResMan->printDebug(); ! bool singleinstance = globalResMan->getBooleanProperty("skel_SingleInstance"); --- 94,99 ---- } ! if (DEBUGCONSOLE!=0) ! globalResMan->printDebug(); bool singleinstance = globalResMan->getBooleanProperty("skel_SingleInstance"); *************** *** 96,146 **** } ! DEBUG(string("Main class: ") + globalResMan->getMainName()); - char curdir[256]; - GetCurrentDirectory(256, curdir); - DEBUG(string("Currentdir: ") + curdir); ! string newcurdir = globalResMan->getCurrentDirectory(); ! SetCurrentDirectory(newcurdir.c_str()); ! JavaMachineManager man(*globalResMan); ! man.setAcceptExe(true); ! man.setAcceptDLL(true); ! if (dodebug) ! man.setUseConsole(true); ! else ! man.setUseConsole(false); ! bool singleprocess = globalResMan->getBooleanProperty("skel_SingleProcess"); ! bool jnismooth = globalResMan->getBooleanProperty("skel_JniSmooth"); ! if (singleprocess || jnismooth) ! man.setPreferDLL(true); ! else ! man.setPreferDLL(false); ! int retvalue = 0; ! if (man.run() == false) { DEBUG("Displaying error message to user..."); ! std::string errmsg = globalResMan->getProperty("skel_Message"); ! std::string url = globalResMan->getProperty("skel_URL"); ! if (MessageBox(NULL, errmsg.c_str(), "No Java?", MB_OKCANCEL|MB_ICONQUESTION|MB_APPLMODAL) == IDOK) { ! ShellExecute(NULL, "open", url.c_str(), NULL, "", 0); } } ! else ! { ! retvalue = man.getExitCode(); ! } ! DEBUG("NORMAL EXIT"); ! DEBUGWAITKEY(); ! /* The program return-value is 0 - The value that PostQuitMessage() gave */ ! return retvalue; } --- 111,176 ---- } ! std::string splashimg = globalResMan->getProperty("skel_SplashImg"); ! DEBUG("splash: " + splashimg); ! if (splashimg.size() > 0) ! { ! splashwindow_start(splashimg); ! // Sleep(1000); ! } ! DEBUG(string("Main class: ") + globalResMan->getMainName()); ! char curdir[256]; ! GetCurrentDirectory(256, curdir); ! DEBUG(string("Currentdir: ") + curdir); ! string newcurdir = globalResMan->getCurrentDirectory(); ! SetCurrentDirectory(newcurdir.c_str()); ! JavaMachineManager man(*globalResMan); ! man.setJNI(jnireg); ! man.setAcceptExe(true); ! man.setAcceptDLL(true); ! if (dodebug) ! man.setUseConsole(true); ! else ! man.setUseConsole(false); ! bool singleprocess = globalResMan->getBooleanProperty("skel_SingleProcess"); ! bool jnismooth = globalResMan->getBooleanProperty("skel_JniSmooth"); ! if (singleprocess || jnismooth) ! man.setPreferDLL(true); ! else ! man.setPreferDLL(false); ! ! if (splashimg.size() > 0) ! { ! man.addListener(new JVMListener()); ! } ! ! int retvalue = 0; ! ! if (man.run() == false) { DEBUG("Displaying error message to user..."); ! std::string errmsg = globalResMan->getProperty("skel_Message"); ! std::string url = globalResMan->getProperty("skel_URL"); ! if (MessageBox(NULL, errmsg.c_str(), "No Java?", MB_OKCANCEL|MB_ICONQUESTION|MB_APPLMODAL) == IDOK) { ! ShellExecute(NULL, "open", url.c_str(), NULL, "", 0); } } ! else ! { ! retvalue = man.getExitCode(); ! } ! DEBUG("NORMAL EXIT"); ! DEBUGWAITKEY(); ! /* The program return-value is 0 - The value that PostQuitMessage() gave */ ! return retvalue; } Index: Makefile.win =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/simplewrap/Makefile.win,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Makefile.win 18 May 2007 21:34:00 -0000 1.14 --- Makefile.win 27 May 2007 09:14:51 -0000 1.15 *************** *** 8,15 **** RES = JWrap_private.res OBJ = main.o $(RES) LINKOBJ = main.o $(RES) ! LIBS = -L"/lib" -L"../commonjava" -L"../util-core" -mwindows ../commonjava/CommonJava.a ../util-core/util-core.a INCS = -I"/include" -I"$(JDK)/include/win32" -I"$(JDK)/include" -I"../commonjava" -I"../util-core" ! CXXINCS = -g -I"/include/c++" -I"/include/c++/mingw32" -I"/include/c++/backward" -I"/include" -I"$(JDK)/include/win32" -I"$(JDK)/include" -I"../commonjava" -I../util-core BIN = JWrap.exe CXXFLAGS = $(CUSTOMFLAGS) $(CXXINCS) -DJDK="$(JDK)" --- 8,17 ---- RES = JWrap_private.res OBJ = main.o $(RES) + FLTK-LDFLAGS = $(shell fltk-config --use-images --ldflags ) + FLTK-CXXFLAGS = $(shell fltk-config --use-images --cxxflags ) LINKOBJ = main.o $(RES) ! LIBS = -L"/lib" -L"../commonjava" -L"../util-core" -mwindows ../commonjava/CommonJava.a ../util-core/util-core.a ../util-gui/util-gui.a $(FLTK-LDFLAGS) -lfltk_images -lfltk_png -lfltk_z -lfltk_jpeg ../jnismooth/jnismooth.a INCS = -I"/include" -I"$(JDK)/include/win32" -I"$(JDK)/include" -I"../commonjava" -I"../util-core" ! CXXINCS = -g -I"/include/c++" -I"/include/c++/mingw32" -I"/include/c++/backward" -I"/include" -I"$(JDK)/include/win32" -I"$(JDK)/include" -I"../commonjava" -I../util-core -I../util-gui -I../jnismooth BIN = JWrap.exe CXXFLAGS = $(CUSTOMFLAGS) $(CXXINCS) -DJDK="$(JDK)" |