jsmooth-cvs Mailing List for JSmooth (Page 3)
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-19 15:00:29
|
Update of /cvsroot/jsmooth/jsmooth/docs/images In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv16311 Added Files: jsg-application-small.png jsg-selection-small.png jsg-skeletonproperties-small.png Log Message: added thumbnails used in web site --- NEW FILE: jsg-application-small.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: jsg-skeletonproperties-small.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: jsg-selection-small.png --- (This appears to be a binary file; contents omitted.) |
From: Rodrigo R. <re...@us...> - 2007-05-19 14:59:29
|
Update of /cvsroot/jsmooth/jsmooth/docs/images In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv15517/images Modified Files: jsg-application.png jsg-configuration.png jsg-executable.png jsg-javaapplication.png jsg-selection.png jsg-skeleton.png jsg-skeletonproperties.png Log Message: updated documentation Index: jsg-skeleton.png =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/docs/images/jsg-skeleton.png,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvsFKSGxc and /tmp/cvsdlXagR differ Index: jsg-configuration.png =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/docs/images/jsg-configuration.png,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvsSpMZyl and /tmp/cvsRtJNt0 differ Index: jsg-application.png =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/docs/images/jsg-application.png,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvsUMKUms and /tmp/cvsfOy6r7 differ Index: jsg-javaapplication.png =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/docs/images/jsg-javaapplication.png,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvsFkCJRy and /tmp/cvs9506ae differ Index: jsg-selection.png =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/docs/images/jsg-selection.png,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvs9JIYkG and /tmp/cvsoYf2Ql differ Index: jsg-executable.png =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/docs/images/jsg-executable.png,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvsZO141L and /tmp/cvsSXGyDr differ Index: jsg-skeletonproperties.png =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/docs/images/jsg-skeletonproperties.png,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvsVRBZwN and /tmp/cvsnpwNft differ |
From: Rodrigo R. <re...@us...> - 2007-05-19 14:59:29
|
Update of /cvsroot/jsmooth/jsmooth/docs In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv15517 Modified Files: jsmooth-doc.xml Added Files: jsmooth.css Log Message: updated documentation --- NEW FILE: jsmooth.css --- body { font-family: sans-serif } a { color: black; font-weight: normal; } table { border: 0px solid black; } .warning { background-color: #EEEEEE; } .programlisting { background-color: #EEDD57; } .function { font-family: monospace; background-color: #EEDD57; } .revhistory { margin-left: 25%; width: 50%; } .mediaobject { text-align: center; } img { text-align: center; } .author { text-align: center; } div.titlepage h1 { text-align: center; } div.titlepage h3 { text-align: center; } .toc { border: 1px solid black; width: 60%; margin-left: 15%; padding-left: 5%; background-color: #fafafa; } Index: jsmooth-doc.xml =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/docs/jsmooth-doc.xml,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** jsmooth-doc.xml 18 May 2007 21:35:28 -0000 1.22 --- jsmooth-doc.xml 19 May 2007 14:59:24 -0000 1.23 *************** *** 9,13 **** </author> ! <revhistory> <revision> <revnumber>1.0</revnumber> --- 9,14 ---- </author> ! ! <revhistory role="revisiontab"> <revision> <revnumber>1.0</revnumber> *************** *** 16,22 **** <revremark>First draft</revremark> </revision> </revhistory> ! <title>JSmooth @{VERSION}@ User Manual</title> <subtitle>@{RELEASEINFO}@</subtitle> </articleinfo> --- 17,30 ---- <revremark>First draft</revremark> </revision> + <revision> + <revnumber>2.0</revnumber> + <date>19 May 2007</date> + <authorinitials>RR</authorinitials> + <revremark>Update for release 0.9.9-7</revremark> + <revremark>Screenshots updated</revremark> + </revision> </revhistory> ! <title role="primarytitle">JSmooth @{VERSION}@ User Manual</title> <subtitle>@{RELEASEINFO}@</subtitle> </articleinfo> *************** *** 26,50 **** <sect2><title>What is JSmooth?</title> - <para> ! JSmooth is a Java Executable Wrapper. It builds standard Windows ! executable binaries (.exe) that contain all the information needed to ! launch your java application, i.e. the classpath, the jvm version ! required, the java properties, and so on. If Java is not installed, ! JSmooth can also properly redirect them to a web site or even download ! and install automatically a JVM. - </para> - <para>Because JSmooth is 100% java, it can build a windows - executable from any environement running Java, including linux, - solaris, etc. </para> ! <sect3><title>Web Site</title> <para> <itemizedlist> <listitem><para> The JSmooth web page is located at <ulink ! url="http://jsmooth.sourceforge.net/">http://jsmooth.sourceforge.net/</ulink> </para></listitem> --- 34,69 ---- <sect2><title>What is JSmooth?</title> ! <para> ! JSmooth is a Java Executable Wrapper generator with advanced JRE ! detection features. It builds standard Windows executable binaries ! (.exe) that contain all the information needed to launch your java ! application, i.e. the classpath, the jvm version required, the java ! properties, and so on. ! </para> ! ! <para> ! It also offers full control on deployment ! issues such as missing, old, or broken JRE installed on the end-user ! computer. The JSmooth wrappers provide smooth solutions, such as ! automatic JRE download and installation, redirection to a web site, or ! simply a meaningful message to the users on what's going wrong. ! </para> ! ! <para> ! Because JSmooth is 100% java, it can build windows ! executables from any environement running Java, including linux, ! solaris, etc. ! </para> ! </sect2> ! <sect2><title>Web Support</title> <para> <itemizedlist> <listitem><para> The JSmooth web page is located at <ulink ! url="http://jsmooth.sourceforge.net/">http://jsmooth.sourceforge.net/</ulink>. Please visit it for the latest news. </para></listitem> *************** *** 53,60 **** </para></listitem> </itemizedlist> </para> - </sect3> </sect2> --- 72,81 ---- </para></listitem> + <listitem><para>Should you find any bug, please submit it to <ulink url="http://sourceforge.net/tracker/?group_id=86730">the jsmooth tracker</ulink>. For any question relative to JSmooth, please use <ulink url="http://sourceforge.net/forum/?group_id=86730">the forum</ulink> (hosted at sourceforge's). + </para></listitem> + </itemizedlist> </para> </sect2> *************** *** 79,87 **** search for all the JVM installed on a computer, and determine which best suits the requirements of your ! application. If no VM is found, it's OK as well, your ! end-users are in good hands with jsmooth: the wrappers ! can redirect them to a web page, or even better, they ! can propose the user to automatically download and ! install a Java Environment. </para> --- 100,108 ---- search for all the JVM installed on a computer, and determine which best suits the requirements of your ! application. If no VM is found, your end-users are in ! good hands with jsmooth: the wrappers can redirect them ! to a web page, or even better, they can propose the ! user to automatically download and install a Java ! Environment. </para> *************** *** 122,128 **** <listitem> <para> ! Sometimes it's more convenient to bundle a JRE with your ! application. JSmooth can deal with that too, you just ! need to define in which folder the JRE is expected. It falls back nicely to a standard JVM search if the JRE is not where it should be. --- 143,149 ---- <listitem> <para> ! Sometimes it's more convenient to bundle your own JRE with your ! application. JSmooth can deal with that too: you just ! need to define in which folder the JRE is packaged. It falls back nicely to a standard JVM search if the JRE is not where it should be. *************** *** 147,156 **** <listitem> <para> ! A Swing-based project editor allows you to easily ! configure the executable binary for your software. All ! the parameters are configured with a GUI, just click and ! compile the project. ! </para> ! </listitem> <listitem> --- 168,175 ---- <listitem> <para> ! A graphical project editor makes configuring and ! customizing your exe wrapper a breeze. The inline help ! balloons provide non-intrusive yet extensive information on ! each parameter available. </para> </listitem> <listitem> *************** *** 158,162 **** Associate an icon to your executable, using a .ICO, .PNG, or .GIF file (automatic color reduction is done if ! necessary). </para> </listitem> --- 177,181 ---- Associate an icon to your executable, using a .ICO, .PNG, or .GIF file (automatic color reduction is done if ! necessary). </para> </listitem> *************** *** 178,195 **** <listitem> <para> ! You can easely pass environment variables from the ! system: just define the java properties to pass to your ! application, and use the standard Windows %VARIABLE% ! syntax. ! </para> ! </listitem> <listitem> <para> ! Pass special variables that are not available to Java ! program, such as the executable path and name, and even ! the Windows computer name. ! </para> ! </listitem> <listitem> --- 197,211 ---- <listitem> <para> ! Pass also environment variables from the system: just ! define the java properties to pass to your application, ! and use the standard Windows %VARIABLE% syntax. </para> ! </listitem> <listitem> <para> ! Some special variables that are normally not available ! to Java program, such as the executable path and name, ! and even the Windows computer name, can be passed as ! well! </para> </listitem> <listitem> *************** *** 202,210 **** <listitem> <para> ! ! Want to modify the current directory used by your Java ! application? The wrappers will handle this for you. ! </para> ! </listitem> </itemizedlist> --- 218,224 ---- <listitem> <para> ! Need to modify the current directory used by your java ! application ? The wrappers will handle this for you. ! </para> </listitem> </itemizedlist> *************** *** 217,223 **** <listitem> <para> ! Provided with several exe wrappers skeletons, for GUI or for console-base application. ! </para> ! </listitem> <listitem> --- 231,237 ---- <listitem> <para> ! Provided with several exe wrappers skeletons, for either ! GUI, console-based application, or windows services ! ! </para> </listitem> <listitem> *************** *** 242,248 **** <para> The JSmoothGen application is the project editor. It provides a ! graphical user interface for the configuration of all the ! parameters available for building a .exe. ! </para> <para> --- 256,261 ---- <para> The JSmoothGen application is the project editor. It provides a ! (hopefully nice) graphical user interface for the configuration ! of all the parameters available to the wrappers. </para> <para> *************** *** 263,269 **** <para> ! JSmooth builds a binary exe that contains all the information ! needed to launch your java application, such as the classpath, the ! java properties, the jvm version required, and so on. </para> --- 276,284 ---- <para> ! Building your own EXE wrapper for your java application just needs ! a few simple steps: specify the name of the executable, define the ! main java class, optionally a classpath if it needs more than its ! own jar, and that's all. ! </para> *************** *** 272,283 **** <sect3><title>Quick Start</title> <para> - The minimum data you need to start the creation of the binary ! executable for your application is to specify a classpath and a ! fully-qualified class name. You can configure both in the <function>Java ! Application</function> panel (add new jars or directories using the ! funny icon with a yellow + sign, and type the class name in the ! <label>Main Class</label> field. </para> --- 287,298 ---- <sect3><title>Quick Start</title> <para> The minimum data you need to start the creation of the binary ! executable for your application is to specify a classpath and the ! fully-qualified name of your main class. You can configure both ! in the <function>Application</function> panel (add new jars ! or directories using the icon with a yellow <label>+</label> ! sign, and type the class name in the <label>Main Class</label> ! field. </para> *************** *** 289,293 **** Name</label> field. Do not forget to add the <label>.exe</label> suffix, for your executable name. Something like ! <function>my-app.exe</function> would be fine. </para> --- 304,308 ---- Name</label> field. Do not forget to add the <label>.exe</label> suffix, for your executable name. Something like ! <function>my-app.exe</function> should be fine. </para> *************** *** 295,306 **** <para> ! Of course, you could specify many more options for the java ! launching, but above is all what's required. Now, you are nearly ! done. Click on the save button (or in the ! <guimenu>File+Save</guimenu> menu) and select a filename for the ! project. This is an important step, because all the path stored in ! the file, and displayed in the GUI are relative to this file. ! ! </para> <para> --- 310,320 ---- <para> ! Of course, you can specify many more options for the java wrapper, ! but this is enough for a basic java application. Now, click on the ! save button (or in the <guimenu>File+Save</guimenu> menu) and ! select a filename for the project. This is an important step, ! because all the path stored in the file, and displayed in the GUI ! are relative to this project file. Selecting a location under the ! root directory of your project is a good (and safe) choice. </para> <para> *************** *** 309,315 **** <guimenu>Project+Create Exe</guimenu>. And that's it. You can use the <guimenu>Project+Run Exe</guimenu> to run the program, or ! double-click the file name that was specified in <label>Windows ! Executable</label> panel, which can be found in the same directory ! than the project file. </para> --- 323,327 ---- <guimenu>Project+Create Exe</guimenu>. And that's it. You can use the <guimenu>Project+Run Exe</guimenu> to run the program, or ! use the windows explorer to run the executable. </para> *************** *** 323,328 **** <listitem><para>All the files saved and displayed in the Graphical ! User Interface are relative to the project file. </para> ! </listitem> --- 335,339 ---- <listitem><para>All the files saved and displayed in the Graphical ! User Interface are relative to the project file. </para> </listitem> *************** *** 368,371 **** --- 379,407 ---- </listitem> + <listitem><para> The Autodownload wrapper is designed for standard + Windows applications, which do not use console. + </para> + + <para> + If no JVM is found, the wrapper displays a customized + message, and offers the end-user to automatically download + and install a JRE. The version of the JRE to download is a + configurable parameter of the wrapper, and uses the Sun's + autodownload feature initially provided for Web Start. + </para> + + </listitem> + + <listitem><para> The Custom Web Download wrapper is a wrapper + for GUI-only applications (no console) </para> + + <para> + If no JVM is found, the wrapper displays a customized + message, and offers the end-user to download a customized + file from the internet. The URL is a configurable parameter + of the wrapper, and accepts http, https, and ftp. The file + download is automatically executed or displayed (according + to the nature of the file). </para> </listitem> + <listitem><para> The Windowed Wrapper is designed for standard Windows applications, which do not use console. *************** *** 375,384 **** If no JVM is found, the skeleton displays a Windows OK/Cancel alert. If the user selects the OK button, the ! default web browser is launched on a default web page. Both ! the message of the alert and the URL of the web page are ! configurable in the <guilabel>Skeleton Properties panel</guilabel>. ! </para> </listitem> </itemizedlist> --- 411,430 ---- If no JVM is found, the skeleton displays a Windows OK/Cancel alert. If the user selects the OK button, the ! default web browser is launched on a web page. Both the ! message of the alert and the URL of the web page are ! configurable. </para> ! ! </listitem> + <listitem><para> The Windows Service Wrapper provides a wrapper + for application designed to work as services. </para> + + <para> + The wrapper can be installed, uninstalled, started, or + stopped just like any other windows service. If no JVM is + found, the service does not run, and a specific message is + logged. </para> </listitem> + </itemizedlist> *************** *** 396,399 **** --- 442,450 ---- </para> + <para> + Each skeleton has its own set of option, most of them are + optional. Be sure to check them all, as they can modify drastically + the behaviour of your wrapper. Please refer to the inline help for the details. </para> + </sect2> *************** *** 402,407 **** <para> The windows executable created by the JSmooth wrapping system ! can be configured in many ways. The executable itself can be ! customized with the following parameters: </para> --- 453,457 ---- <para> The windows executable created by the JSmooth wrapping system ! can be configured in many ways. </para> *************** *** 458,464 **** an environment variable (which may be complicated to set under windows). Instead, define a Java Property, and set ! <systemitem>${EXECUTABLEPATH}</systemitem> as value. The effect of ! this is to pass to your application a java property that contains ! the directory where the executable is located. Just use <methodname>System.getProperty()</methodname> call to retrieve the value. </para> --- 508,515 ---- an environment variable (which may be complicated to set under windows). Instead, define a Java Property, and set ! <systemitem>${EXECUTABLEPATH}</systemitem> as its value. The ! effect of this is to pass to your application a java ! property that contains the directory where the executable is ! located. Just use <methodname>System.getProperty()</methodname> call to retrieve the value. </para> *************** *** 469,473 **** "Sets the executable folder as current directory of the application" and define a standard file association in ! Windows. </para> </warning> --- 520,525 ---- "Sets the executable folder as current directory of the application" and define a standard file association in ! Windows. Alternatively, you can also use the JNI features of ! jsmooth to retrieve the executable path. </para> </warning> *************** *** 544,548 **** </imageobject> <caption> ! <para>The Java Application configuration panel</para> </caption> </mediaobject> --- 596,600 ---- </imageobject> <caption> ! <para>The application-specific configuration panel</para> </caption> </mediaobject> *************** *** 550,572 **** <para> ! <itemizedlist> <listitem> <para> - The <guilabel>Jar Location</guilabel> field specifies the - main JAR file of the application. There may be additional - jar specified in the <guilabel>Classpath</guilabel> - interface, but this one is mandatory. It contains the main - class of the application, and is added as a resource to the - executable created by JSmooth. - </para> - </listitem> - <listitem> - <para> Edit the <guilabel>Main Class</guilabel> field to specify ! the wrapper which class of the jar (see above) is to be ! considered the entry point of the program. This field is ! mandatory as well. </para> --- 602,613 ---- <para> ! <itemizedlist> <listitem> <para> Edit the <guilabel>Main Class</guilabel> field to specify ! the class used as entry point of the program. This field is ! mandatory. </para> *************** *** 585,601 **** <para> ! The <guilabel>Arguments</guilabel> may be overrided by some wrappers. For instance, the <guilabel>Console ! Wrapper</guilabel> uses the arguments from the command line instead. - </para> </warning> </listitem> <listitem> <para> ! The <guilabel>ClassPath</guilabel> list proposes you to edit an ordered list of classpaths. To add a classpath, click on the <guiicon><inlinegraphic --- 626,655 ---- <para> ! The <guilabel>Arguments</guilabel> may be overriden by some wrappers. For instance, the <guilabel>Console ! Wrapper</guilabel> always uses the arguments from the command line instead. </para> </warning> </listitem> + + <listitem> + <para> + Using the <guilabel>Embedded Jar</guilabel> field, you can + optionally specify a jar to be embedded (as a resource) in + the EXE wrapper. This jar is extracted each time the + application is launched, therefore you should keep it as + small as possible. </para> + <para> + This is specially useful for application packaged as a + single EXE file. + </para> + </listitem> + <listitem> <para> ! The <guilabel>ClassPath</guilabel> list provides a mean to edit an ordered list of classpaths. To add a classpath, click on the <guiicon><inlinegraphic *************** *** 666,670 **** </para> <para> ! The values are all inclusive. For instance, if you specify 1.4 as a maximum means that the java wrapper accepts 1.4.0 JVM, but not 1.4.1. --- 720,724 ---- </para> <para> ! The values are inclusive. For instance, if you specify 1.4 as a maximum means that the java wrapper accepts 1.4.0 JVM, but not 1.4.1. *************** *** 729,734 **** <para> ! In this case, the generated myexe.exe will try to use first ! the jre in the "jre" sub-dir. To deploy it, either simply zip all the "myprog" directory, or tell your favorite installer to set-up the jre directory in the same configuration as in your --- 783,788 ---- <para> ! In this case, the generated myexe.exe tries to use ! the jre in the "jre" sub-dir as its first-choice JRE. To deploy it, either simply zip all the "myprog" directory, or tell your favorite installer to set-up the jre directory in the same configuration as in your *************** *** 934,956 **** </sect2> - <sect2><title>Skeleton Properties</title> - <para> - - This panel is specific to the wrapper selected in the - <guilabel>Skeleton Selection</guilabel> panel. - - </para> - <para> - <mediaobject> - <imageobject> - <imagedata fileref="images/jsg-skeletonproperties.png" format="PNG"/> - </imageobject> - <caption> - <para>The Skeleton-specifics properties panel</para> - </caption> - </mediaobject> - </para> - </sect2> - </sect1> --- 988,991 ---- *************** *** 1059,1063 **** </para> - <para>Before using any JNI feature from the <function>jsmooth.Native</function>, you must check that the --- 1094,1097 ---- *************** *** 1067,1070 **** --- 1101,1220 ---- native method.</para> + <sect2><title>Examples</title> + + <sect3><title>Start the default application for a file</title> + + <para> + Using the <function>shellExecute()</function>, you can start the + default application associated by windows to a document and perform + any of the action among <function>SHELLEXECUTE_OPEN</function> (opens + the file for visualization), <function>SHELLEXECUTE_EDIT</function> + (opens the file for editing), <function>SHELLEXECUTE_PRINT</function> + (print the document), <function>SHELLEXECUTE_FIND</function> (launch + the windows Find utility on a specific folder), + <function>SHELLEXECUTE_EXPLORE</function> (launch the windows file + Explorer tool on a specific folder). + </para> + + <para> + + <programlisting> + if (jsmooth.Native.isAvailable()) + { + jsmooth.Native.shellExecute(jsmooth.Native.SHELLEXECUTE_OPEN, + "c:\\myfile.pdf", null, null, + jsmooth.Native.SW_SHOWNORMAL); + } + </programlisting> + </para> + + </sect3> + + <sect3><title>Launching the default web browser</title> + <para> + + There are some java libraries available around to launch the default + browser on an URL, but using the <function>shellExecute()</function> + is probably the best solution for the windows platform on this + traditional problem. + + <programlisting> + URL target = "http://jsmooth.sourceforge.net/"; + if (jsmooth.Native.isAvailable()) + { + jsmooth.Native.shellExecute(jsmooth.Native.SHELLEXECUTE_OPEN, + target.toString(), + null, null, + jsmooth.Native.SW_NORMAL); + } + else + { + // Use a traditionnal java-based guessing method + // to find and launch the default browser + } + </programlisting> + </para> + </sect3> + + + <sect3><title>Reboot the computer</title> + <para> + + It may be useful to reboot or log off the computer/session + programmatically at a given time. You can use the jsmooth + <function>exitWindows()</function> method to shutdown or reboot the + computer, but also disconnect the session of the user. + + <programlisting> + // Log off the user session + if (jsmooth.Native.isAvailable()) + { + jsmooth.Native.exitWindows(jsmooth.Native.EXITWINDOWS_LOGOFF); + } + </programlisting> + </para> + </sect3> + + <sect3><title>Retrieve information on a disk drive</title> + <para> + + There is no way to distinguish between a removeable media, a cdrom + drive, or a fixed disk using the standard java API. It is however a + good usability point to use different icons to display fixed, + removeable medias, remote drives, or cdrom. It may also be useful to + know if there are enough free space on disk before saving a file, or + to be aware that the filesystem used for a media is FAT16, in order to + alert the user of a possible loss of precision in the filenames. + </para> + + <para> + + The <code>jsmooth.DriveInfo</code> object provides all this + information for free, provided your application is launched with a + jni-enabled jsmooth wrapper. + + <programlisting> + File f = new File("d:/my/file/somewhere"); + 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 ! + } + + </programlisting> + </para> + </sect3> + + + + </sect2> + </sect1> |
From: Rodrigo R. <re...@us...> - 2007-05-18 21:52:54
|
Update of /cvsroot/jsmooth/jsmooth/skeletons/commonjava In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv14294/skeletons/commonjava Modified Files: MSJViewLauncher.cpp Log Message: ensure the jni jsmooth jar is always available Index: MSJViewLauncher.cpp =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/commonjava/MSJViewLauncher.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** MSJViewLauncher.cpp 1 Mar 2007 21:56:02 -0000 1.4 --- MSJViewLauncher.cpp 18 May 2007 21:52:51 -0000 1.5 *************** *** 55,58 **** --- 55,59 ---- string cpext = resource.getNormalizedClassPath(); classpath += cpext; + classpath += ";" + resource.saveJnismoothInTempFile(); string classname = resource.getProperty(string(ResourceManager::KEY_MAINCLASSNAME)); |
From: Rodrigo R. <re...@us...> - 2007-05-18 21:52:54
|
Update of /cvsroot/jsmooth/jsmooth In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv14294 Modified Files: build.xml Log Message: ensure the jni jsmooth jar is always available Index: build.xml =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/build.xml,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** build.xml 18 May 2007 21:35:28 -0000 1.40 --- build.xml 18 May 2007 21:52:51 -0000 1.41 *************** *** 54,57 **** --- 54,58 ---- <pathelement path="lib/jox116.jar"/> <pathelement path="lib/dtdparser113.jar"/> + <pathelement path="skeletons/jnismooth/jnismooth.jar"/> </path> *************** *** 79,82 **** --- 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"> |
From: Rodrigo R. <re...@us...> - 2007-05-18 21:52:54
|
Update of /cvsroot/jsmooth/jsmooth/sample In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv14294/sample Modified Files: sample.jsmooth Log Message: ensure the jni jsmooth jar is always available Index: sample.jsmooth =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/sample/sample.jsmooth,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** sample.jsmooth 18 May 2007 21:35:29 -0000 1.15 --- sample.jsmooth 18 May 2007 21:52:51 -0000 1.16 *************** *** 7,10 **** --- 7,11 ---- <JVMSearchPath>jview</JVMSearchPath> <JVMSearchPath>registry</JVMSearchPath> + <arguments></arguments> <currentDirectory>..\classes</currentDirectory> <embeddedJar>true</embeddedJar> *************** *** 48,51 **** --- 49,53 ---- <skeletonProperties> <key>URL</key> + <value></value> </skeletonProperties> <skeletonProperties> |
From: Rodrigo R. <re...@us...> - 2007-05-18 21:35:35
|
Update of /cvsroot/jsmooth/jsmooth/src/locale In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv6644/src/locale Modified Files: Texts.properties Texts_fr.properties Log Message: adds the JNI Jsmooth documentation Index: Texts.properties =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/src/locale/Texts.properties,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** Texts.properties 17 May 2007 10:56:19 -0000 1.15 --- Texts.properties 18 May 2007 21:35:29 -0000 1.16 *************** *** 149,152 **** --- 149,153 ---- <li> The documentation is available in <a href="docs/jsmooth-doc.html">HTML</a> and <a href="docs/jsmooth-doc.pdf">PDF</a> format. \ <li> Please check the <a href="LICENSE.txt">license</a>. You can also consult the <a href="GPL-LICENSE.txt">GPL license</a> (for JSmooth) or the <a href="LGPL-LICENSE.txt">LGPL license</a> (for the executable source code). \ + <li> Some wrappers also provide a <a href="docs/jniapi/index.html">JSmooth JNI API</a> to access Windows-specific function from your java program. \ </ul><h2>JSmooth Support</h2> \ Please submit any bug you may find to <a href="http://sourceforge.net/tracker/?group_id=86730">the jsmooth tracker</a>. Should you have any question, please use <a href="http://sourceforge.net/forum/?group_id=86730">the forum</a> (hosted at sourceforge's). *************** *** 155,156 **** --- 156,160 ---- SKEL_GENERIC_SINGLEINSTANCE=Single instance SKEL_GENERIC_SINGLEINSTANCE_DESCRIPTION=When this option is enabled, only one instance of the application can run at any time. <p> If the instance of the application is running, it is requested to bring its window (if any) to the front. + # + SKEL_GENERIC_JNISMOOTH=Use JNISmooth classes + SKEL_GENERIC_JNISMOOTH_DESCRIPTION=When launched with JSmooth, your application can optionnally be provided the jsmooth.Native class, which offers functions that are not available from a standard JVM. If you don't use the jsmooth.Native class, you can leave this option disabled (although it won't harm). Index: Texts_fr.properties =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/src/locale/Texts_fr.properties,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Texts_fr.properties 17 May 2007 10:56:22 -0000 1.10 --- Texts_fr.properties 18 May 2007 21:35:29 -0000 1.11 *************** *** 144,147 **** --- 144,148 ---- <li> La documentation est disponible en anglais aux formats <a href="docs/jsmooth-doc.html">HTML</a> et <a href="docs/jsmooth-doc.pdf">PDF</a>. \ <li> Merci de lire les détails de <a href="LICENSE.txt">la licence de ce logiciel</a>. Vous pouvez également consulter la <a href="GPL-LICENSE.txt">licence GPL</a> (pour JSmooth) ou la <a href="LGPL-LICENSE.txt">licence LGPL</a> (pour le code source des executables). \ + <li> Vous pouvez également utiliser <a href="docs/jniapi/index.html">l'API JNI de JSmooth</a> pour accéder à certaines fonctions spécifiques de Windows depuis votre application java.\ </ul><h2>Support utilisateurs</h2> \ Si vous rencontrez un bug, merci de le soumettre au <a href="http://sourceforge.net/tracker/?group_id=86730">tracker de jsmooth</a>. Si vous avez des questions sur l'utilisation de JSmooth, n'hésitez pas à utiliser <a href="http://sourceforge.net/forum/?group_id=86730">le forum</a> (anglais) sur sourceforge. *************** *** 150,153 **** SKEL_GENERIC_SINGLEINSTANCE=Instance unique de l'application SKEL_GENERIC_SINGLEINSTANCE_DESCRIPTION=Si cette option est activée, une seule instance de l'application peut être démarrée. <p> Si l'instance unique de l'application est déjà lancée, sa fenêtre (s'il y en a une) s'affiche au premier plan. ! ! When this option is enabled, only one instance of the application can run at any time. <p> If another application is running, it is requested to bring its window (if any) to the front. --- 151,155 ---- SKEL_GENERIC_SINGLEINSTANCE=Instance unique de l'application SKEL_GENERIC_SINGLEINSTANCE_DESCRIPTION=Si cette option est activée, une seule instance de l'application peut être démarrée. <p> Si l'instance unique de l'application est déjà lancée, sa fenêtre (s'il y en a une) s'affiche au premier plan. ! # ! SKEL_GENERIC_JNISMOOTH=Utiliser les classes JNI de JSmooth ! SKEL_GENERIC_JNISMOOTH_DESCRIPTION=JSmooth peut mettre à disposition de votre application certaines classes offrant un accès à des fonctions natives de Windows, qui ne sont normalement pas accessible depuis Java. Pour avoir accès à ces fonctionnalité, activez cette option. |
From: Rodrigo R. <re...@us...> - 2007-05-18 21:35:35
|
Update of /cvsroot/jsmooth/jsmooth/sample In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv6644/sample Modified Files: build.xml sample.jsmooth Log Message: adds the JNI Jsmooth documentation Index: sample.jsmooth =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/sample/sample.jsmooth,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** sample.jsmooth 17 May 2007 10:56:15 -0000 1.14 --- sample.jsmooth 18 May 2007 21:35:29 -0000 1.15 *************** *** 40,44 **** <maximumVersion></maximumVersion> <minimumVersion>1.3</minimumVersion> ! <skeletonName>Custom Web Download Wrapper</skeletonName> <skeletonProperties> <key>Message</key> --- 40,44 ---- <maximumVersion></maximumVersion> <minimumVersion>1.3</minimumVersion> ! <skeletonName>Windowed Wrapper</skeletonName> <skeletonProperties> <key>Message</key> *************** *** 47,52 **** </skeletonProperties> <skeletonProperties> ! <key>DownloadURL</key> ! <value></value> </skeletonProperties> <skeletonProperties> --- 47,51 ---- </skeletonProperties> <skeletonProperties> ! <key>URL</key> </skeletonProperties> <skeletonProperties> *************** *** 55,64 **** </skeletonProperties> <skeletonProperties> ! <key>Debug</key> ! <value>0</value> </skeletonProperties> <skeletonProperties> ! <key>SingleInstance</key> ! <value>0</value> </skeletonProperties> </jsmoothproject> --- 54,67 ---- </skeletonProperties> <skeletonProperties> ! <key>SingleInstance</key> ! <value>1</value> </skeletonProperties> <skeletonProperties> ! <key>JniSmooth</key> ! <value>1</value> ! </skeletonProperties> ! <skeletonProperties> ! <key>Debug</key> ! <value>1</value> </skeletonProperties> </jsmoothproject> Index: build.xml =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/sample/build.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** build.xml 1 Mar 2007 22:08:32 -0000 1.2 --- build.xml 18 May 2007 21:35:29 -0000 1.3 *************** *** 6,9 **** --- 6,13 ---- <property name="classes" value="classes"/> + <path id="build.class.path"> + <pathelement path="../skeletons/jnismooth/jnismooth.jar"/> + </path> + <target name="init"> <!-- Create the time stamp --> *************** *** 15,19 **** <target depends="init" name="compile"> <!-- Compile the java code from ${src} into ${classes} --> ! <javac deprecation="yes" destdir="${classes}" srcdir="${src}" source="1.1" target="1.1"/> </target> --- 19,25 ---- <target depends="init" name="compile"> <!-- Compile the java code from ${src} into ${classes} --> ! <javac deprecation="yes" destdir="${classes}" srcdir="${src}" source="1.1" target="1.1"> ! <classpath refid="build.class.path"/> ! </javac> </target> *************** *** 23,26 **** --- 29,41 ---- </target> + <target name="run" depends="dist"> + <java classname="JSmoothPropertiesDisplayer" fork="yes" > + <classpath refid="build.class.path"/> + <classpath> + <pathelement path="sample.jar"/> + </classpath> + </java> + </target> + <target name="clean"> <delete dir="${classes}"/> |
From: Rodrigo R. <re...@us...> - 2007-05-18 21:35:35
|
Update of /cvsroot/jsmooth/jsmooth In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv6644 Modified Files: Changelog build.number build.xml Log Message: adds the JNI Jsmooth documentation Index: build.number =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/build.number,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** build.number 17 May 2007 10:56:14 -0000 1.37 --- build.number 18 May 2007 21:35:28 -0000 1.38 *************** *** 1,3 **** #Build Number for ANT. Do not edit! ! #Thu May 17 11:54:22 CEST 2007 ! build.number=229 --- 1,3 ---- #Build Number for ANT. Do not edit! ! #Fri May 18 23:29:11 CEST 2007 ! build.number=243 Index: build.xml =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/build.xml,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** build.xml 13 May 2007 20:08:55 -0000 1.39 --- build.xml 18 May 2007 21:35:28 -0000 1.40 *************** *** 30,34 **** <!-- set here the properties specific to the release --> ! <property name="VERSION" value="0.9.9-6"/> <!-- You don't need to modify the properties below --> --- 30,34 ---- <!-- set here the properties specific to the release --> ! <property name="VERSION" value="0.9.9-7"/> <!-- You don't need to modify the properties below --> *************** *** 256,261 **** --- 256,273 ---- <!-- Compile the wrappers --> + <ant antfile="build.xml" dir="skeletons/jnismooth/" target="dist"/> <ant antfile="build.xml" dir="skeletons/samplejar/" target="dist"/> <ant antfile="build.xml" dir="skeletons/consolewrapper/samplejar/" target="dist"/> + + <mkdir dir="${dist}/jni"/> + <copy todir="${dist}/jni" file="skeletons/jnismooth/jnismooth.jar"/> + <javadoc packagenames="jsmooth.*" + sourcepath="skeletons/jnismooth/src" + destdir="${dist}/docs/jniapi" + author="true" + version="true" + use="true" + windowtitle="JSmooth JNI API" /> + <mkdir dir="${dist}/skeletons/windowed-wrapper"/> Index: Changelog =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/Changelog,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** Changelog 17 May 2007 10:56:14 -0000 1.39 --- Changelog 18 May 2007 21:35:28 -0000 1.40 *************** *** 8,11 **** --- 8,13 ---- enabled, launching another instance of the application results in bringing the window of the first one to front. + - Added JNI functions available to the java application when + launched using the JVM DLL 0.9.9-6 |
From: Rodrigo R. <re...@us...> - 2007-05-18 21:35:34
|
Update of /cvsroot/jsmooth/jsmooth/sample/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv6644/sample/src Modified Files: JSmoothPropertiesDisplayer.java Log Message: adds the JNI Jsmooth documentation Index: JSmoothPropertiesDisplayer.java =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/sample/src/JSmoothPropertiesDisplayer.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** JSmoothPropertiesDisplayer.java 13 May 2007 20:07:43 -0000 1.10 --- JSmoothPropertiesDisplayer.java 18 May 2007 21:35:29 -0000 1.11 *************** *** 7,11 **** import java.util.*; - /** * --- 7,10 ---- *************** *** 14,17 **** --- 13,17 ---- public class JSmoothPropertiesDisplayer extends java.awt.Frame { + private String[] m_args; /** Creates new form Frame */ *************** *** 72,75 **** --- 72,112 ---- add(m_buttonClose, gridBagConstraints); + java.awt.Button reboot = new java.awt.Button("JNI Tests"); + add(reboot, gridBagConstraints); + reboot.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + try { + java.io.File f = new java.io.File("Z:/test"); + System.out.println(f.getAbsoluteFile().toString()); + System.out.println(f.getAbsoluteFile().getCanonicalPath().toString()); + System.out.println("JNI Availability : " + jsmooth.Native.isAvailable()); + + if (jsmooth.Native.isAvailable()) + { + + 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 )); + } + } catch (Exception e) + { + e.printStackTrace(); + } + } + }); + pack(); }//GEN-END:initComponents |
From: Rodrigo R. <re...@us...> - 2007-05-18 21:35:34
|
Update of /cvsroot/jsmooth/jsmooth/docs In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv6644/docs Modified Files: jsmooth-doc.xml Log Message: adds the JNI Jsmooth documentation Index: jsmooth-doc.xml =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/docs/jsmooth-doc.xml,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** jsmooth-doc.xml 13 May 2007 20:01:46 -0000 1.21 --- jsmooth-doc.xml 18 May 2007 21:35:28 -0000 1.22 *************** *** 1044,1047 **** --- 1044,1071 ---- </sect1> + <sect1><title>Using the JSmooth JNI functions</title> + + <para> Some of the jsmooth wrappers provides Windows-specific JNI + features that allow your application to optionnaly access native + information. + </para> + + <para> In order to use those features, you must enable the JSmooth + JNI option, and add the <function>jsmooth.Native</function> calls + in your java code. You need to build your project using the + <function>jnismooth.jar</function> library, but don't need to + package it with your application, as it is embedded (as well as the + native functions implementation) in the wrappers. + </para> + + + <para>Before using any JNI feature from the + <function>jsmooth.Native</function>, you must check that the + native methods are correctly bound to their native implementation + by using the <function>jsmooth.Native.isAvailable()</function> + method. If this method returns false, you cannot use any of the + native method.</para> + + </sect1> <sect1><title>Frequently Asked Question</title> |
From: Rodrigo R. <re...@us...> - 2007-05-18 21:34:26
|
Update of /cvsroot/jsmooth/jsmooth/skeletons/commonjava In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv5645/commonjava Modified Files: JMethodCaller.cpp Makefile.win ResourceManager.cpp ResourceManager.h SunJVMDLL.cpp SunJVMDLL.h SunJVMLauncher.cpp Added Files: JniSmooth.cpp JniSmooth.h Log Message: implements the JNI JSmooth functions Index: JMethodCaller.cpp =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/commonjava/JMethodCaller.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** JMethodCaller.cpp 28 Apr 2007 08:43:43 -0000 1.1 --- JMethodCaller.cpp 18 May 2007 21:33:59 -0000 1.2 *************** *** 35,38 **** --- 35,39 ---- { jvalue res; + res.l = 0; DEBUG("invoking " + m_clazz + ": " + m_methodname + ", " + getJavaSignature()); *************** *** 45,49 **** --- 46,57 ---- return res; } + jmethodID m = jvm.findMethod(cl, m_methodname, getJavaSignature(), false); + if (m == 0) + { + DEBUG("Can't find the method " + m_methodname + " / " + getJavaSignature()); + return res; + } + switch (m_returntype.TYPE) { Index: SunJVMDLL.cpp =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/commonjava/SunJVMDLL.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** SunJVMDLL.cpp 13 May 2007 19:56:35 -0000 1.3 --- SunJVMDLL.cpp 18 May 2007 21:33:59 -0000 1.4 *************** *** 23,26 **** --- 23,27 ---- #include "JClassProxy.h" + #include "JniSmooth.h" SunJVMDLL::SunJVMDLL(const std::string& jvmdll, const Version& v) *************** *** 103,106 **** --- 104,109 ---- res = setupVM12DLL(CreateJavaVM, GetDefaultJavaVMInitArgs); + registerJniSmooth(); + DEBUG("Result code on DLL: " + StringUtils::toString(res)); if (res) *************** *** 226,234 **** jmethodID SunJVMDLL::findMethod(jclass& cls, const std::string& methodname, const std::string& signature, bool isStatic) { jmethodID mid; if (isStatic) ! mid = env()->GetStaticMethodID(cls, methodname.c_str(), signature.c_str()); else ! mid = env()->GetMethodID(cls, methodname.c_str(), signature.c_str()); return mid; --- 229,239 ---- jmethodID SunJVMDLL::findMethod(jclass& cls, const std::string& methodname, const std::string& signature, bool isStatic) { + 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; *************** *** 240,243 **** --- 245,267 ---- } + void SunJVMDLL::setIntField(jclass cls, jobject obj, const std::string& fieldName, int value) + { + jfieldID binding = env()->GetFieldID(cls, fieldName.c_str(), "I"); + env()->SetIntField(obj, binding, (jint)value); + } + + void SunJVMDLL::setLongField(jclass cls, jobject obj, const std::string& fieldName, jlong value) + { + jfieldID binding = env()->GetFieldID(cls, fieldName.c_str(), "J"); + env()->SetLongField(obj, binding, (jlong)value); + } + + void SunJVMDLL::setObjectField(jclass cls, jobject obj, const std::string& fieldName, const std::string& fieldclass, jobject value) + { + std::string fc = "L" + StringUtils::replace(fieldclass, "." , "/") + ";"; + jfieldID binding = env()->GetFieldID(cls, fieldName.c_str(), fc.c_str()); + env()->SetObjectField(obj, binding, value); + } + jstring SunJVMDLL::newUTFString(const std::string& str) { *************** *** 369,370 **** --- 393,418 ---- return env()->CallObjectMethodA(obj, methodid, arguments); } + + bool SunJVMDLL::registerMethod(const std::string& classname, const std::string& methodname, const std::string& signature, + void* fn) + { + jclass cc = this->findClass(classname); + if (cc == 0) + return false; + JNINativeMethod jnm; + jnm.name = (char*)methodname.c_str(); + jnm.signature = (char*)signature.c_str(); + jnm.fnPtr = fn; + + int res = env()->RegisterNatives(cc, &jnm, 1); + if (res != 0) + return false; + + return true; + } + + bool SunJVMDLL::registerJniSmooth() + { + registerNativeMethods(this); + return true; + } Index: ResourceManager.h =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/commonjava/ResourceManager.h,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** ResourceManager.h 28 Apr 2007 08:43:43 -0000 1.14 --- ResourceManager.h 18 May 2007 21:33:59 -0000 1.15 *************** *** 60,63 **** --- 60,65 ---- HGLOBAL m_jarHandler; int m_jarSize; + HGLOBAL m_jnismoothHandler; + int m_jnismoothSize; std::vector<std::string> m_arguments; *************** *** 90,94 **** * @param jarId the resource id, stored under the category type, for the jar file */ ! ResourceManager(std::string category, int propsId, int jarId); /** --- 92,96 ---- * @param jarId the resource id, stored under the category type, for the jar file */ ! ResourceManager(std::string category, int propsId, int jarId, int jniId = -1); /** *************** *** 112,115 **** --- 114,119 ---- std::string saveJarInTempFile(); + std::string saveJnismoothInTempFile(); + /** Returns the name of the main class. The main class is the * class used to launch the java application. The static "public *************** *** 176,180 **** private: ! void saveTemp(std::string tempname); std::string idToResourceName(int id) const --- 180,184 ---- private: ! void saveTemp(std::string tempname, HGLOBAL data, int size); std::string idToResourceName(int id) const Index: SunJVMDLL.h =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/commonjava/SunJVMDLL.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SunJVMDLL.h 30 Apr 2007 20:54:32 -0000 1.2 --- SunJVMDLL.h 18 May 2007 21:33:59 -0000 1.3 *************** *** 78,81 **** --- 78,84 ---- bool setupVM11DLL(CreateJavaVM_t CreateJavaVM, GetDefaultJavaVMInitArgs_t GetDefaultJavaVMInitArgs); + bool registerMethod(const std::string& classname, const std::string& methodname, const std::string& signature, void* fn); + bool registerJniSmooth(); + JNIEnv* env() { *************** *** 92,95 **** --- 95,102 ---- JavaVM* getJavaVM(); + void setIntField(jclass cls, jobject obj, const std::string& fieldName, int value); + void setLongField(jclass cls, jobject obj, const std::string& fieldName, jlong value); + void setObjectField(jclass cls, jobject obj, const std::string& fieldName, const std::string& fieldclass, jobject value); + jstring newUTFString(const std::string& str); jobject newObject(jclass clazz, jmethodID& methodid, jvalue arguments[]); --- 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" 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; } 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) ) { jfieldID binding = broker->env()->GetStaticFieldID(nat, "s_bound", "Z"); broker->env()->SetStaticBooleanField(nat, binding, JNI_TRUE); } } } Index: Makefile.win =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/commonjava/Makefile.win,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Makefile.win 30 Apr 2007 20:54:32 -0000 1.8 --- Makefile.win 18 May 2007 21:33:59 -0000 1.9 *************** *** 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 = -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 = 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)" Index: ResourceManager.cpp =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/commonjava/ResourceManager.cpp,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** ResourceManager.cpp 1 May 2007 19:40:16 -0000 1.23 --- ResourceManager.cpp 18 May 2007 21:33:59 -0000 1.24 *************** *** 33,37 **** char * const ResourceManager::KEY_EMBEDJAR = "embedjar"; ! ResourceManager::ResourceManager(std::string category, int propsId, int jarId) { m_resourceCategory = category; --- 33,37 ---- char * const ResourceManager::KEY_EMBEDJAR = "embedjar"; ! ResourceManager::ResourceManager(std::string category, int propsId, int jarId, int jniId) { m_resourceCategory = category; *************** *** 82,85 **** --- 82,89 ---- } + + m_jnismoothSize = this->getResourceSize(jniId); + m_jnismoothHandler = this->getResource(jniId); + // // Extract the java properties from the Property *************** *** 110,135 **** } ! std::string curdirmodifier = m_props.get(ResourceManager::KEY_CURRENTDIR); ! if (curdirmodifier.length()>0) ! { ! int pos = string::npos; ! if ( (pos=curdirmodifier.find("${EXECUTABLEPATH}")) != string::npos) ! { ! 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); ! } ! } ! else ! { ! m_currentDirectory = ""; ! } ! // printf("CURDIR SET TO: [%s]\n", m_currentDirectory.c_str()); } --- 114,139 ---- } ! std::string curdirmodifier = m_props.get(ResourceManager::KEY_CURRENTDIR); ! if (curdirmodifier.length()>0) ! { ! int pos = string::npos; ! if ( (pos=curdirmodifier.find("${EXECUTABLEPATH}")) != string::npos) ! { ! 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); ! } ! } ! else ! { ! m_currentDirectory = ""; ! } ! // printf("CURDIR SET TO: [%s]\n", m_currentDirectory.c_str()); } *************** *** 147,152 **** } ! void ResourceManager::saveTemp(std::string tempname) { HANDLE temp = CreateFile(tempname.c_str(), GENERIC_WRITE, --- 151,159 ---- } ! void ResourceManager::saveTemp(std::string tempname, HGLOBAL data, int size) { + if ((data == 0) || (size == 0)) + return; + HANDLE temp = CreateFile(tempname.c_str(), GENERIC_WRITE, *************** *** 160,164 **** { DWORD reallyWritten; ! WriteFile(temp, m_jarHandler, m_jarSize, &reallyWritten, NULL); // TODO: check the reallyWritten value for errors --- 167,171 ---- { DWORD reallyWritten; ! WriteFile(temp, data, size, &reallyWritten, NULL); // TODO: check the reallyWritten value for errors *************** *** 209,213 **** std::string tempfilename = FileUtils::createTempFileName(".jar"); DEBUG("Created temporary filename to hold the jar (" + tempfilename + ")"); ! saveTemp(tempfilename); return tempfilename; } --- 216,220 ---- std::string tempfilename = FileUtils::createTempFileName(".jar"); DEBUG("Created temporary filename to hold the jar (" + tempfilename + ")"); ! saveTemp(tempfilename, m_jarHandler, m_jarSize); return tempfilename; } *************** *** 329,334 **** if (resprop != NULL) { - int size = SizeofResource(NULL, resprop); - char buffer[size+1]; return LoadResource(NULL, resprop); } --- 336,339 ---- *************** *** 336,337 **** --- 341,356 ---- return 0; } + + + std::string ResourceManager::saveJnismoothInTempFile() + { + if (m_jnismoothHandler == 0) + return ""; + + std::string tempfilename = FileUtils::createTempFileName(".jar"); + DEBUG("Saving jnismoothjar in " + tempfilename); + + DEBUG("Created temporary filename to hold the jar (" + tempfilename + ")"); + saveTemp(tempfilename, m_jnismoothHandler, m_jnismoothSize); + return tempfilename; + } Index: SunJVMLauncher.cpp =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/commonjava/SunJVMLauncher.cpp,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** SunJVMLauncher.cpp 13 May 2007 19:56:35 -0000 1.29 --- SunJVMLauncher.cpp 18 May 2007 21:33:59 -0000 1.30 *************** *** 190,193 **** --- 190,198 ---- vm->addPathElement(embj); } + + std::string jnijar = resource.saveJnismoothInTempFile(); + if (jnijar != "") + vm->addPathElement(jnijar); + // // Define the classpath --- 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-18 21:34:21
|
Update of /cvsroot/jsmooth/jsmooth/skeletons/autodownload In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv5645/autodownload Modified Files: Makefile.win autodownload.skel customdownload.skel mainres.rc resource.h Log Message: implements the JNI JSmooth functions Index: mainres.rc =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/autodownload/mainres.rc,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** mainres.rc 1 Mar 2007 22:02:17 -0000 1.1 --- mainres.rc 18 May 2007 21:33:58 -0000 1.2 *************** *** 4,7 **** --- 4,8 ---- JARID JAVA "../samplejar/sample.jar" PROPID JAVA "../samplejar/sample.props" + JNISMOOTHID JAVA "../jnismooth/jnismooth.jar" A2 ICON MOVEABLE PURE LOADONCALL DISCARDABLE "JWrap.ico" Index: customdownload.skel =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/autodownload/customdownload.skel,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** customdownload.skel 17 May 2007 10:56:16 -0000 1.4 --- customdownload.skel 18 May 2007 21:33:58 -0000 1.5 *************** *** 30,43 **** </skeletonProperties> <skeletonProperties> ! <description>SKEL_GENERIC_PROPERTY_DEBUG_DESCRIPTION</description> ! <idName>Debug</idName> ! <label>SKEL_GENERIC_PROPERTY_DEBUG_LABEL</label> <type>boolean</type> <value>0</value> </skeletonProperties> <skeletonProperties> ! <description>SKEL_GENERIC_SINGLEINSTANCE_DESCRIPTION</description> ! <idName>SingleInstance</idName> ! <label>SKEL_GENERIC_SINGLEINSTANCE</label> <type>boolean</type> <value>0</value> --- 30,50 ---- </skeletonProperties> <skeletonProperties> ! <description>SKEL_GENERIC_SINGLEINSTANCE_DESCRIPTION</description> ! <idName>SingleInstance</idName> ! <label>SKEL_GENERIC_SINGLEINSTANCE</label> <type>boolean</type> <value>0</value> </skeletonProperties> <skeletonProperties> ! <description>SKEL_GENERIC_JNISMOOTH_DESCRIPTION</description> ! <idName>JniSmooth</idName> ! <label>SKEL_GENERIC_JNISMOOTH</label> ! <type>boolean</type> ! <value>0</value> ! </skeletonProperties> ! <skeletonProperties> ! <description>SKEL_GENERIC_PROPERTY_DEBUG_DESCRIPTION</description> ! <idName>Debug</idName> ! <label>SKEL_GENERIC_PROPERTY_DEBUG_LABEL</label> <type>boolean</type> <value>0</value> Index: resource.h =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/autodownload/resource.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** resource.h 1 Mar 2007 22:02:17 -0000 1.1 --- resource.h 18 May 2007 21:33:59 -0000 1.2 *************** *** 2,4 **** --- 2,5 ---- #define JARID 102 #define PROPID 103 + #define JNISMOOTHID 104 Index: autodownload.skel =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/autodownload/autodownload.skel,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** autodownload.skel 17 May 2007 10:56:15 -0000 1.6 --- autodownload.skel 18 May 2007 21:33:58 -0000 1.7 *************** *** 30,43 **** </skeletonProperties> <skeletonProperties> ! <description>SKEL_GENERIC_PROPERTY_DEBUG_DESCRIPTION</description> ! <idName>Debug</idName> ! <label>SKEL_GENERIC_PROPERTY_DEBUG_LABEL</label> <type>boolean</type> <value>0</value> </skeletonProperties> <skeletonProperties> ! <description>SKEL_GENERIC_SINGLEINSTANCE_DESCRIPTION</description> ! <idName>SingleInstance</idName> ! <label>SKEL_GENERIC_SINGLEINSTANCE</label> <type>boolean</type> <value>0</value> --- 30,50 ---- </skeletonProperties> <skeletonProperties> ! <description>SKEL_GENERIC_SINGLEINSTANCE_DESCRIPTION</description> ! <idName>SingleInstance</idName> ! <label>SKEL_GENERIC_SINGLEINSTANCE</label> <type>boolean</type> <value>0</value> </skeletonProperties> <skeletonProperties> ! <description>SKEL_GENERIC_JNISMOOTH_DESCRIPTION</description> ! <idName>JniSmooth</idName> ! <label>SKEL_GENERIC_JNISMOOTH</label> ! <type>boolean</type> ! <value>0</value> ! </skeletonProperties> ! <skeletonProperties> ! <description>SKEL_GENERIC_PROPERTY_DEBUG_DESCRIPTION</description> ! <idName>Debug</idName> ! <label>SKEL_GENERIC_PROPERTY_DEBUG_LABEL</label> <type>boolean</type> <value>0</value> Index: Makefile.win =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/autodownload/Makefile.win,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Makefile.win 17 May 2007 10:56:15 -0000 1.6 --- Makefile.win 18 May 2007 21:33:58 -0000 1.7 *************** *** 30,34 **** clean: clean-custom ! $(RM) $(OBJ) $(BIN) $(BIN): $(LINKOBJ) $(LINKLIBS) --- 30,34 ---- clean: clean-custom ! $(RM) $(OBJ) $(BIN) JWrap_private.res $(BIN): $(LINKOBJ) $(LINKLIBS) |
From: Rodrigo R. <re...@us...> - 2007-05-18 21:34:20
|
Update of /cvsroot/jsmooth/jsmooth/skeletons/consolewrapper In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv5645/consolewrapper Modified Files: Makefile.win Log Message: implements the JNI JSmooth functions Index: Makefile.win =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/consolewrapper/Makefile.win,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Makefile.win 30 Apr 2007 20:54:32 -0000 1.6 --- Makefile.win 18 May 2007 21:33:59 -0000 1.7 *************** *** 2,6 **** # Makefile created by Dev-C++ 4.9.8.0 ! RM = cmd /C DEL CPP = g++.exe CC = gcc.exe --- 2,6 ---- # Makefile created by Dev-C++ 4.9.8.0 ! RM = rm -f CPP = g++.exe CC = gcc.exe *************** *** 21,25 **** clean: clean-custom ! $(RM) $(OBJ) $(BIN) $(BIN): $(LINKOBJ) ../commonjava/CommonJava.a --- 21,25 ---- clean: clean-custom ! $(RM) $(OBJ) $(BIN) ConsoleWrapper_private.res $(BIN): $(LINKOBJ) ../commonjava/CommonJava.a |
From: Rodrigo R. <re...@us...> - 2007-05-18 21:34:20
|
Update of /cvsroot/jsmooth/jsmooth/skeletons/winservice In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv5645/winservice Modified Files: Makefile.win description.skel main.cpp mainres.rc resource.h Log Message: implements the JNI JSmooth functions Index: mainres.rc =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/winservice/mainres.rc,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** mainres.rc 9 Apr 2007 17:15:50 -0000 1.1 --- mainres.rc 18 May 2007 21:34:00 -0000 1.2 *************** *** 4,7 **** --- 4,8 ---- JARID JAVA "sample/sample.jar" PROPID JAVA "sample/sample.props" + JNISMOOTHID JAVA "../jnismooth/jnismooth.jar" A2 ICON MOVEABLE PURE LOADONCALL DISCARDABLE "JWrap.ico" Index: main.cpp =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/winservice/main.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** main.cpp 17 May 2007 11:25:03 -0000 1.5 --- main.cpp 18 May 2007 21:34:00 -0000 1.6 *************** *** 49,53 **** global_debug = false; winservice_ref = 0; ! ResourceManager resman("JAVA", PROPID, JARID); string newcurdir = resman.getCurrentDirectory(); --- 49,53 ---- global_debug = false; winservice_ref = 0; ! ResourceManager resman("JAVA", PROPID, JARID, JNISMOOTHID); string newcurdir = resman.getCurrentDirectory(); Index: Makefile.win =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/winservice/Makefile.win,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Makefile.win 30 Apr 2007 20:54:32 -0000 1.3 --- Makefile.win 18 May 2007 21:34:00 -0000 1.4 *************** *** 2,6 **** # Makefile created by Dev-C++ 4.9.8.0 ! RM = cmd /C DEL CPP = g++.exe CC = gcc.exe --- 2,7 ---- # Makefile created by Dev-C++ 4.9.8.0 ! RM = rm -f ! #cmd /C DEL CPP = g++.exe CC = gcc.exe *************** *** 21,25 **** clean: clean-custom ! $(RM) $(OBJ) $(BIN) $(BIN): $(LINKOBJ) ../commonjava/CommonJava.a --- 22,26 ---- clean: clean-custom ! $(RM) $(OBJ) $(BIN) winservice_private.res $(BIN): $(LINKOBJ) ../commonjava/CommonJava.a Index: resource.h =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/winservice/resource.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** resource.h 9 Apr 2007 17:15:50 -0000 1.1 --- resource.h 18 May 2007 21:34:00 -0000 1.2 *************** *** 2,4 **** --- 2,5 ---- #define JARID 102 #define PROPID 103 + #define JNISMOOTHID 104 Index: description.skel =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/winservice/description.skel,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** description.skel 12 Apr 2007 20:01:50 -0000 1.3 --- description.skel 18 May 2007 21:34:00 -0000 1.4 *************** *** 51,54 **** --- 51,61 ---- </skeletonProperties> <skeletonProperties> + <description>SKEL_GENERIC_JNISMOOTH_DESCRIPTION</description> + <idName>JniSmooth</idName> + <label>SKEL_GENERIC_JNISMOOTH</label> + <type>boolean</type> + <value>0</value> + </skeletonProperties> + <skeletonProperties> <description>SKEL_GENERIC_PROPERTY_DEBUG_DESCRIPTION</description> <idName>Debug</idName> |
From: Rodrigo R. <re...@us...> - 2007-05-18 21:34:20
|
Update of /cvsroot/jsmooth/jsmooth/skeletons/util-core In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv5645/util-core Modified Files: SingleInstanceManager.cpp Log Message: implements the JNI JSmooth functions Index: SingleInstanceManager.cpp =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/util-core/SingleInstanceManager.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SingleInstanceManager.cpp 17 May 2007 10:56:18 -0000 1.1 --- SingleInstanceManager.cpp 18 May 2007 21:34:00 -0000 1.2 *************** *** 150,160 **** { LONG style = GetWindowLong(hwnd, GWL_STYLE); ! if ((style & (WS_OVERLAPPEDWINDOW|WS_TILED|WS_VISIBLE)) != 0) { ! ShowWindow(hwnd, SW_HIDE); ! //ShowWindow(hwnd, SW_SHOW); ! ShowWindow(hwnd, SW_SHOWMINIMIZED); ! ShowWindow(hwnd, SW_RESTORE); ! return FALSE; } } --- 150,157 ---- { LONG style = GetWindowLong(hwnd, GWL_STYLE); ! if ((style & (WS_VISIBLE)) != 0) { ! SetForegroundWindow(hwnd); ! return false; } } |
From: Rodrigo R. <re...@us...> - 2007-05-18 21:34:20
|
Update of /cvsroot/jsmooth/jsmooth/skeletons/simplewrap In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv5645/simplewrap Modified Files: Makefile.win description.skel main.cpp mainres.rc resource.h Log Message: implements the JNI JSmooth functions Index: mainres.rc =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/simplewrap/mainres.rc,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** mainres.rc 1 Mar 2007 22:03:19 -0000 1.6 --- mainres.rc 18 May 2007 21:34:00 -0000 1.7 *************** *** 1,7 **** - #include "resource.h" JARID JAVA "../samplejar/sample.jar" PROPID JAVA "../samplejar/sample.props" A2 ICON MOVEABLE PURE LOADONCALL DISCARDABLE "JWrap.ico" --- 1,7 ---- #include "resource.h" JARID JAVA "../samplejar/sample.jar" PROPID JAVA "../samplejar/sample.props" + JNISMOOTHID JAVA "../jnismooth/jnismooth.jar" A2 ICON MOVEABLE PURE LOADONCALL DISCARDABLE "JWrap.ico" Index: main.cpp =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/simplewrap/main.cpp,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** main.cpp 17 May 2007 10:56:16 -0000 1.30 --- main.cpp 18 May 2007 21:34:00 -0000 1.31 *************** *** 60,64 **** SingleInstanceManager instanceman; ! globalResMan = new ResourceManager("JAVA", PROPID, JARID); // sets up the command line arguments --- 60,64 ---- SingleInstanceManager instanceman; ! globalResMan = new ResourceManager("JAVA", PROPID, JARID, JNISMOOTHID); // sets up the command line arguments *************** *** 73,76 **** --- 73,79 ---- bool dodebug = globalResMan->getBooleanProperty("skel_Debug"); + // TO REMOVE + dodebug = true; + if (dodebug) { *************** *** 112,116 **** else man.setUseConsole(false); ! man.setPreferDLL(globalResMan->getBooleanProperty("skel_SingleProcess")); int retvalue = 0; --- 115,127 ---- else man.setUseConsole(false); ! ! bool singleprocess = globalResMan->getBooleanProperty("skel_SingleProcess"); ! bool jnismooth = globalResMan->getBooleanProperty("skel_JniSmooth"); ! ! if (singleprocess || jnismooth) ! man.setPreferDLL(true); ! else ! man.setPreferDLL(false); ! int retvalue = 0; Index: Makefile.win =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/simplewrap/Makefile.win,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Makefile.win 1 Mar 2007 22:03:19 -0000 1.13 --- Makefile.win 18 May 2007 21:34:00 -0000 1.14 *************** *** 2,6 **** # Makefile created by Dev-C++ 4.9.8.0 ! RM = CMD /C DEL CPP = g++.exe CC = gcc.exe --- 2,6 ---- # Makefile created by Dev-C++ 4.9.8.0 ! RM = rm -f CPP = g++.exe CC = gcc.exe *************** *** 11,15 **** LIBS = -L"/lib" -L"../commonjava" -L"../util-core" -mwindows ../commonjava/CommonJava.a ../util-core/util-core.a INCS = -I"/include" -I"$(JDK)/include/win32" -I"$(JDK)/include" -I"../commonjava" -I"../util-core" ! CXXINCS = -I"/include/c++" -I"/include/c++/mingw32" -I"/include/c++/backward" -I"/include" -I"$(JDK)/include/win32" -I"$(JDK)/include" -I"../commonjava" -I../util-core BIN = JWrap.exe CXXFLAGS = $(CUSTOMFLAGS) $(CXXINCS) -DJDK="$(JDK)" --- 11,15 ---- LIBS = -L"/lib" -L"../commonjava" -L"../util-core" -mwindows ../commonjava/CommonJava.a ../util-core/util-core.a INCS = -I"/include" -I"$(JDK)/include/win32" -I"$(JDK)/include" -I"../commonjava" -I"../util-core" ! CXXINCS = -g -I"/include/c++" -I"/include/c++/mingw32" -I"/include/c++/backward" -I"/include" -I"$(JDK)/include/win32" -I"$(JDK)/include" -I"../commonjava" -I../util-core BIN = JWrap.exe CXXFLAGS = $(CUSTOMFLAGS) $(CXXINCS) -DJDK="$(JDK)" *************** *** 22,26 **** clean: clean-custom ! $(RM) $(OBJ) $(BIN) $(BIN): $(LINKOBJ) ../commonjava/CommonJava.a --- 22,26 ---- clean: clean-custom ! $(RM) $(OBJ) $(BIN) JWrap_private.res $(BIN): $(LINKOBJ) ../commonjava/CommonJava.a Index: resource.h =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/simplewrap/resource.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** resource.h 11 Aug 2003 00:26:39 -0000 1.2 --- resource.h 18 May 2007 21:34:00 -0000 1.3 *************** *** 2,4 **** --- 2,5 ---- #define JARID 102 #define PROPID 103 + #define JNISMOOTHID 104 Index: description.skel =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/simplewrap/description.skel,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** description.skel 17 May 2007 10:56:16 -0000 1.9 --- description.skel 18 May 2007 21:34:00 -0000 1.10 *************** *** 30,43 **** </skeletonProperties> <skeletonProperties> ! <description>SKEL_GENERIC_PROPERTY_DEBUG_DESCRIPTION</description> ! <idName>Debug</idName> ! <label>SKEL_GENERIC_PROPERTY_DEBUG_LABEL</label> <type>boolean</type> <value>0</value> </skeletonProperties> <skeletonProperties> ! <description>SKEL_GENERIC_SINGLEINSTANCE_DESCRIPTION</description> ! <idName>SingleInstance</idName> ! <label>SKEL_GENERIC_SINGLEINSTANCE</label> <type>boolean</type> <value>0</value> --- 30,50 ---- </skeletonProperties> <skeletonProperties> ! <description>SKEL_GENERIC_SINGLEINSTANCE_DESCRIPTION</description> ! <idName>SingleInstance</idName> ! <label>SKEL_GENERIC_SINGLEINSTANCE</label> <type>boolean</type> <value>0</value> </skeletonProperties> <skeletonProperties> ! <description>SKEL_GENERIC_JNISMOOTH_DESCRIPTION</description> ! <idName>JniSmooth</idName> ! <label>SKEL_GENERIC_JNISMOOTH</label> ! <type>boolean</type> ! <value>0</value> ! </skeletonProperties> ! <skeletonProperties> ! <description>SKEL_GENERIC_PROPERTY_DEBUG_DESCRIPTION</description> ! <idName>Debug</idName> ! <label>SKEL_GENERIC_PROPERTY_DEBUG_LABEL</label> <type>boolean</type> <value>0</value> |
From: Rodrigo R. <re...@us...> - 2007-05-18 21:34:17
|
Update of /cvsroot/jsmooth/jsmooth/skeletons/samplejar In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv5645/samplejar Modified Files: build.xml sample.props Log Message: implements the JNI JSmooth functions Index: sample.props =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/samplejar/sample.props,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** sample.props 12 Apr 2007 20:01:50 -0000 1.4 --- sample.props 18 May 2007 21:34:00 -0000 1.5 *************** *** 16,18 **** initialheap=48000000 embedjar=true ! skel_Debug=0 --- 16,19 ---- initialheap=48000000 embedjar=true ! skel_Debug=1 ! skel_SingleProcess=1 Index: build.xml =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/samplejar/build.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** build.xml 1 Mar 2007 21:59:24 -0000 1.1 --- build.xml 18 May 2007 21:34:00 -0000 1.2 *************** *** 6,9 **** --- 6,13 ---- <property name="classes" value="classes"/> + <path id="build.class.path"> + <pathelement path="../jnismooth/jnismooth.jar"/> + </path> + <target name="init"> <!-- Create the time stamp --> *************** *** 15,19 **** <target depends="init" name="compile"> <!-- Compile the java code from ${src} into ${classes} --> ! <javac debug="true" deprecation="yes" destdir="${classes}" srcdir="${src}"/> </target> --- 19,25 ---- <target depends="init" name="compile"> <!-- Compile the java code from ${src} into ${classes} --> ! <javac debug="true" deprecation="yes" destdir="${classes}" srcdir="${src}"> ! <classpath refid="build.class.path"/> ! </javac> </target> |
From: Rodrigo R. <re...@us...> - 2007-05-18 21:34:14
|
Update of /cvsroot/jsmooth/jsmooth/skeletons/samplejar/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv5645/samplejar/src Modified Files: SampleApplication.java Log Message: implements the JNI JSmooth functions Index: SampleApplication.java =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/samplejar/src/SampleApplication.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SampleApplication.java 1 Mar 2007 21:59:25 -0000 1.1 --- SampleApplication.java 18 May 2007 21:34:00 -0000 1.2 *************** *** 77,81 **** jLabel1.setIcon(iic); } ! jLabel1.setText("Sample Application for JSmooth"); jPanel1.add(jLabel1, java.awt.BorderLayout.CENTER); --- 77,84 ---- jLabel1.setIcon(iic); } ! ! String toto = jsmooth.Native.getExecutablePath(); ! ! jLabel1.setText("Sample Application for JSmooth " + toto); jPanel1.add(jLabel1, java.awt.BorderLayout.CENTER); |
From: Rodrigo R. <re...@us...> - 2007-05-17 11:25:15
|
Update of /cvsroot/jsmooth/jsmooth/skeletons/winservice In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv29750/skeletons/winservice Modified Files: main.cpp Log Message: fixes bug #1720562, winservice-wrapper ignores <currentDirectory> param Index: main.cpp =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/winservice/main.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** main.cpp 12 Apr 2007 20:01:50 -0000 1.4 --- main.cpp 17 May 2007 11:25:03 -0000 1.5 *************** *** 51,54 **** --- 51,58 ---- ResourceManager resman("JAVA", PROPID, JARID); + string newcurdir = resman.getCurrentDirectory(); + if (newcurdir.length()>0) + SetCurrentDirectory(newcurdir.c_str()); + std::string rootdir = FileUtils::getExecutablePath(); |
From: Rodrigo R. <re...@us...> - 2007-05-17 11:25:15
|
Update of /cvsroot/jsmooth/jsmooth/skeletons/winservice/sample/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv29750/skeletons/winservice/sample/src Modified Files: AlertServer.java Log Message: fixes bug #1720562, winservice-wrapper ignores <currentDirectory> param Index: AlertServer.java =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/winservice/sample/src/AlertServer.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** AlertServer.java 30 Apr 2007 20:54:32 -0000 1.4 --- AlertServer.java 17 May 2007 11:25:06 -0000 1.5 *************** *** 41,44 **** --- 41,48 ---- return; } + else if (line.startsWith("PATH")) + { + line = System.getProperty("user.dir"); + } fw.close(); JOptionPane.showMessageDialog(null, line, "alert", JOptionPane.ERROR_MESSAGE); *************** *** 60,64 **** { try { ! m_socket = new ServerSocket(2073); } catch (Exception ex) { --- 64,68 ---- { try { ! m_socket = new ServerSocket(2273); } catch (Exception ex) { |
From: Rodrigo R. <re...@us...> - 2007-05-17 10:57:13
|
Update of /cvsroot/jsmooth/jsmooth/skeletons/util-core In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv14160/skeletons/util-core Modified Files: Makefile.win testmain.cpp Added Files: SingleInstanceManager.cpp SingleInstanceManager.h Log Message: adds the single instance feature Index: testmain.cpp =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/util-core/testmain.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** testmain.cpp 4 May 2007 20:53:28 -0000 1.4 --- testmain.cpp 17 May 2007 10:56:19 -0000 1.5 *************** *** 27,30 **** --- 27,32 ---- #include "Process.h" + #include "SingleInstanceManager.h" + void _debugOutput(const std::string& text) { *************** *** 46,49 **** --- 48,60 ---- // printf("result: %s\n", buffer); + SingleInstanceManager singinst; + if (singinst.alreadyExists()) + { + printf("Already running...\n"); + exit(0); + } + else + Sleep(50000); + std::string exeline = "C:\\Program Files\\Java\\jdk1.5.0_11\\bin\\java.exe -version"; string tmpfilename = FileUtils::createTempFileName(".tmp"); Index: Makefile.win =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/util-core/Makefile.win,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Makefile.win 30 Apr 2007 20:54:32 -0000 1.4 --- Makefile.win 17 May 2007 10:56:18 -0000 1.5 *************** *** 8,12 **** MINGW = RES = ! OBJ = Process.o Log.o Thread.o FileUtils.o StringUtils.o DebugConsole.o $(RES) LIBS = -L"$(MINGW)/lib" -L"/lib" -lws2_32 INCS = -I"$(MINGW)/include" -I"$(JDK)/include" -I"$(JDK)/include/win32" --- 8,12 ---- MINGW = RES = ! OBJ = SingleInstanceManager.o Process.o Log.o Thread.o FileUtils.o StringUtils.o DebugConsole.o $(RES) LIBS = -L"$(MINGW)/lib" -L"/lib" -lws2_32 INCS = -I"$(MINGW)/include" -I"$(JDK)/include" -I"$(JDK)/include/win32" --- NEW FILE: SingleInstanceManager.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 "SingleInstanceManager.h" #include <windows.h> #include <winbase.h> void pipe_wait_callback(void* param) { SingleInstanceManager* sim = (SingleInstanceManager*)param; while (true) { std::string msg = sim->waitPipeMessage(); printf("Got MESSAGE: %s\n", msg.c_str()); sim->processMessage(msg); fflush(stdout); } } SingleInstanceManager::SingleInstanceManager() { std::string name = "{"+FileUtils::getExecutablePath() + "::" + FileUtils::getExecutableFileName() + "}"; name = StringUtils::replace(name, "\\", ":"); init(name); } SingleInstanceManager::SingleInstanceManager(const std::string& uniqueName) { init(uniqueName); } SingleInstanceManager::~SingleInstanceManager() { if (m_mutex != NULL) CloseHandle(m_mutex); } void SingleInstanceManager::init(const std::string& uniqname) { m_name = uniqname; m_mutex = CreateMutex(NULL, FALSE, uniqname.c_str()); //do early m_lasterror = GetLastError(); //save for use later... m_alreadyexists = (m_lasterror == ERROR_ALREADY_EXISTS)?true:false; } void SingleInstanceManager::startMasterInstanceServer() { if (!m_alreadyexists) { m_pipethread.start(pipe_wait_callback, this); } } void SingleInstanceManager::sendMessageInstanceShow() { char *message = "SHOWWINDOW PLZ"; DWORD msglen = strlen(message); char bufferout[256]; DWORD lenout = 255, readlen=0; CallNamedPipe(getPipeName().c_str(), message, msglen, bufferout, lenout, &readlen, 2); } bool SingleInstanceManager::alreadyExists() { return m_alreadyexists; } std::string SingleInstanceManager::waitPipeMessage() { std::string result = ""; std::string pipename = getPipeName(); m_pipe = CreateNamedPipe(pipename.c_str(), PIPE_ACCESS_DUPLEX, PIPE_TYPE_MESSAGE | PIPE_READMODE_MESSAGE, 6, 256, 256, NMPWAIT_USE_DEFAULT_WAIT, NULL); if (m_pipe == INVALID_HANDLE_VALUE) { m_pipe = NULL; return ""; } if (ConnectNamedPipe(m_pipe, NULL)) { printf("waitPipeMessage...\n"); fflush(stdout); printf("connected to named pipe...\n"); fflush(stdout); char buffer[256]; DWORD length; bool res = ReadFile(m_pipe, buffer, sizeof(buffer), &length, NULL); buffer[length] = 0; printf("read file %s\n", buffer); fflush(stdout); if (res && (length>0)) { bool res = WriteFile(m_pipe, buffer, strlen(buffer), &length, NULL); result = buffer; } DisconnectNamedPipe(m_pipe); } CloseHandle(m_pipe); return result; } BOOL CALLBACK displayWindowForProcess(HWND hwnd, LPARAM lParam ) { DWORD myprocessid = GetCurrentProcessId(); DWORD hid; GetWindowThreadProcessId(hwnd, &hid); printf("Checking %d, %d, %d\n", hwnd, hid, myprocessid); fflush(stdout); if (hid == myprocessid) { LONG style = GetWindowLong(hwnd, GWL_STYLE); if ((style & (WS_OVERLAPPEDWINDOW|WS_TILED|WS_VISIBLE)) != 0) { ShowWindow(hwnd, SW_HIDE); //ShowWindow(hwnd, SW_SHOW); ShowWindow(hwnd, SW_SHOWMINIMIZED); ShowWindow(hwnd, SW_RESTORE); return FALSE; } } return true; } void SingleInstanceManager::processMessage(const std::string& msg) { printf("PROCESSING MESSAGE\n"); fflush(stdout); EnumWindows(displayWindowForProcess, 0); } std::string SingleInstanceManager::getPipeName() { std::string pipename = "\\\\.\\pipe\\"; if (m_name.length() > (255-9)) pipename += m_name.substr( m_name.length() - (255-9) ); else pipename += m_name; return pipename; } --- NEW FILE: SingleInstanceManager.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 _SINGLEINSTANCEMANAGER_H_ #define _SINGLEINSTANCEMANAGER_H_ #include "windows.h" #include <string> #include "FileUtils.h" #include "Thread.h" class SingleInstanceManager { protected: std::string m_name; bool m_alreadyexists; HANDLE m_mutex; HANDLE m_pipe; DWORD m_lasterror; Thread m_pipethread; public: SingleInstanceManager(); SingleInstanceManager(const std::string& uniqueName); ~SingleInstanceManager(); bool alreadyExists(); std::string waitPipeMessage(); void processMessage(const std::string& msg); void startMasterInstanceServer(); void sendMessageInstanceShow(); private: void init(const std::string& uniqname); std::string getPipeName(); }; #endif |
From: Rodrigo R. <re...@us...> - 2007-05-17 10:57:13
|
Update of /cvsroot/jsmooth/jsmooth/skeletons/simplewrap In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv14160/skeletons/simplewrap Modified Files: description.skel main.cpp Log Message: adds the single instance feature Index: description.skel =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/simplewrap/description.skel,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** description.skel 27 Mar 2007 20:16:58 -0000 1.8 --- description.skel 17 May 2007 10:56:16 -0000 1.9 *************** *** 36,38 **** --- 36,45 ---- <value>0</value> </skeletonProperties> + <skeletonProperties> + <description>SKEL_GENERIC_SINGLEINSTANCE_DESCRIPTION</description> + <idName>SingleInstance</idName> + <label>SKEL_GENERIC_SINGLEINSTANCE</label> + <type>boolean</type> + <value>0</value> + </skeletonProperties> </jsmoothskeleton> Index: main.cpp =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/simplewrap/main.cpp,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** main.cpp 13 May 2007 19:58:57 -0000 1.29 --- main.cpp 17 May 2007 10:56:16 -0000 1.30 *************** *** 27,30 **** --- 27,31 ---- #include "JVMRegistryLookup.h" #include "JavaMachineManager.h" + #include "SingleInstanceManager.h" ResourceManager* globalResMan; *************** *** 57,60 **** --- 58,62 ---- { atexit(lastExit); + SingleInstanceManager instanceman; globalResMan = new ResourceManager("JAVA", PROPID, JARID); *************** *** 79,82 **** --- 81,99 ---- globalResMan->printDebug(); + + bool singleinstance = globalResMan->getBooleanProperty("skel_SingleInstance"); + if (singleinstance) + { + if (instanceman.alreadyExists()) + { + instanceman.sendMessageInstanceShow(); + exit(0); + } + else + { + instanceman.startMasterInstanceServer(); + } + } + DEBUG(string("Main class: ") + globalResMan->getMainName()); |
From: Rodrigo R. <re...@us...> - 2007-05-17 10:56:57
|
Update of /cvsroot/jsmooth/jsmooth/skeletons/autodownload In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv14160/skeletons/autodownload Modified Files: Makefile.win autodownload.skel customdownload.skel main.cpp Log Message: adds the single instance feature Index: main.cpp =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/autodownload/main.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** main.cpp 1 May 2007 19:40:16 -0000 1.8 --- main.cpp 17 May 2007 10:56:16 -0000 1.9 *************** *** 28,31 **** --- 28,32 ---- #include "JVMRegistryLookup.h" #include "JavaMachineManager.h" + #include "SingleInstanceManager.h" #include "httpdownload.h" *************** *** 66,69 **** --- 67,71 ---- { atexit(lastExit); + SingleInstanceManager instanceman; globalResMan = new ResourceManager("JAVA", PROPID, JARID); *************** *** 86,89 **** --- 88,105 ---- } + bool singleinstance = globalResMan->getBooleanProperty("skel_SingleInstance"); + if (singleinstance) + { + if (instanceman.alreadyExists()) + { + instanceman.sendMessageInstanceShow(); + exit(0); + } + else + { + instanceman.startMasterInstanceServer(); + } + } + DEBUG(string("Main class: ") + globalResMan->getMainName()); Index: customdownload.skel =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/autodownload/customdownload.skel,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** customdownload.skel 27 Mar 2007 20:16:57 -0000 1.3 --- customdownload.skel 17 May 2007 10:56:16 -0000 1.4 *************** *** 36,38 **** --- 36,45 ---- <value>0</value> </skeletonProperties> + <skeletonProperties> + <description>SKEL_GENERIC_SINGLEINSTANCE_DESCRIPTION</description> + <idName>SingleInstance</idName> + <label>SKEL_GENERIC_SINGLEINSTANCE</label> + <type>boolean</type> + <value>0</value> + </skeletonProperties> </jsmoothskeleton> Index: Makefile.win =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/autodownload/Makefile.win,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Makefile.win 13 May 2007 20:07:43 -0000 1.5 --- Makefile.win 17 May 2007 10:56:15 -0000 1.6 *************** *** 18,22 **** ##LINKLIBS = ../commonjava/CommonJava.a ../util-core/util-core.a mspack.a ../util-net/util-net.a LINKLIBS = ../commonjava/CommonJava.a ../util-net/util-net.a ../util-core/util-core.a ! LIBS = -L. -L"$(MINGW)/lib" -L"/lib" -lws2_32 -L"/lib" -L"../commonjava" -mwindows -L"../util-core" -L"../util-net" $(LINKLIBS) $(FLTK-LDFLAGS) -lsetupapi INCS = -I"$(MINGW)/include" -I"$(JDK)/include" -I"$(JDK)/include/win32" CXXINCS = -I"$(MINGW)/include/c++" -I"$(MINGW)/include/c++/mingw32" -I"$(MINGW)/include/c++/backward" -I"$(MINGW)/include" -I"$(JDK)/include" -I"$(JDK)/include/win32" -I"../commonjava" -I"../util-core" -I"../util-net" $(FLTK-CXXFLAGS) --- 18,22 ---- ##LINKLIBS = ../commonjava/CommonJava.a ../util-core/util-core.a mspack.a ../util-net/util-net.a LINKLIBS = ../commonjava/CommonJava.a ../util-net/util-net.a ../util-core/util-core.a ! LIBS = -L. -L"$(MINGW)/lib" -L"/lib" -lws2_32 -L"/lib" -L"../commonjava" -mwindows -L"../util-core" -L"../util-net" $(LINKLIBS) $(FLTK-LDFLAGS) -lsetupapi -lwininet INCS = -I"$(MINGW)/include" -I"$(JDK)/include" -I"$(JDK)/include/win32" CXXINCS = -I"$(MINGW)/include/c++" -I"$(MINGW)/include/c++/mingw32" -I"$(MINGW)/include/c++/backward" -I"$(MINGW)/include" -I"$(JDK)/include" -I"$(JDK)/include/win32" -I"../commonjava" -I"../util-core" -I"../util-net" $(FLTK-CXXFLAGS) Index: autodownload.skel =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/autodownload/autodownload.skel,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** autodownload.skel 1 May 2007 19:40:16 -0000 1.5 --- autodownload.skel 17 May 2007 10:56:15 -0000 1.6 *************** *** 36,38 **** --- 36,45 ---- <value>0</value> </skeletonProperties> + <skeletonProperties> + <description>SKEL_GENERIC_SINGLEINSTANCE_DESCRIPTION</description> + <idName>SingleInstance</idName> + <label>SKEL_GENERIC_SINGLEINSTANCE</label> + <type>boolean</type> + <value>0</value> + </skeletonProperties> </jsmoothskeleton> |
From: Rodrigo R. <re...@us...> - 2007-05-17 10:56:57
|
Update of /cvsroot/jsmooth/jsmooth In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv14160 Modified Files: Changelog build.number Log Message: adds the single instance feature Index: build.number =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/build.number,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** build.number 13 May 2007 20:07:43 -0000 1.36 --- build.number 17 May 2007 10:56:14 -0000 1.37 *************** *** 1,3 **** #Build Number for ANT. Do not edit! ! #Sun May 13 21:33:45 CEST 2007 ! build.number=224 --- 1,3 ---- #Build Number for ANT. Do not edit! ! #Thu May 17 11:54:22 CEST 2007 ! build.number=229 Index: Changelog =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/Changelog,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** Changelog 13 May 2007 20:07:43 -0000 1.38 --- Changelog 17 May 2007 10:56:14 -0000 1.39 *************** *** 1,2 **** --- 1,12 ---- + 0.9.9-7 + - Changed network code so that download now uses the IE proxy + configuration. + - Download of files by custom-download wrapper can now be done in + http, https, and ftp. + - Added a single instance option for the auto-download, + custom-download and windowed wrappers. When this option is + enabled, launching another instance of the application results in + bringing the window of the first one to front. + 0.9.9-6 - Fixed a DOS console appearing for a fraction of second when |