Re: [Gimp-user] Scheme question

2004-10-20 Thread Michael Schumacher
Joao S. O. Bueno Calligaris wrote:
Are there any plans to compile Gimp Python for Win32?
I'd be happy to use it!
Oh gosh...
I forgot it doesn't run on Windows yet.
It must be because of fairly minor details...but I can not check for 
them simply because I have no windows. 

I will try and contact someone who could check for it.
In order to get Python plug-ins for GIMP on Win32, you need:
1. Python
You can use ActviePython, probably the most common Python distribution
for Win32: http://www.activestate.com/Products/ActivePython/
2. PyGTK
The python binding to GTK+. Available as installers from
http://www.pcpm.ucl.ac.be/~gustin/win32_ports/
3. PyGIMP itself
Built using the distutils tools, which are part of Python (and not the
current autotools build).
4. A fix for bug 98737
http://bugzilla.gnome.org/show_bug.cgi?id=98737
Basically, glib can't run scripts on win32 right now.
I did step 3 myself (the resulting setup.py is rather poor, though) and 
use a modification to gimp's plug-in handling code to get around step 4.

PyGTK can be built without problems if you have a build environment that 
allows ou to build GIMP, so it can probably serve as an example on how 
to create a proper PyGIMP distutils build.

HTH,
Michael
--
The GIMP  http://www.gimp.org  | IRC: irc://irc.gimp.org/gimp
Wiki  http://wiki.gimp.org | .de: http://gimpforum.de
Plug-ins  http://registry.gimp.org |
___
Gimp-user mailing list
[EMAIL PROTECTED]
http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-user


Re: [Gimp-user] Scheme question

2004-10-20 Thread Jonathan Bartlett
  I have been trying to write some scripts to automate tasks but find
  that I have some trouble using scheme.  Although I am experienced
  in other languages I find scheme quite difficult to master as I
  can't seem to find any language references.  There are lots of
  tutorials and samples showing how to create scripts but nothing
  that I could find that actually describes the language, functions
  available, etc.
 

The big problem w/ Gimp's scheme is that they use a version that is not
really respected by anyone and that's horribly out-of-date.  I think they
did that in the spirit of keeping things simple, but it's horribly
backfired.

Scheme is one of the most ingenious languages around.  I'll be describing
some of its more interesting features this coming year in several IBM
DeveloperWorks articles.  Unfortunately, many of these features aren't
available on GIMP's scheme.

For learning scheme as a language, some good books are:

Teach Yourself Scheme in Fixnum Days (available on the web somewhere)
How to Design Programs
Simply Scheme

a more advanced introduction, which every serious programmer should read
sometime in their life, is

Structure and Interpretation of Computer Programs

In addition, the scheme standard is only 50 pages, and is a pretty easy
read.  You can get it online at schemers.org or a hardcopy from my website
at http://www.cafepress.com/bartlettpublish.9174125

Jon

Learn to program using Linux assembly language
http://www.cafeshops.com/bartlettpublish.8640017
___
Gimp-user mailing list
[EMAIL PROTECTED]
http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-user


Re: [Gimp-user] Scheme question

2004-10-20 Thread Joao S. O. Bueno Calligaris
On Wednesday 20 October 2004 16:44, Jonathan Bartlett wrote:
   I have been trying to write some scripts to automate tasks but
   find that I have some trouble using scheme.  Although I am
   experienced in other languages I find scheme quite difficult to
   master as I can't seem to find any language references.  There
   are lots of tutorials and samples showing how to create scripts
   but nothing that I could find that actually describes the
   language, functions available, etc.

 The big problem w/ Gimp's scheme is that they use a version that is
 not really respected by anyone and that's horribly out-of-date.  I
 think they did that in the spirit of keeping things simple, but
 it's horribly backfired.

 Scheme is one of the most ingenious languages around.  I'll be
 describing some of its more interesting features this coming year
 in several IBM DeveloperWorks articles.  Unfortunately, many of
 these features aren't available on GIMP's scheme.

 For learning scheme as a language, some good books are:

 Teach Yourself Scheme in Fixnum Days (available on the web
 somewhere) How to Design Programs
 Simply Scheme

 a more advanced introduction, which every serious programmer should
 read sometime in their life, is

 Structure and Interpretation of Computer Programs

 In addition, the scheme standard is only 50 pages, and is a pretty
 easy read.  You can get it online at schemers.org or a hardcopy
 from my website at http://www.cafepress.com/bartlettpublish.9174125


The GIMP Scheme is in the proccess of beying updated by another 
interpreter  - the Tiny-fu extension by Kevin is doing that.

I do notknow if that is an up to date implementation, however. All I 
know is that it currently doesn't support multi-byte character 
encodings - i.e. UTF-8, just like GIMP's native script-fu.
 Jon
 
 Learn to program using Linux assembly language
 http://www.cafeshops.com/bartlettpublish.8640017
___
Gimp-user mailing list
[EMAIL PROTECTED]
http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-user


Re: [Gimp-user] Scheme question

