development GUI-server 0.996

Started by Lutz, July 16, 2007, 10:07:24 AM

Previous topic - Next topic

Lutz

• 'Edit/Goto Line' and 'Files/Recent Files' in newlisp-edit.lsp.



• minor changes/additions to the GUI-Server API



Changes: http://newlisp.org/downloads/development/CHANGES-GUI-0996.txt">http://newlisp.org/downloads/developmen ... I-0996.txt">http://newlisp.org/downloads/development/CHANGES-GUI-0996.txt



Files: http://newlisp.org/downloads/development/guiserver-0.996.tgz">http://newlisp.org/downloads/developmen ... -0.996.tgz">http://newlisp.org/downloads/development/guiserver-0.996.tgz



Docs: http://newlisp.org/downloads/development/guiserver-0.996/">http://newlisp.org/downloads/developmen ... ver-0.996/">http://newlisp.org/downloads/development/guiserver-0.996/



Lutz

didi

#1
newLISP-edit :

until now all works well !   the recent-file-function is a real shortcut  :-)



The new goto-line works ok , but how do you use it best - do you print the text in advance with line-numbers , or do you use it to jump 'blind'  across the text ?  ( or is this in advance to a  lin-col-display or a  optional  line-number-display .. )



gui-server :
(gs:draw-text sym-tag str-text int-x int-y[list-rgb [str-path-file [int-width int-height])

this is out of the new manual from the 2-D-functions-overview  , the str-path-file-option is not explained in detail .



And something what i've  overseen until now - set-scale and set-translation effect is not completely clear to me, but i'm no expert at all .  Can i  scale the visible canvas to eg .  100 x 100  ?

Can i translate the origin  in every direction eg  to  -100 -100  , so that the origin is in the middle of the canvas ?

jrh

#2
This version still doesn't work with Java 1.4.2 on the Mac.

Lutz

#3
Didi:



The correct syntax pattern for gs:draw-text should be:


(gs:draw-text sym-tag str-text int-x int-y [list-rgb [float-angle]])

scroll down where the full description is.


QuoteCan i scale the visible canvas to eg . 100 x 100 ? Can i translate the origin in every direction eg to -100 -100 , so that the origin is in the middle of the canvas ?


if you don't scale, everything works in points with 72 points per each inch on the screen, it doesn't have to do anything with visibility or how big you canvas is on the screen. if you scale 2 x 2 every thing will appear double as big. Look into the source of shapes-demo.lsp where I have scale, translate and rotation statements out-commented around line 70. Yes, translation moves the origin, rotation turns around the origin.



 

Jrh:



It seems newLISP GUI-Server will only work with 1.5 on the Mac. But the same compiles seem to work on Win32 with 1.42 installed?



I was trying to fix the situation with target/source options (thanks for the tip), but no success, trying various variations. I think this is not a problem as 1.5 seems to be the current standard on all systems (1.6 just came out but is not widely installed). I hope your system will allow you to install JRE v.1.5.



Lutz

jrh

#4
Unfortunately Java 1.5 is not compatible with versions of OSX earlier than 10.4.5.  After further research I find that there are two main approaches for compiling 1.4 compatible Java apps.



1) Use 1.5 (or 1.6!) javac compiler with the earlier -target and -source options.



or



2) Use the 1.4 javac compiler which you should still have in your /System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Commands

directory unless you explicitly deleted it.  I find that my Mac has three previous versions of Java going back to 1.2.  The javac, java etc... programs in /usr/bin are sym linked to the latest version (in my case that would be 1.4.2_12.



Apple has some documentaion about this here:



http://developer.apple.com/documentation/Java/Conceptual/Java14Development/index.html">//http://developer.apple.com/documentation/Java/Conceptual/Java14Development/index.html



The downside to approach 1 from what I can gather is that javac 1.5 will still compile certain 1.5 constructs/syntax that you may have in your application specific source code even when the -source and -target options for javac 1.5 are 1.4 libraries.  This could still lead to run time errors.  An example of this problem I have seen referred to is the different implementation of the enum keyword in 1.5 versus 1.4.  



However, the Java spec supposedly guarantees that apps compiled under previous versions should be upwardly runtime compatible with newer JVM's.  So if guiserver.jar is built with javac 1.4 (assuming that you don't use new 1.5 methods and classes) it should execute correctly when invoked by java 1.5.



At any rate, if guiserver.jar compiles and runs under Java 1.4.2 on Windows, it should compile and run under Java 1.4.2 on the Mac as long as it is pointed at the right framework should it not?

.

Lutz

#5
I may try method (2) and post a 1.42 guiserver.jar as soon as I have one. The problem is I am using some pragma like statements to avoid warning messages on 1.5, but these don't compile on 1.42. So in any case I will have to edit over 60 files to get this stuff out. So this may take a while ;-)



Lutz