jsmooth-cvs Mailing List for JSmooth (Page 2)
Status: Beta
Brought to you by:
reyes
You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
(64) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(44) |
Sep
|
Oct
(1) |
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
|
Feb
|
Mar
|
Apr
(23) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2007 |
Jan
|
Feb
(35) |
Mar
(75) |
Apr
(105) |
May
(89) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(12) |
Nov
|
Dec
|
2014 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
(1) |
Nov
(1) |
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
2016 |
Jan
(4) |
Feb
(1) |
Mar
|
Apr
(2) |
May
(1) |
Jun
|
Jul
(1) |
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
From: Rodrigo R. <re...@us...> - 2007-05-27 09:14:55
|
Update of /cvsroot/jsmooth/jsmooth/skeletons/samplejar In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv14482/skeletons/samplejar Modified Files: sample.props Log Message: splash screen support and small overall refactoring Index: sample.props =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/samplejar/sample.props,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** sample.props 18 May 2007 21:34:00 -0000 1.5 --- sample.props 27 May 2007 09:14:50 -0000 1.6 *************** *** 18,19 **** --- 18,20 ---- skel_Debug=1 skel_SingleProcess=1 + skel_SplashImg=splash.png |
From: Rodrigo R. <re...@us...> - 2007-05-27 09:14:54
|
Update of /cvsroot/jsmooth/jsmooth/skeletons/samplejar/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv14482/skeletons/samplejar/src Modified Files: SampleApplication.java Log Message: splash screen support and small overall refactoring Index: SampleApplication.java =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/samplejar/src/SampleApplication.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SampleApplication.java 18 May 2007 21:34:00 -0000 1.2 --- SampleApplication.java 27 May 2007 09:14:50 -0000 1.3 *************** *** 78,84 **** } ! String toto = jsmooth.Native.getExecutablePath(); ! ! jLabel1.setText("Sample Application for JSmooth " + toto); jPanel1.add(jLabel1, java.awt.BorderLayout.CENTER); --- 78,88 ---- } ! String jnitest = ""; ! if (jsmooth.Native.isAvailable()) ! { ! jnitest = jsmooth.Native.getExecutablePath(); ! } ! ! jLabel1.setText("Sample Application for JSmooth " + jnitest); jPanel1.add(jLabel1, java.awt.BorderLayout.CENTER); *************** *** 122,128 **** * @param args the command line arguments */ ! public static void main(String args[]) { ! new SampleApplication().setVisible(true); } --- 126,148 ---- * @param args the command line arguments */ ! public static void main(String args[]) throws Exception { ! jsmooth.SplashWindow spw = null; ! ! // throw new Exception("KO"); ! ! if (jsmooth.Native.isAvailable()) ! { ! spw = jsmooth.Native.getSplashWindow(); ! } ! ! if (spw != null) ! for (int i=0; i<=50; i+=2) ! { ! spw.setProgress(i, 50); ! Thread.currentThread().sleep(100); ! } ! ! new SampleApplication().setVisible(true); } |
From: Rodrigo R. <re...@us...> - 2007-05-27 09:13:04
|
Update of /cvsroot/jsmooth/jsmooth/skeletons/jnismooth In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv13717/skeletons/jnismooth Added Files: Makefile.win JniSmoothRegister.o JniSmooth.cpp JniSmoothRegister.h JniSmooth.h JniSmoothRegister.cpp Log Message: jnismooth moved from commonjava --- NEW FILE: JniSmoothRegister.o --- (This appears to be a binary file; contents omitted.) --- NEW FILE: JniSmoothRegister.h --- /* JSmooth: a VM wrapper toolkit for Windows Copyright (C) 2003-2007 Rodrigo Reyes <re...@ch...> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef __JNISMOOTHREGISTER_H_ #define __JNISMOOTHREGISTER_H_ #include <string> #include "SunJVMDLL.h" #include "JNIRegister.h" class JniSmoothRegister : public JNIRegister { virtual void registerJNI(SunJVMDLL* target); }; #endif --- NEW FILE: JniSmooth.cpp --- /* JSmooth: a VM wrapper toolkit for Windows Copyright (C) 2003-2007 Rodrigo Reyes <re...@ch...> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "JniSmooth.h" #include "common.h" #include "StringUtils.h" #include "FileUtils.h" #include "jni.h" #include "JMethodCaller.h" #include "splashhelper.h" SunJVMDLL* jnismooth_dll = 0; JNIEXPORT jstring JNICALL testString (JNIEnv *env, jobject obj, jstring s) { jboolean copy = true; const char* str = jnismooth_dll->env()->GetStringUTFChars(s, ©); std::string result = StringUtils::toLowerCase(str); jnismooth_dll->env()->ReleaseStringUTFChars(s, str); return jnismooth_dll->newUTFString(result); } JNIEXPORT jstring JNICALL jnm_getExecutablePath(JNIEnv *env, jobject obj) { return jnismooth_dll->newUTFString(FileUtils::getExecutablePath()); } JNIEXPORT jstring JNICALL jnm_getExecutableName(JNIEnv *env, jobject obj) { return jnismooth_dll->newUTFString(FileUtils::getExecutableFileName()); } JNIEXPORT jboolean JNICALL jnm_deleteFileOnReboot(JNIEnv *env, jobject obj, jstring s) { jboolean copy = true; const char* str = jnismooth_dll->env()->GetStringUTFChars(s, ©); std::string filename = str; jnismooth_dll->env()->ReleaseStringUTFChars(s, str); if (!FileUtils::fileExists(filename)) { filename = StringUtils::replace(filename, "/", "\\"); if (!FileUtils::fileExists(filename)) { return JNI_FALSE; } } FileUtils::deleteOnReboot(filename); return JNI_TRUE; } JNIEXPORT jboolean JNICALL jnm_exitWindows(JNIEnv *env, jobject obj, jint s) { DWORD dwVersion = GetVersion(); if ( dwVersion < 0x80000000) { // Windows NT4/2000/XP HANDLE hToken; LUID tmpLuid; HANDLE handleProcess=GetCurrentProcess(); if (!OpenProcessToken(handleProcess,TOKEN_ADJUST_PRIVILEGES|TOKEN_QUERY, &hToken)) return JNI_FALSE; if (!LookupPrivilegeValue(0, SE_SHUTDOWN_NAME, &tmpLuid)) return JNI_FALSE; TOKEN_PRIVILEGES NewState; LUID_AND_ATTRIBUTES luidattr; NewState.PrivilegeCount = 1; luidattr.Luid=tmpLuid; luidattr.Attributes=SE_PRIVILEGE_ENABLED; NewState.Privileges[0]=luidattr; if (!AdjustTokenPrivileges(hToken, false, &NewState, sizeof(TOKEN_PRIVILEGES), 0, 0)) return JNI_FALSE; } if (ExitWindowsEx(s, 0)) return JNI_TRUE; return JNI_FALSE; } JNIEXPORT jboolean JNICALL jnm_shellexecute(JNIEnv *env, jobject obj, jstring action, jstring file, jstring parameters, jstring directory, jint showcmd) { jboolean copy = true; const char* s_action = (action != NULL)?jnismooth_dll->env()->GetStringUTFChars(action, ©):NULL; const char* s_file = (file != NULL)?jnismooth_dll->env()->GetStringUTFChars(file, ©):NULL; const char* s_parameters = (parameters != NULL)?jnismooth_dll->env()->GetStringUTFChars(parameters, ©):NULL; const char* s_directory = (directory != NULL)?jnismooth_dll->env()->GetStringUTFChars(directory, ©):NULL; bool res = ShellExecute(NULL, s_action, s_file, s_parameters, s_directory, showcmd); if (s_action != NULL) jnismooth_dll->env()->ReleaseStringUTFChars(action, s_action); if (s_file != NULL) jnismooth_dll->env()->ReleaseStringUTFChars(file, s_file); if (s_parameters != NULL) jnismooth_dll->env()->ReleaseStringUTFChars(parameters, s_parameters); if (s_directory != NULL) jnismooth_dll->env()->ReleaseStringUTFChars(directory, s_directory); return res?JNI_TRUE:JNI_FALSE; } JNIEXPORT jobject JNICALL jnm_getdriveinfo(JNIEnv *env, jobject obj, jobject file) { jclass dic = jnismooth_dll->findClass("jsmooth.DriveInfo"); if (dic == 0) { return NULL; } jmethodID construc = jnismooth_dll->findMethod(dic, "<init>", "()V", false); if (construc == 0) { return NULL; } JMethodCaller canonicalcaller("java.io.File", "java.lang.String getCanonicalPath()"); jvalue vals[0]; jvalue canonicalval = canonicalcaller.invoke(*jnismooth_dll, file, vals); jstring jcanstr = (jstring)canonicalval.l; jboolean copy = true; const char* str = jnismooth_dll->env()->GetStringUTFChars(jcanstr, ©); std::string canonicalfile = str; jnismooth_dll->env()->ReleaseStringUTFChars(jcanstr, str); // int driveType = GetDriveType(); jobject driveinfo = jnismooth_dll->env()->NewObject(dic, construc); if ((canonicalfile.length()>1) && (canonicalfile[1] == ':')) { std::string driveletter = canonicalfile[0] + std::string(":\\"); int drivetype = GetDriveType(driveletter.c_str()); jnismooth_dll->setIntField(dic, driveinfo, "m_driveType", drivetype); void * pGetDiskFreeSpaceEx = (void*)GetProcAddress(GetModuleHandle("kernel32.dll"), "GetDiskFreeSpaceExA"); long freeBytes = 0, totalBytes = -1, totalFreeBytes = 0; if ((pGetDiskFreeSpaceEx != 0) && (drivetype > 1)) { unsigned __int64 lpFreeBytesAvailable, lpTotalNumberOfBytes, lpTotalNumberOfFreeBytes; if (GetDiskFreeSpaceEx(driveletter.c_str(), (_ULARGE_INTEGER*)&lpFreeBytesAvailable, (_ULARGE_INTEGER*)&lpTotalNumberOfBytes, (_ULARGE_INTEGER*)&lpTotalNumberOfFreeBytes)) { freeBytes = lpFreeBytesAvailable; totalBytes = lpTotalNumberOfBytes; totalFreeBytes = lpTotalNumberOfFreeBytes; } } else if (drivetype > 1) { DWORD dwSectPerClust, dwBytesPerSect, dwFreeClusters, dwTotalClusters; if (GetDiskFreeSpace(driveletter.c_str(), &dwSectPerClust, &dwBytesPerSect, &dwFreeClusters, &dwTotalClusters)) { freeBytes = ((long)dwBytesPerSect * (long)dwSectPerClust * (long)dwFreeClusters); totalBytes = ((long)dwBytesPerSect * (long)dwSectPerClust * (long)dwTotalClusters); totalFreeBytes = ((long)dwBytesPerSect * (long)dwSectPerClust * (long)dwFreeClusters); } } jnismooth_dll->setLongField(dic, driveinfo, "m_freeBytesForUser", freeBytes); jnismooth_dll->setLongField(dic, driveinfo, "m_totalFreeBytes", totalFreeBytes); jnismooth_dll->setLongField(dic, driveinfo, "m_totalBytes", totalBytes); if (drivetype > 1) { char volumename[MAX_PATH+1], filesystemname[MAX_PATH+1]; DWORD serialnumber, maxcomposize, systemflags; if (GetVolumeInformation( driveletter.c_str(), volumename, MAX_PATH, &serialnumber, &maxcomposize, &systemflags, filesystemname, MAX_PATH)) { jnismooth_dll->setIntField(dic, driveinfo, "m_serialNumber", serialnumber); jnismooth_dll->setIntField(dic, driveinfo, "m_maxComponentSize", maxcomposize); jnismooth_dll->setIntField(dic, driveinfo, "m_systemFlags", systemflags); jstring jvolumename = jnismooth_dll->newUTFString(volumename); jstring jfilesystemname = jnismooth_dll->newUTFString(filesystemname); jnismooth_dll->setObjectField(dic, driveinfo, "m_volumeName", "java.lang.String", (jobject)jvolumename); jnismooth_dll->setObjectField(dic, driveinfo, "m_fileSystemName", "java.lang.String", (jobject)jfilesystemname); } } } // jfieldID binding = broker->env()->GetFieldID(nat, "m_", "I"); // broker->env()->SetStaticBooleanField(nat, binding, JNI_TRUE); return driveinfo; } JNIEXPORT jboolean JNICALL jnm_splash_isvisible(JNIEnv *env, jobject obj) { return splashwindow_isVisible(); } JNIEXPORT void JNICALL jnm_splash_hide(JNIEnv *env, jobject obj) { splashwindow_hide(); } JNIEXPORT void JNICALL jnm_splash_setprogress(JNIEnv *env, jobject obj, jint current, jint maximum) { splashwindow_setProgress(current, maximum); } JNIEXPORT jobject JNICALL jnm_splash_getsplashwindow(JNIEnv *env, jobject obj, jint current, jint maximum) { jclass spc = jnismooth_dll->findClass("jsmooth.SplashWindow"); if (spc == 0) { return NULL; } jmethodID construc = jnismooth_dll->findMethod(spc, "<init>", "()V", false); if (construc == 0) { return NULL; } jobject splashwindow = jnismooth_dll->env()->NewObject(spc, construc); return splashwindow; } void registerNativeMethods(SunJVMDLL* broker) { jnismooth_dll = broker; jclass nat = broker->findClass("jsmooth.Native"); if (nat != 0) { if ( broker->registerMethod("jsmooth.Native", "getExecutablePath", "()Ljava/lang/String;", (void*)jnm_getExecutablePath) && broker->registerMethod("jsmooth.Native", "getExecutableName", "()Ljava/lang/String;", (void*)jnm_getExecutableName) && broker->registerMethod("jsmooth.Native", "deleteFileOnReboot", "(Ljava/lang/String;)Z", (void*)jnm_deleteFileOnReboot) && broker->registerMethod("jsmooth.Native", "exitWindows", "(I)Z", (void*)jnm_exitWindows) && broker->registerMethod("jsmooth.Native", "shellExecute", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;I)Z", (void*)jnm_shellexecute) && broker->registerMethod("jsmooth.Native", "getDriveInfo", "(Ljava/io/File;)Ljsmooth/DriveInfo;", (void*)jnm_getdriveinfo) && broker->registerMethod("jsmooth.Native", "getSplashWindow", "()Ljsmooth/SplashWindow;", (void*)jnm_splash_getsplashwindow) ) { jfieldID binding = broker->env()->GetStaticFieldID(nat, "s_bound", "Z"); broker->env()->SetStaticBooleanField(nat, binding, JNI_TRUE); } jclass splashc = broker->findClass("jsmooth.SplashWindow"); if (splashc != 0) { broker->registerMethod("jsmooth.SplashWindow", "isVisible", "()Z", (void*)jnm_splash_isvisible); broker->registerMethod("jsmooth.SplashWindow", "hide", "()V", (void*)jnm_splash_hide); broker->registerMethod("jsmooth.SplashWindow", "setProgress", "(II)V", (void*)jnm_splash_setprogress); } } } --- NEW FILE: Makefile.win --- # Project: CommonJava # Makefile created by Dev-C++ 4.9.8.0 RM = rm -f CPP = g++.exe CC = gcc.exe WINDRES = windres.exe MINGW = RES = OBJ = JniSmooth.o JniSmoothRegister.o $(RES) LINKOBJ = JniSmooth.o JniSmoothRegister.o $(RES) LIBS = -L"$(MINGW)/lib" INCS = -I"../commonjava" -I"../util-core" -I"../util-gui" -I"$(MINGW)/include" -I"$(JDK)/include" -I"$(JDK)/include/win32" CXXINCS = -g -fno-rtti -Os -I"../util-core" -I"../commonjava" -I"../util-gui" -I"$(MINGW)/include/c++" -I"$(MINGW)/include/c++/mingw32" -I"$(MINGW)/include/c++/backward" -I"$(MINGW)/include" -I"$(JDK)/include" -I"$(JDK)/include/win32" BIN = jnismooth.a CXXFLAGS = $(CUSTOMFLAGS) $(CXXINCS) -DJDK="$(JDK)" CFLAGS = $(INCS) .PHONY: all all-before all-after clean clean-custom all: all-before jnismooth.a all-after clean: clean-custom $(RM) $(OBJ) $(BIN) $(BIN): $(LINKOBJ) ar r $(BIN) $(LINKOBJ) ranlib $(BIN) ## $(CPP) $(CXXFLAGS) test.cpp $(BIN) ../util-core/util-core.a ../util-core/util-gui.a -o test.exe JavaMachineManager.o: JavaMachineManager.cpp $(CPP) -c JavaMachineManager.cpp -o JavaMachineManager.o $(CXXFLAGS) JVMEnvVarLookup.o: JVMEnvVarLookup.cpp $(CPP) -c JVMEnvVarLookup.cpp -o JVMEnvVarLookup.o $(CXXFLAGS) JVMRegistryLookup.o: JVMRegistryLookup.cpp $(CPP) -c JVMRegistryLookup.cpp -o JVMRegistryLookup.o $(CXXFLAGS) MSJViewLauncher.o: MSJViewLauncher.cpp $(CPP) -c MSJViewLauncher.cpp -o MSJViewLauncher.o $(CXXFLAGS) Properties.o: Properties.cpp $(CPP) -c Properties.cpp -o Properties.o $(CXXFLAGS) ResourceManager.o: ResourceManager.cpp $(CPP) -c ResourceManager.cpp -o ResourceManager.o $(CXXFLAGS) SunJVMLauncher.o: SunJVMLauncher.cpp $(CPP) -c SunJVMLauncher.cpp -o SunJVMLauncher.o $(CXXFLAGS) Version.o: Version.cpp $(CPP) -c Version.cpp -o Version.o $(CXXFLAGS) global.o: global.cpp $(CPP) -c global.cpp -o global.o $(CXXFLAGS) JavaProperty.o: JavaProperty.cpp $(CPP) -c JavaProperty.cpp -o JavaProperty.o $(CXXFLAGS) --- NEW FILE: JniSmoothRegister.cpp --- /* JSmooth: a VM wrapper toolkit for Windows Copyright (C) 2003-2007 Rodrigo Reyes <re...@ch...> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "JniSmooth.h" #include "JniSmoothRegister.h" #include "common.h" #include "SunJVMDLL.h" #include "jni.h" #include "JMethodCaller.h" #include "splashhelper.h" void JniSmoothRegister::registerJNI(SunJVMDLL* target) { printf("JniSmoothRegister::registerJNI activated\n"); fflush(stdout); registerNativeMethods(target); } --- NEW FILE: JniSmooth.h --- /* JSmooth: a VM wrapper toolkit for Windows Copyright (C) 2003-2007 Rodrigo Reyes <re...@ch...> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef __JNISMOOTH_H_ #define __JNISMOOTH_H_ #include <string> #include "SunJVMDLL.h" void registerNativeMethods(SunJVMDLL* broker); #endif |
From: Rodrigo R. <re...@us...> - 2007-05-27 09:12:38
|
Update of /cvsroot/jsmooth/jsmooth/skeletons/jnismooth/src/jsmooth In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv13696/skeletons/jnismooth/src/jsmooth Modified Files: Native.java Log Message: add splash screen support Index: Native.java =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/jnismooth/src/jsmooth/Native.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Native.java 19 May 2007 15:09:44 -0000 1.1 --- Native.java 27 May 2007 09:12:27 -0000 1.2 *************** *** 1,165 **** ! /* ! JSmooth: a VM wrapper toolkit for Windows ! Copyright (C) 2003 Rodrigo Reyes <re...@ch...> ! ! 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. ! ! */ ! ! package jsmooth; ! ! /** ! * The Native class is the main hub for accessing the native functions ! * provided by JSmooth at runtime. All the methods provided are ! * static, but it is important that you check the availability of the ! * methods by calling first the <tt>isAvailable()</tt> method. ! * <p> ! * ! * When JSmooth loads the JVM, and before calling the application's ! * main class, it registers all the native methods provided in this ! * class with their matching C functions. If the registration process ! * is successful, it enables the binding by setting to <tt>true</tt> ! * the result of <tt>isAvailable()</tt>. ! * ! */ ! ! public class Native ! { ! private static boolean s_bound = false; ! ! /** ! * Return true if this class is correctly bound to the native ! * methods. ! * ! * @return true if you can use this class, false otherwise. ! */ ! static public boolean isAvailable() ! { ! return s_bound; ! } ! ! /** ! * Return the directory where is located the executable used to ! * launch the current application. The result is a string ! * containing a native file descriptor of the directory. ! * <br/> For instance: <tt>c:\my program\here\</tt> ! * ! * @return A java.lang.String containing the path of this executable ! */ ! static public native String getExecutablePath(); ! ! /** ! * Return the file name of the executable used to launch the ! * current application. It only contains the file part, not the ! * directory. ! * <br/> For instance: <tt>myprogram.exe</tt> ! * ! * @return A java.lang.String containing the name of this executable ! */ ! static public native String getExecutableName(); ! ! /** ! * Flag a file so that Windows shall delete it during the next ! * startup sequence of the operating system. The file is not ! * deleted nor touched before the next reboot. If the file is ! * already deleted, nothing happens. ! * ! * @param filename the name of the file to delete ! */ ! static public native boolean deleteFileOnReboot(String filename); ! ! ! static public final int EXITWINDOWS_FORCE = 4; ! static public final int EXITWINDOWS_LOGOFF = 0; ! static public final int EXITWINDOWS_POWEROFF = 8; ! static public final int EXITWINDOWS_REBOOT = 2; ! static public final int EXITWINDOWS_SHUTDOWN = 1; ! ! /** ! * Request Windows to shutdown/reboot the computer, or log off the ! * current user/session. There is no dialog asking the user to ! * confirm. ! * ! * @param shutdownFlags a combination of EXITWINDOWS_* flags ! */ ! static public native boolean exitWindows(int shutdownFlags); ! ! ! static public final String SHELLEXECUTE_OPEN = "open"; ! static public final String SHELLEXECUTE_PRINT = "print"; ! static public final String SHELLEXECUTE_EXPLORE = "explore"; ! static public final String SHELLEXECUTE_FIND = "find"; ! static public final String SHELLEXECUTE_EDIT = "edit"; ! ! static public final int SW_HIDE=0; ! static public final int SW_NORMAL=1; ! static public final int SW_SHOWNORMAL=1; ! static public final int SW_SHOWMINIMIZED=2; ! static public final int SW_MAXIMIZE=3; ! static public final int SW_SHOWMAXIMIZED=3; ! static public final int SW_SHOWNOACTIVATE=4; ! static public final int SW_SHOW=5; ! static public final int SW_MINIMIZE=6; ! static public final int SW_SHOWMINNOACTIVE=7; ! static public final int SW_SHOWNA=8; ! static public final int SW_RESTORE=9; ! static public final int SW_SHOWDEFAULT=10; ! static public final int SW_FORCEMINIMIZE=11; ! static public final int SW_MAX=11; ! ! /** ! * Maps the ShellExecute Windows function, which allows the ! * application to either run a new process, or to start a standard ! * operation on any document file, such as opening, editing, ! * printing, etc. ! * <p> ! * For instance, to start the default application for PDF reading: ! * <tt>shellExecute(Native.SHELLEXECUTE_OPEN, "c:/somewhere/mydocument.pdf", null, null, Native.SW_NORMAL);</tt> ! * <br/> ! * To print an html page: <tt>shellExecute(Native.SHELLEXECUTE_PRINT, "mydocument.html", null, null, Native.SW_NORMAL);</tt> ! * ! * @param action specify the operation to perform, can be any of the SHELLEXECUTE_* constant ! * @param file the file to run or for which to start the default application ! * @param parameters if file is an executable, this variable specifies the parameters to be passed. Otherwise, just set it to null. ! * @param directory the working directory for the action executed. If set to <tt>null</tt>, the default working directory of the java application is used. ! * @param showCmd a flag that specifies the state of the launched application display ! * ! * @return true if the action was successfully started, false if an error occurred. ! */ ! static public native boolean shellExecute(String action, String file, String parameters, String directory, int showCmd); ! ! ! /** ! * a DriveInfo info object provides platform-specific information ! * relative to the disk volume where the File object parameter is ! * located. This method determines the disk drive from the File ! * object provided, or from the disk drive of the working ! * directory if the File object does not represent an absolute ! * path. ! * ! * <p> ! * ! * For instance <tt>Native.getDriveInfo(new File("."))</tt> ! * provides a DriveInfo object for the volume on which the current ! * working directory is located. ! * <br/> ! * ! * <tt>Native.getDriveInfo(new File("D:/my/dir/or/file"))</tt> is ! * the same as <tt>Native.getDriveInfo(new File("D:"))</tt>. ! * ! * @return an DriveInfo object ! */ ! static public native DriveInfo getDriveInfo(java.io.File f); ! } --- 1,167 ---- ! /* ! JSmooth: a VM wrapper toolkit for Windows ! Copyright (C) 2003 Rodrigo Reyes <re...@ch...> ! ! 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. ! ! */ ! ! package jsmooth; ! ! /** ! * The Native class is the main hub for accessing the native functions ! * provided by JSmooth at runtime. All the methods provided are ! * static, but it is important that you check the availability of the ! * methods by calling first the <tt>isAvailable()</tt> method. ! * <p> ! * ! * When JSmooth loads the JVM, and before calling the application's ! * main class, it registers all the native methods provided in this ! * class with their matching C functions. If the registration process ! * is successful, it enables the binding by setting to <tt>true</tt> ! * the result of <tt>isAvailable()</tt>. ! * ! */ ! ! public class Native ! { ! private static boolean s_bound = false; ! ! /** ! * Return true if this class is correctly bound to the native ! * methods. ! * ! * @return true if you can use this class, false otherwise. ! */ ! static public boolean isAvailable() ! { ! return s_bound; ! } ! ! /** ! * Return the directory where is located the executable used to ! * launch the current application. The result is a string ! * containing a native file descriptor of the directory. ! * <br/> For instance: <tt>c:\my program\here\</tt> ! * ! * @return A java.lang.String containing the path of this executable ! */ ! static public native String getExecutablePath(); ! ! /** ! * Return the file name of the executable used to launch the ! * current application. It only contains the file part, not the ! * directory. ! * <br/> For instance: <tt>myprogram.exe</tt> ! * ! * @return A java.lang.String containing the name of this executable ! */ ! static public native String getExecutableName(); ! ! /** ! * Flag a file so that Windows shall delete it during the next ! * startup sequence of the operating system. The file is not ! * deleted nor touched before the next reboot. If the file is ! * already deleted, nothing happens. ! * ! * @param filename the name of the file to delete ! */ ! static public native boolean deleteFileOnReboot(String filename); ! ! ! static public final int EXITWINDOWS_FORCE = 4; ! static public final int EXITWINDOWS_LOGOFF = 0; ! static public final int EXITWINDOWS_POWEROFF = 8; ! static public final int EXITWINDOWS_REBOOT = 2; ! static public final int EXITWINDOWS_SHUTDOWN = 1; ! ! /** ! * Request Windows to shutdown/reboot the computer, or log off the ! * current user/session. There is no dialog asking the user to ! * confirm. ! * ! * @param shutdownFlags a combination of EXITWINDOWS_* flags ! */ ! static public native boolean exitWindows(int shutdownFlags); ! ! ! static public final String SHELLEXECUTE_OPEN = "open"; ! static public final String SHELLEXECUTE_PRINT = "print"; ! static public final String SHELLEXECUTE_EXPLORE = "explore"; ! static public final String SHELLEXECUTE_FIND = "find"; ! static public final String SHELLEXECUTE_EDIT = "edit"; ! ! static public final int SW_HIDE=0; ! static public final int SW_NORMAL=1; ! static public final int SW_SHOWNORMAL=1; ! static public final int SW_SHOWMINIMIZED=2; ! static public final int SW_MAXIMIZE=3; ! static public final int SW_SHOWMAXIMIZED=3; ! static public final int SW_SHOWNOACTIVATE=4; ! static public final int SW_SHOW=5; ! static public final int SW_MINIMIZE=6; ! static public final int SW_SHOWMINNOACTIVE=7; ! static public final int SW_SHOWNA=8; ! static public final int SW_RESTORE=9; ! static public final int SW_SHOWDEFAULT=10; ! static public final int SW_FORCEMINIMIZE=11; ! static public final int SW_MAX=11; ! ! /** ! * Maps the ShellExecute Windows function, which allows the ! * application to either run a new process, or to start a standard ! * operation on any document file, such as opening, editing, ! * printing, etc. ! * <p> ! * For instance, to start the default application for PDF reading: ! * <tt>shellExecute(Native.SHELLEXECUTE_OPEN, "c:/somewhere/mydocument.pdf", null, null, Native.SW_NORMAL);</tt> ! * <br/> ! * To print an html page: <tt>shellExecute(Native.SHELLEXECUTE_PRINT, "mydocument.html", null, null, Native.SW_NORMAL);</tt> ! * ! * @param action specify the operation to perform, can be any of the SHELLEXECUTE_* constant ! * @param file the file to run or for which to start the default application ! * @param parameters if file is an executable, this variable specifies the parameters to be passed. Otherwise, just set it to null. ! * @param directory the working directory for the action executed. If set to <tt>null</tt>, the default working directory of the java application is used. ! * @param showCmd a flag that specifies the state of the launched application display ! * ! * @return true if the action was successfully started, false if an error occurred. ! */ ! static public native boolean shellExecute(String action, String file, String parameters, String directory, int showCmd); ! ! ! /** ! * a DriveInfo info object provides platform-specific information ! * relative to the disk volume where the File object parameter is ! * located. This method determines the disk drive from the File ! * object provided, or from the disk drive of the working ! * directory if the File object does not represent an absolute ! * path. ! * ! * <p> ! * ! * For instance <tt>Native.getDriveInfo(new File("."))</tt> ! * provides a DriveInfo object for the volume on which the current ! * working directory is located. ! * <br/> ! * ! * <tt>Native.getDriveInfo(new File("D:/my/dir/or/file"))</tt> is ! * the same as <tt>Native.getDriveInfo(new File("D:"))</tt>. ! * ! * @return an DriveInfo object ! */ ! static public native DriveInfo getDriveInfo(java.io.File f); ! ! static public native SplashWindow getSplashWindow(); ! } |
Update of /cvsroot/jsmooth/jsmooth/skeletons/util-gui In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv10916/skeletons/util-gui Added Files: testmain.cpp Splash.h splashhelper.h guihelper.h splashhelper.cpp Makefile.win guihelper.cpp Splash.cpp Log Message: splash screen gui package --- NEW FILE: splashhelper.h --- /* JSmooth: a VM wrapper toolkit for Windows Copyright (C) 2003-2007 Rodrigo Reyes <re...@ch...> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef __SPLASHHELPER_H_ #define __SPLASHHELPER_H_ #include <string> #include "windef.h" void splashwindow_start(const std::string& filename); bool splashwindow_isVisible(void); void splashwindow_hide(void); void splashwindow_setProgress(int cur, int max); void splashwindow_setProcessId(DWORD pid); #endif --- NEW FILE: Makefile.win --- # Project: CommonJava PROJECTNAME=util-gui RM = rm -f CPP = g++.exe CC = gcc.exe WINDRES = windres.exe MINGW = "c:/MinGW" FLTK-LDFLAGS = $(shell fltk-config --ldflags --use-images) FLTK-CXXFLAGS = $(shell fltk-config --cxxflags --use-images) RES = OBJ = guihelper.o splashhelper.o Splash.o $(RES) LIBS = -L"$(MINGW)/lib" -L"/lib" -lws2_32 -lwininet $(FLTK-LDFLAGS) CXXINCS = -Os -I"../util-core" -I"$(MINGW)/include/c++" -I"$(MINGW)/include/c++/mingw32" -I"$(MINGW)/include/c++/backward" -I"$(MINGW)/include" -I"$(JDK)/include" -I"$(JDK)/include/win32" $(FLTK-CXXFLAGS) BIN = $(PROJECTNAME).a CXXFLAGS = $(CUSTOMFLAGS) $(CXXINCS) -DJDK="$(JDK)" .PHONY: all all-before all-after clean clean-custom $(PROJECTNAME) all: all-before $(PROJECTNAME).a testmain.cpp all-after clean: clean-custom $(RM) $(OBJ) $(BIN) test.exe testmain.o $(BIN): $(OBJ) ar r $(BIN) $(OBJ) ranlib $(BIN) $(CPP) -g testmain.o $(BIN) ../util-core/util-core.a -o test.exe $(LIBS) $(PROJECTNAME).a: $(OBJ) testmain.o testmain.o: testmain.cpp $(CPP) -c testmain.cpp -o testmain.o $(CXXFLAGS) --- NEW FILE: guihelper.h --- /* JSmooth: a VM wrapper toolkit for Windows Copyright (C) 2003-2007 Rodrigo Reyes <re...@ch...> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef __GUIHELPER_H_ #define __GUIHELPER_H_ void guihelper_run(void); #endif --- NEW FILE: testmain.cpp --- /* JSmooth: a VM wrapper toolkit for Windows Copyright (C) 2003-2007 Rodrigo Reyes <re...@ch...> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <iostream> #include <stdlib.h> #include "StringUtils.h" #include "guihelper.h" #define DEBUG(x) _debugOutput(x) #define DEBUGWAITKEY() _debugWaitKey() void _debugOutput(const std::string& text) { // std::cerr << text << "\r\n"; printf("%s\n", text.c_str()); fflush(stdout); } void _debugWaitKey() { } int main(int argc, char *argv[]) { guihelper_run(); exit(0); } --- NEW FILE: Splash.h --- /* JSmooth: a VM wrapper toolkit for Windows Copyright (C) 2003-2007 Rodrigo Reyes <re...@ch...> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef __SPLASH_H_ #define __SPLASH_H_ #include <FL/Fl.H> #include <FL/Fl_Double_Window.H> #include <FL/Fl_Tile.H> #include <FL/Fl_Progress.H> #include <FL/Fl_Pack.H> #include <FL/Fl_Box.H> #include <FL/Fl_Group.H> #include <FL/Fl_Shared_Image.H> #include <FL/fl_draw.H> #include <FL/x.H> #include <string> #include "Thread.h" /** * Manages versions as used by Sun's JVM. The version scheme used is * major.minor.sub, for instance 1.1.8 or 1.4.2. * * @author Rodrigo Reyes <re...@ch...> */ class SplashContent : public Fl_Group { private: Fl_Shared_Image* m_splashImage; Fl_Progress* m_progressBar; std::string m_label; public: SplashContent(int x, int y, int w, int h, const char *label = 0, Fl_Shared_Image* image=0) : Fl_Group(x,y,w,h,label) { m_splashImage = image; buildGui(); } void buildGui(); void setProgress(int cur, int max); void setLabel(const std::string& label); virtual void draw(); }; class SplashWindow : public Fl_Double_Window { private: SplashContent* m_content; Fl_Shared_Image* m_splashImage; Thread* m_closer; DWORD m_watchedProcessId; static SplashWindow* s_singleton; public: SplashWindow(const std::string& splashfile); // Warning: NOT THREAD-SAFE static SplashWindow* getSingleton(); void setProgress(int cur, int max); void setLabel(const std::string& label); void splashCheck(HWND tocheck); void splashOn(); void splashOff(); void setWatchedProcessId(DWORD pid); DWORD getWatchedProcessId(); }; #endif --- NEW FILE: Splash.cpp --- /* JSmooth: a VM wrapper toolkit for Windows Copyright (C) 2003-2007 Rodrigo Reyes <re...@ch...> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "Splash.h" #include <stdio.h> #include "StringUtils.h" void SplashContent::buildGui() { m_progressBar = new Fl_Progress(x()+10,h()-20,w()-20,10); // redraw(); m_progressBar->hide(); } void SplashContent::setProgress(int cur, int max) { Fl::lock(); if (!m_progressBar->visible()) m_progressBar->show(); m_progressBar->maximum((float)max); m_progressBar->value((float)cur); m_progressBar->redraw(); Fl::awake(); Fl::unlock(); } void SplashContent::setLabel(const std::string& label) { Fl::lock(); m_label = label; if (m_label != "") { m_progressBar->position(x()+10, h()-32); m_progressBar->size(w()-20,22); } else { m_progressBar->position(x()+10, h()-20); m_progressBar->size(w()-20,10); } m_progressBar->label(m_label.c_str()); Fl::awake(); Fl::unlock(); } void SplashContent::draw() { fl_color(FL_BLACK); fl_rectf(0,0,w(),h()); if (m_splashImage != 0) { m_splashImage->draw(0,0); } Fl_Widget *const*a = array(); // now draw all the children atop the background: for (int i = children(); i --; a ++) { draw_child(**a); draw_outside_label(**a); // you may not need to do this } } SplashWindow::SplashWindow(const std::string& splashfile) : Fl_Double_Window(0,0) { if (s_singleton == 0) s_singleton = this; m_closer = new Thread(); m_watchedProcessId = 0; m_splashImage = Fl_Shared_Image::get(splashfile.c_str()); int w = 200, h = 200; if (m_splashImage != NULL) { w = m_splashImage->w(); h = m_splashImage->h(); printf("Splash window dimension: %dx%d\n", w,h); fflush(stdout); } size(w,h); border(0); position(Fl::w() / 2 - w/2, Fl::h() / 2 - h/2); m_content = new SplashContent(0,0, w, h, "splash", m_splashImage); end(); } BOOL CALLBACK thread_closer_enumerator(HWND hwnd, LPARAM param) { SplashWindow* splash = (SplashWindow*)param; DWORD hpid = 0; DWORD curpid = splash->getWatchedProcessId(); // GetCurrentProcessId(); GetWindowThreadProcessId(hwnd, &hpid); if (hpid == curpid) { if (GetWindowLong(hwnd, GWL_STYLE) & WS_VISIBLE) { splash->splashCheck(hwnd); } } return TRUE; } void thread_closer(void* param) { SplashWindow* splash = (SplashWindow*)param; // int cur = 0; while (1) { Sleep(500); printf("Watching splash process %d\n", splash->getWatchedProcessId()); fflush(stdout); EnumWindows(thread_closer_enumerator, (LPARAM)splash); if (splash->visible() == 0) { return; } } } void SplashWindow::splashCheck(HWND tocheck) { if (tocheck != fl_xid(this)) { splashOff(); } } void SplashWindow::splashOn() { show(); m_closer->start(thread_closer, this); } void SplashWindow::splashOff() { Fl::lock(); hide(); Fl::unlock(); } void SplashWindow::setProgress(int cur, int max) { Fl::lock(); m_content->setProgress(cur, max); // Fl::redraw(); // Fl::awake(); Fl::unlock(); } void SplashWindow::setLabel(const std::string& label) { m_content->setLabel(label); } void SplashWindow::setWatchedProcessId(DWORD pid) { m_watchedProcessId = pid; } DWORD SplashWindow::getWatchedProcessId() { return m_watchedProcessId; } SplashWindow* SplashWindow::getSingleton() { return s_singleton; } SplashWindow* SplashWindow::s_singleton = 0; --- NEW FILE: splashhelper.cpp --- /* JSmooth: a VM wrapper toolkit for Windows Copyright (C) 2003-2007 Rodrigo Reyes <re...@ch...> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "splashhelper.h" #include "Splash.h" #include <FL/Fl_Shared_Image.H> #include <FL/Fl.H> #include "FileUtils.h" #include "guihelper.h" void splashwindow_start(const std::string& filename) { if (FileUtils::fileExists(filename)) { fl_register_images(); printf("Creating splash with image %s\n",filename.c_str()); fflush(stdout); SplashWindow* sw = new SplashWindow(filename); // SplashWindow::getSingleton()->splashOn(); guihelper_run(); } } bool splashwindow_isVisible() { SplashWindow* sp = SplashWindow::getSingleton(); if (sp != 0) return sp->visible(); } void splashwindow_hide() { SplashWindow* sp = SplashWindow::getSingleton(); if (sp != 0) sp->hide(); } void splashwindow_setProgress(int cur, int max) { SplashWindow* sp = SplashWindow::getSingleton(); if (sp != 0) sp->setProgress(cur, max); } void splashwindow_setProcessId(DWORD pid) { SplashWindow* sp = SplashWindow::getSingleton(); if (sp != 0) sp->setWatchedProcessId(pid); } --- NEW FILE: guihelper.cpp --- /* JSmooth: a VM wrapper toolkit for Windows Copyright (C) 2003-2007 Rodrigo Reyes <re...@ch...> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "guihelper.h" #include <FL/Fl.H> #include "Thread.h" #include "Splash.h" bool guihelper_running = false; void guihelper_run_thread(void* param) { if (guihelper_running == false) { guihelper_running = true; Fl::lock(); if (SplashWindow::getSingleton() != 0) SplashWindow::getSingleton()->splashOn(); Fl::run(); Fl::unlock(); } } void guihelper_run() { Thread* guithread = new Thread(); guithread->setAutoDelete(true); guithread->start(guihelper_run_thread, NULL); } |
From: Rodrigo R. <re...@us...> - 2007-05-27 09:04:27
|
Update of /cvsroot/jsmooth/jsmooth/skeletons/util-gui In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv10362/skeletons/util-gui Log Message: Directory /cvsroot/jsmooth/jsmooth/skeletons/util-gui added to the repository |
From: Rodrigo R. <re...@us...> - 2007-05-26 11:25:28
|
Update of /cvsroot/jsmooth/jsmooth/skeletons/commonjava In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv8488 Added Files: JNIRegister.h Log Message: splash window refactoring --- NEW FILE: JNIRegister.h --- /* JSmooth: a VM wrapper toolkit for Windows Copyright (C) 2003-2007 Rodrigo Reyes <re...@ch...> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef __JNIREGISTER_H_ #define __JNIREGISTER_H_ class SunJVMDLL; class JNIRegister { public: virtual void registerJNI(SunJVMDLL* target) = 0; }; #endif |
From: Rodrigo R. <re...@us...> - 2007-05-26 11:24:41
|
Update of /cvsroot/jsmooth/jsmooth/skeletons/commonjava In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv8035 Modified Files: JVMBase.cpp JVMBase.h JavaMachineManager.cpp JavaMachineManager.h Makefile.win ResourceManager.cpp ResourceManager.h SunJVMDLL.cpp SunJVMDLL.h SunJVMExe.cpp SunJVMLauncher.cpp SunJVMLauncher.h Removed Files: JniSmooth.cpp JniSmooth.h Log Message: jnismooth and splash refactoring Index: JavaMachineManager.cpp =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/commonjava/JavaMachineManager.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** JavaMachineManager.cpp 13 May 2007 19:56:35 -0000 1.19 --- JavaMachineManager.cpp 26 May 2007 11:24:36 -0000 1.20 *************** *** 60,72 **** return true; } - - // DEBUG("Trying to use bundled VM " + m_localVM.JavaHome); - // if (m_localVM.runProc(m_resman, m_useConsole, "bundled")) - // { - // m_exitCode = m_localVM.getExitCode(); - // return true; - // } - // if (m_localVM.run(m_resman, "bundled")) - // return true; } --- 60,63 ---- *************** *** 134,137 **** --- 125,131 ---- SunJVMLauncher launcher; + for(int i=0; i<m_listeners.size(); i++) + launcher.addListener(m_listeners[i]); + if (launcher.runProc(m_resman, m_useConsole, "path")) { *************** *** 149,152 **** --- 143,152 ---- bool JavaMachineManager::internalRun(SunJVMLauncher& launcher, const string& org) { + DEBUG("JavaMachineManager: setting " + StringUtils::toString(m_jnireg.size()) + " JNI libs"); + launcher.setJNI(m_jnireg); + + for(int i=0; i<m_listeners.size(); i++) + launcher.addListener(m_listeners[i]); + if (m_acceptDLL && m_preferDLL) { *************** *** 189,192 **** --- 189,193 ---- DEBUG("- Trying registry: " + m_registryVms[i].toString()); + m_registryVms[i].setJNI(m_jnireg); bool res = m_registryVms[i].run(m_resman, "registry", justInstanciate); *************** *** 222,223 **** --- 223,229 ---- return m_exitCode; } + + void JavaMachineManager::setJNI(vector<JNIRegister*> reg) + { + m_jnireg = reg; + } Index: SunJVMDLL.cpp =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/commonjava/SunJVMDLL.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** SunJVMDLL.cpp 18 May 2007 21:33:59 -0000 1.4 --- SunJVMDLL.cpp 26 May 2007 11:24:36 -0000 1.5 *************** *** 23,27 **** #include "JClassProxy.h" ! #include "JniSmooth.h" SunJVMDLL::SunJVMDLL(const std::string& jvmdll, const Version& v) --- 23,27 ---- #include "JClassProxy.h" ! ////#include "JniSmooth.h" SunJVMDLL::SunJVMDLL(const std::string& jvmdll, const Version& v) *************** *** 59,62 **** --- 59,69 ---- ma[0].l = mainargs; disp.invokeStatic(std::string("void main(java.lang.String[] args)"), ma); + DEBUG("main class invoked"); + + if (env()->ExceptionOccurred()) + { + env()->ExceptionDescribe(); + } + if (waitDeath == true) m_javavm->DestroyJavaVM(); *************** *** 104,112 **** res = setupVM12DLL(CreateJavaVM, GetDefaultJavaVMInitArgs); ! registerJniSmooth(); DEBUG("Result code on DLL: " + StringUtils::toString(res)); if (res) { m_statusCode = SunJVMDLL::JVM_LOADED; return true; --- 111,130 ---- res = setupVM12DLL(CreateJavaVM, GetDefaultJavaVMInitArgs); ! // ! // registerJniSmooth(); ! DEBUG("Registration of " + StringUtils::toString(m_jnireg.size()) + " JNI libraries"); ! for (int i=0; i<m_jnireg.size(); i++) ! { ! JNIRegister* reg = m_jnireg[i]; ! reg->registerJNI(this); ! } DEBUG("Result code on DLL: " + StringUtils::toString(res)); if (res) { + // + // Call the JVM listeners + callListeners(GetCurrentProcessId()); + m_statusCode = SunJVMDLL::JVM_LOADED; return true; *************** *** 240,243 **** --- 258,278 ---- } + jmethodID SunJVMDLL::findMethod(const std::string& clsname, const std::string& methodname, const std::string& signature, bool isStatic) + { + jclass cls = findClass(clsname); + if (cls == 0) + return NULL; + + std::string sig = StringUtils::replace(signature, ".", "/"); + + jmethodID mid; + if (isStatic) + mid = env()->GetStaticMethodID(cls, methodname.c_str(), sig.c_str()); + else + mid = env()->GetMethodID(cls, methodname.c_str(), sig.c_str()); + + return mid; + } + JavaVM* SunJVMDLL::getJavaVM() { *************** *** 397,403 **** void* fn) { jclass cc = this->findClass(classname); if (cc == 0) ! return false; JNINativeMethod jnm; jnm.name = (char*)methodname.c_str(); --- 432,442 ---- void* fn) { + DEBUG("Registering JNI " + classname + "::" + methodname + "::" + signature); jclass cc = this->findClass(classname); if (cc == 0) ! { ! DEBUG("Error registering JNI " + classname + "::" + methodname + ": class not found"); ! return false; ! } JNINativeMethod jnm; jnm.name = (char*)methodname.c_str(); *************** *** 407,418 **** int res = env()->RegisterNatives(cc, &jnm, 1); if (res != 0) ! return false; return true; } ! bool SunJVMDLL::registerJniSmooth() { ! registerNativeMethods(this); ! return true; } --- 446,467 ---- int res = env()->RegisterNatives(cc, &jnm, 1); if (res != 0) ! { ! DEBUG("Error registering JNI " + classname + "::" + methodname + ": failed for some reason"); ! return false; ! } return true; } ! // bool SunJVMDLL::registerJniSmooth() ! // { ! // registerNativeMethods(this); ! // return true; ! // } ! ! ! void SunJVMDLL::setJNI(vector<JNIRegister*> reg) { ! m_jnireg = reg; ! DEBUG("SunJVMDLL: Got " + StringUtils::toString(m_jnireg.size()) + " JNI libs"); } Index: ResourceManager.h =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/commonjava/ResourceManager.h,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** ResourceManager.h 18 May 2007 21:33:59 -0000 1.15 --- ResourceManager.h 26 May 2007 11:24:36 -0000 1.16 *************** *** 57,60 **** --- 57,61 ---- int m_resourcePropsId; int m_resourceJarId; + int m_resourceJniId; std::string m_lastError; HGLOBAL m_jarHandler; Index: SunJVMDLL.h =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/commonjava/SunJVMDLL.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** SunJVMDLL.h 18 May 2007 21:33:59 -0000 1.3 --- SunJVMDLL.h 26 May 2007 11:24:36 -0000 1.4 *************** *** 31,34 **** --- 31,35 ---- #include "JavaProperty.h" #include "JVMBase.h" + #include "JNIRegister.h" typedef jint (JNICALL *CreateJavaVM_t)(JavaVM **pvm, JNIEnv **env, void *args); *************** *** 64,67 **** --- 65,70 ---- StatusCode m_statusCode; + + vector<JNIRegister*> m_jnireg; protected: *************** *** 79,83 **** bool registerMethod(const std::string& classname, const std::string& methodname, const std::string& signature, void* fn); ! bool registerJniSmooth(); JNIEnv* env() --- 82,87 ---- bool registerMethod(const std::string& classname, const std::string& methodname, const std::string& signature, void* fn); ! // bool registerJniSmooth(); ! void setJNI(vector<JNIRegister*> reg); JNIEnv* env() *************** *** 93,96 **** --- 97,101 ---- jclass findClass(const std::string& clazz); jmethodID findMethod(jclass& cls, const std::string& methodname, const std::string& signature, bool isStatic); + jmethodID findMethod(const std::string& clsname, const std::string& methodname, const std::string& signature, bool isStatic); JavaVM* getJavaVM(); Index: SunJVMLauncher.h =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/commonjava/SunJVMLauncher.h,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** SunJVMLauncher.h 13 May 2007 19:56:35 -0000 1.15 --- SunJVMLauncher.h 26 May 2007 11:24:36 -0000 1.16 *************** *** 33,36 **** --- 33,37 ---- #include "SunJVMDLL.h" #include "SunJVMExe.h" + #include "JNIRegister.h" typedef jint (JNICALL *CreateJavaVM_t)(JavaVM **pvm, JNIEnv **env, void *args); *************** *** 59,62 **** --- 60,64 ---- int LaunchingStatus; + vector<JNIRegister*> m_jnireg; protected: *************** *** 112,116 **** * false otherwise. */ - virtual bool runProc(ResourceManager& resource, bool noConsole, const string& origin); --- 114,117 ---- *************** *** 121,124 **** --- 122,126 ---- std::string toString() const; + void setJNI(vector<JNIRegister*> reg); friend bool operator < (const SunJVMLauncher& v1, const SunJVMLauncher& v2); *************** *** 126,163 **** int getExitCode(); ! ! ! ! // Version guessVersionByProcess(const string& exepath); ! ! ! ! // bool runExe(const string& exepath, bool forceFullClasspath, ResourceManager& resource, bool noConsole, const std::string& version, const string& origin); ! // bool dllInstanciate(ResourceManager& resource, const string& origin); ! ! // bool callDLLStaticMethod(const std::string& classname, const std::string& methodname, const std::string& signature); ! // bool callDLLStaticMethodInt(const std::string& classname, const std::string& methodname, const std::string& signature, int value); ! ! // int destroyVM(); ! // JavaVM* getJavaVM(); ! ! // jclass findClass(const std::string& clazz); ! // jmethodID findMethod(jclass& cls, const std::string& methodname, const std::string& signature, bool isStatic); ! ! // void invokeVoidStatic(jclass clazz, jmethodID& methodid, jvalue arguments[]); ! // // jvaluea invokeIntStatic(jclass clazz, jmethodID& methodid, jvalue arguments[]); ! // jint invokeIntStatic(jclass clazz, jmethodID& methodid, jvalue arguments[]); ! // jlong invokeLongStatic(jclass clazz, jmethodID& methodid, jvalue arguments[]); ! ! private: ! ! // bool runVMDLL(ResourceManager& resource, const string& origin, bool justInstanciate=false); ! ! // bool setupVM12DLL(ResourceManager& resource, const string& origin); ! // bool setupVM11DLL(ResourceManager& resource, const string& origin); ! ! // bool runVM11proc(ResourceManager& resource, bool noConsole, const string& origin); ! // bool runVM12proc(ResourceManager& resource, bool noConsole, const string& origin); }; --- 128,137 ---- int getExitCode(); + std::vector<JVMSetUpListener*> m_listeners; ! void addListener(JVMSetUpListener* listener) ! { ! m_listeners.push_back(listener); ! } }; Index: JavaMachineManager.h =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/commonjava/JavaMachineManager.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** JavaMachineManager.h 1 May 2007 19:40:16 -0000 1.6 --- JavaMachineManager.h 26 May 2007 11:24:36 -0000 1.7 *************** *** 31,34 **** --- 31,35 ---- #include "JVMEnvVarLookup.h" #include "MSJViewLauncher.h" + #include "JNIRegister.h" /** Manages the JVM available on the computer. It builds the list of *************** *** 60,63 **** --- 61,66 ---- bool m_acceptDLL; bool m_preferDLL; + vector<JNIRegister*> m_jnireg; + std::vector<JVMSetUpListener*> m_listeners; public: *************** *** 75,78 **** --- 78,88 ---- void setPreferDLL(bool prefDLL); + void setJNI(vector<JNIRegister*> reg); + + void addListener(JVMSetUpListener* listener) + { + m_listeners.push_back(listener); + } + /** * Start the Java application. The java application started is --- JniSmooth.cpp DELETED --- Index: Makefile.win =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/commonjava/Makefile.win,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Makefile.win 18 May 2007 21:33:59 -0000 1.9 --- Makefile.win 26 May 2007 11:24:36 -0000 1.10 *************** *** 8,16 **** MINGW = RES = ! OBJ = JniSmooth.o JVMBase.o SunJVMExe.o JArgs.o JClassProxy.o SunJVMDLL.o JavaMachineManager.o JVMEnvVarLookup.o JVMRegistryLookup.o MSJViewLauncher.o Properties.o ResourceManager.o SunJVMLauncher.o Version.o global.o JavaProperty.o JMethodCaller.o $(RES) ! LINKOBJ = JniSmooth.o JVMBase.o SunJVMExe.o JArgs.o JClassProxy.o SunJVMDLL.o JavaMachineManager.o JVMEnvVarLookup.o JVMRegistryLookup.o MSJViewLauncher.o Properties.o ResourceManager.o SunJVMLauncher.o Version.o global.o JavaProperty.o JMethodCaller.o $(RES) LIBS = -L"$(MINGW)/lib" INCS = -I"../util-core" -I"$(MINGW)/include" -I"$(JDK)/include" -I"$(JDK)/include/win32" ! CXXINCS = -g -fno-rtti -Os -I"../util-core" -I"$(MINGW)/include/c++" -I"$(MINGW)/include/c++/mingw32" -I"$(MINGW)/include/c++/backward" -I"$(MINGW)/include" -I"$(JDK)/include" -I"$(JDK)/include/win32" BIN = CommonJava.a CXXFLAGS = $(CUSTOMFLAGS) $(CXXINCS) -DJDK="$(JDK)" --- 8,16 ---- MINGW = RES = ! OBJ = JVMBase.o SunJVMExe.o JArgs.o JClassProxy.o SunJVMDLL.o JavaMachineManager.o JVMEnvVarLookup.o JVMRegistryLookup.o MSJViewLauncher.o Properties.o ResourceManager.o SunJVMLauncher.o Version.o global.o JavaProperty.o JMethodCaller.o $(RES) ! LINKOBJ = JVMBase.o SunJVMExe.o JArgs.o JClassProxy.o SunJVMDLL.o JavaMachineManager.o JVMEnvVarLookup.o JVMRegistryLookup.o MSJViewLauncher.o Properties.o ResourceManager.o SunJVMLauncher.o Version.o global.o JavaProperty.o JMethodCaller.o $(RES) LIBS = -L"$(MINGW)/lib" INCS = -I"../util-core" -I"$(MINGW)/include" -I"$(JDK)/include" -I"$(JDK)/include/win32" ! CXXINCS = -g -fno-rtti -Os -I"../util-core" -I"$(MINGW)/include/c++" -I"$(MINGW)/include/c++/mingw32" -I"$(MINGW)/include/c++/backward" -I"$(MINGW)/include" -I"$(JDK)/include" -I"$(JDK)/include/win32" BIN = CommonJava.a CXXFLAGS = $(CUSTOMFLAGS) $(CXXINCS) -DJDK="$(JDK)" Index: ResourceManager.cpp =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/commonjava/ResourceManager.cpp,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** ResourceManager.cpp 19 May 2007 23:34:07 -0000 1.26 --- ResourceManager.cpp 26 May 2007 11:24:36 -0000 1.27 *************** *** 38,41 **** --- 38,42 ---- m_resourcePropsId = propsId; m_resourceJarId = jarId; + m_resourceJniId = jniId; // *************** *** 49,54 **** --- 50,57 ---- mainsize = SizeofResource(NULL, resprop); // char mainbuf[mainsize+1]; + DEBUG("Loading resource..."); HGLOBAL main = LoadResource(NULL, resprop); m_props.setData((const char*)main, mainsize); + DEBUG("Loading resource... done"); } else *************** *** 63,85 **** m_arguments = StringUtils::split(getProperty(KEY_ARGUMENTS, ""), " \t\n\r", "\"\'"); ! // ! // loads the jar information ! // ! std::string jaridstr = this->idToResourceName(jarId); ! HRSRC resjar = FindResource(NULL, jaridstr.c_str(), category.c_str()); ! if (resjar != NULL) ! { ! m_jarSize = SizeofResource(NULL, resjar); ! m_jarHandler = LoadResource(NULL, resjar); ! } ! else ! { ! m_lastError = "Can't find JAR resource!"; ! return; ! } ! ! ! m_jnismoothSize = this->getResourceSize(jniId); ! m_jnismoothHandler = this->getResource(jniId); // --- 66,71 ---- m_arguments = StringUtils::split(getProperty(KEY_ARGUMENTS, ""), " \t\n\r", "\"\'"); ! m_jnismoothSize = 0; ! m_jnismoothHandler = 0; // *************** *** 118,128 **** { m_currentDirectory = FileUtils::concFile(exepath, curdirmodifier.substr(pos + string("${EXECUTABLEPATH}").size())); - // m_currentDirectory = StringUtils::replace(curdirmodifier, "${EXECUTABLEPATH}", exepath); } else { ! DEBUG(string("Currentdirectory =") + curdirmodifier); m_currentDirectory = curdirmodifier; - // m_currentDirectory = FileUtils::concFile(FileUtils::getExecutablePath(), curdirmodifier); m_currentDirectory = StringUtils::replaceEnvironmentVariable(m_currentDirectory); } --- 104,112 ---- { m_currentDirectory = FileUtils::concFile(exepath, curdirmodifier.substr(pos + string("${EXECUTABLEPATH}").size())); } else { ! DEBUG(string("Currentdirectory: ") + curdirmodifier); m_currentDirectory = curdirmodifier; m_currentDirectory = StringUtils::replaceEnvironmentVariable(m_currentDirectory); } *************** *** 132,136 **** m_currentDirectory = ""; } - // printf("CURDIR SET TO: [%s]\n", m_currentDirectory.c_str()); } --- 116,119 ---- *************** *** 211,214 **** --- 194,211 ---- return ""; + // + std::string jaridstr = this->idToResourceName(m_resourceJarId); + HRSRC resjar = FindResource(NULL, jaridstr.c_str(), m_resourceCategory.c_str()); + if (resjar != NULL) + { + m_jarSize = SizeofResource(NULL, resjar); + m_jarHandler = LoadResource(NULL, resjar); + } + else + { + m_lastError = "Can't find JAR resource!"; + return ""; + } + std::string tempfilename = FileUtils::createTempFileName(".jar"); DEBUG("Created temporary filename to hold the jar (" + tempfilename + ")"); *************** *** 344,349 **** if (m_jnismoothHandler == 0) { ! DEBUG("NO JNI SMOOTH ID !!"); ! return ""; } --- 341,352 ---- if (m_jnismoothHandler == 0) { ! m_jnismoothSize = this->getResourceSize( m_resourceJniId ); ! m_jnismoothHandler = this->getResource( m_resourceJniId ); ! ! if (m_jnismoothHandler == 0) ! { ! DEBUG("NO JNI SMOOTH ID !!"); ! return ""; ! } } Index: SunJVMLauncher.cpp =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/commonjava/SunJVMLauncher.cpp,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** SunJVMLauncher.cpp 18 May 2007 21:33:59 -0000 1.30 --- SunJVMLauncher.cpp 26 May 2007 11:24:36 -0000 1.31 *************** *** 119,122 **** --- 119,124 ---- m_dllrunner = new SunJVMDLL(this->RuntimeLibPath, v); + m_dllrunner->setJNI(m_jnireg); + // set up the vm parameters... setupVM(resource, m_dllrunner); *************** *** 140,143 **** --- 142,146 ---- DEBUG("No version identified for " + toString()); SunJVMExe exe(this->JavaHome); + VmVersion = exe.guessVersion(); DEBUG("Version found: " + VmVersion.toString()); *************** *** 160,163 **** --- 163,167 ---- SunJVMExe exe(this->JavaHome, VmVersion); + setupVM(resource, &exe); if (exe.run(classname, useConsole)) *************** *** 171,174 **** --- 175,181 ---- bool SunJVMLauncher::setupVM(ResourceManager& resource, JVMBase* vm) { + for(int i=0; i<m_listeners.size(); i++) + vm->addListener(m_listeners[i]); + // // create the properties array *************** *** 229,230 **** --- 236,241 ---- } + void SunJVMLauncher::setJNI(vector<JNIRegister*> reg) + { + m_jnireg = reg; + } Index: JVMBase.cpp =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/commonjava/JVMBase.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** JVMBase.cpp 28 Apr 2007 08:43:43 -0000 1.1 --- JVMBase.cpp 26 May 2007 11:24:36 -0000 1.2 *************** *** 67,68 **** --- 67,81 ---- } } + + void JVMBase::addListener(JVMSetUpListener* listener) + { + m_listeners.push_back(listener); + } + + void JVMBase::callListeners(int pid) + { + for (int i=0; i<m_listeners.size(); i++) + { + m_listeners[i]->jvmHasPid(pid); + } + } --- JniSmooth.h DELETED --- Index: SunJVMExe.cpp =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/commonjava/SunJVMExe.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SunJVMExe.cpp 1 May 2007 19:40:16 -0000 1.2 --- SunJVMExe.cpp 26 May 2007 11:24:36 -0000 1.3 *************** *** 92,95 **** --- 92,99 ---- if (proc.run()) { + // + // Call the JVM listeners + callListeners(proc.getProcessId()); + DEBUG("Started successfully"); proc.join(); Index: JVMBase.h =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/commonjava/JVMBase.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** JVMBase.h 28 Apr 2007 08:43:43 -0000 1.1 --- JVMBase.h 26 May 2007 11:24:36 -0000 1.2 *************** *** 23,27 **** #include <string> - #include "jni.h" #include "Version.h" --- 23,26 ---- *************** *** 35,38 **** --- 34,43 ---- */ + class JVMSetUpListener + { + public: + virtual void jvmHasPid(int pid)=0; + }; + class JVMBase { *************** *** 44,48 **** int m_initialHeap; std::vector<std::string> m_arguments; ! public: JVMBase(); --- 49,54 ---- int m_initialHeap; std::vector<std::string> m_arguments; ! std::vector<JVMSetUpListener*> m_listeners; ! public: JVMBase(); *************** *** 54,57 **** --- 60,69 ---- void addArgument(const std::string& arg); void setArguments(const std::string& args); + + void addListener(JVMSetUpListener* listener); + + protected: + void callListeners(int pid); + }; |
From: Rodrigo R. <re...@us...> - 2007-05-20 21:05:42
|
Update of /cvsroot/jsmooth/jsmooth/skeletons/simplewrap In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv2952/skeletons/simplewrap Modified Files: main.cpp Log Message: remove the debug always forced to true Index: main.cpp =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/simplewrap/main.cpp,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** main.cpp 18 May 2007 21:34:00 -0000 1.31 --- main.cpp 20 May 2007 21:05:39 -0000 1.32 *************** *** 73,79 **** bool dodebug = globalResMan->getBooleanProperty("skel_Debug"); - // TO REMOVE - dodebug = true; - if (dodebug) { --- 73,76 ---- |
From: Rodrigo R. <re...@us...> - 2007-05-19 23:34:11
|
Update of /cvsroot/jsmooth/jsmooth/skeletons/commonjava In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv32586/skeletons/commonjava Modified Files: JClassProxy.cpp ResourceManager.cpp Log Message: update due to winservice Index: JClassProxy.cpp =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/commonjava/JClassProxy.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** JClassProxy.cpp 28 Apr 2007 08:43:43 -0000 1.1 --- JClassProxy.cpp 19 May 2007 23:34:07 -0000 1.2 *************** *** 53,57 **** } - jvalue JClassProxy::invoke(jobject& obj, const std::string& fqmethod, jvalue arguments[]) { --- 53,56 ---- Index: ResourceManager.cpp =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/commonjava/ResourceManager.cpp,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** ResourceManager.cpp 19 May 2007 15:11:54 -0000 1.25 --- ResourceManager.cpp 19 May 2007 23:34:07 -0000 1.26 *************** *** 49,56 **** mainsize = SizeofResource(NULL, resprop); // char mainbuf[mainsize+1]; - HGLOBAL main = LoadResource(NULL, resprop); m_props.setData((const char*)main, mainsize); - } else --- 49,54 ---- *************** *** 64,68 **** // m_arguments = StringUtils::split(getProperty(KEY_ARGUMENTS, ""), " \t\n\r", "\"\'"); - // --- 62,65 ---- |
From: Rodrigo R. <re...@us...> - 2007-05-19 23:34:11
|
Update of /cvsroot/jsmooth/jsmooth/sample In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv32586/sample Modified Files: sample.jsmooth Log Message: update due to winservice Index: sample.jsmooth =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/sample/sample.jsmooth,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** sample.jsmooth 18 May 2007 21:52:51 -0000 1.16 --- sample.jsmooth 19 May 2007 23:34:07 -0000 1.17 *************** *** 7,11 **** <JVMSearchPath>jview</JVMSearchPath> <JVMSearchPath>registry</JVMSearchPath> - <arguments></arguments> <currentDirectory>..\classes</currentDirectory> <embeddedJar>true</embeddedJar> --- 7,10 ---- *************** *** 41,45 **** <maximumVersion></maximumVersion> <minimumVersion>1.3</minimumVersion> ! <skeletonName>Windowed Wrapper</skeletonName> <skeletonProperties> <key>Message</key> --- 40,44 ---- <maximumVersion></maximumVersion> <minimumVersion>1.3</minimumVersion> ! <skeletonName>Autodownload Wrapper</skeletonName> <skeletonProperties> <key>Message</key> *************** *** 48,53 **** </skeletonProperties> <skeletonProperties> ! <key>URL</key> ! <value></value> </skeletonProperties> <skeletonProperties> --- 47,52 ---- </skeletonProperties> <skeletonProperties> ! <key>DownloadURL</key> ! <value>http://java.sun.com/update/1.6.0/jinstall-6-windows-i586.cab</value> </skeletonProperties> <skeletonProperties> *************** *** 65,69 **** <skeletonProperties> <key>Debug</key> ! <value>1</value> </skeletonProperties> </jsmoothproject> --- 64,68 ---- <skeletonProperties> <key>Debug</key> ! <value>0</value> </skeletonProperties> </jsmoothproject> |
From: Rodrigo R. <re...@us...> - 2007-05-19 23:34:11
|
Update of /cvsroot/jsmooth/jsmooth In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv32586 Modified Files: build.number Log Message: update due to winservice Index: build.number =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/build.number,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** build.number 18 May 2007 21:35:28 -0000 1.38 --- build.number 19 May 2007 23:34:06 -0000 1.39 *************** *** 1,3 **** #Build Number for ANT. Do not edit! ! #Fri May 18 23:29:11 CEST 2007 ! build.number=243 --- 1,3 ---- #Build Number for ANT. Do not edit! ! #Sun May 20 01:00:46 CEST 2007 ! build.number=256 |
From: Rodrigo R. <re...@us...> - 2007-05-19 22:55:53
|
Update of /cvsroot/jsmooth/jsmooth/skeletons/winservice In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv17934/skeletons/winservice Modified Files: WinService.cpp Log Message: fixes the JNI jar not being extracted correctly Index: WinService.cpp =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/winservice/WinService.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** WinService.cpp 1 May 2007 19:40:16 -0000 1.6 --- WinService.cpp 19 May 2007 22:55:49 -0000 1.7 *************** *** 275,279 **** log("Run..."); ! ResourceManager* globalResMan = new ResourceManager("JAVA", PROPID, JARID); // --- 275,279 ---- log("Run..."); ! ResourceManager* globalResMan = new ResourceManager("JAVA", PROPID, JARID, JNISMOOTHID); // *************** *** 308,312 **** } else ! log("ERROR: JVM is launched, but can get a DLL... ?"); } --- 308,312 ---- } else ! log("ERROR: JVM is launched, but can't get a DLL... ?"); } |
From: Rodrigo R. <re...@us...> - 2007-05-19 16:12:37
|
Update of /cvsroot/jsmooth/jsmooth/src/net/charabia/jsmoothgen/application/gui/util In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv25648/src/net/charabia/jsmoothgen/application/gui/util Modified Files: HTMLPane.java Log Message: links of the html panel linked to Native.shellExecute() Index: HTMLPane.java =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/src/net/charabia/jsmoothgen/application/gui/util/HTMLPane.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** HTMLPane.java 6 Apr 2007 16:27:10 -0000 1.4 --- HTMLPane.java 19 May 2007 15:24:03 -0000 1.5 *************** *** 58,62 **** if (nurl == null) nurl = new URL(m_baseurl, e.getDescription()); ! m_launcher.openURLinBrowser(nurl.toExternalForm()); } catch (Throwable t) { t.printStackTrace(); --- 58,67 ---- if (nurl == null) nurl = new URL(m_baseurl, e.getDescription()); ! if (jsmooth.Native.isAvailable()) ! { ! jsmooth.Native.shellExecute(jsmooth.Native.SHELLEXECUTE_OPEN, nurl.toString(), null, null, jsmooth.Native.SW_NORMAL); ! } ! else ! m_launcher.openURLinBrowser(nurl.toExternalForm()); } catch (Throwable t) { t.printStackTrace(); |
From: Rodrigo R. <re...@us...> - 2007-05-19 15:35:08
|
Update of /cvsroot/jsmooth/jsmooth/skeletons/commonjava In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv20793/commonjava Modified Files: ResourceManager.cpp Log Message: jni update Index: ResourceManager.cpp =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/commonjava/ResourceManager.cpp,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** ResourceManager.cpp 18 May 2007 21:33:59 -0000 1.24 --- ResourceManager.cpp 19 May 2007 15:11:54 -0000 1.25 *************** *** 346,350 **** { if (m_jnismoothHandler == 0) ! return ""; std::string tempfilename = FileUtils::createTempFileName(".jar"); --- 346,353 ---- { if (m_jnismoothHandler == 0) ! { ! DEBUG("NO JNI SMOOTH ID !!"); ! return ""; ! } std::string tempfilename = FileUtils::createTempFileName(".jar"); |
From: Rodrigo R. <re...@us...> - 2007-05-19 15:34:19
|
Update of /cvsroot/jsmooth/jsmooth/skeletons/jnismooth/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv19171/src Log Message: Directory /cvsroot/jsmooth/jsmooth/skeletons/jnismooth/src added to the repository |
From: Rodrigo R. <re...@us...> - 2007-05-19 15:33:16
|
Update of /cvsroot/jsmooth/jsmooth/skeletons/jnismooth/src/jsmooth In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv19946/src/jsmooth Added Files: DriveInfo.java Native.java Log Message: added jni java lib --- NEW FILE: DriveInfo.java --- /* JSmooth: a VM wrapper toolkit for Windows Copyright (C) 2003 Rodrigo Reyes <re...@ch...> 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. */ package jsmooth; /** * */ public class DriveInfo { static public final int DRIVE_REMOVABLE=2; static public final int DRIVE_FIXED=3; static public final int DRIVE_REMOTE=4; static public final int DRIVE_CDROM=5; static public final int DRIVE_RAMDISK=6; static public final int DRIVE_UNKNOWN=0; static public final int DRIVE_NO_ROOT_DIR=1; private int m_driveType = DRIVE_UNKNOWN; private long m_totalBytes; private long m_freeBytesForUser; private long m_totalFreeBytes; private int m_serialNumber; private int m_maxComponentSize; private int m_systemFlags; private String m_volumeName; private String m_fileSystemName; public static final int FILE_CASE_SENSITIVE_SEARCH = 0x00000001; public static final int FILE_CASE_PRESERVED_NAMES = 0x00000002; public static final int FILE_UNICODE_ON_DISK = 0x00000004; public static final int FILE_PERSISTENT_ACLS = 0x00000008; public static final int FILE_FILE_COMPRESSION = 0x00000010; public static final int FILE_VOLUME_QUOTAS = 0x00000020; public static final int FILE_SUPPORTS_SPARSE_FILES = 0x00000040; public static final int FILE_SUPPORTS_REPARSE_POINTS = 0x00000080; public static final int FILE_SUPPORTS_REMOTE_STORAGE = 0x00000100; public static final int FILE_VOLUME_IS_COMPRESSED = 0x00008000; public static final int FILE_SUPPORTS_OBJECT_IDS = 0x00010000; public static final int FILE_SUPPORTS_ENCRYPTION = 0x00020000; public static final int FILE_NAMED_STREAMS = 0x00040000; public static final int FILE_READ_ONLY_VOLUME = 0x00080000; public DriveInfo() { } /** * Return the drive type as one of the DRIVE_* constants. * * @return one of the DRIVE_* constants */ public int getDriveType() { return m_driveType; } /** * Return the total free space of the volume in bytes * * @return free space in bytes */ public long getFreeSpace() { return m_totalFreeBytes; } /** * Return the free space of the volume available to the user. This * value can be different from getFreeSpace() when the filesystem * implements quotas. * * @return free space for the user, in bytes */ public long getFreeSpaceForUser() { return m_freeBytesForUser; } /** * Return the total space of the volume, including the free and allocated space. * * @return total space of the volume, in bytes */ public long getTotalSpace() { return m_totalBytes; } /** * Return the serial number of the volume, as allocated by the * system during the formatting of the volume. * * @return the serial number of the volume */ public int getSerialNumber() { return m_serialNumber; } /** * The maximum size supported by the file system for a single component (directory or filename). * * @return the maximum number of chars for a component */ public int getMaximumComponentSize() { return m_maxComponentSize; } /** * Return a combination of system flags supported by the filesystem. * * @return a combination of FILE_* constants */ public int getSystemFlags() { return m_systemFlags; } /** * If a name has been defined for the volume represented by this * object, it is returned. Otherwise, an empty string is returned. * * @return a java.lang.String of the volume name */ public String getVolumeName() { return m_volumeName!=null?m_volumeName:""; } /** * The name of the filesystem installed on this drive * * @return a java.lang.String of the filesystem name */ public String getFileSystemName() { return m_fileSystemName!=null?m_fileSystemName:""; } public String toString() { String res="["; switch(m_driveType) { case DRIVE_REMOVABLE: res += "DRIVE_REMOVABLE"; break; case DRIVE_FIXED: res += "DRIVE_FIXED"; break; case DRIVE_REMOTE: res += "DRIVE_REMOTE"; break; case DRIVE_CDROM: res += "DRIVE_CDROM"; break; case DRIVE_RAMDISK: res += "DRIVE_RAMDISK"; break; case DRIVE_UNKNOWN: res += "DRIVE_UNKNOWN"; break; default: res += "DRIVE_NO_ROOT_DIR"; break; } res += ":" + m_freeBytesForUser + ":" + m_totalFreeBytes + "/" + m_totalBytes; res += "," + m_serialNumber +","+m_maxComponentSize + "," + m_systemFlags + "," + m_volumeName + "," + m_fileSystemName; res += "]"; return res; } } --- NEW FILE: Native.java --- /* JSmooth: a VM wrapper toolkit for Windows Copyright (C) 2003 Rodrigo Reyes <re...@ch...> 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. */ package jsmooth; /** * The Native class is the main hub for accessing the native functions * provided by JSmooth at runtime. All the methods provided are * static, but it is important that you check the availability of the * methods by calling first the <tt>isAvailable()</tt> method. * <p> * * When JSmooth loads the JVM, and before calling the application's * main class, it registers all the native methods provided in this * class with their matching C functions. If the registration process * is successful, it enables the binding by setting to <tt>true</tt> * the result of <tt>isAvailable()</tt>. * */ public class Native { private static boolean s_bound = false; /** * Return true if this class is correctly bound to the native * methods. * * @return true if you can use this class, false otherwise. */ static public boolean isAvailable() { return s_bound; } /** * Return the directory where is located the executable used to * launch the current application. The result is a string * containing a native file descriptor of the directory. * <br/> For instance: <tt>c:\my program\here\</tt> * * @return A java.lang.String containing the path of this executable */ static public native String getExecutablePath(); /** * Return the file name of the executable used to launch the * current application. It only contains the file part, not the * directory. * <br/> For instance: <tt>myprogram.exe</tt> * * @return A java.lang.String containing the name of this executable */ static public native String getExecutableName(); /** * Flag a file so that Windows shall delete it during the next * startup sequence of the operating system. The file is not * deleted nor touched before the next reboot. If the file is * already deleted, nothing happens. * * @param filename the name of the file to delete */ static public native boolean deleteFileOnReboot(String filename); static public final int EXITWINDOWS_FORCE = 4; static public final int EXITWINDOWS_LOGOFF = 0; static public final int EXITWINDOWS_POWEROFF = 8; static public final int EXITWINDOWS_REBOOT = 2; static public final int EXITWINDOWS_SHUTDOWN = 1; /** * Request Windows to shutdown/reboot the computer, or log off the * current user/session. There is no dialog asking the user to * confirm. * * @param shutdownFlags a combination of EXITWINDOWS_* flags */ static public native boolean exitWindows(int shutdownFlags); static public final String SHELLEXECUTE_OPEN = "open"; static public final String SHELLEXECUTE_PRINT = "print"; static public final String SHELLEXECUTE_EXPLORE = "explore"; static public final String SHELLEXECUTE_FIND = "find"; static public final String SHELLEXECUTE_EDIT = "edit"; static public final int SW_HIDE=0; static public final int SW_NORMAL=1; static public final int SW_SHOWNORMAL=1; static public final int SW_SHOWMINIMIZED=2; static public final int SW_MAXIMIZE=3; static public final int SW_SHOWMAXIMIZED=3; static public final int SW_SHOWNOACTIVATE=4; static public final int SW_SHOW=5; static public final int SW_MINIMIZE=6; static public final int SW_SHOWMINNOACTIVE=7; static public final int SW_SHOWNA=8; static public final int SW_RESTORE=9; static public final int SW_SHOWDEFAULT=10; static public final int SW_FORCEMINIMIZE=11; static public final int SW_MAX=11; /** * Maps the ShellExecute Windows function, which allows the * application to either run a new process, or to start a standard * operation on any document file, such as opening, editing, * printing, etc. * <p> * For instance, to start the default application for PDF reading: * <tt>shellExecute(Native.SHELLEXECUTE_OPEN, "c:/somewhere/mydocument.pdf", null, null, Native.SW_NORMAL);</tt> * <br/> * To print an html page: <tt>shellExecute(Native.SHELLEXECUTE_PRINT, "mydocument.html", null, null, Native.SW_NORMAL);</tt> * * @param action specify the operation to perform, can be any of the SHELLEXECUTE_* constant * @param file the file to run or for which to start the default application * @param parameters if file is an executable, this variable specifies the parameters to be passed. Otherwise, just set it to null. * @param directory the working directory for the action executed. If set to <tt>null</tt>, the default working directory of the java application is used. * @param showCmd a flag that specifies the state of the launched application display * * @return true if the action was successfully started, false if an error occurred. */ static public native boolean shellExecute(String action, String file, String parameters, String directory, int showCmd); /** * a DriveInfo info object provides platform-specific information * relative to the disk volume where the File object parameter is * located. This method determines the disk drive from the File * object provided, or from the disk drive of the working * directory if the File object does not represent an absolute * path. * * <p> * * For instance <tt>Native.getDriveInfo(new File("."))</tt> * provides a DriveInfo object for the volume on which the current * working directory is located. * <br/> * * <tt>Native.getDriveInfo(new File("D:/my/dir/or/file"))</tt> is * the same as <tt>Native.getDriveInfo(new File("D:"))</tt>. * * @return an DriveInfo object */ static public native DriveInfo getDriveInfo(java.io.File f); } |
From: Rodrigo R. <re...@us...> - 2007-05-19 15:31:44
|
Update of /cvsroot/jsmooth/jsmooth/skeletons/jnismooth In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv19946 Added Files: build.xml Log Message: added jni java lib --- NEW FILE: build.xml --- <?xml version="1.0" encoding="UTF-8"?> <project basedir="." default="dist" name="jsmooth-sample"> <!-- set global properties for this build --> <property name="src" value="src"/> <property name="classes" value="classes"/> <target name="init"> <!-- Create the time stamp --> <tstamp/> <!-- Create the build directory structure used by compile --> <mkdir dir="${classes}"/> </target> <target depends="init" name="compile"> <!-- Compile the java code from ${src} into ${classes} --> <javac debug="true" deprecation="yes" destdir="${classes}" srcdir="${src}"/> </target> <target depends="compile" name="dist"> <!-- Compile the java code from ${src} into ${classes} --> <jar jarfile="jnismooth.jar" basedir="classes"/> </target> <target depends="dist" name="run"> <!-- Compile the java code from ${src} into ${classes} --> <java classname="AlertServer" fork="yes" > <classpath> <pathelement path="sample.jar"/> </classpath> </java> </target> <target name="clean"> <delete dir="${classes}"/> </target> </project> |
From: Rodrigo R. <re...@us...> - 2007-05-19 15:31:18
|
Update of /cvsroot/jsmooth/jsmooth/skeletons/jnismooth In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv18764/jnismooth Log Message: Directory /cvsroot/jsmooth/jsmooth/skeletons/jnismooth added to the repository |
From: Rodrigo R. <re...@us...> - 2007-05-19 15:29:37
|
Update of /cvsroot/jsmooth/jsmooth/skeletons/jnismooth/src/jsmooth In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv19171/src/jsmooth Log Message: Directory /cvsroot/jsmooth/jsmooth/skeletons/jnismooth/src/jsmooth added to the repository |
From: Rodrigo R. <re...@us...> - 2007-05-19 15:29:31
|
Update of /cvsroot/jsmooth/jsmooth/skeletons/autodownload In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv20793/autodownload Modified Files: main.cpp resource.h Log Message: jni update Index: main.cpp =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/autodownload/main.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** main.cpp 17 May 2007 10:56:16 -0000 1.9 --- main.cpp 19 May 2007 15:11:53 -0000 1.10 *************** *** 69,73 **** SingleInstanceManager instanceman; ! globalResMan = new ResourceManager("JAVA", PROPID, JARID); // sets up the command line arguments --- 69,73 ---- SingleInstanceManager instanceman; ! globalResMan = new ResourceManager("JAVA", PROPID, JARID, JNISMOOTHID); // sets up the command line arguments Index: resource.h =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/autodownload/resource.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** resource.h 18 May 2007 21:33:59 -0000 1.2 --- resource.h 19 May 2007 15:11:53 -0000 1.3 *************** *** 3,5 **** #define PROPID 103 #define JNISMOOTHID 104 - --- 3,4 ---- |
From: Rodrigo R. <re...@us...> - 2007-05-19 15:28:38
|
Update of /cvsroot/jsmooth/jsmooth In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv27642 Modified Files: Changelog Log Message: updated for 0.9.9-7 Index: Changelog =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/Changelog,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** Changelog 18 May 2007 21:35:28 -0000 1.40 --- Changelog 19 May 2007 15:28:35 -0000 1.41 *************** *** 10,13 **** --- 10,15 ---- - Added JNI functions available to the java application when launched using the JVM DLL + - Fixes bug #1720562: winservice-wrapper ignores "currentDirectory" + param 0.9.9-6 |
From: Rodrigo R. <re...@us...> - 2007-05-19 15:27:40
|
Update of /cvsroot/jsmooth/jsmooth In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv27231 Modified Files: build.xml Log Message: changed fop version to 0.93 Index: build.xml =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/build.xml,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** build.xml 18 May 2007 21:52:51 -0000 1.41 --- build.xml 19 May 2007 15:27:37 -0000 1.42 *************** *** 25,29 **** <!-- What's below is optional (needed only if you build a dist) --> ! <property name="FOP" value="c:/Programs/fop-0.20.5\fop.bat"/> <property name="DOCBOOKBASE" value="c:\programs\docbook-xsl-1.72.0"/> --- 25,29 ---- <!-- What's below is optional (needed only if you build a dist) --> ! <property name="FOP" value="c:/Programs/fop-0.93\fop.bat"/> <property name="DOCBOOKBASE" value="c:\programs\docbook-xsl-1.72.0"/> *************** *** 54,58 **** <pathelement path="lib/jox116.jar"/> <pathelement path="lib/dtdparser113.jar"/> - <pathelement path="skeletons/jnismooth/jnismooth.jar"/> </path> --- 54,57 ---- *************** *** 69,72 **** --- 68,74 ---- <include name="**/*.jar"/> </fileset> + <fileset dir="skeletons/jnismooth"> + <include name="*.jar"/> + </fileset> </path> *************** *** 80,84 **** <target depends="init" name="compile"> <!-- Compile the java code from ${src} into ${classes} --> - <ant antfile="build.xml" dir="skeletons/jnismooth/" target="dist"/> <echo>Compiling the application from ${src}</echo> <javac target="1.4" source="1.4" deprecation="yes" destdir="${classes}" srcdir="${src}" debug="true"> --- 82,85 ---- *************** *** 99,102 **** --- 100,104 ---- <param name="section.label.includes.component.label" expression="1"/> <param name="chunk.section.depth" expression="2"/> + <param name="html.stylesheet" expression="jsmooth.css"/> </xslt> *************** *** 198,201 **** --- 200,205 ---- </replace> + <ant antfile="build.xml" dir="skeletons/jnismooth/" target="dist"/> + <antcall target="jar"> <param name="src" value="${tmp}/src"/> *************** *** 247,250 **** --- 251,257 ---- <include name="**/*.html"/> </fileset> + <fileset dir="${tmp}/docs"> + <include name="**/*.css"/> + </fileset> </copy> <copy todir="${dist}/docs/images"> |
From: Rodrigo R. <re...@us...> - 2007-05-19 15:23:39
|
Update of /cvsroot/jsmooth/jsmooth/jsprj In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv24429/jsprj Modified Files: jsmoothgen.jsmooth Log Message: update project to be single-instance enabled Index: jsmoothgen.jsmooth =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/jsprj/jsmoothgen.jsmooth,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** jsmoothgen.jsmooth 6 Apr 2007 16:27:10 -0000 1.10 --- jsmoothgen.jsmooth 19 May 2007 15:20:55 -0000 1.11 *************** *** 7,11 **** <JVMSearchPath>jdkpath</JVMSearchPath> <JVMSearchPath>jview</JVMSearchPath> - <arguments></arguments> <classPath>..\lib\jox116.jar</classPath> <classPath>..\lib\dtdparser113.jar</classPath> --- 7,10 ---- *************** *** 31,39 **** <skeletonProperties> <key>DownloadURL</key> ! <value>http://java.sun.com/update/1.5.0/jinstall-1_5_0-windows-i586.cab</value> </skeletonProperties> <skeletonProperties> <key>SingleProcess</key> ! <value>0</value> </skeletonProperties> <skeletonProperties> --- 30,46 ---- <skeletonProperties> <key>DownloadURL</key> ! <value>http://java.sun.com/update/1.6.0/jinstall-6-windows-i586.cab</value> </skeletonProperties> <skeletonProperties> <key>SingleProcess</key> ! <value>1</value> ! </skeletonProperties> ! <skeletonProperties> ! <key>SingleInstance</key> ! <value>1</value> ! </skeletonProperties> ! <skeletonProperties> ! <key>JniSmooth</key> ! <value>1</value> </skeletonProperties> <skeletonProperties> |
From: Rodrigo R. <re...@us...> - 2007-05-19 15:23:21
|
Update of /cvsroot/jsmooth/jsmooth/sample/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv24829/sample/src Modified Files: JSmoothPropertiesDisplayer.java Log Message: modified the jni test procedure Index: JSmoothPropertiesDisplayer.java =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/sample/src/JSmoothPropertiesDisplayer.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** JSmoothPropertiesDisplayer.java 18 May 2007 21:35:29 -0000 1.11 --- JSmoothPropertiesDisplayer.java 19 May 2007 15:21:51 -0000 1.12 *************** *** 86,102 **** jsmooth.DriveInfo di = jsmooth.Native.getDriveInfo(f); System.out.println("DriveInfo: " + di + " = " + di.toString()); System.out.println("path: " + jsmooth.Native.getExecutablePath()); System.out.println("filename: " + jsmooth.Native.getExecutableName()); ! jsmooth.Native.shellExecute(jsmooth.Native.SHELLEXECUTE_OPEN, ! "service.log", null, null, ! jsmooth.Native.SW_SHOWNORMAL); ! jsmooth.Native.shellExecute(jsmooth.Native.SHELLEXECUTE_FIND, ! "c:\\TEMP", null, null, ! jsmooth.Native.SW_SHOWNORMAL); ! jsmooth.Native.shellExecute(jsmooth.Native.SHELLEXECUTE_EXPLORE, ! "z:\\", null, null, ! jsmooth.Native.SW_SHOWNORMAL); // System.out.println("RES: " + jsmooth.Native.exitWindows(jsmooth.Native.EXITWINDOWS_REBOOT | jsmooth.Native.EXITWINDOWS_FORCE )); --- 86,112 ---- jsmooth.DriveInfo di = jsmooth.Native.getDriveInfo(f); + if (di.getDriveType() == jsmooth.DriveInfo.DRIVE_REMOVABLE) + { + // This file is on a removeable drive ! + } + if (di.getFreeSpaceForUser() < (1024*1024*64)) + { + // there are less than 64MB free for the + // user on this drive ! + } + System.out.println("DriveInfo: " + di + " = " + di.toString()); System.out.println("path: " + jsmooth.Native.getExecutablePath()); System.out.println("filename: " + jsmooth.Native.getExecutableName()); ! // jsmooth.Native.shellExecute(jsmooth.Native.SHELLEXECUTE_OPEN, ! // "service.log", null, null, ! // jsmooth.Native.SW_SHOWNORMAL); ! // jsmooth.Native.shellExecute(jsmooth.Native.SHELLEXECUTE_FIND, ! // "c:\\TEMP", null, null, ! // jsmooth.Native.SW_SHOWNORMAL); ! // jsmooth.Native.shellExecute(jsmooth.Native.SHELLEXECUTE_EXPLORE, ! // "z:\\", null, null, ! // jsmooth.Native.SW_SHOWNORMAL); // System.out.println("RES: " + jsmooth.Native.exitWindows(jsmooth.Native.EXITWINDOWS_REBOOT | jsmooth.Native.EXITWINDOWS_FORCE )); |