2004-10-19 Thread Nonexistent Entity
On Mon, 18 Oct 2004 22:57:58 -0200, Joao S. O. Bueno Calligaris  
[EMAIL PROTECTED] wrote:

I may be pushing it too hard...may be going off topic. But I will
insist on this subject. I'd like to see more people using gimp
python.
Are there any plans to compile Gimp Python for Win32?
I'd be happy to use it!
___
Gimp-user mailing list
[EMAIL PROTECTED]
http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-user


Re: [Gimp-user] Scheme question

2004-10-19 Thread Joao S. O. Bueno Calligaris
On Tuesday 19 October 2004 08:26, Nonexistent Entity wrote:
 On Mon, 18 Oct 2004 22:57:58 -0200, Joao S. O. Bueno Calligaris

 [EMAIL PROTECTED] wrote:
  I may be pushing it too hard...may be going off topic. But I will
  insist on this subject. I'd like to see more people using gimp
  python.

 Are there any plans to compile Gimp Python for Win32?
 I'd be happy to use it!

Oh gosh...
I forgot it doesn't run on Windows yet.

It must be because of fairly minor details...but I can not check for 
them simply because I have no windows. 

I will try and contact someone who could check for it.


Regards,

JS
--
___
Gimp-user mailing list
[EMAIL PROTECTED]
http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-user


[Gimp-user] Scheme question

2004-10-18 Thread Steve Crane
I have been trying to write some scripts to automate tasks but find that
I have some trouble using scheme.  Although I am experienced in other
languages I find scheme quite difficult to master as I can't seem to
find any language references.  There are lots of tutorials and samples
showing how to create scripts but nothing that I could find that
actually describes the language, functions available, etc.

At the moment I am trying to work out how to do integer division.  I
want to draw guides mapping the rule of thirds and want to ensure that I
get an integer result when I divide the image height and width by 3.
How would I do this?

Thanks
--
Steve Crane
http://craniac.afraid.org
___
Gimp-user mailing list
[EMAIL PROTECTED]
http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-user


RE: [Gimp-user] Scheme question

2004-10-18 Thread G . DeSercey
 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf 
 Of Steve Crane
 Sent: 16 October 2004 00:01
 To: [EMAIL PROTECTED]
 Subject: [Gimp-user] Scheme question

 At the moment I am trying to work out how to do integer 
 division.  I want to draw guides mapping the rule of thirds 
 and want to ensure that I get an integer result when I divide 
 the image height and width by 3.
 How would I do this?
 
 Thanks
 --

There is no internal function to convert to integer, but the following will
do it:
(define (floor x) (- x (fmod x 1)))
___
Gimp-user mailing list
[EMAIL PROTECTED]
http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-user


Re: [Gimp-user] Scheme question

2004-10-18 Thread Jeff Trefftzs
On Fri, 2004-10-15 at 16:00, Steve Crane wrote:
 I have been trying to write some scripts to automate tasks but find that
 I have some trouble using scheme.  Although I am experienced in other
 languages I find scheme quite difficult to master as I can't seem to
 find any language references.  There are lots of tutorials and samples
 showing how to create scripts but nothing that I could find that
 actually describes the language, functions available, etc.

http://www.cs.indiana.edu/scheme-repository/imp/siod.html

This document describes (well, mostly) the implementation of scheme used
in the GIMP.  I have found that with this doc and occasional reference
to existing scripts I can write my own scripts with no problem.

HTH,

-- 
Jeff


___
Gimp-user mailing list
[EMAIL PROTECTED]
http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-user


Re: [Gimp-user] Scheme question

2004-10-18 Thread Joao S. O. Bueno Calligaris
On Monday 18 October 2004 13:45, [EMAIL PROTECTED] wrote:
  -Original Message-
  From: [EMAIL PROTECTED]
  [mailto:[EMAIL PROTECTED] On Behalf
  Of Steve Crane
  Sent: 16 October 2004 00:01
  To: [EMAIL PROTECTED]
  Subject: [Gimp-user] Scheme question
 
  At the moment I am trying to work out how to do integer
  division.  I want to draw guides mapping the rule of thirds
  and want to ensure that I get an integer result when I divide
  the image height and width by 3.
  How would I do this?
 
  Thanks
  --

 There is no internal function to convert to integer, but the
 following will do it:
 (define (floor x) (- x (fmod x 1)))

I may be pushing it too hard...may be going off topic. But I will 
insist on this subject. I'd like to see more people using gimp 
python.

Getting the integer part of a image width and height would be as 
complex as:
width_3 = image.width / 3
heigth_3 = image.height / 3

where image is an image object passed by ptyhon-fu to every python 
script that needs an image as a parameter. As both numbers on above 
opertaions are int, so is the result. Would one need the integer 
number of a division by 2.5:
width_25 = int (image.width / 2.5)

Regards,

JS
--
 ___
 Gimp-user mailing list
 [EMAIL PROTECTED]
 http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-user
___
Gimp-user mailing list
[EMAIL PROTECTED]
http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-user