Imported Upstream version 2.2.4

This commit is contained in:
Ari Pollak
2010-08-11 01:13:56 -04:00
parent 3154facabf
commit c5acc8ae10
5446 changed files with 2386086 additions and 390981 deletions

202
AUTHORS
View File

@ -1,5 +1,199 @@
Main authors
------------
This file is generated from authors.xml, do not edit it directly.
Spencer Kimball
Peter Mattis
Lauri Alanko
Shawn Amundson
Sven Anders
Henrik Brix Andersen
Karl-Johan Andersson
John Beale
Zach Beane
Tom Bech
Marc Bless
Edward Blevins
Reagan Blundell
Xavier Bouchoux
Roberto Boyd
Stanislav Brabec
Robert Brady
Hans Breuer
Simon Budig
João S. O. Bueno Calligaris
Carey Bunks
Seth Burgess
Brent Burton
Francisco Bustamante
Albert Cahalan
George J. Carrette
Sean Cier
Winston Chang
Kenneth Christiansen
Zbigniew Chyla
Branko Collin
Ed Connel
Piers Cornwell
Daniel Cotting
Jay Cox
Kevin Cozens
Brian Degenhardt
Gert Dewit
Andreas Dilger
Austin Donnelly
Scott Draves
Daniel Dunbar
Misha Dynin
Daniel Egger
Morton Eriksen
Larry Ewing
Nick Fetchak
Valek Filippov
Shlomi Fish
David Forsyth
Raphael Francois
Jochen Friedrich
Jordi Gay
Sami Gerdt
Jim Geuther
Graeme Gill
Pedro Gimeno
Scott Goehring
Heiko Goller
Marcelo de Gomensoro Malheiros
David Gowers
Cameron Gregory
Pavel Grinfeld
Dov Grobgeld
Michael Hammel
Henrik Hansen
Ville Hautamäki
James Henstridge
Eric Hernes
David Hodson
Christoph Hoegl
Wolfgang Hofer
Alan Horkan
Jan Hubička
Andreas Hyden
Ben Jackson
Krzysztof Jakubowski
Simon Janes
Tim Janik
Fellmann Joaquim
Róman Joost
Geert Jordaens
Andrew Kieschnick
Peter Kirchgessner
Philipp Klaus
David Koblas
Daniel Kobras
Øyvind Kolås
Robert L Krawitz
Tuomas Kuosmanen
Karin Kylander
Olof S Kylander
Karl La Rocca
Philip Lafleur
Chris Lahey
Nick Lamb
Marco Lamberto
Jens Lautenbacher
Laramie Leavitt
Elliot Lee
Marc Lehmann
Ray Lehtiniemi
Raph Levien
Wing Tung Leung
Adrian Likins
Tor Lillqvist
Ingo Lütkebohle
Josh MacDonald
Ed Mackey
Vidar Madsen
Ian Main
Kjartan Maraas
Kelly Martin
Torsten Martinsen
Gordon Matzigkeit
Gregory McLean
Daniele Medri
Federico Mena Quintero
Jim Meyer
James Mitchell
Hirotsuna Mizuno
David Monniaux
Adam D Moss
Balazs Nagy
Yukihiro Nakai
Sung-Hyun Nam
Shuji Narazaki
Felix Natter
Michael Natterer
David Neary
David Necas
Sven Neumann
Stephen Robert Norris
Tim Newsome
Erik Nygren
Miles O'Neal
David Odin
Robert Ögren
Thom van Os
Garry R. Osgood
Alan Paeth
Jay Painter
Sergey Panov
Ville Pätsi
Asbjorn Pettersen
Mike Phillips
Artur Polaczynski
Ari Pollak
Karine Proot
Raphaël Quinet
Tom Rathborne
Vincent Renardias
Jens Restemeier
Maurits Rijk
Daniel Risacher
James Robinson
Guillermo S. Romero
Tim Rowley
Pablo Saratxaga
Mike Schaeffer
John Schlag
Norbert Schmitz
Thorsten Schnier
Alexander Schulz
Michael Schumacher
Tracy Scott
Craig Setera
Aaron Sherman
Manish Singh
William Skaggs
Daniel Skarda
Carol Spears
Adam Spiers
Jakub Steiner
Nathan Summers
Mike Sweet
Yuri Syrota
Eiichi Takamori
Tristan Tarrant
Michael Taylor
Owen Taylor
Ian Tester
Andy Thomas
Kevin Turner
Brion Vibber
Helvetix Victorinox
Rebecca Walter
Martin Weber
James Wang
Kris Wehner
Nigel Wetten
Calvin Williamson
Matthew Wilson
Shirasaki Yasuhiro
Spencer Kimball (spencer@xcf.berkeley.edu)
Peter Mattis (petm@xcf.berkeley.edu)

View File

@ -2,7 +2,7 @@
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
59 Temple Place, Suite 330, Boston, MA 02111 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
@ -279,7 +279,7 @@ POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
Appendix: How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
@ -305,8 +305,7 @@ the "copyright" line and a pointer to where the full notice is found.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA
Also add information on how to contact you by electronic and paper mail.

4488
ChangeLog

File diff suppressed because it is too large Load Diff

3329
ChangeLog.pre-1-0 Normal file

File diff suppressed because it is too large Load Diff

28795
ChangeLog.pre-1-2 Normal file

File diff suppressed because it is too large Load Diff

61186
ChangeLog.pre-2-0 Normal file

File diff suppressed because it is too large Load Diff

159
HACKING Normal file
View File

@ -0,0 +1,159 @@
Requirements
------------
If you want to hack on the GIMP project, it will make your life easier
to have the following packages (or newer versions) installed:
* GNU autoconf 2.54
- ftp://ftp.gnu.org/gnu/autoconf/
* GNU automake 1.7 (1.9, 1.8 and 1.6 will also work)
- ftp://ftp.gnu.org/gnu/automake/
* GNU libtool 1.4 (1.5 if you are compiling on Win32)
- ftp://ftp.gnu.org/gnu/libtool/
Fine GNU mirrors are listed at http://www.gnu.org/prep/ftp.html
Beta software can be found at alpha.gnu.org.
* pkg-config 0.7.0 (or preferably a newer version)
- http://www.freedesktop.org/software/pkgconfig/
* intltoolize 0.31.1 (or preferably a newer version)
- ftp://ftp.gnome.org/pub/gnome/sources/intltool/
* gtkdocize
- http://ftp.gnome.org/pub/GNOME/sources/gtk-doc/
* xsltproc
- ftp://ftp.gnome.org/pub/GNOME/sources/libxslt/1.1/
These are only the additional requirements if you want to compile from
CVS. The file INSTALL lists the various libraries we depend on.
Compilation
-----------
If you are accessing gimp via CVS, then you will need to take several
steps to get it to compile. You can do all these steps at once
by running:
cvsroot/gimp$ ./autogen.sh
Basically this does the following for you:
cvsroot/gimp$ aclocal-1.7; libtoolize; automake-1.7 -a;
cvsroot/gimp$ autoconf; glib-gettextize; intltoolize
The above commands create the "configure" script. Now you can run the
configure script in cvsroot/gimp to create all the Makefiles.
Before running autogen.sh or configure, make sure you have libtool in
your path. Also make sure glib-2.0.m4 glib-gettext.m4, gtk-2.0.m4,
pkg.m4 and intltool.m4 are either installed in the same
$prefix/share/aclocal relative to your automake/aclocal installation
or call autogen.sh as follows:
$ ACLOCAL_FLAGS="-I $prefix/share/aclocal" ./autogen.sh
Note that autogen.sh runs configure for you. If you wish to pass
options like --prefix=/usr to configure you can give those options to
autogen.sh and they will be passed on to configure.
If AUTOGEN_CONFIGURE_ARGS is set, these options will also be passed to
the configure script. If for example you want to enable the build of
the GIMP API reference manuals, you can set AUTOGEN_CONFIGURE_ARGS to
"--enable-gtk-doc". Please note that you will then need a recent
version of gtk-doc as well as a working setup for handling DocBook/XML.
If you do not have a recent version of gtk-doc, you can pass the
option "--disable-gtk-doc" to autogen.sh. This will completely
disable the support for gtk-doc so you will not be able to generate
the API documentation.
CVS
---
GIMP is available from GNOME CVS. You can also grab glib, pango, atk,
gtk+, libart, gtkhtml2 as well as intltool and gtk-doc from the same
CVS server. You can use the following commands to get them from the
anonymous CVS server:
$ export CVSROOT=':pserver:anonymous@anoncvs.gimp.org:/cvs/gnome'
$ cvs login
(there is no password, just hit return)
$ cvs -z3 checkout [-r <branch>] <module>
The interesting modules and the suggested stable branches to use are:
* gimp
* glib (glib-2-4)
* atk (gnome-2-6)
* pango (pango-1-4)
* gtk+ (gtk-2-4)
* libart_lgpl
* gtkhtml2
* intltool
* gtk-doc
Patches
-------
Please submit patches to the gimp-developer@lists.xcf.berkeley.edu
mailing list. It's also a good idea to file a bug-report at
http://bugzilla.gnome.org/ and attach your patch to it. All kinds
of contributions are appreciated.
Autogenerated Files
-------------------
Please notice that some files in the source are generated from other
sources. All those files have a short notice about being autogenerated
somewhere at the top. Among them are the files ending in _pdb.[ch] in
the libgimp directory and the files ending in _cmds.c in the app/pdb
subdirectory. Those are generated from the respective .pdb files in
tools/pdbgen/pdb. The list of contributors is used in several files
which are for that reason generated from the file contributors in
tools/authorsgen.
Hackordnung
-----------
We encourage you to follow the GIMP coding style throughout the GIMP
project. For the core components (application and libs) this coding
style is enforced. The GIMP coding style is defined as follows:
* There's a single space between the function name and the opening
bracket.
* Function names are lowercase, words separated by underscores.
* Macros and enums are all uppercase, words seperated by
underscores.
* Types are all words capitalized, no separators between words.
* All functions in header files need to be prototyped.
* Indentation rules are GNU coding style, in particular:
- 2 characters indentation level
- Do not use tabs (of course your editor can use tabs, but it
should write them to file as 8 spaces each).
- Opening brackets are on a new line and indented one level.
- Function header have the return type on one line, the name
starting in the first column of the following line. All
parameters are prototyped and there's a new line for each.
Try to make use of GLib's object system as much as possible. Do not
create wrappers around functions of parent classes. If you end up
duplicating code, try to create a common parent class and implement
the common methods there.
Don't include headers in headers except where unavoidable (e.g. for
deriving objects). Opaque typedefs go to app/base/base-types.h,
app/core/core-types.h etc. See devel-docs/includes.txt for a
detailed description of the include policy.
Don't use the GTK wrappers around the GLib object and signal system.
One goal of GIMP development is to make the GIMP code more readable
and understandable. Please help us to achieve this goal by cleaning up
the present code and make sure that all new code follows the coding
guidelines.

258
INSTALL
View File

@ -1,93 +1,218 @@
There are three basic steps to building and installing the
GIMP on unix:
Installation instructions for GIMP 2.2
--------------------------------------
1. You need to have installed GTK version 1.0.1 or better from
ftp://ftp.gtk.org/pub/gtk/v1.0/ (GTK 1.1.x will NOT work)
2. You may want to install other third party libraries that
are needed for some of the available plugins: TIFF, PNG,
JPEG, MPEG, etc.
3. Configure the GIMP by running the `configure' script.
4. Build the GIMP by running `make'.
5. Install the GIMP by running `make install'.
6. Optionally install the separate gimp-data-extras package.
There are some basic steps to building and installing The GIMP.
GIMP 2.2 replaces GIMP 2.0. It is advised that you uninstall GIMP 2.0
before installing GIMP 2.2. If you want to keep GIMP 2.0 installed in
parallel to GIMP 2.2, you have to choose a separate prefix which is
not in your default library search path.
GIMP 2.2 is fully backward compatible to GIMP 2.0. Plug-ins and
scripts written for GIMP 2.0 will continue to work and don't need to
be changed nor recompiled to be used with GIMP 2.2.
The most important part is to make sure the requirements for a build
are fulfilled. We depend on a number of tools and libraries which are
listed below. For libraries this means you need to also have the
header files installed.
******************************************************************
* Unless you are experienced with building software from source, *
* you should not attempt to build all these libraries yourself! *
* We suggest that you check if your distributor has development *
* packages of them and use these instead. *
******************************************************************
1. You need to have installed a recent version of pkg-config available
from http://www.freedesktop.org/software/pkgconfig/.
2. You need to have installed GTK+ version 2.4.4 or better. Do not
try to use an older GTK+ version (1.2.x), it will not work.
GTK+ itself needs recent versions of GLib (>= 2.4.5),
Pango (>= 1.4.0) and ATK. Sources for these can be grabbed from
ftp://ftp.gtk.org/. GTK+-2.x and friends can be installed side
by side with GTK+-1.2.
3. We require PangoFT2, a Pango backend that uses FreeType2. Make
sure you have FreeType2 and fontconfig installed before you
compile Pango. FreeType2 can be downloaded from
http://www.freetype.org/. Fontconfig from
http://freedesktop.org/fontconfig/. GIMP 2.2 depends on
freetype2 being newer than version 2.1.7. Older versions are
known to have bugs that seriously affect stability of The GIMP.
4. We use libart2. Grab the module libart_lgpl out of GNOME CVS or
fetch the tarball from
ftp://ftp.gnome.org/pub/gnome/sources/libart_lgpl/
5. You may want to install other third party libraries or programs that
are needed for some of the available plugins. We recommend to check
that the following libraries are installed: libpng, libjpeg,
libtiff, gimp-print (4.2.x), gtkhtml-2, libmng, librsvg, libwmf.
6. Configure the GIMP by running the `configure' script. You may want
to pass some options to it, see below.
7. Build the GIMP by running `make'. The use of GNU make is recommened.
If you need to tweak the build to make it work with other flavours
of make, we'd appreciate if you'd send us a patch with the changes.
8. Install the GIMP by running `make install'. In order to avoid clashes
with other versions of The GIMP, we install a binary called gimp-2.2.
By default there's also a link created so that you can type 'gimp'
to start gimp-2.2. If you have the 2.0 version installed, you should
still be able to run it using 'gimp-2.0'.
Please make sure you don't have any old GTK+-2.x, jpeg, etc. libraries
lying around on your system, otherwise configure may fail to find the
new ones.
Please make sure you don't have any old GTK, jpeg, etc. libraries lying
around on your system, otherwise configure will fail to find the new
ones.
Generic instructions for configuring and compiling auto-configured
packages are included below. Here is an illustration of commands that
might be used to build and install the GIMP. The actual configuration,
compilation and installation output is not shown.
% tar xvfz gimp-1.0.0.tar.gz # unpack the sources
% cd gimp-1.0.0 # change to the toplevel directory
% tar xvfz gimp-2.2.x.tar.gz # unpack the sources
% cd gimp-2.2.x # change to the toplevel directory
% ./configure # run the `configure' script
% make # build the GIMP
% make install # install the GIMP
The `configure' script examines your system, and adapts the GIMP to
run on it. The script has many options, some of which are described in
the generic instructions included at the end of this file. All of the
options can be listed using the command `./configure --help'. There
are six commands special options the GIMP `configure' script
recognizes. These are:
are several special options the GIMP `configure' script recognizes.
These are:
1. --enable-shared and --disable-shared. This option affects whether
--enable-shared and --disable-shared. This option affects whether
shared libraries will be built or not. Shared libraries provide
for much smaller executables, but they are difficult to debug
with. If you are interested in doing development, it is probably
wise to specify `--disable-shared'. The default is to enable
shared libraries.
for much smaller executables. The default is to enable shared
libraries. Disabling shared libraries is almost never a good idea.
2. --enable-debug and --disable-debug. This option causes the build
--enable-debug and --disable-debug. This option causes the build
process to compile with debugging enabled. If debugging is
disabled, the GIMP will instead be compiled with optimizations turned
on. The default is for debugging to be disabled. NOTE: This
option is intended primarily as a convenience for developers.
3. --enable-ansi and --disable-ansi. This options causes stricter
--enable-ansi and --disable-ansi. This option causes stricter
ANSI C checking to be performed when compiling with GCC. The
default is for strict checking to be disabled. NOTE: This option
is intended primarily as a convenience for developers.
4. --enable-gimpdir=DIR. This option changes the default directory
the gimp uses to search for its configuration files from ~/.gimp (the
directory .gimp in the users home directory) to DIR.
--enable-gimpdir=DIR. This option changes the default directory
the gimp uses to search for its configuration files from ~/.gimp-2.2
(the directory .gimp-2.2 in the users home directory) to DIR.
--without-libtiff, --without-libjpeg, --without-libpng. configure
will bail out if libtiff, libjpeg or libpng can not be found. You
better fix the underlying problem and install these libraries with
their header files. If you absolutely want to compile GIMP without
support for TIFF, JPEG or PNG you need to explicitely disable
them using the options given above.
--without-exif. If libexif is available, the JPEG plug-in will use
it to keep EXIF data in your JPEG files intact. If this is
causing any trouble at compile-time, you can build --without-exif.
Get libexif from http://www.sourceforge.net/projects/libexif.
--without-mng, --without-aa. The MNG plug-in needs libmng and
configure checks for its presense. If for some reason you don't
want to build the MNG plug-in even though the library is installed,
use --without-mng to disable it expliticely. The same switch exists
for aalib, use --without-aa if you run into problems.
--with-gif-compression=[lzw|rle|none]. Allows to tune the compression
algorithm used by the GIF plug-in. If you are afraid of Unisys' LZW
patent (which should have expired in most countries by now), you
can go for simple run-length encoding or even configure the plug-in
to create uncompressed GIFs.
--enable-gtk-doc. This option controls whether the libgimp API
references will be created using gtk-doc. The HTML pages are
included in a standard tarball, so you will only need this if you
are building from CVS.
--with-html-dir=PATH. This option allows to specify where the
libgimp API reference should be installed. You might want to modify
the path so it points to the place where glib and gtk+ installled
their API references so that the libgimp reference can link to
them.
--disable-print. The print plug-in requires a recent version of
libgimpprint. If you don't have it already installed, download
it from http://gimp-print.sourceforge.net/. You need to pass
--without-gimp to gimp-print's configure script to build it without
having gimp-1.2 installed. If you want to compile GIMP without
support for printing, use the --disable-print option.
--enable-mp. This options control whether to build GIMP with or without
support for multiple processors. This option is off by default. If
you do have multiply processors and run GIMP with an OS supporting
them you will like to enable this features to use all of your
horsepower. Enabling it on singleprocessor systems won't harm but
cause a bit processing overhead.
--with-sendmail=[PATH]. This option is used to tell GIMP where to find
the sendmail command. Normally this options don't have to be used
because configure tries to find it in the usual places.
--with-desktop-dir=[PATH]. This option specifies where to install
links to the gimp desktop files. These files are used by desktop
environments that comply to the specs published at freedesktop.org.
The default value ${prefix}/share should be fine if your desktop
environment is installed in the same prefix as gimp. No links are
created if the desktop directories don't exist or you used
--without-desktop-dir.
--disable-default-binary. Use this option if you don't want to make
gimp-2.2 the default gimp installation. Otherwise a link called
gimp pointing to the gimp-2.2 executable will be installed.
--enable-gimp-console. In addition to the standard gimp binary,
build a console-only binary which does not link GTK+ at all.
The `make' command builds several things:
- The libraries `libgimp/libgimp.la', `libgimp/libgimpi.la' and
`libgimp/libgimpui.la'. The `.la' suffix is used by libtool, the
program used to ease the compilation of shared libraries on
different platforms.
- The plug-in programs in the `plug-ins' subdirectory.
- The main GIMP program in `app/gimp'.
- A bunch of public libraries in the directories starting with 'libgimp'.
- The plug-in programs in the 'plug-ins' directory.
- Some modules in the 'modules' subdirectory.
- The main GIMP program 'gimp-2.2' in `app'.
The `make install' commands installs the gimp header files associated
with the libgimp libraries, the plug-ins, some data files and the GIMP
executable. After running `make install' and assuming the build process
was successful you should be able to run `gimp'.
The `make install' commands installs the glib, gdk and gtk header
files and libraries, the gimp header files associated with libgimp and
the libgimp library, the plug-ins, and the GIMP executable. After
running `make install' and assuming the build process was successful
you should be able to run `gimp'.
When ./configure fails
======================
'configure' tries to compile and run a short GTK program. There are
'configure' uses pkg-config, a tool that replaces the old foo-config
scripts. The most recent version is available from
http://www.freedesktop.org/software/pkgconfig/
'configure' tries to compile and run a short GTK+ program. There are
several reasons why this might fail:
* The 'gtk-config' script installed with GTK could not be found.
(This script is used to get information about where GTK is
installed.)
* pkg-config could not find the file 'gtk+-2.0.pc' that gets installed
with GTK. (This file is used to get information about where GTK+ is
installed.)
Fix: Either make sure that this program is in your path, or set
the environment variable GTK_CONFIG to the full pathname to
this program before running configure.
Fix: Either make sure that this file is in the path where pkg-config
looks for it (try 'pkg-config --debug' or add the location of
gtk+-2.0.pc to the environment variable PKG_CONFIG_PATH before running
configure.
* The GTK libraries were not found at run time. The details
of how to fix this problem will depend on the system:
* Libraries you installed are not found when you attempt to start gimp.
The details of how to fix this problem will depend on the system:
Fix: On Linux and other systems using ELF libraries, add the
directory to /etc/ld.so.conf or to the environment variable
On Linux and other systems using ELF libraries, add the directory to
holding the library to /etc/ld.so.conf or to the environment variable
LD_LIBRARY_PATH, and run 'ldconfig'.
On other systems, it may be necessary to encode this path
@ -98,24 +223,23 @@ several reasons why this might fail:
or
LDFLAGS="-Wl,-rpath -Wl,/home/joe/lib" ./configure
* An old version of the GTK libraries was found instead of
* An old version of the GTK+ libraries was found instead of
your newly installed version. This commonly happens if a
binary package of GTK was previously installed on your system,
and you later compiled GTK from source.
binary package of GTK+ was previously installed on your system,
and you later compiled GTK+ from source.
Fix: remove the old libraries and include files.
Fix: Remove the old libraries and include files. If you are afraid
that removing the old libraries may break other packages supplied by
your distributor, you can try installing GLib, GTK+ and other
libraries in a different prefix after setting the environment
variable PKG_CONFIG_LIBDIR to point to lib/pkgconfig/ in that new
prefix so that it does not try to read the *.pc files from the
default directory (/usr/lib/pkgconfig). However, removing the old
packages is often the easier solution.
A detailed log of the ./configure output is written to the file
config.log. This may help diagnose problems.
If you are sure of what you're doing, you can bypass the sanity check and
just go by what gtk-config by using the --disable-gtktest option. Please
only use this in dire circumstances.
After fixing a problem, it is safest to delete the file 'config.cache'
before re-running ./configure.
When ./configure fails on plug-ins
==================================
@ -139,8 +263,9 @@ certain place, e.g. if you are working in a bash shell you would say:
export CPPFLAGS="-I<path_to_header_file> -I<path_to_another_one>"
before you run configure.
It's wise to remove the file 'config.cache' before re-running configure.
* If the check for gimpprint fails even though you have version 4.2.x
installed, please try the latest available 4.2 package (which is
gimp-print 4.2.7 at the time of this writing).
Generic Instructions for Building Auto-Configured Packages
@ -175,10 +300,7 @@ directory.
By default, `make install' will install the package's files in
/usr/local/bin, /usr/local/lib, /usr/local/man, etc. You can specify
an installation prefix other than /usr/local by giving `configure' the
option `--prefix=PATH'. Alternately, you can do so by changing the
`prefix' variable in the Makefile that `configure' creates (the
Makefile in the top-level directory, if the package contains
subdirectories).
option `--prefix=PATH'.
You can specify separate installation prefixes for machine-specific
files and machine-independent files. If you give `configure' the

27
LICENSE Normal file
View File

@ -0,0 +1,27 @@
* The GIMP application core, and other portions of the official GIMP
distribution not explicitly licensed otherwise, are licensed under
the GNU GENERAL PUBLIC LICENSE -- see the 'COPYING' file in this
directory for details.
[ The below explicit exemption, we hope, clears up the GIMP
developers' position concerning an ambiguity with the GNU General
Public License concerning what constitutes a 'mere aggregation'
versus a combined or derived work. The intention is to make it
clear that arbitrarily-licensed programs such as GIMP plug-ins do
not automatically assume the GNU General Public License (GPL)
themselves simply because of their invokation of (or by) procedures
implemented in GPL-licensed code, via libgimp or a similar interface
to methods provided by the pdb: ]
* If you create a program which invokes (or provides) methods within
(or for) the GPL GIMP application core through the medium of libgimp
or another implementation of the 'procedural database' (pdb) serial
protocol, then the GIMP developers' position is that this is a 'mere
aggregation' of the program invoking the method and the program
implementing the method as per section 2 of the GNU General Public
License.
* 'libgimp' and the other GIMP libraries are licensed under the
GNU LESSER GENERAL PUBLIC LICENSE -- see the 'COPYING' file in the
libgimp directory for details.

View File

@ -1,42 +1,98 @@
## Process this file with automake to produce Makefile.in
SUBDIRS = libgimp plug-ins app data @GIMPDOCS@
SUBDIRS = \
m4macros \
tools \
regexrepl \
cursors \
themes \
po \
po-libgimp \
po-plug-ins \
po-script-fu \
data \
menus \
tips \
libgimpbase \
libgimpcolor \
libgimpmath \
libgimpmodule \
libgimpthumb \
libgimpwidgets \
libgimp \
app \
$(GIMP_MODULES) \
$(GIMP_PLUGINS) \
etc \
devel-docs \
docs
bin_SCRIPTS = gimptool
bin_SCRIPTS = gimptool-@GIMP_TOOL_VERSION@ @GIMPINSTALL@
EXTRA_DIST = TODO gtkrc gimp_logo.ppm gimp_splash.ppm rmshm user_install gimp_tips.txt ps-menurc gimp.1 gimptool.1 gtkrc.forest2 gimp.m4 RPM/gimp.wmconfig RPM/wilbur.xpm RPM/mini-wilbur.xpm
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = \
gimp-@GIMP_PKGCONFIG_VERSION@.pc \
gimpthumb-@GIMP_PKGCONFIG_VERSION@.pc \
gimpui-@GIMP_PKGCONFIG_VERSION@.pc
gimpdata_DATA = gimprc gimprc_user gtkrc gimp_logo.ppm gimp_splash.ppm gimp_tips.txt ps-menurc gtkrc.forest2
gimpdata_SCRIPTS = user_install
AUTHORS: authors.xml
if HAVE_XSLTPROC
$(XSLTPROC) authors.xsl $< > $(@) || rm -f $(@)
endif
man_MANS=gimp.1 gimptool.1
m4datadir = $(datadir)/aclocal
m4data_DATA = gimp.m4
EXTRA_SCRIPTS = gimpinstall-@GIMP_TOOL_VERSION@
scriptdata =
EXTRA_DIST = \
AUTHORS \
COPYING \
ChangeLog \
ChangeLog.pre-1-0 \
ChangeLog.pre-1-2 \
ChangeLog.pre-2-0 \
HACKING \
INSTALL \
LICENSE \
NEWS \
NEWS.pre-2-0 \
NEWS.pre-2-2 \
README \
README.i18n \
README.win32 \
authors.dtd \
authors.xml \
authors.xsl \
config.h.win32 \
gimp-zip.in \
gimpdefs.msc \
gimptool-win32.c.in \
intltool-extract.in \
intltool-merge.in \
intltool-update.in \
makefile.msc \
po-libgimp/update.sh \
po-plug-ins/update.sh \
po-script-fu/update.sh
.PHONY: files populate checkin release
files:
@files=`ls $(DISTFILES) 2> /dev/null`; for p in $$files; do \
echo $$p; \
done
@for subdir in $(SUBDIRS); do \
files=`cd $$subdir; $(MAKE) files | grep -v "make\[[1-9]\]"`; \
for file in $$files; do \
echo $$subdir/$$file; \
done; \
done
DISTCHECK_CONFIGURE_FLAGS = --enable-gimp-console
populate:
@echo "populating project"
@files=`$(MAKE) files | grep -v "make\[[1-9]\]"`; prcs populate -d gimp.prj $$files
DISTCLEANFILES = \
intltool-extract \
intltool-merge \
intltool-update
checkin: populate
@echo "checking in project"
@prcs checkin
release:
$(MAKE) dist distdir=$(PACKAGE)`date +"%y%m%d"`
gimpinstall-@GIMP_TOOL_VERSION@:
$(LN_S) $(srcdir)/install-sh $(srcdir)/gimpinstall-@GIMP_TOOL_VERSION@
validate-authors:
if HAVE_XMLLINT
@$(XMLLINT) --noout --valid authors.xml || \
( echo "* authors.xml INVALID *"; exit 1; )
endif
dist-hook: validate-authors

File diff suppressed because it is too large Load Diff

112
NEWS
View File

@ -1,32 +1,96 @@
What's new in GIMP 1.0.4
The GNU Image Manipulation Program Version 2.2
----------------------------------------------
* Fixes in the menu code - hotkey accelerators for tools work again
* Fixes for 8 bit visual rendering
This is the stable branch of GIMP 2.2. Only bug-fixes are applied
here. New features are being added in the HEAD branch that will be
released as GIMP version 2.4.
What's new in GIMP 1.0.3
* GTK+ 1.2 support. Now the GIMP *requires* GTK+ 1.2
Bugs fixed in GIMP 2.2.4
========================
- fixed an out-of-bounds read access in the Edge plug-in (bug #164963)
- limit aspect ratio in crop tool to sane values (bug #164827)
- fixed indexed conversion on floating selections (bug #165342)
- fixed button order in resize and scale dialogs
- improved handling of UNC paths on Windows
- fixed crash in winicon save plug-in (bug #162742)
- fixed image types registration for some python plug-ins (bug #1666650)
- workaround problems with font names ending in numbers (bug #166540)
- show clone source when cloning from a different image (bug #167002)
- corrected coordinate limits in New Guide script (bug #167529)
- fixed crash in gradient editor (bug #167604)
- don't give keyboard focus to combo boxes in image window (bug #167809)
- fixed saving of MNG files with negative layer offsets (bug #166059)
- fixed use of the text tool on floating selections (bug #166829)
- don't create duplicate templates when migrating user settings (bug #167893)
- let the py-slice script ignore out-of-bounds guides (bug #167843)
- store thumbnails in temporary folder if no valid home directory exists
(bug #167973)
- fixed Emboss plug-in for small images (bug #168022)
- avoid crashes in toolbox size allocation code (bug #162500)
- switch from display-wide grab to application-wide grab while tool
actions are being performed (bug #162823)
What's new in GIMP 1.0.2
* Evil GIF infinite file bug introduced in 1.0.1 fixed
* GIMP_DATADIR environment var can override precompiled DATADIR spec
* Nicer write error handling
* A few small bugfixes
Bugs fixed in GIMP 2.2.3
========================
- fixed build problem in MIDI input controller (bug #163593)
- remember last used directory in file open and save dialogs (bug #162385)
- fixed crashed in DND of indexed drawables (bug #163879)
- removed bumpmap artifacts in Lighting Effects plug-in (bug #163877)
- fixed non-interactive mode of Retinex plug-in
- fixed undo of ink strokes (bug #163670)
- fixed expose event handling in Curve Bend plug-in (bug #164207)
- added a missing pressure sensitivity toggle to Airbrush tool (bug #164237)
- fixed loading of XJT images files from read-only folders (bug #164116)
- fixed bug in the Info dialog that crashed the Crop tool (bug #163617)
- fixed yet another entry problem in the Scale Image dialog (bug #163951)
- fixed serialization of binary parasites (bug #163131)
- correctly initialize the preview in the Bumpmap plug-in (bug #162285)
- give visual feedback if a dialog is already opened (bug #164156)
- fixed saving of JPEG images with large quality settings (bug #164087)
- update the menus when selecting a component in the Channels dialog
(bug #164195)
- fixed issues with the save dialog in the Imagemap plug-in (bug #164864)
- update filesize in JPEG dialog if size of EXIF data changes (bug #164914)
What's new in GIMP 1.0.1
* Redid the way batch mode works: it now uses script-fu instead of a thin
wrapper around the PDB. This may break some stuff that relies on batch
mode, but batch mode was broken in 1.0 anyway
* NeXTStep support
* Portability fixes (should compile on non-gcc compilers)
* gimptool supports a lot more options
* Added gimpfeatures.h header
* Plug-in bugfixes, updates
* New gimp.m4 for plug-ins to use to check for gimp using autoconf/automake
* Less spurious message dialogs
* PDB interface for setting the g_message handler
* App bugfixes
Bugs fixed in GIMP 2.2.2
========================
- let Decompose plug-in create layers with alpha channel
- fixed crash in save dialog (bug #162443)
- fixed misbehaviour in Scale and Resize dialogs (bug #162387)
- fixed preview in Imagemap plug-in (bug #162592)
- fixed handling of broken menu path translations (bug #162590)
- fixed bugs in the Sparkle plug-in and the Frosty Logo script (bug #132145)
- fixed two broken Python scripts (bug #162707)
- changed default response in Close dialog (bug #162872)
- flush the display when plug-in dialogs are disposed (bug #163084)
- fixed build problem on amd64 with gcc-4.0 (bug #163041)
- fixed problem in locales that are rendered right-to-left (bug #162663)
- fixed bug in Frosty Logo Script-Fu (bug #132145)
- raise the toolbox when it is selected from the Tools menu (bug #163381)
- improved usability of Keyboard Shortcuts editor (bug #163385)
- fixed gradient selection widget in libgimpui (bug #163427)
- workaround a problem in the MMX code (bug #162778)
GIMP 1.0 Released!
Bugs fixed in GIMP 2.2.1
========================
- added python logo to EXTRA_DIST so it shows up in the tarball (bug #161716)
- fixed mempory corruption in FracalExplorer plug-in (bug #161729)
- fixed crash in gradient editor (bug #161411)
- fixed crash in unsharp mask plug-in preview code (bug #157910)
- fixed bug in unsharp mask plug-in that caused artefacts when a large blur
radius was being used on a small drawable; minor optimizations
- removed broken asc2img Script-Fu
- fixed channel drag-n-drop (bug #161877)
- fixed misbehaviour of entries in Scale and Resize dialogs (bug #161756)
- speed up preview in several plug-ins
- fixed bug in Despeckle plug-in that caused it to run very slowly
(bug #162129)
- fixed a crash in the error dialog (bug #162147)
- fixed parameter value range in Weave script (bug #162182)
- fixed crash in brush preview (bug #162232)
- minor improvements to the API docs

807
NEWS.pre-2-0 Normal file
View File

@ -0,0 +1,807 @@
The GNU Image Manipulation Program Version 1.3
A Colorspace Odyssey
GIMP 1.3 used to be the development branch of The GIMP. Here's where
the development took place on the road to GIMP version 2.0. This file
lists the changes for each release in this development cycle.
Bugs fixed in GIMP 2.0.0
========================
- 137766: compress text undo steps (Sven)
- 137876: set a default height for dock windows (Sven, Simon)
- 137502: check for buggy intltool versions (Raphael)
- 137930: portability fix for Solaris (Sven)
- 137968: workaround GIOChannel misfeature on win32 (Tor)
- 137957: bugfix in floating selection code (Sven, Mitch)
- 136868: fixed alien glow arrow script (Simon)
Bugs fixed in GIMP 2.0rc1
=========================
- 136124: count animation frames starting with 1 (Simon)
- 122519: allow to share paint options between tools (Mitch)
- 136227: allow to toggle the histogram scale from the tool dialogs (Sven)
- 136303: fixed translation of preview widget (Sven)
- 136321: fixed bug in Plasma plug-in (Sven)
- 136371: fixed a crash caused by gimp_query_boolean_box (Sven)
- 119905: configurable undo preview size (Sven)
- 136524: fixed Shadow Bevel script (Yosh)
- 136535: enable i18n in SVG plug-in (Yuheng Xie, Sven)
- 136081: allow to use the webbrowser to access help (Brix, Sven)
- 128588: resurrected Save button in input devices dialog (Simon)
- 136489: added boolean return values to gimp_edit_[cut|copy] (Mitch)
- 136706: added missing i18n in IfsCompose plug-in (Sven)
- 136713: added missing i18n in ImageMap plug-in (Sven)
- 131965: cancel tools instead of resetting when image becomes dirty (Mitch)
- 12253: only cancel tool operation if tool is active on the image that
is becoming dirty (Mitch)
- 136343: fixed wrong function prototypes (Mitch)
- 136636: workaround a GDK problem on win32 (Mitch)
- 136747: fixed problem in gimp-print configure check (Yosh)
- 136850: fixed crash when toggling tool preview (Sven)
- 136937: allow translation of tool-option menus (Sven)
- 136645: fixed crash when dropping pattern on a text layer (Sven)
- 136907: fixed off-by-one error in gimp_pixel_fetcher_get_pixel() (Simon)
- 73610: improvements to Script-Fu error reporting (Kevin Cozen)
- 136702: made supersampling in transform tools optional (Raphael, Mitch)
- 118356: keep the font size fixed when changing the unit (Sven)
- 136623: don't set the text color on modified text layers (Sven)
- 135023: show mask state on unselected layers also (Simon)
- 137076: don't discard session info for dialogs hidden with Tab (Mitch)
- 124176: use a counter to track undo_[freeze|thaw] (Simon)
- 128833: don't make tool dialogs transient to the image window (Sven)
- 64835: on startup test if a swap file can be created (Simon, Raphael)
- 136909, 137242, 81479: update the menus when a plug-in finished (Simon)
- 137435: fixed sort order in plug-in menus for broken locales (Simon)
- 137529: don't crash on invalid brush hoses (Simon)
- 136996: search help pages in the users locale (Sven)
- 137151: make accelerators work in gtk+-2.4 if there's no menubar (Mitch)
- 136623, 136645: properly handle modifications to text layers (Sven)
- 130985, 120021: implemented text undo (Sven)
- 137612: improve tooltips for GimpScaleEntry (Sven)
- 137737: show all user interface elements in the Jigsaw plug-in (Sven)
- 137753: added a shortcut for the Path tool (Simon)
- 137754: added a menu entry and shortcut for "Path to Selection" (Simon)
- 137170: fixed crash with floating selections on quick-mask (Simon, Sven)
- 137786: duplicate the text when duplicating a text layer (Sven)
- 137566: fixed off-by-one errors on the canvas (Pedro)
Other contributions:
Jakub Steiner, Eric Pierce
Bugs fixed in GIMP 2.0pre4
==========================
- 128825: Improved misleading debug output and hide it in the stable branch
(Raphael)
- 133467: Fixed autoshrink selection (Mitch)
- 131634: Fixed text-circle script-fu (David Odin)
- 133532: Quit the imagemap plug-in when it is finished (Sven)
- 133456: Disallow editing of data objects which have no save functionality
(Mitch)
- 113142: Don't attempt to render the display out of bounds (Mitch)
- 133763: Fix use of EXEEXT in tiff checks (Yosh)
- 131044: Attempt to read layer names from TIFF files (Pablo d'Angelo)
- 133490: Fixed handling of missing pluginrc file (Sven)
- 121074: Suppress some harmless warnings in the stable branch (Sven)
- 132351: Fixed harmless iscissors tool warnings (Sven)
- 97999: Indicate progress when scaling a drawable (Sven)
- 133244: Fixed crash in Curve Bend plug-in (Wolfgang Hofer)
- 133818: Added a runtime check for fontconfig >= 2.2.0 (Mitch)
- 130636: Fixed undo handling in Add Bevel script (Simon)
- 133067: Connect the text tool font with the global font selector (Sven)
- 133958: Made color values in color picker selectable (Mariano Suárez-Alvarez)
- 125283: Have configure warn when gimp-print is older than 4.2.6 (Sven)
- 112012: Use default preview if none can be generated (Mitch)
- 124969: Improve text tool logic (Sven)
- 121033: Ensure that non-indexed images cannot have a colormap (Mitch)
- 132356: Curves tool trapped the mouse (Mitch)
- 123321: UTF-8 and zero-size layer bug (Adam Moss, Daniel Rogers, Piotr
Krysiuk)
- 134274: Behave correctly for edit and delete functions for data files (Mitch)
- 134285: Improve snap behaviour for grid and guides (Simon)
- 134274: Fix data file initialisation routine (Mitch)
- 134423: Fix GIF plug-in when used without display (Sven)
- 134419: Fix undo button behaviour in GFig plug-in (Sven)
- 134562: Ensure tile cache cannot write to freed memory (Mitch)
- 134512: Exclude undo stack from size of memory in an image when scaling
(Sven)
- 134694: Fix bug in Preferences (Mitch)
- 134410: Make drawing of straight lines better for fuzzy brushes (Simon)
- 125303: Remove per-channel gray point picker from levels dialog (Dave
Neary)
- 134752: Improve clipboard buffer detection between different images in
the same GIMP instance (Mitch)
- 122049: Validate numerical input in pygimp plug-ins, and fix the Sphere
plug-in (Dave Neary, Florian Traverse)
- 130568: Mostly fix Van Gogh (LIC) plug-in (Simon)
- 70673: Let Curves and Levels widgets scale with the dialog (Sven)
- 135059: Remember the preview setting for all ImageMap tools (Sven)
- 135630: Don't make the resolution calibration dialog modal (Sven, Pedro)
- 133266: Saner max. value for the blend tool's supersampling (Sven, Pedro)
- 135866: Fix displacement handling in bumpmap plug-in (Pedro, Joao)
- 135994: Fix offsets when scaling or resizing vectors (Simon)
- 133453: Experiments with global shortcuts (Mitch, Simon)
Other contributions:
Manish Singh, Michael Natterer, Sven Neumann, Henrik Brix Andersen,
Jakub Steiner, Simon Budig
Bugs fixed in GIMP 2.0pre3
==========================
- 127451: Anchor floating selection when creating a text layer (Mitch)
- 50649: Allow to call script-fu scripts from plug-ins (Mitch)
- 132617: Improved gimp-remote behaviour (Sven)
- 132036: Fixed issues with libart scan conversion (Simon)
- 132041: Made info window not grab the focus (Mitch)
- 132077: Redraw layer boundary when using transform tools (Mitch)
- 132089: Flip tool misbehaviours (Mitch)
- 132032: User interface issues with Plugin Details (David Odin)
- 132145: Use default values when stroking from the PDB (Mitch)
- 132162: Anchoring a floating selection on a channel (Mitch)
- 132271: Mosaic filter on selections (Simon)
- 132322: gimp-levels on grayscale images (Mitch)
- 132329: Info window doesn't show inital values (Shlomi Fish)
- 118084: Info window not updated in automatic mode (Shlomi Fish)
- 132495: Positioning of glyphs that extend the logical rectangle (Sven)
- 108659: Use g_spawn in postscript plug-in (Peter Kirchgessner)
- 132508: Problems with path tool in Edit mode (Simon)
- 132504: Fixed unsharp mask script (Mitch)
- 132595: Don't draw the selection if it's hidden (Sven)
- 132027: Crash in gimpressionist (Sven)
- 132596: Use default values for color DND (Mitch)
- 132493: Tuned Comic Logo script (Pedro Gimeno)
- 132649: Allow to fill the whole selection using bucket-fill (Mitch)
- 131902: Improved handling of missing tags in TIFF loader (Andrey Kiselev)
- 93806: Validate script-fu input (Yosh)
- 132214: Differentiate writable and readonly data directories (Mitch)
- 131964: Zoom ratio problem (Simon)
- 132969: Set help-id for tool on tool options dock (Mitch)
- 132999: Make assembler code PIC safe (Yosh)
- 119878: Use the same keyboard shortcuts in all GIMP windows
(except the toolbox window) (Mitch)
- 131975 &
- 132297: Disable some warnings while loading TIFFs (Raphael)
- 129529: Add a "randomize" toggle to random number widget (Dave Neary)
- 133099: Duplicate PDB entries problem (Mitch)
- 133122: Disallow renaming of layer masks and some floating selections (Mitch)
- 130118: Allow non-UTF8 characters in the GIMP home directory (Mitch)
- 122026: Workaround a bug in gdk_draw_segments() (David Odin)
- 133280: Remove deleted scripts from the menu (Mitch)
- 133270: Replace deprecated enum values in scripts (Kevin Cozens)
- 133180: Sort menu entries for save and load procedures (Mitch)
- 131563: Use percentages for zoom ratios (Simon, Sven)
Other contributions:
Manish Singh, Tor Lillqvist, Jakub Steiner, Michael Natterer,
Sven Neumann, Kevin Cozens
Bugs fixed in GIMP 2.0pre2
==========================
- 130828: Compile error with gcc 2.95 (Adrian Bunk)
- 35335: Curve tool doesn't conserve black (Simon)
- 130866: Remove multiple PNG entries in file type dropdown (Brix)
- 106991: Add mnemonics for all menu items (finished by Mitch)
- 130869: Add smaller image templates (Dave Neary)
- 130916: Handle multiline texts better (Mitch)
- 120424: Add dirty flag to default image title (Brix)
- 130912: Fix rounding errors in JPEG plug-in (keith@goatman.me.uk)
- 131016: Add support for layer offsets in multipage tiff loading (Pablo
d'Angelo)
- 124073: Modify behaviour of zoom tool to avoid funny fractions (Dave Neary,
Simon)
- 131088: fix select-to-pattern script-fu (Mitch)
- 82478: Fix zoom handling in fractal explorer (Pedro Gimeno)
- 115793: Make thumbnail preview of indexed images match display (Pedro Gimeno)
- 130471: Handle RGBA images correctly in the CEL plug-in (Dov Grobgeld)
- 131109: Remove EMX specific code (Sven)
- 130118: Handle GIMP2_DIRECTORY with non-UTF-8 characters correctly (Tor
Lillqvist, Sven)
- 82465: Make preview match image when image is greyscale (Sven)
- 92586: Force SF_IMAGE value to reflect the selected image (Sven)
- 116765: Fix selection artifacts while moving selections (Pedro Gimeno, Mitch)
- 131215: Only call bind_textdomain_codeset when available (Reinhard Geissler)
- 125141: Resolve API issues with GimpPixelFetcher and GimpRegionIterator
(David Odin, Maurits Rijk)
- 109078: Fix histogram for graylevel images (Pedro Gimeno, Mitch)
- 131146: Fix drag & drop of patterns to layer masks (Dave Neary, Mitch)
- 128112: Use a better error message if help files are not present (Mitch)
- 78732: Don't paste outside the visible screen, if possible (Mitch)
- 131561: Make "Condensed" fonts available for use (Manish Singh)
- 71922: Fix SuperNova preview for Alpha channel (David Odin)
- 82464: Fix SuperNova preview for greyscale images (David Odin)
- 121966: Fix SuperNova plug-in (David Odin)
- 110610: Allow user to choose file formats even if the current image type is
not supported by them (Pedro Gimeno)
- 131980: Fix crash in crop tool (David Odin, Sven)
- 131030: Allow saving data without pre-multiplying by alpha channel in tiff
plug-in (Pablo d'Angelo, Dave Neary)
- 125864: Guides behave correctly when spacing is set to 1px (Brix)
- 131721: Fix handling of alpha channels across undo steps (Mitch)
- 128025: Fix behaviour when there is a floating selection (Mitch)
- 131076: Make fuzzy select tool respect alpha channel in indexed mode (Mitch)
- 131779: Improve indexed scaling dialog (Mitch)
- 127673: Overlapping widgets in gradient editor (Mitch)
Other contributions:
David Odin, Manish Singh, Simon Budig, Michael Natterer, Sven Neumann,
Tor Lillqvist, Henrik Brix Andersen
Overview of Changes in GIMP 2.0pre1
===================================
- Persistent user preferences for PNG save [Yosh]
- Replaced old "About" dialog [Simon]
- Allow removal of text attributes from text layer [Sven]
- Add optimisation option to png (clear transparent pixels) [Joao]
- Add POSIX shared memory implementation, and use it on MacOS X [Yosh]
- Dashed selection and path stroking [Simon]
- Grey picker in Levels dialog conserves lightness [Bolsh]
- Created a library for handling thumbnails [Sven]
- Support for multipage TIFFs [Andrey Kiselev]
- Added a channel mixer plug-in [Martin Guldahl, Yosh]
- PDB cleanup and compatibility mode [Mitch]
- Cleaned up libgimp API [David Odin]
- Lots of bug fixes
Other contributors:
Adam Moss, Jakub Steiner, Helvetix Victorinox, Pedro Gimeno, Adrian
Bunk, Abel Cheung, Maurits Rijk, Ville Pätsi, Marco Munari, Shlomi
Fish, Jakub Steiner, Raphaël Quinet, David Gowers, Michael Schumacher
Overview of Changes in GIMP 1.3.23
==================================
- Color proof display filter using ICC profiles written by Banlu Kemiyatorn
- New gimprc options to work around window management problems [Sven, Brix]
- Fixes for using GIMP on Xinerama setups [Sven]
- Numerous libgimp* API cleanups [Mitch, Sven]
- Theme switching in the preferences dialog [Mitch]
- Added a small theme [Mitch]
- Cleanup and unification of message strings [Mitch]
- 64bit clean libgimp API [Yosh]
- New plug-in color selector using color-selector modules [Mitch]
- GimpCanvas drawing abstraction [Sven]
- Added DICOM file plug-in by Dov Grobgeld
- Imported new WMF plug-in from libwmf2 [Sven, Mitch]
- A session name can be given on the command-line [Sven]
- Allow to move image windows and docks between screens [Mitch, Sven]
- Fixed multi-head issues [Mitch]
- Allow to merge visible paths [Simon]
- Redone GimpDialog API [Mitch]
- Load GIMP brush format version 3 [Sven]
- Allow to use GIMP without any fonts [Sven]
- Improved animoptimize plug-in [Raphaël]
- Lots of bug fixes
Other contributors:
Ville Pätsi, Eric Pierce, Tor Lillqvist, Henrik Brix Andersen,
Manish Singh, Dom Lachowicz, Francis James Franklin, Dave Neary,
Maurits Rijk, Joao S. O. Bueno, Michael Schumacher, Daniel Rogers,
Hans Breuer, Jakub Steiner
Overview of Changes in GIMP 1.3.22
==================================
- Made GIMP compile and work with gtk+-2.3 [Yosh]
- Replaced histogram tool with a histogram dialog [Sven]
- Multi-head safety [Sven, Yosh]
- Changes for future compatibility of text layers [Sven]
- Histogram scale configurable for all tools and defaults to linear [Sven]
- Better default settings
- Completed configurability of normal and fullscreen view [Sven, Bolsh]
- GimpConfig cleanups and improvements [Mitch, Sven]
- Allow to configure the default grid in your gimprc [Brix]
- Improved session handling; store more settings like the position of
dock panes and the selected page in the dockbook [Mitch]
- Auto-scrolling for DND in list views [Mitch]
- Refresh rendering of paint strokes more often [Mitch]
- Refactored handling of modifier keys for tools [Mitch]
- Changed the redo shortcut to Ctrl-Y [Sven]
- Numerous plug-in cleanups [Maurits, Bolsh]
- Code documentation [Bolsh, Helvetix, Sven, Mitch]
- Lots of bug fixes
Other contributors:
Ville Pätsi, Simon Budig, Tor Lillqvist, Pedro Gimeno, Seth Burgess,
Jakub Steiner, David Odin, Ed Halley, Wolfgang Hofer, Vesa Halttunen
Overview of Changes in GIMP 1.3.21
==================================
- Allow to save tool options as named presets [Mitch].
- Stroke paths using libart [Simon, Bolsh, Mitch, Sven, Ville]
- Better looking and more accessible dockables [Mitch, Sven]
- Fixes for right-to-left rendering [Sven, Mitch]
- Rewritten webbroswer plug-in [Brix]
- Much improved path tool [Simon, Mitch]
- Export GIMP paths to SVG [Sven, Simon]
- Import SVG paths as GIMP paths [Sven, Simon]
- Added SVG file plug-in from librsvg and improved it [Sven]
- Store new vectors in XCF [Simon, Mitch]
- Allow to toggle visibility of paths in path list [Mitch]
- Move tool now also moves paths [Mitch]
- Some progress towards gimp-console, a gtk-less GIMP for batch mode [Mitch]
- Improved Decompose/Compose plug-ins [Alexey Dyachenko, Sven]
- More SIMD compositing code [Helvetix]
- Right mouse buttons now also cancels paint operations [Mitch]
- More internal code cleanup and documentation [Mitch, Sven]
- Documented libgimpmath [DindinX]
- Lots of bug fixes
Other contributors:
Adam D. Moss, Dom Lachowicz, Manish Singh, Jakub Steiner,
Christian Neumair, Seth Burgess, Maurits Rijk, David Necas,
Tor Lillqvist, Ville Pätsi, Morten Eriksen, Pedro Gimeno
Overview of Changes in GIMP 1.3.20
==================================
- Improved documentation of the app directory [Mitch, Sven]
- Image update optimizations [Mitch]
- font-map script improvements [Sven]
- PDB API to access fonts [Sven]
- Portability fixes for x86-64 [Yosh]
- Enabled SSE and SSE2 compositing code [Helvetix]
- GimpSelection class added [Mitch]
- Pullout parameter added to RGB->CMYK conversions [Sven]
- Basic framework for future help system in place [Mitch]
- Screenshot plug-in rewritten [Brix]
- Font list updates on the fly [Yosh]
- Generic interface for stroking selections and paths [Mitch]
- Further improvements to the path tool [Simon]
- Remove libgck from public API [Mitch]
- Lots of bug fixes
Other contributors:
Maurits Rijk, Ville Pätsi, Larry Ewing, Dmitry G. Mastrukov,
Pedro Gimeno, Raphaël Quinet, S. Mukund, Andy Wallis, Carl Adams,
Tino Schwarz, Tor Lillqvist, Emmet Caulfield, Guillermo S. Romero,
Dave Neary, Wolfgang Hofer
Overview of Changes in GIMP 1.3.19
==================================
- Migration towards new gimp-help system [Mitch]
- Deletion of anchor points on a path [Simon]
- Path stroke moving [Simon]
- Path stroke splitting by deleting an edge (Ctrl-click while in
Delete mode) [Simon]
- Drag path edges modifies curve [Simon]
- DInsertion of points on path edges [Simon]
- Joining two stroke paths is possible (Shift-Ctrl-Alt-Click on
the second end-point) [Simon]
- Polygonal paths [Simon]
- Improved new composite functions and enabled them by default [Helvetix]
- UTF-8 validate all strings coming in from the PDB [Yosh, Mitch]
- Paint-core improvements and bug-fixes [Jay Cox]
- Added more mnemonics [Brix]
- Lots of bug fixes
Other contributors:
Adam D. Moss, Tor Lillqvist, Jakub Steiner, Alan Horkan,
Avi Bercovich, S. Mukund, Maurits Rijk, Guillermo S. Romero,
Seth Burgess, Wolfgang Hofer, Ville Pätsi, Sven Neumann
Overview of Changes in GIMP 1.3.18
==================================
- Made a bunch of improvements to the path tool [Simon]
- Added lots of mnemonnics for plug-ins [Brix]
- Build fixes for Win32 [Hans, Tor]
- Improvements to the grid [Brix]
- Improved compiler checks for MMX code [Helvetix, Sven]
- Allow patent-free compression for GIF [Cameron]
- Add several edge detection algorithms to the edge tool [Bolsh]
- Fixed handle leak in plug-ins on Win32 [Tor]
- Changed default quality for jpegs [Raphaël]
- Add changing opacity via cursor keys [Simon]
- Fix text tool outlines [Mitch]
- Serialize/deserialize documentation [Sven]
- Colourcube analysis plug-in added [Yosh]
- Lots of code clean-up in displayshell [Mitch]
- Camp organisation [Sven, Mitch]
- Added a working gimp.spec for building RPMs [drc]
- Lots of bug fixes
Other contributors:
Maurits Rijk, Raphaël Quinet, Adam Moss
Overview of Changes in GIMP 1.3.17
==================================
- Made the text tool optionally create a path [Sven, Mitch]
- Added the ability to reverse gradients to the blend tool [Mitch]
- Added dithering to the blend tool [Alastair M. Robinson]
- Changed all(?) GIMP-1.4 references to GIMP-2.0 [Sven]
- Allow to transform paths using the transform tools [Mitch]
- Added a simple CMYK color selector [Sven]
- Added naive RGB <-> CMYK conversion routines [Sven]
- Generalized paint tools [Mitch]
- Finally a brush-shaped cursor for all paint tools [Mitch]
- Started to integrate new composite functions [Helvetix]
- Made the style for dockable tabs configurable [Mitch]
- Some preparations for text transformations [Sven]
- Store grid settings in XCF [Brix]
- Redone assembly checks and run-time checks for CPU features [Sven]
- Added lots of mnemonics to the menus [Jimmac]
- Support for comments in PNG files [Sven]
- Constified the libgimp API and adapted all plug-ins [Yosh, Sven]
- Cleaned up the brush/font/gradient/pattern selector API [Mitch]
- Support for patterns with alpha channel [Bolsh]
- Lots of bug fixes
Other contributors:
Eric Pierce, Joao S. O. Bueno, Tor Lillqvist, Damien Carbery,
Maurits Rijk
Overview of Changes in GIMP 1.3.16
==================================
- Vector tool improvements [Simon]
- Import GDynText layers [Sven]
- Save and load text layers to/from XCF files [Sven]
- Added the ability to show a grid over the canvas [Brix]
- Keep EXIF data in JPEG files using libexif [Bolsh]
- Changed a couple of gimprc defaults [Bolsh]
- Updated PS keybindings (ps-menurc) [Eric Pierce]
- Clarified the semantics of EXTENSION and PLUGIN [Mitch]
- Updates to the Win32 build system [Hans]
- Improved brush/pattern/font/gradient selectors in libgimp [Sven]
- Improved handling of transparency in GIF files [Adam]
- Cleaned up and improved the message dialogs and error console [Mitch]
- Added a sample sessionrc [Sven]
- Lots of bug fixes
Other contributors:
Yohei Honda, Elad Shahar, Dave Neary, Jakub Steiner
Overview of Changes in GIMP 1.3.15
==================================
- Removed color correction tools from toolbox again [Sven]
- Factored out color-picking code into a GimpColorTool class [Sven]
- Updates to the Win32 build system [Tor Lillqvist, Hans Breuer]
- Removed the need for special casing for some platforms [Yosh, Sven]
- Added item rotation (90, 180, 270 degrees) [Sven, Mitch]
- Load old paths as new vector objects [Mitch]
- Apply transformations to linked items [Mitch]
- Generalized item transformations [Mitch]
- Improved session managment [Mitch]
- Speed up fonts query [Yosh]
- Backed out pluggable tools [Sven]
- Lots of bug fixes
Other contributors:
Branko Collin, Pedro Gimeno, Dave Neary, Raphaël Quinet, Maurits Rijk,
Adam D. Moss, Jakub Steiner
Overview of Changes in GIMP 1.3.14
==================================
- Better resampling for the transform tools [OEyvind Kolaas]
- Added MNG save plug-in [S. Mukund]
- Added framework for image templates [Mitch]
- Vector tool improvements [Simon]
- Improved look and feel if layer previews are disabled [Mitch, Sven, Jimmac]
- Keyboard navigation for grid views [Sven]
- List and grid views for fonts [Mitch, Sven]
- Some text tool improvements [Sven]
- Moved gimp-gap into it's own CVS module [Yosh, Sven]
- More icons in even more sizes [Jimmac, Mitch, Sven]
- I18n header cleanup [Sven]
- Lots of bug fixes
Other contributors:
Pedro Gimeno, Owen, Raphaël Quinet
Overview of Changes in GIMP 1.3.13
==================================
- New tree-view based popup to select brushes, gradients and such [Mitch]
- Added color pickers to levels tool for easier color correction [Sven]
- Allow to create channels from an image's color component [Sven, Mitch]
- Added a full-screen mode for the image window [Sven, Mitch]
- Added a simple config file writer to GimpConfig [Sven]
- Moved gimp-perl into it's own CVS module [Yosh]
- Migrated all core dialogs from GtkList to GtkTreeView [Mitch]
- Refactored the GimpDisplayShell update/draw code [Mitch, Sven]
- Rewrote the Undo History as a GimpDockable [Mitch]
- Lots of bug fixes
Other contributors:
Sunil Mohan Adapa, Tor Lillqvist, Jay Cox, Dave Neary, Michael J. Hammel,
Toralf Lund, Raphaël Quinet, Hans Breuer, Tuomas Kuosmanen, David Necas,
Jakub Steiner, Simon Budig
Overview of Changes in GIMP 1.3.12
==================================
- Improved and cleaned up undo system [Mitch]
- Added hooks for plug-in debugging [Yosh]
- Redesigned the tool options code [Mitch]
- Converted the API reference to DocBook XML [Sven]
- Lots of text tool changes [Sven]
- Factored common code out of a number of plug-ins [Maurits]
- Cleaned up and improved the code that handles the plug-ins [Mitch]
- Finished colorblindness display filter using the algorithm contributed
by Alex Wade and Robert Dougherty.
- Updated the gimprc man-page, or actually, wrote a tool that does it [Sven]
- Improved the code that handles all the menus [Mitch]
- Added new PSD save plug-in [Bolsh]
- Added back SphereDesigner plug-in [Sven]
- More plug-ins cleaned up [Maurits, Sven]
- Reorganized startup code [Yosh]
- Portability fixes for 64bit platforms [Yosh, Sven]
- Handle large swap files (>2GB) [Sven]
- Updates to the Win32 build system [Tor Lillqvist, Hans Breuer]
- More work on the vectors tool [Simon, Mitch]
- Lots of bug fixes
Other contributors:
Garry R. Osgood, Jakub Steiner, Simon Budig, Henrik Brix Andersen,
Akkana, Carol Spears, Seth Burgess, Nathan Summers, David Necas,
Cameron Gregory, Larry Ewing
Overview of Changes in GIMP 1.3.11
==================================
- Allow to stroke bezier curves with the vectors tool [Simon]
- Added a first draft of a display filter that simulates
color-deficient vision [Mitch, Sven]
- Added an optional menubar per display [Mitch]
- Added PDB functions needed by GAP [Wolfgang Hofer, Sven]
- Updated the Win32 build system [Tor Lillqvist, Hans Breuer]
- Factored common code out of a number of plug-ins [Maurits]
- Use g_rand* functions whereever random numbers are needed [Bolsh]
- GimpPressionist plug-in cleaned up [Maurits]
- Finally landed the new gimprc code based on GimpConfig [Sven, Mitch]
- Added widgets for views on object properties [Mitch]
- Reimplemented the preferences dialog using GimpConfig [Mitch]
- Transform tool cleanup [Mitch]
- Modify the environment of plug-ins according to files installed with the
plug-ins. Allows to install Python modules into the GIMP tree. [Yosh]
- Start plug-ins using g_spawn_async() [Yosh]
- Lots of bug fixes.
Other contributors:
Jim Meyer, Jakub Steiner, Guillermo S. Romero, Henrik Brix Andersen,
Nathan Summers, Jeroen Lamain
Overview of Changes in GIMP 1.3.10
==================================
- Text tool can load text files now [Sven]
- Some unfinished work on the imagemap tools and related widgets [Sven]
- Undeprecated ink tool [Bolsh, Sven]
- Slightly tweaked the look and feel of the toolbox [Mitch, Sven]
- Ported module loading to GTypeModule [Mitch]
- Resurrected the water color selector [Mitch]
- Reworked module browser [Mitch]
- Moved generic datafile loading to LibGimpBase [Mitch]
- Added GimpColorScale widget [Mitch, Sven]
- Added GimpPickButton widget [Mitch]
- Added a color selector dock [Mitch]
- Added new layer modes (Softlight, Grain Extract, Grain Merge) [UnNamed]
- Included Gimp-Python with the tarball (try --enable-python)
- Lots of bug fixes
Other contributors:
Maurits Rijk, Michael Niedermayer, Garry R. Osgood, David Necas,
Toby Smith, Raphaël Quinet, Dave Neary, Jim Meyer
Overview of Changes in GIMP 1.3.9
=================================
- Some minor improvements to the text tool [Sven]
- Started to cleanup DND code [Mitch]
- Added GimpViewableDialog [Mitch]
- Improved UI of color adjustment tools [Mitch]
- Added new icons [Jimmac, Mitch]
- Added GimpSelectionEditor, a view on the current selection [Mitch]
- Improved imagemap plug-in [Maurits]
- GUI cleanups [Mitch, Sven, Maurits]
- Build fixes [Hans, Yosh, Sven]
- Lots of bug fixes
Other contributors:
James Henstridge, Dave Neary, Simon Budig
Overview of Changes in GIMP 1.3.8
=================================
- Lots of plug-ins cleaned up and improved [Maurits]
- More work on the help browser [Sven]
- Core code cleanup [Mitch, Sven]
- Improved icons [Jimmac]
- Fixed permissions of shared memory segments
- Build fixes [Yosh, Sven]
- Bug fixes
Other contributors:
Dave Neary, Zbigniew Chyla, Simon Budig
Overview of Changes in GIMP 1.3.7
=================================
- Build fixes
- Bug fixes
Overview of Changes in GIMP 1.3.6
=================================
- Support tile cache > 4GB on machines with 64bit long integers [Sven]
- Added support for large files (> 2GB) [Sven]
- Cleaned up configure, updated to autoconf-2.52 [Sven]
- Temporary switch to the Move tool when Space is pressed [Mitch]
- More cleanup of display code [Mitch]
- Added mnemonics to lots of plug-ins and fixed some bugs [Maurits Rijk]
- Added new PDB function gimp_image_get_name and corrected behaviour of
gimp_image_get_filename [Yosh, Sven]
- Navigation dialog redone as a dockable [Mitch]
- Updated print plug-in to new version and depend on libgimpprint [Sven]
- Generalized and improved the new config framework; use it for parasites,
documents and devices [Mitch, Sven]
- Started to port the help browser to GtkHtml2 [Sven]
- Finished implementation of the Thumbnail Managing Standard [Mitch, Sven]
- Improved Open dialog using the new thumbnails [Mitch, Sven]
- Use UTF-8 encoded URIs where we used to use filenames [Mitch]
- Plug-in fixes [Iccii]
- Added shortcuts to crop layer or image to selection boundary [Mitch]
- Changes for build on Win32 [Tor Lillqvist, Hans Breuer]
- Started framework for tools loaded as modules or plug-ins [Nathan]
- Lots of bugfixes
- More stuff not mentioned here (see the ChangeLog)
Other contributors:
Zbigniew Chyla, OEyvind Kolaas, Nick Lamb, David Monniaux, Raphaël Quinet,
Jakub Steiner, Simon Budig
Overview of Changes in GIMP 1.3.5
=================================
- Improved tool options and made them dockable [Mitch]
- Cleanup of brush, gradient, pattern and palette PDB functions [Mitch]
- Autogenerate libgimp/gimp_pdb.h [Yosh]
- Converted the toolbox to a dock [Mitch]
- Resurrected display filter modules [Mitch]
- Plug-in code cleanup (colorify) [Maurits Rijk]
- New menu icons [Jimmac, Mitch]
- New widgets to choose from enum values [Sven]
- Enum cleanups [Yosh, Sven]
- Resizeable docks [Mitch]
- Parse unitrc and document history using GScanner [Mitch]
- Fixes for build on Win32 [Hans]
- Treeviewified user installation dialog [Yosh]
- Bugfixes
- More stuff not mentioned here (see the ChangeLog)
Other Contributors:
Rebecca Walter, Tuomas Kuosmanen, Marcel Telka
Overview of Changes in GIMP 1.3.4
=================================
- Improved image status bar and image title [Mitch]
- Updated thumbnail code according to changes in proposed standard [Sven]
- Implemented init_proc in plug-ins [Nathan]
- Allow to choose interpolation for individual transformations [Mitch]
- More framework for tool plug-ins, landed a first tool [Nathan]
- Started core/UI separation for the paint tools [Mitch]
- Win32 fixes [Hans Breuer]
- Plug-in code cleanups (aa, colortoalpha, glasstile, guillotine, vinvert,
pagecurl) [Maurits Rijk, Sven]
- I18n changes, we now use glib-gettextize and intltoolize [Sven]
- New layer mask initialization modes [Mitch]
- Colorpicker, Transform tool and PDB fixes [Mitch]
- Factored out paint code from the paint tools [Mitch]
- New vectors infrastructure [Simon]
- First draft of a new vectors tool [Simon, Mitch]
- Scanline conversion (Path to selection etc.) changed to use libart [Simon]
- Undo cleanups [Mitch]
- Changed tips file format to XML [Sven]
- Added desktop file for GNOME-2 [Sven]
- Added GimpItem class to generalize core code even further [Mitch]
- Improved preferences dialog [Mitch, Sven, Jimmac]
- New tool icons [Jimmac]
- Editor widgets for brushes, gradients and palettes [Mitch]
- Revival of the API reference [Sven]
- Bugfixes
- More stuff not mentioned here (see the ChangeLog)
Other Contributors:
Manish Singh, Rebecca Walter, Guillermo S. Romero
Overview of Changes in GIMP 1.3.3
=================================
- Most of the code is free of deprecated GTK+ calls now [Mitch, Yosh, Sven]
- More use of stock icons [Sven, Mitch]
- New RGB->Indexed quantizer [Adam]
- Framework for pluggable tools [Nathan]
- More tool system cleanups [Mitch]
- Improved image status bar [Mitch]
- GimpObjects now know their memory footprint [Mitch]
- GimpUnit cleanup [Sven]
- Message proofreading [Bex]
- configure.in should work with autoconf-2.5 [Raja R Harinath]
- Bugfixes
- More stuff not mentioned here (see the ChangeLog)
Other Contributors:
Simon Budig
Overview of Changes in GIMP 1.3.2
=================================
- Cleanup of display and tools [Mitch]
- Improvements to tools UI [Mitch]
- Reenabled brush pipes [Mitch]
- Started to reorganize menus [Mitch]
- Cleanup of internal enums [Sven]
- New config file framework (yet unused) [Sven]
- Fixes to the Undo and PixelRegion code [Kelly]
- Optimization and cleanup of the paint-funcs [Daniel]
- Message proofreading [Bex]
- Most stuff compiles with -DGTK_DISABLE_DEPRECATED [Mitch]
- More stuff not mentioned here (see the ChangeLog)
Other Contributors:
Guillermo S. Romero, David Neary, David Odin, Roger Leigh,
Ville Pätsi.
Overview of Changes in GIMP 1.3.1
=================================
- Follow GTK+-2.0 and Pango API changes [Yosh, Mitch, Sven]
- Added Color Erase paint mode [Simon Budig]
- Proofreading of messages [Rebecca Walter]
- Improvements to container views [Mitch]
- Improved tool options [Mitch]
- Made --no-interface mode work without calling gtk_init() [Mitch]
- Reworked paint_funcs [Daniel Egger]
- Added SF-DIRNAME script-fu parameter [Matteo Nastasi]
- Lots of internal cleanups [Mitch, Sven]
- More stuff not mentioned here (see the ChangeLog)
Other Contributors:
Guillermo S. Romero, David Neary
Overview of Changes in GIMP 1.3.0
=================================
- Ported almost everything to the GTK+-2.0 API. Check the file INSTALL
to learn what libraries we require in detail.
- Cleaned up the core a lot. The app directory is now broken up into
subdirectories that define subsystems with defined dependencies.
- Seperated GUI from core functionality in almost all places.
- The core object system does not depend on GTK+ any more.
- Rewrote large parts of the user interface in a more generic way.
- Started to rewrite the text tool (completely broken at the moment)
- Lots of changes in the tool system. All paint tool PDB wrappers are
broken at the moment.
- Split up libgimp and libgimpui in a bunch of smaller utility
libraries for plug-ins and the core.
- Removed GIMP 1.0 compatibility wrappers.
- Lots of stuff not mentioned here. See the file ChangeLog for more info.

578
NEWS.pre-2-2 Normal file
View File

@ -0,0 +1,578 @@
The GNU Image Manipulation Program Version 2.2
----------------------------------------------
This is version 2.2 of The GIMP. Version 2.2 is an update on GIMP 2.0.
GIMP 2.2 is fully backward compatible to GIMP 2.0. Plug-ins and
scripts written for GIMP 2.0 will continue to work and don't need to
be changed nor recompiled to be used with GIMP 2.2. We do however
hope that plug-in authors will update their plug-ins for GIMP 2.2 and
adapt the GUI changes we did with this version.
Please follow the installation instructions in INSTALL.
Overview of Changes in GIMP 2.2.0 (since 2.2-pre2 was released)
=================================
- More work on GFig plug-in.
- Build fixes for Win32 and IRIX.
- Added --no-splash command-line option for gimp-remote.
- More tweaks to the migration of user settings.
- Improved input controller modules, added ALSA support to the MIDI module.
- Allow to transform layers with masks.
- Let the histogram respect the selection.
- Added gimp_edit_copy_visible as a replacement for the "Copy Visible" script.
- Improved color dithering routines.
- Lots of bug fixes and some optimizations.
Contributors:
Michael Natterer, Sven Neumann, David Odin, Manish Singh, Kevin Cozens,
Joao S. O. Bueno, Karine Proot, Tim Mooney, Wolfgang Hofer, Simon Budig,
Bill Skaggs, Øyvind Kolås, Adam D. Moss, Brion Vibber, Maurits Rijk,
Bill Luhtala, Philip Lafleur
Overview of Changes in GIMP 2.2-pre2
====================================
- More work on GFig (still more to come here).
- Improvements and fixes to the migration of user settings.
- Final touches to the new PDB APIs.
- Ported some more item factories to GtkUIManager.
- Added new PDB function gimp_layer_from_mask().
- User interface cleanup in IFS Fractal plug-in (former IfsCompose).
- Allow file plug-ins to provide a way to access an image thumbnail if
the file format provides one or can be rendered at small sizes.
- Load and save EXIF thumbnails in JPEG files.
- Render in small resolution when creating a thumbnail for a
Postscript or PDF document or from an SVG or WMF image file.
- Allow to import Photoshop (.act) palette files.
- Added a Print Size dialog to bring back missing functionality from 2.0.
- Several improvements to the GIMP Python bindins.
- Guard the core better against misbehaving scripts and plug-ins.
- Changed the way that Script-Fu scripts register their menus (in a
backward compatible way).
- Added ALSA support for the MIDI controller module.
- Resurrected the glob plug-in.
- Lots of bug fixes and some optimizations.
Contributors:
Michael Natterer, Sven Neumann, David Odin, Manish Singh, Kevin Cozens,
Joao S. O. Bueno, Geert Jordaens, David Gowers, Øyvind Kolås, Cai Qian,
Simon Budig, Jakub Steiner, Philip Lafleur, Nickolay V. Shmyrev,
Karine Proot, S. Mukund, Dave Neary, Keith Goatman
Overview of Changes in GIMP 2.2-pre1
====================================
- Added more plug-in previews (Displace, Color To Alpha, Newsprint)
and ported existing previews to the new widgets (Glass Tiles).
- Added preview to WMF loader plug-in.
- Added Retinex plug-in for color normalization.
- Added plug-in to load and save raw image data (_not_ the raw format
used by some digital cameras)
- Added a GUI to configure controller modules.
- Let lots of core dialogs remember their last values and add
shortcuts to run with the last values w/o opening the dialog.
- Added new PDB API for drawable tranformations.
- Register all libgimp enums to allow language bindings such as
Script-Fu to access them using GType introspection.
- Improved how we attach user-visible strings to enums registered with
the type system. Added API to access these strings to libgimpbase.
- Cleanups to the new GFig GUI (still work in progress).
- HIGification of the ImageMap plug-in.
- Cleaned up dialogs code.
- Added Auto Whitebalance menu item.
- Redid Scale and Resize dialogs.
- Added code to migrate user settings from ~/.gimp-2.0.
- lots of bug fixes.
Contributors:
Michael Natterer, Sven Neumann, David Odin, Manish Singh, Kevin Cozens,
Joao S. O. Bueno, Geert Jordaens, Yeti, Karine Proot, Øyvind Kolås,
Simon Budig
Overview of Changes in GIMP 2.1.7
=================================
- Added even more plug-in previews (Value Propagate, Cubism, Colorify)
and ported existing previews to the new widgets (AlienMap2, FlareFX,
Jigsaw, NL Filter, Waves, Scatter HSV).
- More PDB API cleanups.
- Allow to specify the batch interpreter on the command-line.
- Improved selection-round script and moved it to the Select menu.
- Don't switch the active layer when using the Move tool.
- Updated libgimpthumb to support local thumbnails as introduced by
version 0.7 of the thumbnail spec.
- Automatically create thumbnails from the Open dialog.
- Added entries next to most viewable buttons.
- Added a bunch of scripts to manipulate guides.
- Improved confirmation and warning dialogs.
- Lots of bug fixes.
Contributors:
Michael Natterer, Sven Neumann, David Odin, Manish Singh, Kevin Cozens,
Alan Horkan, Jakub Steiner
Overview of Changes in GIMP 2.1.6
=================================
- Added more drawable previews (Color Exchange, DOG, Deinterlace,
Engrave, Oilify, Ripple, Shift).
- Added new preview widget that shows a scaled view of the full
drawable. Use it for Apply Lens, Blinds, Channel Mixer, Destripe,
Emboss, Illusion, Map Color, Max RGB, Plasma, Polar, Solid Noise,
Supernova, Whirl and Pinch.
- Added "Open as Layer" functionality to the menus.
- Implemented the recent-file-spec for shared storage of a list of
recently used files (really URIs).
- Cleaned up plug-in procedure handling. Added the possibility to let
plug-ins and scripts run using a private GimpContext.
- Added multi-line text entries for Script-Fu and Gimp-Python.
- Cleaned up PDB API for brushes, gradients, palettes and patterns.
Deprecated lots of functions and added saner replacements. Added
gimp-context-* PDB namespace with replacements for some of the
deprecated stuff.
- Let GimpView handle pixbuf previews. Added a (themable) drop shadow
to image-file previews.
- Cleaned up the dbbrowser and plugindetails code and GUI and factored
out common code. Renamed both executables and menu entries.
- Made tools cancelable with <Escape>.
- Dim the outer (to be cropped) area when using the Crop tool.
- Let GimpDialog add a help button to give easier access to the help pages.
Contributors:
Michael Natterer, Sven Neumann, David Odin, Maurits Rijk, Dave Neary,
Manish Singh, Robert Oegren, Kevin Cozens, Kevin Turner, Dov Grobgeld,
Joao S. O. Bueno, Michael Schumacher, Jonathan Levi, Daniel Egger
Overview of Changes in GIMP 2.1.5
=================================
- Ask the user to save the image when closing the last display.
- Restored compatibility of the wire protocol that was accidentally
broken in 2.1.4.
- Added layer and mask actions to allow to create keybindings for them.
- Preview widget improvements:
* let the preview expand with the plug-in dialog
* added a navigation popup similar to the one in the image window
* respect the selection and show how it will affect the filter
* added API to draw to a GimpDrawablePreview from a GimpPixelRgn
- Added preview to more plug-ins: Cartoon, Apply Canvas, Photocopy,
Motion Blur,
- Ported the Bumpmap plug-in preview to GimpDrawablePreview.
- Removed -u linker hacks from all Makefiles.
Contributors:
Michael Natterer, Sven Neumann, David Odin, Manish Singh, Simon
Budig, Nathan Summers, Alan Horkan, David Gowers, Bill Skaggs,
Joao S. O. Bueno, Peter Kirchgessner
Overview of Changes in GIMP 2.1.4
=================================
- Rewritten internal handling of progress indicators. Embed progress
bars to the File Open dialog to reduce annoying dialogs popping up.
- Added an API for plug-ins to embed a progress bar. Let the Script-Fu
dialog swallow the progress bars created by running the script.
- Ported remaining plug-ins and modules to GimpPreviewArea and removed
GimpOldPreview.
- Show progress while converting from RGB to Indexed Colors.
- Added new plug-ins Cartoon, Neon, Photocopy and Softglow.
- Let color selectors adapt to the given size.
- Import basic SVG shapes as paths.
- Improved GIH and guillotine plug-ins.
- Added GimpMessageBox widget. Collect error messages in a single
dialog to reduce popups.
- Renamed the core GimpPreview widget to GimpView.
- Added a GimpPreview widget to libgimpwidgets. This is an abstract
class that combines a GimpPreviewArea with scrollbars and a "Preview"
toggle button.
- Added GimpDrawablePreview derived from GimpPreview.
- Improved previews in Unsharp Mask, Scatter RGB, Sharpen, Spread and
Grid plug-ins.
- Added previews to Edge, Gaussian Blur, Neon, Soft Glow, Sobel and
Selective Gaussian Blur.
- Added a logarithmic mode for the slider in a GimpScaleEntry.
- Script-Fu code cleanups.
- Fixed composite assembly code.
- Pass user settings for the checkerboard to plug-ins.
- Image comment, if any, is now shown within the info window.
- New function "Fit Canvas to Layers" (gimp_image_resize_to_layers)
Contributors:
Michael Natterer, Sven Neumann, David Odin, Shlomi Fish, Bill Skaggs,
Simon Budig, Ari Pollak, Spencer Kimball, Michael Schumacher, Joao
S. O. Bueno, Manish Singh, Helvetix Victorinox, Kevin Cozens
Overview of Changes in GIMP 2.1.3
=================================
- Cleanups to the MMX code and the composite subsystem in general
- Cleanups and fixes to Gimpressionst plug-in (bug #148088)
- Redone light settings GUI for Lighting plug-in.
- Added keyboard shortcut editor to preferences dialog (bug #142922)
- Implemented the callbacks for the various "Clear saved foobar now"
buttons in the preferences dialog.
- Added support for loading gradients from SVG files. This allows to
share gradient definitions with Inkscape and Sodipodi (bug #148127)
- Added parsers for the various ways to define a color in SVG to
libgimpcolor.
- Added GimpColorHexEntry widget to libgimpwidgets. It displays colors
in hexadecimal represention and takes hex and SVG color names as input.
- Added GimpCellRendererColor and GimpCellRendererToggle to libgimpwidgets.
- Renamed GimpColor boxed type to GimpRGB and moved it to libgimpcolor.
- Moved GIMP_TYPE_UNIT and GIMP_TYPE_MEMSIZE to libgimpbase.
- Fixes to the BMP loader plug-in (bug #143682).
- Fixes to the Decompose plug-in (bug #147603).
- Added palette selector widgets to libgimpui.
- Allow to disable mnemonics in menus (bug #120034).
- Ported TWAIN plug-in to Mac OS X (bug #147962).
- Support motion event history as provided by some input device drivers.
- Let the undo system know more specifically what an undo step
does. Use that info to keep tools active across modifications to
the image that don't affect the tool (bug #109561).
- Changed default config for keyboard controller to allow scrolling
the display using the cursor keys (#53988).
- Added GimpPreviewArea widget as replacement for the deprecated
GtkPreview widget. Ported most plug-ins to the new widget.
- Added shapes for generated brushes and allow for softer brushes.
- Allow to specify the aspect ratio in the scale tool.
- Lots of bug fixes and other goodies. Check the ChangeLog for details.
Contributors:
Michael Natterer, Sven Neumann, Helvetix Victorinox, Shlomi Fish,
Bill Skaggs, Brion Vibber, Raphael Quinet, Simon Budig, David Odin,
Manish Singh, Hans Breuer, Michael Schumacher, Dave Neary
Overview of Changes in GIMP 2.1.2
=================================
- Further improvements to the new input controllers; added a keyboard
controller.
- Show image preview in GFig plug-in, started a complete overhaul.
- Added Difference of Gaussians edge detection plug-in.
- Added more possibilities for drag'n'drop:
* layers dialog accepts URI, color and pattern drops
* path dialog takes and offers DND of SVG data
- Implemented PDB function gimp-path-get-point-at-dist.
- Allow to use the color picker to edit palettes (as in gimp-1.2).
- Improvements and code cleanup in gimpressionist plug-in.
- Allow to cut'n'paste image data between GIMP and other applications
(for example Abiword) using the system clipboard.
- List unsaved images in Quit dialog.
- Completed core/gui separation. Optionally build a gimp-console
application that behaves like 'gimp --no-interface' and doesn't link
to GTK+ at all.
- Deprecated GimpPixmap and ported almost all users to GtkImage.
- Moved display projection code into a GimpProjection object. This means
there's finally only a single projection per image.
- Introduced GimpPickable interface and implemented it for all core
objects that you can pick colors from.
- Write smaller indexed MNG files.
- Fixed issues with the internal statusbar API.
- Allow for multiple light sources in the Lighting plug-in.
- Redone file type selection in file load/save dialogs.
- Removed HRZ plug-in.
- Improved developers documentation.
- Improved quality of antialiasing in the ellipse select tool.
- Lots of bug fixes and other goodies. Check the ChangeLog for details.
Contributors:
Michael Natterer, Sven Neumann, Philip Lafleur, William Skaggs,
Geert Jordaens, Simon Budig, Roman Joost, Michael Schumacher,
Shlomi Fish, Hans Breuer, Brion Vibber, Robert Oegren, Kevin
Cozens, Helvetix Victorinox
Overview of Changes in GIMP 2.1.1
=================================
- Added support for loading patterns in formats supported by GdkPixbuf
(most notably PNG and JPEG).
- Use ARGB cursors when supported by the windowing system. Added nice
new tool cursors.
- Added previews to Solid Noise and Unsharp Mask plug-ins.
- Improvements for painting with pressure-sensitive devices.
- Added preview for transform tools.
- Merged the Gaussian Blur plug-ins.
- Simplified the Blur plug-in.
- Reorganized the Preferences dialog.
- Dispatch Enter, Return, Backspace and Delete key events to the tools
and use them where it makes sense.
- Some optimizations to the tile system, the gradient rendering and to
the cubic interpolation routine.
- Show the brush outline while painting.
- Added an interface that allows to add controller modules. Such a module
can dispatch events to The GIMP which are mapped to actions by a
user-configurable mapping table. Added controller modules for mouse
wheel, midi and linux_input devices.
- Applied HIG capitalization style to all(?) dialogs.
- Lots of bug fixes and other goodies. Check the ChangeLog for details.
Contributors:
Michael Natterer, Sven Neumann, Manish Singh, Philip Lafleur,
William Skaggs, Geert Jordaens, Yeti, Dave Neary, Jakub Steiner,
David Gowers, Henrik Brix Andersen, Simon Budig, Pedro Gimeno,
lots of translators and the contributors that I accidentally missed...
Overview of Changes in GIMP 2.1.0
=================================
GIMP 2.1.0 includes the following enhancements over GIMP 2.0:
- Major user interface improvements.
* Large parts of the GIMP user interface have been changed to
comply better with the GNOME Human Interface Guidelines. This is
an ongoing effort and the interface may still be inconsistent in
a few places.
* Users are now allowed to clear the undo history.
* The unit to be used for the rulers and the coordinates display is now
a display property and can be changed in the statusbar of the image
window.
* New widgets and frameworks provided by GTK+ 2.4 are used; this means
+ uses the new GtkFileChooser dialog, vastly improving the file
dialogs.
+ includes port of menus to GtkUIManager, which creates all core
menus from XML files at runtime. This means that menu items can
be rearranged by users simply by editing these files.
+ uses a global accelerator table in all docks and image windows.
This means that a hotkey will do the same thing regardless of
which dock or image window you are using.
+ adds replacement widgets based on GtkComboBox for most uses of
GtkOptionMenu (GimpUnitMenu remains to be ported)
+ adds GimpContainerEntry, a GtkEntry with completion based on
the contents of a GimpContainer.
+ makes the order and visibility of tools in the toolbox configurable
+ allows keeping toolbox and dock windows above other windows (if
the WM supports this hint)
* The toolbox now has an optional preview of the active image.
* The image window now accepts file/uri drops.
- More internal cleanup and refactoring of the core object model.
- The brush rendering code has been separated from the generic paint
tool code. The ink tool is now a paint tool (it can do straight
lines) and the new infrastructure allows to implement new kinds of
paint methods like vector based painting.
- Gradients can now be created, deleted, renamed and edited through
the PDB.
- Some changes to plug-ins.
* Plug-ins can now register the same procedures in multiple places (the
API to register menu entries has been changed in a backward-compatible
fashion).
* Plug-ins can now optionally register a menu icon.
* File plug-ins can now register a mime-type.
* All plug-in dialogs have been reviewed and changed to make them
comply better with the GNOME Human Interface Guidelines.
* All plug-ins that need to access files use the new GtkFileChooser
dialog.
* The obsolete AlienMap and GIcon plug-ins were removed. AlienMap2
does everything than AlienMap did, and the GIMP-specific GIcon format
has not been used by anything for quite some time now.
* A plug-in to load and save windows icon files has been added.
Contributors:
Michael Natterer, Sven Neumann, Maurits Rijk, Manish Singh,
Henrik Brix Andersen, Philip Lafleur, Raphael Quinet, Simon Budig,
William Skaggs, Shlomi Fish, Kevin Cozens, Jakub Steiner, Dave Neary,
Daniel Kobras, Jordi Gay, Yeti, Marco Munari, David Necas, Nils
Philippsen, Soeren Wedel Nielsen, Joao S. O. Bueno, lots of translators
and the contributors that I accidentally missed...

174
README
View File

@ -1,120 +1,122 @@
The GIMP: the GNU Image Manipulation Program
--------------------------------------------
The GNU Image Manipulation Program Version 2.2
----------------------------------------------
The main difference between v1.0.4 and much earlier versions is the
use of a tile based memory management for images. This allows the GIMP
to work with images much larger than physical memory in a usable
fashion. Before such memory management, the GIMP was nearly unusable
for large images. (Large being something on the order of
4000x3000). With the tile memory management, image size is effectively
limited by disk space. It is due to the switch to a tile based memory
management system that old plug-ins will not work with this version of
the GIMP.
This is version 2.2 of The GIMP. Version 2.2 is an update on GIMP 2.0.
GIMP 2.2 is fully backward compatible to GIMP 2.0. Plug-ins and
scripts written for GIMP 2.0 will continue to work and don't need to
be changed nor recompiled to be used with GIMP 2.2. We do however
hope that plug-in authors will update their plug-ins for GIMP 2.2 and
adapt the GUI changes we did with this version.
The plug-in API has changed drastically from previous versions. The
result is that it is now possible to access much of the GIMP's
internals through a database of procedures aptly named the procedure
database. Plug-ins fit into the procedure database by inserting
themselves into it. The result is that plug-ins can call GIMP internal
procedures and other plug-ins. Most plug-ins now fully support the
procedural database, so that you can call them from scripts and other
places as well.
GIMP 2.2 replaces GIMP 2.0. It is advised that you uninstall GIMP 2.0
before installing GIMP 2.2. If you want to keep GIMP 2.0 installed in
parallel to GIMP 2.2, you have to choose a separate prefix which is
not in your default library search path.
The procedure database is self-documenting. To add a procedure to the
procedure database the programmer must specify a help string and help
strings for the arguments and return values. This allows us to
automatically create documentation for the procedures in the procedure
database. The documentation resides in "docs" and is provided in
texinfo format.
This code has already seen quite some testing but a lot has changed
since version GIMP 2.0 and we could very well have introduced new
bugs. If you find any , make sure you report them at bugzilla.gnome.org
(after checking that it isn't reported already).
A new type of plug-in called an extension has been created. Extensions
are similar to plug-ins in that they are external program, but they
differ in when and how they are run. The essential difference is that
plug-ins are associated with a particular image/drawable, while
extensions are not.
The GIMP 2.2 API is guaranteed to be backward compatible (source and
binary) with the GIMP 2.0 API. If you find that your 2.0 plug-in break
when used with the GIMP 2.2 libraries, or if you cannot compile a GIMP
2.0 plug-in against the GIMP 2.2 header files, please report that as a
bug.
A good example of a complex extension is Script-fu, which resides in
the "plug-ins/script-fu" directory. Script-fu is a simple Scheme
interpreter that provides bindings to the GIMP's procedural database.
This way you can write useful scripts that call the GIMP's functions
and plug-ins, thus allowing automatization of repetitive tasks. Many
scripts are included for your enjoyment in the
"plug-ins/script-fu/scripts" directory.
If you want to hack on The GIMP, please read the file HACKING. For
detailed installation instructions, see the file INSTALL.
Another extension is the "dbbrowser" utility, which lets you
interactively browse through the procedures installed in the
procedural database. This will mainly be of use to Script-fu
programmers. Dbbrowser is also nicely integrated in the interactive
Script-fu console.
Lastly, there is new file format (xcf) designed specifically for
saving GIMP images. It handles layers, channels and tiles as well as
saving all of the state information about the image, such as the
active channel, the selection, etc. It also will probably change
sometime in the future to implement some form of compression for the
tiles.
1. Web Resources
================
The GIMP's home page is at
The GIMP's home page is at:
http://www.gimp.org
http://www.gimp.org/
Please be sure to visit this site for information, documentation,
tutorials, news, etc. All things GIMP-ish are available from there.
The automated plug-in registry is located at
The automated plug-in registry is located at:
http://registry.gimp.org
http://registry.gimp.org/
There you can get the latest versions of plug-ins using a convenient
There you can get the latest versions of plug-ins, using a convenient
forms-based interface.
The latest version of The GIMP can be found at:
http://www.gimp.org/downloads/
2. Mailing Lists
================
We have several mailing lists dedicated to GIMP user and development
discussion. To subscribe, send mail to
discussion. There is more info at
majordomo@scam.xcf.berkeley.edu
https://lists.xcf.berkeley.edu/mailman/listinfo/<listname>
and in the body of the message put
with <listname> replaced by "gimp-announce", "gimp-user", "gimp-win-users"
or "gimp-developer" (without the quotes, of course) depending on the list
you want to subscribe to. Links to the mailing list archives can be
found at the same addresses as given above.
subscribe <list-name> your@email.address
Gimp-announce is a low-traffic list with announcements about new
releases of GIMP and plug-ins. Gimp-user is a mailing list dedicated
to user problems, hints and tips, discussion of cool effects, etc.
Gimp-developer is oriented to GIMP core and plug-in developers. Most
people will only want to be subscribed to gimp-user. If you want to
help develop The GIMP, the gimp-developer mailing list is a good
starting point.
substituting <list-name> for "gimp-user" or "gimp-developer" (without
the quotes, of course) depending on the list you want to subscribe
to. The mailing list archives can be found at
There is also a mailing list, "gimpwin-users", dedicated to users of the
Win32 port. To subscribe, send an empty message to
http://www.findmail.com/listsaver/gimp-developer/
http://www.findmail.com/listsaver/gimp-user/
gimpwin-users-subscribe@egroups.com
Gimp-user is a mailing list dedicated to user problems, hints and
tips, discussion of cool effects, etc. Gimp-developer is oriented to
GIMP core and plug-in developers. Most people will only want to be
subscribed to gimp-user.
You can also use the web interface at
http://www.egroups.com/group/gimpwin-users/. Note that as this mailing
list is hosted on egroups.com, the messages from the list contain
relatively unintrusive and easily ignored advertisements at the
end. But if you are absolutely allergic to ads, don't subscribe.
3. IRC
======
And finally, for the real junkies, there is an IRC channel devoted to
the GIMP :-) On Byxnet (a private mostly-GIMP network) there is #gimp.
Many of the developers hang out there. Some of the Byxnet servers are:
the GIMP. On GIMPNet (a private free software oriented network) there is
#gimp. Many of the developers hang out there. Some of the GIMPNet
servers are:
irc.gimp.org:6667
irc.olg.com:6667
irc.coherent.net:6667
irc.mint.net:6667
irc.us.gimp.org:6667
irc.eu.gimp.org:6667
You can customize the look of the interface quite a bit my editing the
~/.gimp/gtkrc file. A sample file, gtkrc.forest2, is included (Thanks to
Tuomas Kuosmanen)
Included is a set of keybindings similar to those in Adobe Photoshop (tm).
You can find them in the ps-menurc file. To use them, copy this file to
~/.gimp/menurc
4. Customizing
==============
The look of GIMP's interface can be customized like any other GTK app
by editing the ~/.gtkrc-2.0 file or by using "themes" (ready-made
customizations). For downloadable themes and further details, see
http://gtk.themes.org. Additionally, GIMP reads ~/.gimp-2.2/gtkrc so
you can have settings that only apply to The GIMP.
Included is a set of keybindings similar to those in Adobe Photoshop.
You can find them in the ps-menurc file. To use them, copy this file
to ~/.gimp-2.2/menurc. You can also manually change the keybindings to
any of your choice by editing ~/.gimp-2.2/menurc.
We sincerely hope you enjoy the program. Please report problems to
bugs@gimp.org. Before reporting a problem, you may want to see if someone
else has already did (check the http://www.wilberworks.com/bugs.cgi for
this). If you have a fix for the problem, upload a patch to the incoming
dir on ftp.gimp.org.
Have fun,
Spencer Kimball <spencer@xcf.berkeley.edu>
Peter Mattis <petm@xcf.berkeley.edu>
Federico Mena <federico@nuclecu.unam.mx>
Manish Singh <yosh@gimp.org>
Spencer Kimball
Peter Mattis
Federico Mena
Manish Singh
Sven Neumann
Michael Natterer
Dave Neary

238
README.i18n Normal file
View File

@ -0,0 +1,238 @@
This document exists to document the important things to care
for because of locale support. It is aimed at developers and
translators. If you are a translator, you can skip the first
sections, but you definitely want to read sections 5 - 9.
Table of Contents
1. Why localisation?
2. How
3. Deep inside ...
4. Some magic ...
5. Tools and how to use them
6. Gimp is different
7. Adding additional textdomains
8. Tip of the Day messages
9. How to contribute
10. And more ?
1. Why localisation?
Many persons from many countries start to get used to Linux.
Unfortunately not everyone is able to understand English. But
even those people sometimes like to use good and free software
without using a dictionary to get the unknown words.
So why not simply localise the software to make it available to
the mass which isn't wholly English native? Of course this also
eases the migration from PhotoX to GIMP. :))
2. How?
GNU provides a very nice package called gettext. This one offers
the possibility to translate chosen messages from the native language
of the program into that one of the users if a necessary catalog is
provided. Gettext therefore provides some easy tools to create and
maintain such catalogs and a few functions which can be called by the
program to enable automatic translation at runtime. The program gets
linked to the gettext library or glibc2 which already provides that
functionality and everything is fine.
3. Deep inside...
GIMP provides header files called gimpintl.h and stdplugins-intl.h in
the libgimp directory which check whether gettext is available on the
system which GIMP is compiled on and will deactivate language support
if it's not.
If the gettext system is there it will declare 3 functions which will be
described below.
3.1 _() [more correctly: char * _( char * )]
This one is a macro for the function gettext(). You can wrap any text
with it that is allowed to be a return value of a function. If you
use it then libintl will try to translate it into the native language
of the user according to his/her environmental settings.
The gettext() function will do a lookup in the hashed catalog which
contains all the translated texts.
- If it is found a pointer to the string will be returned to the caller.
- If not, the caller will receive a pointer to the original string.
This way it is ensured that there isn't any harm caused to the program
(i.e. The GIMP) if no useful catalog is installed.
Please note that it is important to use _() directly (and not gettext())
for simple messages because of reasons that will be mentioned below.
NOTE: I know some of the developer like short functions like _() but
for a better source understanding I suggest to use it consistently only
for text (like _("That's text!")) and not for variables (like _(text)).
Use gettext(text) instead.
3.2 N_() [more correctly: const char * ( const char * ) ]
This one is a macro for the function gettext_noop(). As you can see
and guess it doesn't really do anything in the programm i.e. it is a
dummy macro but nevertheless important. As it isn't possible to call
functions in a structure as seen here:
struct blurb
{
_("This won't work\n");
}
you have to do it in some other way. In GIMP such structures are
often used to create menus or similar things very simply. Here you
have to use the dummy to allow the generation of the template catalog
which will be described below. This one doesn't do anything but it
marks the text as important to the xgettext extractor.
The text has to be translated manually with the next function.
3.3 gettext()
This function is the same as that macro in 3.1. But there is one big
difference: The _()'s and N_()'s are the only expressions which get
parsed by the template generator.
If you have strings that should be translated but are unfortunately
in a structure you have to do that on your own which means that you
have to parse the fields with the messages in a loop and translate
the texts with this gettext() function.
Please note that it may be necessary to free or allocate memory in
this case!
4. Some magic...
As you have seen we only did the programming part until now but this
isn't all by far. To use catalogs we'll have to create them. Now
there are 3 different files which are importart:
gimp.pot:
This one is the so called template. It contains the messages which
are extracted from the sources and empty fields which have to get
filled by the author. It is used to start a new catalog or to update
the an already available one.
The Makefile will automatically call the program gettext which will
extract all messages that are wrapped by a _() or a N_() (but NOT
gettext()) and concat them to this template.
[language].po:
This file has to be an edited gimp.pot and contains the original
messages plus the translated ones. This file will be delivered
together with GIMP and is the base for the final catalog.
[language].mo:
This file is a compiled version of [language.po] which will be
automatically compiled by the Makefile system and installed in the
locale directory of the system. It contains everything that the .po
file contains except not translated messages, comments and other
overhead. For maximum speed it is also hashed to allow gettext a
faster search.
5. Tools and how to use them
As mentioned the to be translated strings are extracted directly from
the source and written to the template.
I guess many of you will now ask if it is necessary to add new
strings directly to the template or if there's a tool to achieve
that. I think I can calm down those of you who fear lots of had work
just to update the language files. There's a program called msgmerge
which will add all strings that are in the template but not in the
uncompiled catalog to it. Msgmerge does this job very nicely and also
tries to use some kind of fuzzy logic method for already translated
strings for possible reduction of translators work: If an original
string seems similar to a new one and it already has a translation,
it will be taken over to the new catalog together with a remark that
this one may not necessarily fit.
6. Gimp is different
Gimp is a complex application which has a bunch of scripts and
plug-ins that all want to be internationalized. Therefore there is
not one catalog but many. For a full translation of the GIMP's UI,
you will have to add translations for the following catalogs:
po/gimp20.po -- the core
po-libgimp/gimp20-libgimp.pot -- the libgimp library
po-plugins/gimp20-std-plugins.pot -- most of the plug-ins
po-script-fu/gimp20-script-fu.pot -- the script-fu scripts
tips/gimp-tips20.pot -- the startup tips
If you are looking for the translations of gimp-perl, please note that
gimp-perl has been moved into it's own CVS module called gimp-perl.
When translating menu paths in Script-Fu, please do not translate the
name of the item factory (that is the one in brackets at the front),
e.g. <Image>/Script-Fu/Selection should _not_ be translated to
<Bild>/Skript-Fu/Kopieren, but to <Image>/Skript-Fu/Kopieren. If you
get this wrong, Gimp will warn you at startup about bad translations.
So do always test your translations and watch the console for output.
The version of The GIMP you are holding in your hand uses GTK+-2.0.
GTK+-2.0 requires that all strings are UTF-8 encoded. Therefore to make
internationalisation work, po files need to be UTF-8 encoded. If your
editor doesn't support UTF-8, you need to convert it to an encoding your
editor can handle and convert it back to UTF-8 before commiting your
changes back. The gnome-i18n module in CVS has some scripts that help
with this task, but it can also easily done using iconv.
7. Adding additional textdomains
Third-party plug-ins (plug-ins that are not distributed with The
GIMP) can't have their messages in the gimp-std-plugins textdomain.
We have therefore provided a mechanism that allows plug-ins to install
their own message catalogs and tell The GIMP to bind to that
textdomain. This is necessary so that The GIMP can correctly translate
the menu paths the plug-in registers. Basically the plug-in has to call
gimp_plugin_domain_add() or gimp_domain_plugin_add_with_path() before
it registers any functions. Have a look at the script-fu plug-in to see
how this is done in detail.
8. Tip of the Day messages
In addition to message catalogs Gimp provides a file with tips that
are displayed in a Tip of The Day window. This file is in XML format
and can be found in the tips directory. The english tips messages are
extracted from gimp-tips.xml.in so translators can use the usual
tools to create a <lang>.po file that holds the translations. All
translations are then merged into gimp-tips.xml with language
identifiers taken from the po filename.
GIMP needs to know what language it should select from gimp-tips.xml.
Therefore, there's the special message "tips-locale:C" in the main
message catalog that needs to be translated correctly. For a german
translation of the tips this would look like this:
#: app/gui/tips-parser.c:158
msgid "tips-locale:C"
msgstr "tips-locale:de"
9. How to contribute
Any help with translations is appreciated. If you want to help,
please get in contact with the people from the GNOME Translation
Project who coordinate all translation efforts in the GNOME CVS
tree. They have a nice web-page at
http://developer.gnome.org/projects/gtp/.
10. And more?
We hope we mentioned everything that is worth it and hope that this
document will clarify some things. If it doesn't please write us a
mail. This text of course contains errors, so if you find one tell
us...
Happy Gimping.
Daniel Egger
Sven Neumann

21
README.win32 Normal file
View File

@ -0,0 +1,21 @@
For pre-built binary packages of GLib, GTK etc, see
http://www.gimp.org/win32/downloads.html . No pre-built GIMP 1.3
packages, though.
Building GIMP on Win32
======================
There are two ways to build GIMP on Win32:
1) Use the autoconf-generated configure script, and the resulting
Makefiles (which use libtool and gcc to do the compilation). I use
this myself.
2) Use the Microsoft compiler, cl and Make, nmake. Say nmake -f
makefile.msc in various directories. These makefiles are maintained by
Hans Breuer <hans@breuer.org>. They presumably will not generate the
same name DLLs and import libraries as the autoconfiscated libtool
build does, nor necesarily use the same named GLib, GTK etc import
libraries as those distributed from the web site mentioned above.
--Tor Lillqvist <tml@iki.fi>

View File

@ -1,6 +0,0 @@
gimp name "The GIMP"
gimp description "GNU Image Manipulation Program"
gimp icon "wilbur.xpm"
gimp mini-icon "mini-wilbur.xpm"
gimp exec "gimp &"
gimp group Graphics

View File

@ -1,132 +0,0 @@
/* XPM */
static char * wilbur_mini_xpm[] = {
"18 18 111 2",
" c None",
". c #8E38861771C6",
"X c #BEFBB6DAA699",
"o c #71C669A65965",
"O c #AEBA9E798E38",
"+ c #B6DAAEBAA699",
"@ c #71C671C65965",
"# c #69A661854924",
"$ c #B6DAAEBA9E79",
"% c #8E38820769A6",
"& c #AEBAAAAAA699",
"* c #79E775D66185",
"= c #618561854924",
"- c #69A665955144",
"; c #C71BC30BBEFB",
": c #96588A2871C6",
"> c #79E771C65965",
", c #A699A2899658",
"< c #A6999E799658",
"1 c #71C66DB65965",
"2 c #69A661855144",
"3 c #618559654924",
"4 c #79E779E769A6",
"5 c #D75CD34CCF3C",
"6 c #9E7996588617",
"7 c #8E387DF769A6",
"8 c #861779E76185",
"9 c #965892488617",
"0 c #86177DF771C6",
"q c #61855D754924",
"w c #596555554103",
"e c #9E7996589658",
"r c #F7DEF3CEF7DE",
"t c #E79DE79DE79D",
"y c #A6999A698617",
"u c #DF7DDB6CD75C",
"i c #FFFFFBEEF7DE",
"p c #C71BC30BB6DA",
"a c #79E771C66185",
"s c #596559654924",
"d c #596551444103",
"f c #51444D344103",
"g c #618561855144",
"h c #618565956185",
"j c #9E799A699E79",
"k c #E79DE38DDF7D",
"l c #B6DAB2CAB6DA",
"z c #79E77DF779E7",
"x c #E79DE79DDF7D",
"c c #F7DEF7DEF7DE",
"v c #AEBAAEBAAEBA",
"b c #DF7DDF7DDF7D",
"n c #514451444103",
"m c #4924451438E3",
"M c #4103410330C2",
"N c #4924492438E3",
"B c #8617820779E7",
"V c #71C675D671C6",
"C c #8E388E388E38",
"Z c #30C230C230C2",
"A c #8E388A2879E7",
"S c #69A66DB669A6",
"D c #514455555144",
"F c #CF3CCB2BC71B",
"G c #514451445144",
"H c #965896589658",
"J c #41033CF330C2",
"K c #38E338E328A2",
"L c #514451444924",
"P c #596559655965",
"I c #861786178617",
"U c #30C234D330C2",
"Y c #514455554924",
"T c #AEBAA2899E79",
"R c #AEBAAAAA9E79",
"E c #CF3CCB2BCF3C",
"W c #28A22CB228A2",
"Q c #A6999E79A699",
"! c #596555555144",
"~ c #492449244924",
"^ c #410341034103",
"/ c #596559655144",
"( c #86177DF769A6",
") c #BEFBBEFBBEFB",
"_ c #96588E388617",
"` c #51444D3438E3",
"' c #38E334D330C2",
"] c #410345144103",
"[ c #514455555965",
"{ c #69A669A66185",
"} c #4924410330C2",
"| c #A699A2899E79",
" . c #30C230C228A2",
".. c #38E33CF338E3",
"X. c #71C671C669A6",
"o. c #38E338E330C2",
"O. c #61855D755144",
"+. c #38E334D328A2",
"@. c #208120811861",
"#. c #208124921861",
"$. c #20811C711040",
"%. c #186118611040",
"&. c #596555554924",
"*. c #18611C711861",
"=. c #618561856185",
"-. c #4103410338E3",
";. c #104014511040",
":. c #38E338E338E3",
">. c #208124922081",
",. c #208120812081",
"<. c #28A228A228A2",
" ",
" . ",
" X o ",
" O + @ # ",
" $ % & * = - ",
" ; : > , < 1 2 3 4 ",
" 5 6 7 8 . 9 6 0 1 2 q 3 w e ",
" r t y u i p a 2 s d f f g ",
" h j k l z x c v b . q n m M N B ",
"V C Z A S D k F G H A 3 N J K L ",
"P I U Y , T R E W Q a w m K K ! ",
"U ~ ^ / 1 8 ( + ) _ q ` M K ' h ",
"] ^ [ { q 1 > 1 - q N } J K U z ",
"| D S { f 3 2 = 3 ` J N K ... ",
" j X.n m ` d N o. .O.f +.@.P ",
" | J #.$.%.@.+.&.O.K *.Z ",
" =.W @. .m -.@.;.W h ",
" =.:.>.@.,.<.-. "};

View File

@ -1,244 +0,0 @@
/* XPM */
static char * wilbur_xpm[] = {
"66 50 191 2",
" c None",
". c #79E775D66185",
"X c #79E771C66185",
"o c #CF3CBEFB9E79",
"O c #79E771C65965",
"+ c #D75CCB2BB6DA",
"@ c #CF3CBEFBA699",
"# c #965892488617",
"$ c #71C66DB65965",
"% c #DF7DDB6CD75C",
"& c #BEFBB2CA9658",
"* c #BEFBB6DAA699",
"= c #BEFBAEBA9658",
"- c #B6DAAAAA8E38",
"; c #B6DAAEBA9658",
": c #71C669A65144",
"> c #71C669A65965",
", c #CF3CC71BB6DA",
"< c #B6DAA6998E38",
"1 c #AEBA9E798617",
"2 c #A6999E798E38",
"3 c #69A669A65144",
"4 c #69A669A65965",
"5 c #69A665955144",
"6 c #E79DDF7DDF7D",
"7 c #AEBAA6998E38",
"8 c #9E79924879E7",
"9 c #86177DF769A6",
"0 c #69A661855144",
"q c #9E79965879E7",
"w c #96588A2871C6",
"e c #C71BBEFBB6DA",
"r c #69A661854924",
"t c #618561855144",
"y c #CF3CC71BBEFB",
"u c #8E38820769A6",
"i c #79E779E76185",
"p c #BEFBBEFBBEFB",
"a c #61855D754924",
"s c #618559654924",
"d c #96588E3871C6",
"f c #861775D66185",
"g c #79E76DB65965",
"h c #9E7992488617",
"j c #A6999E799658",
"k c #71C671C66185",
"l c #DF7DDB6CDF7D",
"z c #A699965879E7",
"x c #9E798E3871C6",
"c c #8E38861771C6",
"v c #8617820771C6",
"b c #596555554103",
"n c #8E38861779E7",
"m c #CF3CCB2BC71B",
"M c #A6999A6979E7",
"N c #AEBAAEBAAEBA",
"B c #96588E388617",
"V c #596559654103",
"C c #AEBAAAAAAEBA",
"Z c #D75CD34CD75C",
"A c #B6DAAEBAA699",
"S c #596559654924",
"D c #596551444103",
"F c #C71BC30BBEFB",
"G c #861779E76185",
"H c #AEBAA699A699",
"J c #9E799A698E38",
"K c #514455554924",
"L c #8E388A288617",
"P c #C71BC71BC71B",
"I c #AEBAAAAAA699",
"U c #9658861771C6",
"Y c #8E387DF769A6",
"T c #A699A2899658",
"R c #9E799A699658",
"E c #9E7996588E38",
"W c #DF7DDF7DDF7D",
"Q c #514451444103",
"! c #965896589658",
"~ c #EFBEEBADEFBE",
"^ c #EFBEEFBEEFBE",
"/ c #F7DEF3CEF7DE",
"( c #FFFFFFFFFFFF",
") c #F7DEEFBEEFBE",
"_ c #CF3CCB2BBEFB",
"` c #9E79924871C6",
"' c #AEBAA6999658",
"] c #DF7DD75CD75C",
"[ c #F7DEF3CEEFBE",
"{ c #D75CD75CD75C",
"} c #AEBAA6999E79",
"| c #86177DF76185",
" . c #69A669A66185",
".. c #F7DEF7DEF7DE",
"X. c #E79DE38DDF7D",
"o. c #FFFFFBEEFFFF",
"O. c #D75CCF3CC71B",
"+. c #71C671C65965",
"@. c #51444D344103",
"#. c #51444D3438E3",
"$. c #5144492438E3",
"%. c #9E799E799E79",
"&. c #C71BC30BC71B",
"*. c #CF3CCF3CCF3C",
"=. c #FFFFF7DEF7DE",
"-. c #4924451438E3",
";. c #4924492438E3",
":. c #8E388A288E38",
">. c #B6DAB6DAB6DA",
",. c #618565956185",
"<. c #49244D344924",
"1. c #59655D755965",
"2. c #861782078617",
"3. c #B6DAB2CAB6DA",
"4. c #28A22CB228A2",
"5. c #B6DAB2CAAEBA",
"6. c #BEFBBAEAB6DA",
"7. c #E79DE79DE79D",
"8. c #EFBEEBADE79D",
"9. c #4103410330C2",
"0. c #4924410330C2",
"q. c #79E779E779E7",
"w. c #A699A289A699",
"e. c #514451445144",
"r. c #410345144103",
"t. c #38E338E338E3",
"y. c #28A228A228A2",
"u. c #208120812081",
"i. c #30C230C230C2",
"p. c #000000000000",
"a. c #9E799A699E79",
"s. c #69A669A669A6",
"d. c #208124922081",
"f. c #CF3CCB2BCF3C",
"g. c #41033CF330C2",
"h. c #410338E328A2",
"j. c #38E33CF328A2",
"k. c #71C671C671C6",
"l. c #492449244924",
"z. c #618561856185",
"x. c #861786178617",
"c. c #410341034103",
"v. c #186118611861",
"b. c #000004100000",
"n. c #104010401040",
"m. c #082008200820",
"M. c #38E338E328A2",
"N. c #38E33CF330C2",
"B. c #69A66DB669A6",
"V. c #79E77DF779E7",
"C. c #965892489658",
"Z. c #596559655965",
"A. c #38E338E330C2",
"S. c #492449244103",
"D. c #08200C300820",
"F. c #18611C711861",
"G. c #38E33CF338E3",
"H. c #514455555144",
"J. c #D75CD34CCF3C",
"K. c #104014511040",
"L. c #38E334D328A2",
"P. c #30C234D330C2",
"I. c #AEBAAAAA9E79",
"U. c #8E388E388E38",
"Y. c #A699A699A699",
"T. c #30C230C228A2",
"R. c #618561855965",
"E. c #38E334D330C2",
"W. c #71C675D671C6",
"Q. c #30C22CB228A2",
"!. c #4924410338E3",
"~. c #410338E330C2",
"^. c #71C671C669A6",
"/. c #208120811861",
"(. c #28A228A22081",
"). c #514455554103",
"_. c #186118611040",
"`. c #30C230C22081",
"'. c #20811C711861",
"]. c #41033CF338E3",
"[. c #596559655144",
"{. c #28A224922081",
"}. c #4103451438E3",
"|. c #186114511040",
" X c #10400C300820",
".X c #104010400820",
"XX c #082008200000",
"oX c #082004100000",
"OX c #BEFBBAEABEFB",
"+X c #A699A2899E79",
"@X c #492445144103",
" ",
" ",
" . ",
" X ",
" o O O ",
" + @ # O $ ",
" % & * O $ $ ",
" = - ; $ $ : > ",
" , < 1 2 $ > 3 4 5 ",
" 6 7 1 8 8 9 : : 5 5 0 ",
" * 2 q w w e 9 : 3 0 r t t ",
" y 2 q w u i p $ > 5 5 0 a s a ",
" % 7 q d u f g h j $ 5 5 0 a a s a k ",
" l * z x c 9 . $ v u $ $ 5 5 t a s b b n ",
" m M 8 w u f $ > 3 N B $ $ : 5 5 t a s V b b C ",
" Z A z x c 9 . g : 5 v # $ $ > : r r a s S b D 5 ",
" F M x w u G . O $ > $ 9 H y J $ > : : : 5 5 0 0 a a S b D K L ",
" P I 8 d U Y 9 G . . X . . . G G c T j R E E X 0 0 5 5 : 5 5 5 5 t t a a S s b b D a ",
" W y T q 8 d U Y 9 G G G . G G 9 G i . O O 4 5 0 r t r r a a a a a s b s b b D D Q Q ! ",
" ~ ^ / ( ) _ ` w c u 9 ' ] [ ( / { } | i . O > 3 0 t a a a a s b b b b b b Q D D D Q . ",
" ....( ( ( ( ( X.d U c ] ( ( ( ( ( ( o.O.| . +.$ 5 5 a s b b Q D Q @.Q @.#.$.@.Q @.#.b %. ",
" { o.~ ( ..{ &.*./ ( y w % ( ( ( ( ( ( o.=./ m . g : 5 r a s b D Q @.#.$.-.-.;.;.;.#.#.b :. ",
" >.,.<.<.1.2. ] [ ( p 3.4.4.5.( ^ 6.( ( ( o.7.*.P X./ / 8.T +.3 5 a s b D #.;.;.-.9.9.0.0.0.-.;.#.q. ",
" w.e.r.r.t.y.u.e.5.m z ( ( e.w.i.p.4.( ( X.( ( ( { a.s.d.,.f.~ X.e : : 5 a s b Q $.-.9.9.g.h.g.j.g.9.;.k. ",
" 3.l.z.x.x.s.l.4.u.c.$ x [ ( v.d.b.p.n.( 8.[ o.o.( ! >.3.i.m.q.7.l *.$ 5 0 a V D #.;.-.9.g.M.N.M.h.g.-.z.B.V. ",
" B.e.C.P p :.Z.A.d.d.S.X y ( ,.D.p.D.z.o.e ^ ......z.q.q.F.p.l.W { P 3 3 r s b D $.;.9.g.g.M.M.A.M.g.<.1.B.2. ",
" G.H.w.{ Z ! 1.t.y.4.t.Q w % l B.G.s.] J.U J./ / ..Z.v.K.p.p.e.{ f.H 5 t a V Q Q $.0.g.g.M.M.L.L.N.g.<.1.k. ",
" i.<.x.C w.q.<.P.i.P.G.l.X u e 7.o.7.e c c I.^ ^ ^ %.d.p.p.u.:.*.P B 0 a s b @.#.-.9.g.h.M.M.M.L.M.c.<.z.q. ",
" C u.G.s.2.q.Z.G.i.P.G.r.<.S G G G 9 u u 9 Y Y P ~ 7.Z ! <.l.U.&.&.a.5 0 r s b Q -.-.9.9.N.M.L.M.M.A.G.e.s. ",
" Y.d.i.e.z.Z.l.G.t.G.r.<.H.H.$ . . G G 9 9 9 9 9 6.W l l % l Z *.j $ r a a b D #.;.-.9.g.h.N.M.A.M.T.c.H.k. ",
" y.d.t.r.r.G.t.G.l.<.H.1.R.5 $ g . i G | | G G i T A P { *.5.# 5 0 0 s D Q @.;.-.0.g.g.M.M.L.M.E.i.r.z. ",
" i.u.i.P.t.G.c.r.e.Z.z.,.,.a 5 : $ O . G f . . X . X $ > $ 5 5 r t a S -.9.$.;.0.9.g.g.L.M.M.M.T.P.<.s. ",
" k.y.y.P.G.c.l.e.Z.z.,.k. .b a t 3 $ O O . O g O $ : 4 : 5 0 0 t s s @.L.g.-.-.9.g.h.L.L.M.M.L.d.t.H.W. ",
" G.i.t.c.l.e.Z.z.s.B.q. .D V s a 5 : $ +.+.$ : > 5 5 0 5 a a s V b Q.M.9.!.9.g.M.M.M.M.~.g.d.y.c.z.V. ",
" x.l.c.l.e.Z.z.s.k.q.V.S #.Q b V s t 5 : 5 5 5 5 r t t s s b V D 4.T.9.Q #.g.N.h.M.A.M.M.4.F.i.<.s. ",
" V.e.H.1.,.B.^.q.2.^.;.;.$.#.b D b a 0 a a a a s V s b b Q ;./.(.c.K 1.).h.M.L.M.M.M.T._.d.t.Z.q. ",
" P :.,.z.s.k.V.2.V.Z.-.-.-.;.$.Q D b s s S b V b D D Q @.`.'.4.].D ,.$ [.~.M.A.M.M.M._.v.i.l.R. ",
" w.2.^.q.2.s.).;.0.9.0.;.$.$.@.Q b Q Q #.@.Q Q -.{.'./.4.N.Q 5 . X -.N.M.M.L.M.F.K.u.t.Z. ",
" Z J 5 a s D ;.-.9.}.-.-.;.-.;.#.;.#.9.T./.F.'./.(.P.g.Q R.B.W.,.M.M.M.L.T.n.n.F.i.l.,. ",
" >.k g.`.(.T.T.T.T.T.`./.|._.K. X.X_.'./.Q.L.g.S.D a .> 5 g.M.~.M.(.n.n.F.4.c.1. ",
" .Q..X.Xm.XXXXXXoXXXD. XK.F./.(.P.N.;.Q 1.R.5 5 R.N.N.j.T.K.D.n.F.y.G.H. ",
" OX a.R.P._.D.D.m.D.K._./.(.P.M.}.#.H.a ,.,.a ;.~.Q.F.D.D.n._.u.4.].H.B. ",
" +XC.V.B.1.G.T./.d.{.T.M.].-.@.[.t t Q ].u._.m.D.D.n.K.v.d.i.r.Z.k. ",
" :.W.,.H.r.t.4.u.v.K.K.n.D.m.D.D.D.D.D.D.n.K.v.F.y.i.G.l. ",
" x.k.,.e.@Xt.i.y.d.F.F.v.v.v.v.v.v.F.u.u.{.4.P. ",
" x.q.s.1.<.r.G.t.i.i.i.4.4.4.i.i.i.P.G.c. ",
" x.W.B.z.Z.H.e.<.<.l.l.<.l.<.e.H. ",
" 2.q.W.k.B.k.B.B.B. ",
" ! C.! ",
" "};

3
TODO
View File

@ -1,3 +0,0 @@
Please add things to this file when the need to do them is
discovered.

View File

@ -1,43 +0,0 @@
/* acconfig.h
This file is in the public domain.
Descriptive text for the C preprocessor macros that
the distributed Autoconf macros can define.
No software package will use all of them; autoheader copies the ones
your configure.in uses into your configuration header file templates.
The entries are in sort -df order: alphabetical, case insensitive,
ignoring punctuation (such as underscores). Although this order
can split up related entries, it makes it easier to check whether
a given entry is in the file.
Leave the following blank line there!! Autoheader needs it. */
#undef HAVE_DIRENT_H
#undef HAVE_DOPRNT
#undef HAVE_IPC_H
#undef HAVE_NDIR_H
#undef HAVE_PUTENV
#undef HAVE_SHM_H
#undef HAVE_SYS_DIR_H
#undef HAVE_SYS_NDIR_H
#undef HAVE_SYS_SELECT_H
#undef HAVE_SYS_TIME_H
#undef HAVE_UNISTD_H
#undef HAVE_VPRINTF
#undef HAVE_XSHM_H
#undef IPC_RMID_DEFERRED_RELEASE
#undef NO_DIFFTIME
#undef NO_FD_SET
#undef RAND_FUNC
#undef SRAND_FUNC
/* Leave that blank line there!! Autoheader needs it.
If you're adding to this file, keep in mind:
The entries are in sort -df order: alphabetical, case insensitive,
ignoring punctuation (such as underscores). */

418
acinclude.m4 Normal file
View File

@ -0,0 +1,418 @@
## Add your own autoconf macros here.
## Find the install dirs for the python installation.
## By James Henstridge
dnl a macro to check for ability to create python extensions
dnl AM_CHECK_PYTHON_HEADERS([ACTION-IF-POSSIBLE], [ACTION-IF-NOT-POSSIBLE])
dnl function also defines PYTHON_INCLUDES
AC_DEFUN([AM_CHECK_PYTHON_HEADERS],
[AC_REQUIRE([AM_PATH_PYTHON])
AC_MSG_CHECKING(for headers required to compile python extensions)
dnl deduce PYTHON_INCLUDES
py_prefix=`$PYTHON -c "import sys; print sys.prefix"`
py_exec_prefix=`$PYTHON -c "import sys; print sys.exec_prefix"`
PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}"
if test "$py_prefix" != "$py_exec_prefix"; then
PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include/python${PYTHON_VERSION}"
fi
AC_SUBST(PYTHON_INCLUDES)
dnl check if the headers exist:
save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES"
AC_TRY_CPP([#include <Python.h>],dnl
[AC_MSG_RESULT(found)
$1],dnl
[AC_MSG_RESULT(not found)
$2])
CPPFLAGS="$save_CPPFLAGS"
])
# Configure paths for gimp-print
# Roger Leigh -- Sat, 10 Feb 2001
# (based on gimpprint.m4 by Owen Taylor 97-11-3)
dnl AM_PATH_GIMPPRINT([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
dnl Test for GIMP-PRINT, and define GIMPPRINT_CFLAGS and GIMPPRINT_LIBS
dnl
AC_DEFUN([AM_PATH_GIMPPRINT],
[dnl
dnl Get the cflags and libraries from the gimpprint-config script
dnl
AC_ARG_WITH(gimpprint-prefix,[ --with-gimpprint-prefix=PFX Prefix where GIMP-PRINT is installed (optional)],
gimpprint_config_prefix="$withval", gimpprint_config_prefix="")
AC_ARG_WITH(gimpprint-exec-prefix,[ --with-gimpprint-exec-prefix=PFX Exec prefix where GIMP-PRINT is installed
(optional)],
gimpprint_config_exec_prefix="$withval", gimpprint_config_exec_prefix="")
AC_ARG_ENABLE(gimpprinttest, [ --disable-gimpprinttest Do not try to compile and run a test GIMP-PRINT
program],
, enable_gimpprinttest=yes)
if test x$gimpprint_config_exec_prefix != x ; then
gimpprint_config_args="$gimpprint_config_args --exec-prefix=$gimpprint_config_exec_prefix"
if test x${GIMPPRINT_CONFIG+set} != xset ; then
GIMPPRINT_CONFIG=$gimpprint_config_exec_prefix/bin/gimpprint-config
fi
fi
if test x$gimpprint_config_prefix != x ; then
gimpprint_config_args="$gimpprint_config_args --prefix=$gimpprint_config_prefix"
if test x${GIMPPRINT_CONFIG+set} != xset ; then
GIMPPRINT_CONFIG=$gimpprint_config_prefix/bin/gimpprint-config
fi
fi
AC_PATH_PROG(GIMPPRINT_CONFIG, gimpprint-config, no)
min_gimpprint_version=ifelse([$1], ,4.1.4,$1)
AC_MSG_CHECKING(for GIMP-PRINT - version >= $min_gimpprint_version)
no_gimpprint=""
if test "$GIMPPRINT_CONFIG" = "no" ; then
no_gimpprint=yes
else
GIMPPRINT_CFLAGS=`$GIMPPRINT_CONFIG $gimpprint_config_args --cflags`
GIMPPRINT_LIBS=`$GIMPPRINT_CONFIG $gimpprint_config_args --libs`
gimpprint_config_major_version=`$GIMPPRINT_CONFIG $gimpprint_config_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
gimpprint_config_minor_version=`$GIMPPRINT_CONFIG $gimpprint_config_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
gimpprint_config_micro_version=`$GIMPPRINT_CONFIG $gimpprint_config_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
if test "x$enable_gimpprinttest" = "xyes" ; then
ac_save_CFLAGS="$CFLAGS"
ac_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $GIMPPRINT_CFLAGS"
LIBS="$GIMPPRINT_LIBS $LIBS"
dnl
dnl Now check if the installed GIMP-PRINT is sufficiently new. (Also sanity
dnl checks the results of gimpprint-config to some extent
dnl
rm -f conf.gimpprinttest
AC_TRY_RUN([
#include <gimp-print/gimp-print.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int
main ()
{
int major, minor, micro;
char *tmp_version;
system ("touch conf.gimpprinttest");
/* HP/UX 9 (%@#!) writes to sscanf strings */
tmp_version = strdup("$min_gimpprint_version");
if (!tmp_version) {
exit(1);
}
if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
printf("%s, bad version string\n", "$min_gimpprint_version");
exit(1);
}
if ((gimpprint_major_version != $gimpprint_config_major_version) ||
(gimpprint_minor_version != $gimpprint_config_minor_version) ||
(gimpprint_micro_version != $gimpprint_config_micro_version))
{
printf("\n*** 'gimpprint-config --version' returned %d.%d.%d, but GIMP-PRINT (%d.%d.%d)\n",
$gimpprint_config_major_version, $gimpprint_config_minor_version, $gimpprint_config_micro_version,
gimpprint_major_version, gimpprint_minor_version, gimpprint_micro_version);
printf ("*** was found! If gimpprint-config was correct, then it is best\n");
printf ("*** to remove the old version of GIMP-PRINT. You may also be able to fix the\n");
printf("*** error by modifying your LD_LIBRARY_PATH enviroment variable, or by\n");
printf("*** editing /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
printf("*** required on your system.\n");
printf("*** If gimpprint-config was wrong, set the environment variable GIMPPRINT_CONFIG\n");
printf("*** to point to the correct copy of gimpprint-config, and remove the file\n");
printf("*** config.cache before re-running configure\n");
}
#if defined (GIMPPRINT_MAJOR_VERSION) && defined (GIMPPRINT_MINOR_VERSION) && defined (GIMPPRINT_MICRO_VERSION)
else if ((gimpprint_major_version != GIMPPRINT_MAJOR_VERSION) ||
(gimpprint_minor_version != GIMPPRINT_MINOR_VERSION) ||
(gimpprint_micro_version != GIMPPRINT_MICRO_VERSION))
{
printf("\n*** GIMP-PRINT header files (version %d.%d.%d) do not match\n",
GIMPPRINT_MAJOR_VERSION, GIMPPRINT_MINOR_VERSION, GIMPPRINT_MICRO_VERSION);
printf("*** library (version %d.%d.%d)\n",
gimpprint_major_version, gimpprint_minor_version, gimpprint_micro_version);
}
#endif /* defined (GIMPPRINT_MAJOR_VERSION) ... */
else
{
if ((gimpprint_major_version > major) ||
((gimpprint_major_version == major) && (gimpprint_minor_version > minor)) ||
((gimpprint_major_version == major) && (gimpprint_minor_version == minor) && (gimpprint_micro_version >= micro)))
{
return 0;
}
else
{
printf("\n*** An old version of GIMP-PRINT (%d.%d.%d) was found.\n",
gimpprint_major_version, gimpprint_minor_version, gimpprint_micro_version);
printf("*** You need a version of GIMP-PRINT newer than %d.%d.%d. The latest version of\n",
major, minor, micro);
printf("*** GIMP-PRINT is always available from\n");
printf("*** http://sourceforge.net/project/showfiles.php?group_id=1537.\n");
printf("***\n");
printf("*** If you have already installed a sufficiently new version, this error\n");
printf("*** probably means that the wrong copy of the gimpprint-config shell script is\n");
printf("*** being found. The easiest way to fix this is to remove the old version\n");
printf("*** of GIMP-PRINT, but you can also set the GIMPPRINT_CONFIG environment to\n");
printf("*** point to the correct copy of gimpprint-config. (In this case, you will have\n");
printf("*** to modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
printf("*** so that the correct libraries are found at run-time))\n");
}
}
return 1;
}
],, no_gimpprint=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
fi
if test "x$no_gimpprint" = x ; then
AC_MSG_RESULT(yes)
ifelse([$2], , :, [$2])
else
AC_MSG_RESULT(no)
if test "$GIMPPRINT_CONFIG" = "no" ; then
echo "*** The gimpprint-config script installed by GIMP-PRINT could not be found"
echo "*** If GIMP-PRINT was installed in PREFIX, make sure PREFIX/bin is in"
echo "*** your path, or set the GIMPPRINT_CONFIG environment variable to the"
echo "*** full path to gimpprint-config."
else
if test -f conf.gimpprinttest ; then
:
else
echo "*** Could not run GIMP-PRINT test program, checking why..."
CFLAGS="$CFLAGS $GIMPPRINT_CFLAGS"
LIBS="$LIBS $GIMPPRINT_LIBS"
AC_TRY_LINK([
#include <gimp-print/gimp-print.h>
#include <stdio.h>
#include <string.h>
], [ return ((gimpprint_major_version) || (gimpprint_minor_version) || (gimpprint_micro_version)); ],
[ echo "*** The test program compiled, but did not run. This usually means"
echo "*** that the run-time linker is not finding GIMP-PRINT or finding the wrong"
echo "*** version of GIMP-PRINT. If it is not finding GIMP-PRINT, you'll need to set"
echo "*** your LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
echo "*** to the installed location Also, make sure you have run ldconfig if that"
echo "*** is required on your system"
echo "***"
echo "*** If you have an old version installed, it is best to remove it, although"
echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
[ echo "*** The test program failed to compile or link. See the file config.log for the"
echo "*** exact error that occured. This usually means GIMP-PRINT was incorrectly"
echo "*** installed or that you have moved GIMP-PRINT since it was installed. In the"
echo "*** latter case, you may want to edit the gimpprint-config script:"
echo "*** $GIMPPRINT_CONFIG" ])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
fi
GIMPPRINT_CFLAGS=""
GIMPPRINT_LIBS=""
ifelse([$3], , :, [$3])
fi
AC_SUBST(GIMPPRINT_CFLAGS)
AC_SUBST(GIMPPRINT_LIBS)
rm -f conf.gimpprinttest
])
dnl Configure Paths for Alsa
dnl Some modifications by Richard Boulton <richard-alsa@tartarus.org>
dnl Christopher Lansdown <lansdoct@cs.alfred.edu>
dnl Jaroslav Kysela <perex@suse.cz>
dnl Last modification: alsa.m4,v 1.23 2004/01/16 18:14:22 tiwai Exp
dnl AM_PATH_ALSA([MINIMUM-VERSION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
dnl Test for libasound, and define ALSA_CFLAGS and ALSA_LIBS as appropriate.
dnl enables arguments --with-alsa-prefix=
dnl --with-alsa-enc-prefix=
dnl --disable-alsatest
dnl
dnl For backwards compatibility, if ACTION_IF_NOT_FOUND is not specified,
dnl and the alsa libraries are not found, a fatal AC_MSG_ERROR() will result.
dnl
AC_DEFUN([AM_PATH_ALSA],
[dnl Save the original CFLAGS, LDFLAGS, and LIBS
alsa_save_CFLAGS="$CFLAGS"
alsa_save_LDFLAGS="$LDFLAGS"
alsa_save_LIBS="$LIBS"
alsa_found=yes
dnl
dnl Get the cflags and libraries for alsa
dnl
AC_ARG_WITH(alsa-prefix,
[ --with-alsa-prefix=PFX Prefix where Alsa library is installed(optional)],
[alsa_prefix="$withval"], [alsa_prefix=""])
AC_ARG_WITH(alsa-inc-prefix,
[ --with-alsa-inc-prefix=PFX Prefix where include libraries are (optional)],
[alsa_inc_prefix="$withval"], [alsa_inc_prefix=""])
dnl FIXME: this is not yet implemented
AC_ARG_ENABLE(alsatest,
[ --disable-alsatest Do not try to compile and run a test Alsa program],
[enable_alsatest="$enableval"],
[enable_alsatest=yes])
dnl Add any special include directories
AC_MSG_CHECKING(for ALSA CFLAGS)
if test "$alsa_inc_prefix" != "" ; then
ALSA_CFLAGS="$ALSA_CFLAGS -I$alsa_inc_prefix"
CFLAGS="$CFLAGS -I$alsa_inc_prefix"
fi
AC_MSG_RESULT($ALSA_CFLAGS)
CFLAGS="$alsa_save_CFLAGS"
dnl add any special lib dirs
AC_MSG_CHECKING(for ALSA LDFLAGS)
if test "$alsa_prefix" != "" ; then
ALSA_LIBS="$ALSA_LIBS -L$alsa_prefix"
LDFLAGS="$LDFLAGS $ALSA_LIBS"
fi
dnl add the alsa library
ALSA_LIBS="$ALSA_LIBS -lasound -lm -ldl -lpthread"
LIBS=`echo $LIBS | sed 's/-lm//'`
LIBS=`echo $LIBS | sed 's/-ldl//'`
LIBS=`echo $LIBS | sed 's/-lpthread//'`
LIBS=`echo $LIBS | sed 's/ //'`
LIBS="$ALSA_LIBS $LIBS"
AC_MSG_RESULT($ALSA_LIBS)
dnl Check for a working version of libasound that is of the right version.
min_alsa_version=ifelse([$1], ,0.1.1,$1)
AC_MSG_CHECKING(for libasound headers version >= $min_alsa_version)
no_alsa=""
alsa_min_major_version=`echo $min_alsa_version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
alsa_min_minor_version=`echo $min_alsa_version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
alsa_min_micro_version=`echo $min_alsa_version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
AC_LANG_SAVE
AC_LANG_C
AC_TRY_COMPILE([
#include <alsa/asoundlib.h>
], [
/* ensure backward compatibility */
#if !defined(SND_LIB_MAJOR) && defined(SOUNDLIB_VERSION_MAJOR)
#define SND_LIB_MAJOR SOUNDLIB_VERSION_MAJOR
#endif
#if !defined(SND_LIB_MINOR) && defined(SOUNDLIB_VERSION_MINOR)
#define SND_LIB_MINOR SOUNDLIB_VERSION_MINOR
#endif
#if !defined(SND_LIB_SUBMINOR) && defined(SOUNDLIB_VERSION_SUBMINOR)
#define SND_LIB_SUBMINOR SOUNDLIB_VERSION_SUBMINOR
#endif
# if(SND_LIB_MAJOR > $alsa_min_major_version)
exit(0);
# else
# if(SND_LIB_MAJOR < $alsa_min_major_version)
# error not present
# endif
# if(SND_LIB_MINOR > $alsa_min_minor_version)
exit(0);
# else
# if(SND_LIB_MINOR < $alsa_min_minor_version)
# error not present
# endif
# if(SND_LIB_SUBMINOR < $alsa_min_micro_version)
# error not present
# endif
# endif
# endif
exit(0);
],
[AC_MSG_RESULT(found.)],
[AC_MSG_RESULT(not present.)
ifelse([$3], , [AC_MSG_ERROR(Sufficiently new version of libasound not found.)])
alsa_found=no]
)
AC_LANG_RESTORE
dnl Now that we know that we have the right version, let's see if we have the library and not just the headers.
if test "x$enable_alsatest" = "xyes"; then
AC_CHECK_LIB([asound], [snd_ctl_open],,
[ifelse([$3], , [AC_MSG_ERROR(No linkable libasound was found.)])
alsa_found=no]
)
fi
LDFLAGS="$alsa_save_LDFLAGS"
LIBS="$alsa_save_LIBS"
if test "x$alsa_found" = "xyes" ; then
ifelse([$2], , :, [$2])
else
ALSA_CFLAGS=""
ALSA_LIBS=""
ifelse([$3], , :, [$3])
fi
dnl That should be it. Now just export out symbols:
AC_SUBST(ALSA_CFLAGS)
AC_SUBST(ALSA_LIBS)
])
dnl The following lines were copied from gtk-doc.m4
dnl Usage:
dnl GTK_DOC_CHECK([minimum-gtk-doc-version])
AC_DEFUN([GTK_DOC_CHECK],
[
AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first
AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first
dnl for overriding the documentation installation directory
AC_ARG_WITH(html-dir,
AC_HELP_STRING([--with-html-dir=PATH], [path to installed docs]),,
[with_html_dir='${datadir}/gtk-doc/html'])
HTML_DIR="$with_html_dir"
AC_SUBST(HTML_DIR)
dnl enable/disable documentation building
AC_ARG_ENABLE(gtk-doc,
AC_HELP_STRING([--enable-gtk-doc],
[use gtk-doc to build documentation (default=no)]),,
enable_gtk_doc=no)
have_gtk_doc=no
if test x$enable_gtk_doc = xyes; then
if test -z "$PKG_CONFIG"; then
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
fi
if test "$PKG_CONFIG" != "no" && $PKG_CONFIG --exists gtk-doc; then
have_gtk_doc=yes
fi
dnl do we want to do a version check?
ifelse([$1],[],,
[gtk_doc_min_version=$1
if test "$have_gtk_doc" = yes; then
AC_MSG_CHECKING([gtk-doc version >= $gtk_doc_min_version])
if $PKG_CONFIG --atleast-version $gtk_doc_min_version gtk-doc; then
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
have_gtk_doc=no
fi
fi
])
if test "$have_gtk_doc" != yes; then
enable_gtk_doc=no
fi
fi
AM_CONDITIONAL(ENABLE_GTK_DOC, test x$enable_gtk_doc = xyes)
AM_CONDITIONAL(GTK_DOC_USE_LIBTOOL, test -n "$LIBTOOL")
])

8994
aclocal.m4 vendored

File diff suppressed because it is too large Load Diff

View File

@ -1,312 +1,219 @@
## Process this file with automake to produce Makefile.in
libgimpbase = $(top_builddir)/libgimpbase/libgimpbase-$(GIMP_API_VERSION).la
libgimpcolor = $(top_builddir)/libgimpcolor/libgimpcolor-$(GIMP_API_VERSION).la
libgimpmath = $(top_builddir)/libgimpmath/libgimpmath-$(GIMP_API_VERSION).la
libgimpmodule = $(top_builddir)/libgimpmodule/libgimpmodule-$(GIMP_API_VERSION).la
libgimpwidgets = $(top_builddir)/libgimpwidgets/libgimpwidgets-$(GIMP_API_VERSION).la
libgimpthumb = $(top_builddir)/libgimpthumb/libgimpthumb-$(GIMP_API_VERSION).la
SUBDIRS = \
paint-funcs \
composite \
base \
config \
core \
paint \
text \
vectors \
xcf \
file \
plug-in \
tools \
widgets \
display \
dialogs \
actions \
menus \
gui \
pdb
scriptdata =
bin_PROGRAMS = gimp
if ENABLE_GIMP_CONSOLE
bin_PROGRAMS = gimp-2.2 gimp-console-2.2
else
bin_PROGRAMS = gimp-2.2
endif
app_sources = \
app_procs.c \
app_procs.h \
main.c \
batch.c \
batch.h \
errors.c \
errors.h \
sanity.c \
sanity.h \
units.c \
units.h \
gimp-intl.h
gimp_2_2_SOURCES = $(app_sources)
gimp_SOURCES = \
about_dialog.c \
about_dialog.h \
actionarea.c \
actionarea.h \
airbrush.c \
airbrush.h \
app_procs.c \
app_procs.h \
appenv.h \
asupsample.c \
asupsample.h \
batch.c \
batch.h \
bezier_select.c \
bezier_select.h \
bezier_selectP.h \
blend.c \
blend.h \
boundary.c \
boundary.h \
brightness_contrast.c \
brightness_contrast.h \
brush_header.h \
brush_select.c \
brush_select.h \
brushes.c \
brushes.h \
bucket_fill.c \
bucket_fill.h \
buildmenu.c \
buildmenu.h \
by_color_select.c \
by_color_select.h \
channel.c \
channel.h \
channel_pvt.h \
channel_cmds.c \
channel_cmds.h \
channels_dialog.c \
channels_dialog.h \
channel_ops.c \
channel_ops.h \
clone.c \
clone.h \
color_area.c \
color_area.h \
color_balance.c \
color_balance.h \
color_panel.c \
color_panel.h \
color_picker.c \
color_picker.h \
color_select.c \
color_select.h \
color_transfer.c \
color_transfer.h \
colormaps.c \
colormaps.h \
commands.c \
commands.h \
convert.c \
convert.h \
convolve.c \
convolve.h \
crop.c \
crop.h \
cursorutil.c \
cursorutil.h \
curves.c \
curves.h \
datafiles.c \
datafiles.h \
desaturate.c \
desaturate.h \
dialog_types.h \
disp_callbacks.c \
disp_callbacks.h \
draw_core.c \
draw_core.h \
drawable.c \
drawable.h \
drawable_pvt.h \
drawable_cmds.c \
drawable_cmds.h \
edit_cmds.c \
edit_cmds.h \
edit_selection.c \
edit_selection.h \
ellipse_select.c \
ellipse_select.h \
eraser.c \
eraser.h \
errors.c \
errors.h \
equalize.c \
equalize.h \
fileops.c \
fileops.h \
flip_tool.c \
flip_tool.h \
floating_sel.c \
floating_sel.h \
floating_sel_cmds.c \
floating_sel_cmds.h \
frac.c \
frac.h \
free_select.c \
free_select.h \
fsdither.h \
fuzzy_select.c \
fuzzy_select.h \
gdisplay.c \
gdisplay.h \
gdisplayP.h \
gdisplay_cmds.c \
gdisplay_cmds.h \
gdisplay_ops.c \
gdisplay_ops.h \
general.c \
general.h \
gimage.c \
gimage.h \
gimage_cmds.c \
gimage_cmds.h \
gimage_mask.c \
gimage_mask.h \
gimage_mask_cmds.c \
gimage_mask_cmds.h \
gimprc.c \
gimprc.h \
global_edit.c \
global_edit.h \
gradient.c \
gradient.h \
gximage.c \
gximage.h \
histogram.c \
histogram.h \
histogram_tool.c \
histogram_tool.h \
hue_saturation.c \
hue_saturation.h \
image_map.c \
image_map.h \
image_render.c \
image_render.h \
indexed_palette.c \
indexed_palette.h \
info_dialog.c \
info_dialog.h \
info_window.c \
info_window.h \
install.c \
install.h \
interface.c \
interface.h \
internal_procs.c \
internal_procs.h \
invert.c \
invert.h \
iscissors.c \
iscissors.h \
layer.c \
layer.h \
layer_pvt.h \
layer_cmds.c \
layer_cmds.h \
layer_select.c \
layer_select.h \
layers_dialog.c \
layers_dialog.h \
layers_dialogP.h \
levels.c \
levels.h \
magnify.c \
magnify.h \
main.c \
marching_ants.h \
menus.c \
menus.h \
move.c \
move.h \
ops_buttons.c \
ops_buttons.h \
palette.c \
palette.h \
paint_core.c \
paint_core.h \
paint_funcs.c \
paint_funcs.h \
paintbrush.c \
paintbrush.h \
pattern_header.h \
pattern_select.c \
pattern_select.h \
patterns.c \
patterns.h \
pencil.c \
pencil.h \
perspective_tool.c \
perspective_tool.h \
pixel_region.c \
pixel_region.h \
pixmaps.h \
plug_in.c \
plug_in.h \
posterize.c \
posterize.h \
procedural_db.c \
procedural_db.h \
rect_select.c \
rect_select.h \
rect_selectP.h \
regex.h \
regex.c \
resize.c \
resize.h \
rotate_tool.c \
rotate_tool.h \
scale.c \
scale.h \
scale_tool.c \
scale_tool.h \
scroll.c \
scroll.h \
selection.c \
selection.h \
shear_tool.c \
shear_tool.h \
temp_buf.c \
temp_buf.h \
text_tool.c \
text_tool.h \
threshold.c \
threshold.h \
tile.c \
tile.h \
tile_cache.c \
tile_cache.h \
tile_manager.c \
tile_manager.h \
tile_manager_pvt.h \
tile_swap.c \
tile_swap.h \
tips_dialog.c \
tips_dialog.h \
tools.c \
tools.h \
transform_core.c \
transform_core.h \
transform_tool.c \
transform_tool.h \
undo.c \
undo.h \
undo_cmds.c \
undo_cmds.h \
wilber.h \
xcf.c \
xcf.h
EXTRA_DIST = \
tools/channel.xbm \
tools/eye.xbm \
tools/layer.xbm \
tools/linked.xbm \
tools/mask.xbm \
tools/anchor.xpm \
tools/anchor_is.xpm \
tools/delete.xpm \
tools/delete_is.xpm \
tools/duplicate.xpm \
tools/duplicate_is.xpm \
tools/lower.xpm \
tools/lower_is.xpm \
tools/new.xpm \
tools/new_is.xpm \
tools/raise.xpm \
tools/raise_is.xpm
makefile.msc \
gimp.rc \
fileicon.ico \
wilber.ico
CPPFLAGS = \
-DLIBDIR=\""$(gimpplugindir)"\" \
-DDATADIR=\""$(gimpdatadir)"\" \
-DGIMPDIR=\""$(gimpdir)"\" \
-DREGEX_MALLOC
if HAVE_GLIBC_REGEX
REGEXREPL =
else
REGEXREPL = $(top_builddir)/regexrepl/libregex.a
endif
if OS_WIN32
mwindows = -mwindows
endif
if HAVE_WINDRES
GIMPICONRC = gimprc.o
endif
AM_CPPFLAGS = \
-DG_LOG_DOMAIN=\"Gimp\" \
-DGIMP_APP_GLUE_COMPILATION \
@GIMP_THREAD_FLAGS@ \
@GIMP_MP_FLAGS@
INCLUDES = \
$(X_CFLAGS) \
-I$(top_srcdir) \
-I$(top_srcdir) \
$(GTK_CFLAGS) \
$(PANGOFT2_CFLAGS) \
-I$(includedir)
gimp_LDADD = \
$(top_builddir)/libgimp/libgimpi.a \
$(X_LIBS)
gimp_2_2_LDFLAGS = $(mwindows)
DEPS = \
$(top_builddir)/libgimp/libgimpi.a
gimp_2_2_LDADD = \
gui/libappgui.a \
actions/libappactions.a \
dialogs/libappdialogs.a \
menus/libappmenus.a \
display/libappdisplay.a \
tools/libapptools.a \
widgets/libappwidgets.a \
pdb/libapppdb.a \
vectors/libappvectors.a \
plug-in/libappplug-in.a \
core/libappcore.a \
paint/libapppaint.a \
xcf/libappxcf.a \
text/libapptext.a \
file/libappfile.a \
config/libappconfig.a \
paint-funcs/libapppaint-funcs.a \
composite/libappcomposite.a \
base/libappbase.a \
$(libgimpwidgets) \
$(libgimpmodule) \
$(libgimpcolor) \
$(libgimpthumb) \
$(libgimpmath) \
$(libgimpbase) \
$(REGEXREPL) \
$(GTK_LIBS) \
$(LIBART_LIBS) \
$(PANGOFT2_LIBS) \
$(FONTCONFIG_LIBS) \
$(FREETYPE_LIBS) \
$(GIMP_THREAD_LIBS) \
$(GIMP_MP_LIBS) \
$(RT_LIBS) \
$(INTLLIBS) \
$(GIMPICONRC)
gimp_DEPENDENCIES = $(DEPS)
.PHONY: files
if ENABLE_GIMP_CONSOLE
files:
@files=`ls $(DISTFILES) 2> /dev/null`; for p in $$files; do \
echo $$p; \
done
gimp_console_2_2_SOURCES = $(app_sources)
gimp_console_2_2_CPPFLAGS = \
$(AM_CPPFLAGS) \
-DGIMP_CONSOLE_COMPILATION
gimp_console_2_2_LDFLAGS = $(gimp_2_2_LDFLAGS)
gimp_console_2_2_LDADD = \
widgets/widgets-enums.o \
display/display-enums.o \
display/gimpdisplayoptions.o \
pdb/libapppdb.a \
vectors/libappvectors.a \
plug-in/libappplug-in.a \
core/libappcore.a \
paint/libapppaint.a \
xcf/libappxcf.a \
text/libapptext.a \
file/libappfile.a \
config/libappconfig.a \
paint-funcs/libapppaint-funcs.a \
composite/libappcomposite.a \
base/libappbase.a \
$(libgimpmodule) \
$(libgimpcolor) \
$(libgimpthumb) \
$(libgimpmath) \
$(libgimpbase) \
$(REGEXREPL) \
$(GDK_PIXBUF_LIBS) \
$(LIBART_LIBS) \
$(PANGOFT2_LIBS) \
$(FONTCONFIG_LIBS) \
$(FREETYPE_LIBS) \
$(GIMP_THREAD_LIBS) \
$(GIMP_MP_LIBS) \
$(RT_LIBS) \
$(INTLLIBS) \
$(GIMPICONRC)
endif
install-exec-hook:
if DEFAULT_BINARY
cd $(DESTDIR)$(bindir) \
&& rm -f gimp$(EXEEXT) \
&& $(LN_S) gimp-$(GIMP_APP_VERSION)$(EXEEXT) gimp$(EXEEXT)
if ENABLE_GIMP_CONSOLE
cd $(DESTDIR)$(bindir) \
&& rm -f gimp-console$(EXEEXT) \
&& $(LN_S) gimp-console-$(GIMP_APP_VERSION)$(EXEEXT) gimp-console$(EXEEXT)
endif
endif
uninstall-local:
if DEFAULT_BINARY
rm -f $(DESTDIR)$(bindir)/gimp$(EXEEXT)
if ENABLE_GIMP_CONSOLE
rm -f $(DESTDIR)$(bindir)/gimp-console$(EXEEXT)
endif
endif
# require gimp-console when making dist
#
if ENABLE_GIMP_CONSOLE
dist-check-gimp-console:
else
dist-check-gimp-console:
@echo "*** gimp-console must be enabled in order to make dist"
@false
endif
# hook to assure that the system gimprc and the gimprc manpage are
# uptodate when a release is made
#
dist-dump-gimprc: gimp-console-$(GIMP_APP_VERSION)$(EXEEXT)
./$< --dump-gimprc-system > $(top_srcdir)/etc/gimprc
./$< --dump-gimprc-manpage > $(top_srcdir)/docs/gimprc.5.in
dist-hook: dist-check-gimp-console dist-dump-gimprc
gimprc.o:
$(WINDRES) gimp.rc gimprc.o

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +0,0 @@
convert to using gtk+
remove traces of autodialog
remove traces of action areas
remove use of mem chunks from memutils.[ch]
remove use of xmalloc and xfree (use g_malloc and g_free instead)

View File

@ -1,523 +0,0 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <gtk/gtk.h>
#include "libgimp/gimpfeatures.h"
#include "about_dialog.h"
#include "interface.h"
#include "config.h"
#define ANIMATION_STEPS 16
#define ANIMATION_SIZE 2
static int about_dialog_load_logo (GtkWidget *window);
static void about_dialog_destroy (void);
static void about_dialog_unmap (void);
static int about_dialog_logo_expose (GtkWidget *widget, GdkEventExpose *event);
static int about_dialog_button (GtkWidget *widget, GdkEventButton *event);
static int about_dialog_timer (gpointer data);
static GtkWidget *about_dialog = NULL;
static GtkWidget *logo_area = NULL;
static GtkWidget *scroll_area = NULL;
static GdkPixmap *logo_pixmap = NULL;
static GdkPixmap *scroll_pixmap = NULL;
static unsigned char *dissolve_map = NULL;
static int dissolve_width;
static int dissolve_height;
static int logo_width = 0;
static int logo_height = 0;
static int do_animation = 0;
static int do_scrolling = 0;
static int scroll_state = 0;
static int frame = 0;
static int offset = 0;
static int timer = 0;
static char *scroll_text[] =
{
"Lauri Alanko",
"Shawn Amundson",
"John Beale",
"Zach Beane",
"Tom Bech",
"Marc Bless",
"Edward Blevins",
"Roberto Boyd",
"Seth Burgess",
"Brent Burton",
"Francisco Bustamante",
"Ed Connel",
"Andreas Dilger",
"Misha Dynin",
"Larry Ewing",
"David Forsyth",
"Jim Geuther",
"Scott Goehring",
"Heiko Goller",
"Michael Hammel",
"Christoph Hoegl",
"Jan Hubicka",
"Simon Janes",
"Tim Janik",
"Tuomas Kuosmanen",
"Peter Kirchgessner",
"Nick Lamb",
"Karl LaRocca",
"Jens Lautenbacher",
"Laramie Leavitt",
"Elliot Lee",
"Raph Levien",
"Adrian Likins",
"Ingo Luetkebohle",
"Josh MacDonald",
"Ed Mackey",
"Marcelo Malheiros",
"Ian Main",
"Torsten Martinsen",
"Federico Mena",
"Adam D. Moss",
"Shuji Narazaki",
"Sven Neumann",
"Stephen Robert Norris",
"Erik Nygren",
"Miles O'Neal",
"Jay Painter",
"Mike Phillips",
"Raphael Quinet",
"James Robinson",
"Mike Schaeffer",
"Tracy Scott",
"Manish Singh",
"Nathan Summers",
"Mike Sweet",
"Eiichi Takamori",
"Tristan Tarrant",
"Owen Taylor",
"Ian Tester",
"Andy Thomas",
"James Wang",
"Kris Wehner",
"Matthew Wilson",
};
static int nscroll_texts = sizeof (scroll_text) / sizeof (scroll_text[0]);
static int scroll_text_widths[100] = { 0 };
static int cur_scroll_text = 0;
static int cur_scroll_index = 0;
static int shuffle_array[ sizeof(scroll_text) / sizeof(scroll_text[0]) ];
void
about_dialog_create (int timeout)
{
GtkStyle *style;
GtkWidget *vbox;
GtkWidget *aboutframe;
GtkWidget *label;
GtkWidget *alignment;
gint max_width;
gint i;
if (!about_dialog)
{
about_dialog = gtk_window_new (GTK_WINDOW_DIALOG);
gtk_window_set_wmclass (GTK_WINDOW (about_dialog), "about_dialog", "Gimp");
gtk_window_set_title (GTK_WINDOW (about_dialog), "About the GIMP");
gtk_window_set_policy (GTK_WINDOW (about_dialog), FALSE, FALSE, FALSE);
gtk_window_position (GTK_WINDOW (about_dialog), GTK_WIN_POS_CENTER);
gtk_signal_connect (GTK_OBJECT (about_dialog), "destroy",
(GtkSignalFunc) about_dialog_destroy, NULL);
gtk_signal_connect (GTK_OBJECT (about_dialog), "unmap_event",
(GtkSignalFunc) about_dialog_unmap, NULL);
gtk_signal_connect (GTK_OBJECT (about_dialog), "button_press_event",
(GtkSignalFunc) about_dialog_button, NULL);
gtk_widget_set_events (about_dialog, GDK_BUTTON_PRESS_MASK);
if (!about_dialog_load_logo (about_dialog))
{
gtk_widget_destroy (about_dialog);
about_dialog = NULL;
return;
}
vbox = gtk_vbox_new (FALSE, 1);
gtk_container_border_width (GTK_CONTAINER (vbox), 1);
gtk_container_add (GTK_CONTAINER (about_dialog), vbox);
gtk_widget_show (vbox);
aboutframe = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (aboutframe), GTK_SHADOW_IN);
gtk_container_border_width (GTK_CONTAINER (aboutframe), 0);
gtk_box_pack_start (GTK_BOX (vbox), aboutframe, TRUE, TRUE, 0);
gtk_widget_show (aboutframe);
logo_area = gtk_drawing_area_new ();
gtk_signal_connect (GTK_OBJECT (logo_area), "expose_event",
(GtkSignalFunc) about_dialog_logo_expose, NULL);
gtk_drawing_area_size (GTK_DRAWING_AREA (logo_area), logo_width, logo_height);
gtk_widget_set_events (logo_area, GDK_EXPOSURE_MASK);
gtk_container_add (GTK_CONTAINER (aboutframe), logo_area);
gtk_widget_show (logo_area);
gtk_widget_realize (logo_area);
gdk_window_set_background (logo_area->window, &logo_area->style->black);
style = gtk_style_new ();
gdk_font_unref (style->font);
style->font = gdk_font_load ("-Adobe-Helvetica-Medium-R-Normal--*-140-*-*-*-*-*-*");
gtk_widget_push_style (style);
label = gtk_label_new ("Version " GIMP_VERSION " brought to you by");
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, TRUE, 0);
gtk_widget_show (label);
label = gtk_label_new ("Spencer Kimball and Peter Mattis");
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, TRUE, 0);
gtk_widget_show (label);
gtk_widget_pop_style ();
alignment = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
gtk_box_pack_start (GTK_BOX (vbox), alignment, FALSE, TRUE, 0);
gtk_widget_show (alignment);
aboutframe = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (aboutframe), GTK_SHADOW_IN);
gtk_container_border_width (GTK_CONTAINER (aboutframe), 0);
gtk_container_add (GTK_CONTAINER (alignment), aboutframe);
gtk_widget_show (aboutframe);
max_width = 0;
for (i = 0; i < nscroll_texts; i++)
{
scroll_text_widths[i] = gdk_string_width (aboutframe->style->font, scroll_text[i]);
max_width = MAX (max_width, scroll_text_widths[i]);
}
scroll_area = gtk_drawing_area_new ();
gtk_drawing_area_size (GTK_DRAWING_AREA (scroll_area),
max_width + 10,
aboutframe->style->font->ascent +
aboutframe->style->font->descent);
gtk_widget_set_events (scroll_area, GDK_BUTTON_PRESS_MASK);
gtk_container_add (GTK_CONTAINER (aboutframe), scroll_area);
gtk_widget_show (scroll_area);
label = gtk_label_new ("Please visit http://www.gimp.org/ for more info");
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, TRUE, 0);
gtk_widget_show (label);
gtk_widget_realize (scroll_area);
gdk_window_set_background (scroll_area->window, &scroll_area->style->white);
}
if (!GTK_WIDGET_VISIBLE (about_dialog))
{
gtk_widget_show (about_dialog);
do_animation = TRUE;
do_scrolling = FALSE;
scroll_state = 0;
frame = 0;
offset = 0;
for (i = 0; i < nscroll_texts; i++)
{
shuffle_array[i] = i;
}
for (i = 0; i < nscroll_texts; i++)
{
int j, k;
j = rand() % nscroll_texts;
k = rand() % nscroll_texts;
if (j != k)
{
int t;
t = shuffle_array[j];
shuffle_array[j] = shuffle_array[k];
shuffle_array[k] = t;
}
}
}
else
{
gdk_window_raise(about_dialog->window);
}
}
static int
about_dialog_load_logo (GtkWidget *window)
{
GtkWidget *preview;
GdkGC *gc;
char buf[1024];
unsigned char *pixelrow;
FILE *fp;
int count;
int i, j, k;
if (logo_pixmap)
return TRUE;
sprintf (buf, "%s/gimp_logo.ppm", DATADIR);
fp = fopen (buf, "rb");
if (!fp)
return 0;
fgets (buf, 1024, fp);
if (strcmp (buf, "P6\n") != 0)
{
fclose (fp);
return 0;
}
fgets (buf, 1024, fp);
fgets (buf, 1024, fp);
sscanf (buf, "%d %d", &logo_width, &logo_height);
fgets (buf, 1024, fp);
if (strcmp (buf, "255\n") != 0)
{
fclose (fp);
return 0;
}
preview = gtk_preview_new (GTK_PREVIEW_COLOR);
gtk_preview_size (GTK_PREVIEW (preview), logo_width, logo_height);
pixelrow = g_new (guchar, logo_width * 3);
for (i = 0; i < logo_height; i++)
{
count = fread (pixelrow, sizeof (unsigned char), logo_width * 3, fp);
if (count != (logo_width * 3))
{
gtk_widget_destroy (preview);
g_free (pixelrow);
fclose (fp);
return 0;
}
gtk_preview_draw_row (GTK_PREVIEW (preview), pixelrow, 0, i, logo_width);
}
gtk_widget_realize (window);
logo_pixmap = gdk_pixmap_new (window->window, logo_width, logo_height,
gtk_preview_get_visual ()->depth);
gc = gdk_gc_new (logo_pixmap);
gtk_preview_put (GTK_PREVIEW (preview),
logo_pixmap, gc,
0, 0, 0, 0, logo_width, logo_height);
gdk_gc_destroy (gc);
gtk_widget_unref (preview);
g_free (pixelrow);
fclose (fp);
dissolve_width = (logo_width / ANIMATION_SIZE)+(logo_width % ANIMATION_SIZE ==0 ?0 : 1);
dissolve_height = (logo_height / ANIMATION_SIZE)+(logo_height % ANIMATION_SIZE ==0 ?0 : 1);
dissolve_map = g_new (guchar, dissolve_width * dissolve_height);
srand (time (NULL));
for (i = 0, k = 0; i < dissolve_height; i++)
for (j = 0; j < dissolve_width; j++, k++)
dissolve_map[k] = rand () % ANIMATION_STEPS;
return TRUE;
}
static void
about_dialog_destroy ()
{
about_dialog = NULL;
about_dialog_unmap ();
}
static void
about_dialog_unmap ()
{
if (timer)
{
gtk_timeout_remove (timer);
timer = 0;
}
}
static int
about_dialog_logo_expose (GtkWidget *widget,
GdkEventExpose *event)
{
if (do_animation)
{
if (!timer)
{
about_dialog_timer (widget);
timer = gtk_timeout_add (75, about_dialog_timer, NULL);
}
}
else
{
/* If we draw beyond the boundaries of the pixmap, then X
will generate an expose area for those areas, starting
an infinite cycle. We now set allow_grow = FALSE, so
the drawing area can never be bigger than the preview.
Otherwise, it would be necessary to intersect event->area
with the pixmap boundary rectangle. */
gdk_draw_pixmap (widget->window,
widget->style->black_gc,
logo_pixmap,
event->area.x, event->area.y,
event->area.x, event->area.y,
event->area.width, event->area.height);
}
return FALSE;
}
static int
about_dialog_button (GtkWidget *widget,
GdkEventButton *event)
{
if (timer)
gtk_timeout_remove (timer);
timer = 0;
frame = 0;
gtk_widget_hide (about_dialog);
return FALSE;
}
static int
about_dialog_timer (gpointer data)
{
gint i, j, k;
gint return_val;
return_val = TRUE;
if (do_animation)
{
if(logo_area->allocation.width != 1)
{
for (i = 0, k = 0; i < dissolve_height; i++)
for (j = 0; j < dissolve_width; j++, k++)
if (frame == dissolve_map[k])
{
gdk_draw_pixmap (logo_area->window,
logo_area->style->black_gc,
logo_pixmap,
j * ANIMATION_SIZE, i * ANIMATION_SIZE, j * ANIMATION_SIZE, i * ANIMATION_SIZE,
ANIMATION_SIZE, ANIMATION_SIZE);
}
frame += 1;
if (frame == ANIMATION_STEPS)
{
do_animation = FALSE;
do_scrolling = TRUE;
frame = 0;
timer = gtk_timeout_add (75, about_dialog_timer, NULL);
return FALSE;
}
}
}
if (do_scrolling)
{
if (!scroll_pixmap)
scroll_pixmap = gdk_pixmap_new (scroll_area->window,
scroll_area->allocation.width,
scroll_area->allocation.height,
-1);
switch (scroll_state)
{
case 1:
scroll_state = 2;
timer = gtk_timeout_add (700, about_dialog_timer, NULL);
return_val = FALSE;
break;
case 2:
scroll_state = 3;
timer = gtk_timeout_add (75, about_dialog_timer, NULL);
return_val = FALSE;
break;
}
if (offset > (scroll_text_widths[cur_scroll_text] + scroll_area->allocation.width))
{
scroll_state = 0;
cur_scroll_index += 1;
if (cur_scroll_index == nscroll_texts)
cur_scroll_index = 0;
cur_scroll_text = shuffle_array[cur_scroll_index];
offset = 0;
}
gdk_draw_rectangle (scroll_pixmap,
scroll_area->style->white_gc,
TRUE, 0, 0,
scroll_area->allocation.width,
scroll_area->allocation.height);
gdk_draw_string (scroll_pixmap,
scroll_area->style->font,
scroll_area->style->black_gc,
scroll_area->allocation.width - offset,
scroll_area->style->font->ascent,
scroll_text[cur_scroll_text]);
gdk_draw_pixmap (scroll_area->window,
scroll_area->style->black_gc,
scroll_pixmap, 0, 0, 0, 0,
scroll_area->allocation.width,
scroll_area->allocation.height);
offset += 15;
if (scroll_state == 0)
{
if (offset > ((scroll_area->allocation.width + scroll_text_widths[cur_scroll_text]) / 2))
{
scroll_state = 1;
offset = (scroll_area->allocation.width + scroll_text_widths[cur_scroll_text]) / 2;
}
}
}
return return_val;
}

View File

@ -1,8 +0,0 @@
#ifndef __ABOUT_DIALOG_H__
#define __ABOUT_DIALOG_H__
void about_dialog_create (int timeout);
#endif /* __ABOUT_DIALOG_H__ */

View File

@ -1,49 +0,0 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "appenv.h"
#include "actionarea.h"
void
build_action_area (GtkDialog * dlg,
ActionAreaItem * actions,
int num_actions,
int default_action)
{
GtkWidget *button;
int i;
gtk_container_border_width (GTK_CONTAINER (dlg->action_area), 2);
for (i = 0; i < num_actions; i++)
{
button = gtk_button_new_with_label (actions[i].label);
GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
gtk_box_pack_start (GTK_BOX (dlg->action_area), button, TRUE, TRUE, 0);
if (actions[i].callback)
gtk_signal_connect (GTK_OBJECT (button), "clicked",
(GtkSignalFunc) actions[i].callback,
actions[i].user_data);
if (default_action == i)
gtk_widget_grab_default (button);
gtk_widget_show (button);
actions[i].widget = button;
}
}

View File

@ -1,37 +0,0 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __ACTIONAREA_H__
#define __ACTIONAREA_H__
typedef void (*ActionCallback) (GtkWidget *, gpointer);
typedef struct {
char *label;
ActionCallback callback;
gpointer user_data;
GtkWidget *widget;
} ActionAreaItem;
void build_action_area (GtkDialog * dlg,
ActionAreaItem * actions,
int num_actions,
int default_action);
#endif /* __ACTIONAREA_H__ */

152
app/actions/Makefile.am Normal file
View File

@ -0,0 +1,152 @@
## Process this file with automake to produce Makefile.in
noinst_LIBRARIES = libappactions.a
libappactions_a_SOURCES = \
actions-types.h \
actions.c \
actions.h \
\
brushes-actions.c \
brushes-actions.h \
buffers-actions.c \
buffers-actions.h \
buffers-commands.c \
buffers-commands.h \
channels-actions.c \
channels-actions.h \
channels-commands.c \
channels-commands.h \
colormap-editor-actions.c \
colormap-editor-actions.h \
colormap-editor-commands.c \
colormap-editor-commands.h \
context-actions.c \
context-actions.h \
context-commands.c \
context-commands.h \
data-commands.c \
data-commands.h \
debug-actions.c \
debug-actions.h \
debug-commands.c \
debug-commands.h \
dialogs-actions.c \
dialogs-actions.h \
dialogs-commands.c \
dialogs-commands.h \
dockable-actions.c \
dockable-actions.h \
dockable-commands.c \
dockable-commands.h \
documents-actions.c \
documents-actions.h \
documents-commands.c \
documents-commands.h \
drawable-actions.c \
drawable-actions.h \
drawable-commands.c \
drawable-commands.h \
edit-actions.c \
edit-actions.h \
edit-commands.c \
edit-commands.h \
error-console-actions.c \
error-console-actions.h \
error-console-commands.c \
error-console-commands.h \
file-actions.c \
file-actions.h \
file-commands.c \
file-commands.h \
fonts-actions.c \
fonts-actions.h \
fonts-commands.c \
fonts-commands.h \
gradient-editor-actions.c \
gradient-editor-actions.h \
gradient-editor-commands.c \
gradient-editor-commands.h \
gradients-actions.c \
gradients-actions.h \
gradients-commands.c \
gradients-commands.h \
help-actions.c \
help-actions.h \
help-commands.c \
help-commands.h \
image-actions.c \
image-actions.h \
image-commands.c \
image-commands.h \
images-actions.c \
images-actions.h \
images-commands.c \
images-commands.h \
layers-actions.c \
layers-actions.h \
layers-commands.c \
layers-commands.h \
palette-editor-actions.c \
palette-editor-actions.h \
palette-editor-commands.c \
palette-editor-commands.h \
palettes-actions.c \
palettes-actions.h \
palettes-commands.c \
palettes-commands.h \
patterns-actions.c \
patterns-actions.h \
plug-in-actions.c \
plug-in-actions.h \
plug-in-commands.c \
plug-in-commands.h \
qmask-actions.c \
qmask-actions.h \
qmask-commands.c \
qmask-commands.h \
select-actions.c \
select-actions.h \
select-commands.c \
select-commands.h \
templates-actions.c \
templates-actions.h \
templates-commands.c \
templates-commands.h \
text-editor-actions.c \
text-editor-actions.h \
text-editor-commands.c \
text-editor-commands.h \
tool-options-actions.c \
tool-options-actions.h \
tool-options-commands.c \
tool-options-commands.h \
tools-actions.c \
tools-actions.h \
tools-commands.c \
tools-commands.h \
vectors-actions.c \
vectors-actions.h \
vectors-commands.c \
vectors-commands.h \
view-actions.c \
view-actions.h \
view-commands.c \
view-commands.h
EXTRA_DIST = \
makefile.msc
AM_CPPFLAGS = \
-DG_LOG_DOMAIN=\"Gimp-Actions\" \
@GIMP_THREAD_FLAGS@ \
@GIMP_MP_FLAGS@
INCLUDES = \
-I$(top_builddir) \
-I$(top_srcdir) \
-I$(top_builddir)/app \
-I$(top_srcdir)/app \
$(GTK_CFLAGS) \
-I$(includedir)

953
app/actions/Makefile.in Normal file
View File

@ -0,0 +1,953 @@
# Makefile.in generated by automake 1.7.9 from Makefile.am.
# @configure_input@
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
# Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ../..
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
host_triplet = @host@
AA = @AA@
ACLOCAL = @ACLOCAL@
ALLOCA = @ALLOCA@
ALSA_CFLAGS = @ALSA_CFLAGS@
ALSA_LIBS = @ALSA_LIBS@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
AR = @AR@
AS = @AS@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BUILD_HELPBROWSER_FALSE = @BUILD_HELPBROWSER_FALSE@
BUILD_HELPBROWSER_TRUE = @BUILD_HELPBROWSER_TRUE@
BUILD_PRINT_FALSE = @BUILD_PRINT_FALSE@
BUILD_PRINT_TRUE = @BUILD_PRINT_TRUE@
BUILD_PYTHON_FALSE = @BUILD_PYTHON_FALSE@
BUILD_PYTHON_TRUE = @BUILD_PYTHON_TRUE@
BUILD_XJT_FALSE = @BUILD_XJT_FALSE@
BUILD_XJT_TRUE = @BUILD_XJT_TRUE@
CATALOGS = @CATALOGS@
CATOBJEXT = @CATOBJEXT@
CC = @CC@
CCAS = @CCAS@
CCASFLAGS = @CCASFLAGS@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DATADIRNAME = @DATADIRNAME@
DEFAULT_BINARY_FALSE = @DEFAULT_BINARY_FALSE@
DEFAULT_BINARY_TRUE = @DEFAULT_BINARY_TRUE@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DESKTOP_DATADIR = @DESKTOP_DATADIR@
DESKTOP_DATADIR_FALSE = @DESKTOP_DATADIR_FALSE@
DESKTOP_DATADIR_TRUE = @DESKTOP_DATADIR_TRUE@
DLLTOOL = @DLLTOOL@
ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
ENABLE_GIMP_CONSOLE_FALSE = @ENABLE_GIMP_CONSOLE_FALSE@
ENABLE_GIMP_CONSOLE_TRUE = @ENABLE_GIMP_CONSOLE_TRUE@
ENABLE_GTK_DOC_FALSE = @ENABLE_GTK_DOC_FALSE@
ENABLE_GTK_DOC_TRUE = @ENABLE_GTK_DOC_TRUE@
EXEEXT = @EXEEXT@
EXIF_CFLAGS = @EXIF_CFLAGS@
EXIF_LIBS = @EXIF_LIBS@
F77 = @F77@
FFLAGS = @FFLAGS@
FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@
FONTCONFIG_LIBS = @FONTCONFIG_LIBS@
FONTCONFIG_REQUIRED_VERSION = @FONTCONFIG_REQUIRED_VERSION@
FREETYPE_CONFIG = @FREETYPE_CONFIG@
FREETYPE_LIBS = @FREETYPE_LIBS@
GDK_PIXBUF_CFLAGS = @GDK_PIXBUF_CFLAGS@
GDK_PIXBUF_CSOURCE = @GDK_PIXBUF_CSOURCE@
GDK_PIXBUF_LIBS = @GDK_PIXBUF_LIBS@
GDK_PIXBUF_REQUIRED_VERSION = @GDK_PIXBUF_REQUIRED_VERSION@
GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
GIMPINSTALL = @GIMPINSTALL@
GIMPPRINT_CFLAGS = @GIMPPRINT_CFLAGS@
GIMPPRINT_CONFIG = @GIMPPRINT_CONFIG@
GIMPPRINT_LIBS = @GIMPPRINT_LIBS@
GIMPPRINT_REQUIRED_VERSION = @GIMPPRINT_REQUIRED_VERSION@
GIMPPRINT_TOONEW_VERSION = @GIMPPRINT_TOONEW_VERSION@
GIMP_API_VERSION = @GIMP_API_VERSION@
GIMP_APP_VERSION = @GIMP_APP_VERSION@
GIMP_BINARY_AGE = @GIMP_BINARY_AGE@
GIMP_DATA_VERSION = @GIMP_DATA_VERSION@
GIMP_DESKTOP_ICON = @GIMP_DESKTOP_ICON@
GIMP_FULL_NAME = @GIMP_FULL_NAME@
GIMP_INTERFACE_AGE = @GIMP_INTERFACE_AGE@
GIMP_MAJOR_VERSION = @GIMP_MAJOR_VERSION@
GIMP_MICRO_VERSION = @GIMP_MICRO_VERSION@
GIMP_MINOR_VERSION = @GIMP_MINOR_VERSION@
GIMP_MKENUMS = @GIMP_MKENUMS@
GIMP_MODULES = @GIMP_MODULES@
GIMP_MP_FLAGS = @GIMP_MP_FLAGS@
GIMP_MP_LIBS = @GIMP_MP_LIBS@
GIMP_PKGCONFIG_VERSION = @GIMP_PKGCONFIG_VERSION@
GIMP_PLUGINS = @GIMP_PLUGINS@
GIMP_PLUGIN_VERSION = @GIMP_PLUGIN_VERSION@
GIMP_REAL_VERSION = @GIMP_REAL_VERSION@
GIMP_REMOTE = @GIMP_REMOTE@
GIMP_SYSCONF_VERSION = @GIMP_SYSCONF_VERSION@
GIMP_THREAD_FLAGS = @GIMP_THREAD_FLAGS@
GIMP_THREAD_LIBS = @GIMP_THREAD_LIBS@
GIMP_TOOL_VERSION = @GIMP_TOOL_VERSION@
GIMP_UNSTABLE = @GIMP_UNSTABLE@
GIMP_USER_VERSION = @GIMP_USER_VERSION@
GIMP_VERSION = @GIMP_VERSION@
GLIB_CFLAGS = @GLIB_CFLAGS@
GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
GLIB_LIBS = @GLIB_LIBS@
GLIB_MKENUMS = @GLIB_MKENUMS@
GLIB_REQUIRED_VERSION = @GLIB_REQUIRED_VERSION@
GMODULE_CFLAGS = @GMODULE_CFLAGS@
GMODULE_LIBS = @GMODULE_LIBS@
GMOFILES = @GMOFILES@
GMSGFMT = @GMSGFMT@
GOBJECT_QUERY = @GOBJECT_QUERY@
GTKDOC_REQUIRED_VERSION = @GTKDOC_REQUIRED_VERSION@
GTKHTML2_CFLAGS = @GTKHTML2_CFLAGS@
GTKHTML2_LIBS = @GTKHTML2_LIBS@
GTKHTML2_REQUIRED_VERSION = @GTKHTML2_REQUIRED_VERSION@
GTK_CFLAGS = @GTK_CFLAGS@
GTK_DOC_USE_LIBTOOL_FALSE = @GTK_DOC_USE_LIBTOOL_FALSE@
GTK_DOC_USE_LIBTOOL_TRUE = @GTK_DOC_USE_LIBTOOL_TRUE@
GTK_LIBS = @GTK_LIBS@
GTK_REQUIRED_VERSION = @GTK_REQUIRED_VERSION@
HAVE_FINITE = @HAVE_FINITE@
HAVE_GLIBC_REGEX = @HAVE_GLIBC_REGEX@
HAVE_GLIBC_REGEX_FALSE = @HAVE_GLIBC_REGEX_FALSE@
HAVE_GLIBC_REGEX_TRUE = @HAVE_GLIBC_REGEX_TRUE@
HAVE_ISFINITE = @HAVE_ISFINITE@
HAVE_LCMS_FALSE = @HAVE_LCMS_FALSE@
HAVE_LCMS_TRUE = @HAVE_LCMS_TRUE@
HAVE_LINUX_INPUT_FALSE = @HAVE_LINUX_INPUT_FALSE@
HAVE_LINUX_INPUT_TRUE = @HAVE_LINUX_INPUT_TRUE@
HAVE_MAC_TWAIN_FALSE = @HAVE_MAC_TWAIN_FALSE@
HAVE_MAC_TWAIN_TRUE = @HAVE_MAC_TWAIN_TRUE@
HAVE_WINDRES_FALSE = @HAVE_WINDRES_FALSE@
HAVE_WINDRES_TRUE = @HAVE_WINDRES_TRUE@
HAVE_XMLLINT_FALSE = @HAVE_XMLLINT_FALSE@
HAVE_XMLLINT_TRUE = @HAVE_XMLLINT_TRUE@
HAVE_XSLTPROC_FALSE = @HAVE_XSLTPROC_FALSE@
HAVE_XSLTPROC_TRUE = @HAVE_XSLTPROC_TRUE@
HTML_DIR = @HTML_DIR@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
INSTOBJEXT = @INSTOBJEXT@
INTLLIBS = @INTLLIBS@
INTLTOOL_CAVES_RULE = @INTLTOOL_CAVES_RULE@
INTLTOOL_DESKTOP_RULE = @INTLTOOL_DESKTOP_RULE@
INTLTOOL_DIRECTORY_RULE = @INTLTOOL_DIRECTORY_RULE@
INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@
INTLTOOL_ICONV = @INTLTOOL_ICONV@
INTLTOOL_KBD_RULE = @INTLTOOL_KBD_RULE@
INTLTOOL_KEYS_RULE = @INTLTOOL_KEYS_RULE@
INTLTOOL_MERGE = @INTLTOOL_MERGE@
INTLTOOL_MSGFMT = @INTLTOOL_MSGFMT@
INTLTOOL_MSGMERGE = @INTLTOOL_MSGMERGE@
INTLTOOL_OAF_RULE = @INTLTOOL_OAF_RULE@
INTLTOOL_PERL = @INTLTOOL_PERL@
INTLTOOL_PONG_RULE = @INTLTOOL_PONG_RULE@
INTLTOOL_PROP_RULE = @INTLTOOL_PROP_RULE@
INTLTOOL_SCHEMAS_RULE = @INTLTOOL_SCHEMAS_RULE@
INTLTOOL_SERVER_RULE = @INTLTOOL_SERVER_RULE@
INTLTOOL_SHEET_RULE = @INTLTOOL_SHEET_RULE@
INTLTOOL_SOUNDLIST_RULE = @INTLTOOL_SOUNDLIST_RULE@
INTLTOOL_THEME_RULE = @INTLTOOL_THEME_RULE@
INTLTOOL_UI_RULE = @INTLTOOL_UI_RULE@
INTLTOOL_UPDATE = @INTLTOOL_UPDATE@
INTLTOOL_XAM_RULE = @INTLTOOL_XAM_RULE@
INTLTOOL_XGETTEXT = @INTLTOOL_XGETTEXT@
INTLTOOL_XML_NOMERGE_RULE = @INTLTOOL_XML_NOMERGE_RULE@
INTLTOOL_XML_RULE = @INTLTOOL_XML_RULE@
JPEG = @JPEG@
LCMS_LIBS = @LCMS_LIBS@
LDFLAGS = @LDFLAGS@
LIBAA = @LIBAA@
LIBART_CFLAGS = @LIBART_CFLAGS@
LIBART_LIBS = @LIBART_LIBS@
LIBJPEG = @LIBJPEG@
LIBMNG = @LIBMNG@
LIBOBJS = @LIBOBJS@
LIBPNG = @LIBPNG@
LIBS = @LIBS@
LIBSCREENSHOT = @LIBSCREENSHOT@
LIBSVG = @LIBSVG@
LIBTIFF = @LIBTIFF@
LIBTOOL = @LIBTOOL@
LIBWMF = @LIBWMF@
LIBXMU = @LIBXMU@
LIBXPM = @LIBXPM@
LIBZ = @LIBZ@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
LT_CURRENT_MINUS_AGE = @LT_CURRENT_MINUS_AGE@
LT_VERSION_INFO = @LT_VERSION_INFO@
MAIL = @MAIL@
MAINT = @MAINT@
MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
MKINSTALLDIRS = @MKINSTALLDIRS@
MNG = @MNG@
MSGFMT = @MSGFMT@
MS_LIB_AVAILABLE_FALSE = @MS_LIB_AVAILABLE_FALSE@
MS_LIB_AVAILABLE_TRUE = @MS_LIB_AVAILABLE_TRUE@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OS_UNIX_FALSE = @OS_UNIX_FALSE@
OS_UNIX_TRUE = @OS_UNIX_TRUE@
OS_WIN32_FALSE = @OS_WIN32_FALSE@
OS_WIN32_TRUE = @OS_WIN32_TRUE@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PANGOFT2_CFLAGS = @PANGOFT2_CFLAGS@
PANGOFT2_LIBS = @PANGOFT2_LIBS@
PANGOFT2_REQUIRED_VERSION = @PANGOFT2_REQUIRED_VERSION@
PATHSEP = @PATHSEP@
PATH_SEPARATOR = @PATH_SEPARATOR@
PERL = @PERL@
PKG_CONFIG = @PKG_CONFIG@
PLATFORM_WIN32_FALSE = @PLATFORM_WIN32_FALSE@
PLATFORM_WIN32_TRUE = @PLATFORM_WIN32_TRUE@
PNG = @PNG@
POFILES = @POFILES@
POSUB = @POSUB@
PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@
PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@
PRINT_CFLAGS = @PRINT_CFLAGS@
PRINT_LIBS = @PRINT_LIBS@
PSP = @PSP@
PYGIMP_EXTRA_CFLAGS = @PYGIMP_EXTRA_CFLAGS@
PYGTK_CFLAGS = @PYGTK_CFLAGS@
PYGTK_LIBS = @PYGTK_LIBS@
PYTHON = @PYTHON@
PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
PYTHON_INCLUDES = @PYTHON_INCLUDES@
PYTHON_PLATFORM = @PYTHON_PLATFORM@
PYTHON_PREFIX = @PYTHON_PREFIX@
PYTHON_VERSION = @PYTHON_VERSION@
RANLIB = @RANLIB@
RSVG_REQUIRED_VERSION = @RSVG_REQUIRED_VERSION@
RT_LIBS = @RT_LIBS@
SCREENSHOT = @SCREENSHOT@
SENDMAIL = @SENDMAIL@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
SOCKET_LIBS = @SOCKET_LIBS@
STATICLIBS_FALSE = @STATICLIBS_FALSE@
STATICLIBS_TRUE = @STATICLIBS_TRUE@
STRIP = @STRIP@
SVG = @SVG@
SVG_CFLAGS = @SVG_CFLAGS@
SVG_LIBS = @SVG_LIBS@
SYMPREFIX = @SYMPREFIX@
TIFF = @TIFF@
URL = @URL@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
WINCLIPBOARD = @WINCLIPBOARD@
WINDRES = @WINDRES@
WINPRINT = @WINPRINT@
WITH_PDBGEN_FALSE = @WITH_PDBGEN_FALSE@
WITH_PDBGEN_TRUE = @WITH_PDBGEN_TRUE@
WMF = @WMF@
WMF_CFLAGS = @WMF_CFLAGS@
WMF_CONFIG = @WMF_CONFIG@
WMF_REQUIRED_VERSION = @WMF_REQUIRED_VERSION@
XGETTEXT = @XGETTEXT@
XMLLINT = @XMLLINT@
XPM = @XPM@
XSLTPROC = @XSLTPROC@
X_CFLAGS = @X_CFLAGS@
X_EXTRA_LIBS = @X_EXTRA_LIBS@
X_LIBS = @X_LIBS@
X_PRE_LIBS = @X_PRE_LIBS@
ac_ct_AR = @ac_ct_AR@
ac_ct_AS = @ac_ct_AS@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_DLLTOOL = @ac_ct_DLLTOOL@
ac_ct_F77 = @ac_ct_F77@
ac_ct_OBJDUMP = @ac_ct_OBJDUMP@
ac_ct_RANLIB = @ac_ct_RANLIB@
ac_ct_STRIP = @ac_ct_STRIP@
ac_ct_WINDRES = @ac_ct_WINDRES@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
datadir = @datadir@
exec_prefix = @exec_prefix@
gimpdatadir = @gimpdatadir@
gimpdir = @gimpdir@
gimpplugindir = @gimpplugindir@
gimpsysconfdir = @gimpsysconfdir@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
ms_librarian = @ms_librarian@
oldincludedir = @oldincludedir@
pkgpyexecdir = @pkgpyexecdir@
pkgpythondir = @pkgpythondir@
prefix = @prefix@
program_transform_name = @program_transform_name@
pyexecdir = @pyexecdir@
pythondir = @pythondir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
noinst_LIBRARIES = libappactions.a
libappactions_a_SOURCES = \
actions-types.h \
actions.c \
actions.h \
\
brushes-actions.c \
brushes-actions.h \
buffers-actions.c \
buffers-actions.h \
buffers-commands.c \
buffers-commands.h \
channels-actions.c \
channels-actions.h \
channels-commands.c \
channels-commands.h \
colormap-editor-actions.c \
colormap-editor-actions.h \
colormap-editor-commands.c \
colormap-editor-commands.h \
context-actions.c \
context-actions.h \
context-commands.c \
context-commands.h \
data-commands.c \
data-commands.h \
debug-actions.c \
debug-actions.h \
debug-commands.c \
debug-commands.h \
dialogs-actions.c \
dialogs-actions.h \
dialogs-commands.c \
dialogs-commands.h \
dockable-actions.c \
dockable-actions.h \
dockable-commands.c \
dockable-commands.h \
documents-actions.c \
documents-actions.h \
documents-commands.c \
documents-commands.h \
drawable-actions.c \
drawable-actions.h \
drawable-commands.c \
drawable-commands.h \
edit-actions.c \
edit-actions.h \
edit-commands.c \
edit-commands.h \
error-console-actions.c \
error-console-actions.h \
error-console-commands.c \
error-console-commands.h \
file-actions.c \
file-actions.h \
file-commands.c \
file-commands.h \
fonts-actions.c \
fonts-actions.h \
fonts-commands.c \
fonts-commands.h \
gradient-editor-actions.c \
gradient-editor-actions.h \
gradient-editor-commands.c \
gradient-editor-commands.h \
gradients-actions.c \
gradients-actions.h \
gradients-commands.c \
gradients-commands.h \
help-actions.c \
help-actions.h \
help-commands.c \
help-commands.h \
image-actions.c \
image-actions.h \
image-commands.c \
image-commands.h \
images-actions.c \
images-actions.h \
images-commands.c \
images-commands.h \
layers-actions.c \
layers-actions.h \
layers-commands.c \
layers-commands.h \
palette-editor-actions.c \
palette-editor-actions.h \
palette-editor-commands.c \
palette-editor-commands.h \
palettes-actions.c \
palettes-actions.h \
palettes-commands.c \
palettes-commands.h \
patterns-actions.c \
patterns-actions.h \
plug-in-actions.c \
plug-in-actions.h \
plug-in-commands.c \
plug-in-commands.h \
qmask-actions.c \
qmask-actions.h \
qmask-commands.c \
qmask-commands.h \
select-actions.c \
select-actions.h \
select-commands.c \
select-commands.h \
templates-actions.c \
templates-actions.h \
templates-commands.c \
templates-commands.h \
text-editor-actions.c \
text-editor-actions.h \
text-editor-commands.c \
text-editor-commands.h \
tool-options-actions.c \
tool-options-actions.h \
tool-options-commands.c \
tool-options-commands.h \
tools-actions.c \
tools-actions.h \
tools-commands.c \
tools-commands.h \
vectors-actions.c \
vectors-actions.h \
vectors-commands.c \
vectors-commands.h \
view-actions.c \
view-actions.h \
view-commands.c \
view-commands.h
EXTRA_DIST = \
makefile.msc
AM_CPPFLAGS = \
-DG_LOG_DOMAIN=\"Gimp-Actions\" \
@GIMP_THREAD_FLAGS@ \
@GIMP_MP_FLAGS@
INCLUDES = \
-I$(top_builddir) \
-I$(top_srcdir) \
-I$(top_builddir)/app \
-I$(top_srcdir)/app \
$(GTK_CFLAGS) \
-I$(includedir)
subdir = app/actions
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
LIBRARIES = $(noinst_LIBRARIES)
libappactions_a_AR = $(AR) cru
libappactions_a_LIBADD =
am_libappactions_a_OBJECTS = actions.$(OBJEXT) brushes-actions.$(OBJEXT) \
buffers-actions.$(OBJEXT) buffers-commands.$(OBJEXT) \
channels-actions.$(OBJEXT) channels-commands.$(OBJEXT) \
colormap-editor-actions.$(OBJEXT) \
colormap-editor-commands.$(OBJEXT) context-actions.$(OBJEXT) \
context-commands.$(OBJEXT) data-commands.$(OBJEXT) \
debug-actions.$(OBJEXT) debug-commands.$(OBJEXT) \
dialogs-actions.$(OBJEXT) dialogs-commands.$(OBJEXT) \
dockable-actions.$(OBJEXT) dockable-commands.$(OBJEXT) \
documents-actions.$(OBJEXT) documents-commands.$(OBJEXT) \
drawable-actions.$(OBJEXT) drawable-commands.$(OBJEXT) \
edit-actions.$(OBJEXT) edit-commands.$(OBJEXT) \
error-console-actions.$(OBJEXT) \
error-console-commands.$(OBJEXT) file-actions.$(OBJEXT) \
file-commands.$(OBJEXT) fonts-actions.$(OBJEXT) \
fonts-commands.$(OBJEXT) gradient-editor-actions.$(OBJEXT) \
gradient-editor-commands.$(OBJEXT) gradients-actions.$(OBJEXT) \
gradients-commands.$(OBJEXT) help-actions.$(OBJEXT) \
help-commands.$(OBJEXT) image-actions.$(OBJEXT) \
image-commands.$(OBJEXT) images-actions.$(OBJEXT) \
images-commands.$(OBJEXT) layers-actions.$(OBJEXT) \
layers-commands.$(OBJEXT) palette-editor-actions.$(OBJEXT) \
palette-editor-commands.$(OBJEXT) palettes-actions.$(OBJEXT) \
palettes-commands.$(OBJEXT) patterns-actions.$(OBJEXT) \
plug-in-actions.$(OBJEXT) plug-in-commands.$(OBJEXT) \
qmask-actions.$(OBJEXT) qmask-commands.$(OBJEXT) \
select-actions.$(OBJEXT) select-commands.$(OBJEXT) \
templates-actions.$(OBJEXT) templates-commands.$(OBJEXT) \
text-editor-actions.$(OBJEXT) text-editor-commands.$(OBJEXT) \
tool-options-actions.$(OBJEXT) tool-options-commands.$(OBJEXT) \
tools-actions.$(OBJEXT) tools-commands.$(OBJEXT) \
vectors-actions.$(OBJEXT) vectors-commands.$(OBJEXT) \
view-actions.$(OBJEXT) view-commands.$(OBJEXT)
libappactions_a_OBJECTS = $(am_libappactions_a_OBJECTS)
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/actions.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/brushes-actions.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/buffers-actions.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/buffers-commands.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/channels-actions.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/channels-commands.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/colormap-editor-actions.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/colormap-editor-commands.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/context-actions.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/context-commands.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/data-commands.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/debug-actions.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/debug-commands.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/dialogs-actions.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/dialogs-commands.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/dockable-actions.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/dockable-commands.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/documents-actions.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/documents-commands.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/drawable-actions.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/drawable-commands.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/edit-actions.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/edit-commands.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/error-console-actions.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/error-console-commands.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/file-actions.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/file-commands.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/fonts-actions.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/fonts-commands.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/gradient-editor-actions.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/gradient-editor-commands.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/gradients-actions.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/gradients-commands.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/help-actions.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/help-commands.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/image-actions.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/image-commands.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/images-actions.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/images-commands.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/layers-actions.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/layers-commands.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/palette-editor-actions.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/palette-editor-commands.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/palettes-actions.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/palettes-commands.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/patterns-actions.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/plug-in-actions.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/plug-in-commands.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/qmask-actions.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/qmask-commands.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/select-actions.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/select-commands.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/templates-actions.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/templates-commands.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/text-editor-actions.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/text-editor-commands.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/tool-options-actions.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/tool-options-commands.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/tools-actions.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/tools-commands.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/vectors-actions.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/vectors-commands.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/view-actions.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/view-commands.Po
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \
$(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
DIST_SOURCES = $(libappactions_a_SOURCES)
DIST_COMMON = $(srcdir)/Makefile.in Makefile.am
SOURCES = $(libappactions_a_SOURCES)
all: all-am
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu app/actions/Makefile
Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
clean-noinstLIBRARIES:
-test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
libappactions.a: $(libappactions_a_OBJECTS) $(libappactions_a_DEPENDENCIES)
-rm -f libappactions.a
$(libappactions_a_AR) libappactions.a $(libappactions_a_OBJECTS) $(libappactions_a_LIBADD)
$(RANLIB) libappactions.a
mostlyclean-compile:
-rm -f *.$(OBJEXT) core *.core
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/actions.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/brushes-actions.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/buffers-actions.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/buffers-commands.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/channels-actions.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/channels-commands.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/colormap-editor-actions.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/colormap-editor-commands.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/context-actions.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/context-commands.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/data-commands.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/debug-actions.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/debug-commands.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dialogs-actions.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dialogs-commands.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dockable-actions.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dockable-commands.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/documents-actions.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/documents-commands.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/drawable-actions.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/drawable-commands.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/edit-actions.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/edit-commands.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/error-console-actions.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/error-console-commands.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file-actions.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file-commands.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fonts-actions.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fonts-commands.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gradient-editor-actions.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gradient-editor-commands.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gradients-actions.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gradients-commands.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/help-actions.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/help-commands.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/image-actions.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/image-commands.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/images-actions.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/images-commands.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/layers-actions.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/layers-commands.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/palette-editor-actions.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/palette-editor-commands.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/palettes-actions.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/palettes-commands.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/patterns-actions.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/plug-in-actions.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/plug-in-commands.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qmask-actions.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qmask-commands.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/select-actions.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/select-commands.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/templates-actions.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/templates-commands.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/text-editor-actions.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/text-editor-commands.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tool-options-actions.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tool-options-commands.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tools-actions.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tools-commands.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vectors-actions.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vectors-commands.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/view-actions.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/view-commands.Po@am__quote@
.c.o:
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
@am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
@am__fastdepCC_TRUE@ fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$<
.c.obj:
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
@am__fastdepCC_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
@am__fastdepCC_TRUE@ fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`
.c.lo:
@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
@am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; \
@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
@am__fastdepCC_TRUE@ fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-rm -f libtool
uninstall-info-am:
ETAGS = etags
ETAGSFLAGS =
CTAGS = ctags
CTAGSFLAGS =
tags: TAGS
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
mkid -fID $$unique
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(ETAGS_ARGS)$$tags$$unique" \
|| $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique
ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& cd $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
top_distdir = ../..
distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
list='$(DISTFILES)'; for file in $$list; do \
case $$file in \
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
esac; \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
dir="/$$dir"; \
$(mkinstalldirs) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
if test -d $$d/$$file; then \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(LIBRARIES)
installdirs:
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \
mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-libtool distclean-tags
dvi: dvi-am
dvi-am:
info: info-am
info-am:
install-data-am:
install-exec-am:
install-info: install-info-am
install-man:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-info-am
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
clean-libtool clean-noinstLIBRARIES ctags distclean \
distclean-compile distclean-generic distclean-libtool \
distclean-tags distdir dvi dvi-am info info-am install \
install-am install-data install-data-am install-exec \
install-exec-am install-info install-info-am install-man \
install-strip installcheck installcheck-am installdirs \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-compile mostlyclean-generic mostlyclean-libtool pdf \
pdf-am ps ps-am tags uninstall uninstall-am uninstall-info-am
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

View File

@ -0,0 +1,38 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __ACTIONS_TYPES_H__
#define __ACTIONS_TYPES_H__
#include "tools/tools-types.h"
typedef enum
{
GIMP_ACTION_SELECT_SET = 0,
GIMP_ACTION_SELECT_FIRST = -1,
GIMP_ACTION_SELECT_LAST = -2,
GIMP_ACTION_SELECT_PREVIOUS = -3,
GIMP_ACTION_SELECT_NEXT = -4,
GIMP_ACTION_SELECT_SKIP_PREVIOUS = -5,
GIMP_ACTION_SELECT_SKIP_NEXT = -6
} GimpActionSelectType;
#endif /* __ACTIONS_TYPES_H__ */

459
app/actions/actions.c Normal file
View File

@ -0,0 +1,459 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"
#include "actions-types.h"
#include "config/gimpguiconfig.h"
#include "core/gimp.h"
#include "core/gimpcontainer.h"
#include "core/gimpcontext.h"
#include "core/gimpimage.h"
#include "widgets/gimpactionfactory.h"
#include "widgets/gimpcontainereditor.h"
#include "widgets/gimpcontainerview.h"
#include "widgets/gimpdock.h"
#include "widgets/gimpdockable.h"
#include "widgets/gimpimageeditor.h"
#include "widgets/gimpitemtreeview.h"
#include "display/gimpdisplay.h"
#include "display/gimpdisplayshell.h"
#include "display/gimpnavigationeditor.h"
#include "dialogs/dialogs.h"
#include "brushes-actions.h"
#include "buffers-actions.h"
#include "channels-actions.h"
#include "colormap-editor-actions.h"
#include "context-actions.h"
#include "debug-actions.h"
#include "dialogs-actions.h"
#include "dockable-actions.h"
#include "documents-actions.h"
#include "drawable-actions.h"
#include "edit-actions.h"
#include "error-console-actions.h"
#include "file-actions.h"
#include "fonts-actions.h"
#include "gradient-editor-actions.h"
#include "gradients-actions.h"
#include "help-actions.h"
#include "image-actions.h"
#include "images-actions.h"
#include "layers-actions.h"
#include "palette-editor-actions.h"
#include "palettes-actions.h"
#include "patterns-actions.h"
#include "plug-in-actions.h"
#include "qmask-actions.h"
#include "select-actions.h"
#include "templates-actions.h"
#include "text-editor-actions.h"
#include "tool-options-actions.h"
#include "tools-actions.h"
#include "vectors-actions.h"
#include "view-actions.h"
#include "gimp-intl.h"
/* global variables */
GimpActionFactory *global_action_factory = NULL;
/* private variables */
static GimpActionFactoryEntry action_groups[] =
{
{ "brushes", N_("Brushes"), GIMP_STOCK_BRUSH,
brushes_actions_setup,
brushes_actions_update },
{ "buffers", N_("Buffers"), GIMP_STOCK_BUFFER,
buffers_actions_setup,
buffers_actions_update },
{ "channels", N_("Channels"), GIMP_STOCK_CHANNEL,
channels_actions_setup,
channels_actions_update },
{ "colormap-editor", N_("Colormap Editor"), GIMP_STOCK_INDEXED_PALETTE,
colormap_editor_actions_setup,
colormap_editor_actions_update },
{ "context", N_("Context"), NULL,
context_actions_setup,
context_actions_update },
{ "debug", N_("Debug"), NULL,
debug_actions_setup,
debug_actions_update },
{ "dialogs", N_("Dialogs"), NULL,
dialogs_actions_setup,
dialogs_actions_update },
{ "dockable", N_("Dockable"), NULL,
dockable_actions_setup,
dockable_actions_update },
{ "documents", N_("Document History"), NULL,
documents_actions_setup,
documents_actions_update },
{ "drawable", N_("Drawable"), GIMP_STOCK_LAYER,
drawable_actions_setup,
drawable_actions_update },
{ "edit", N_("Edit"), GIMP_STOCK_EDIT,
edit_actions_setup,
edit_actions_update },
{ "error-console", N_("Error Console"), GIMP_STOCK_WARNING,
error_console_actions_setup,
error_console_actions_update },
{ "file", N_("File"), GTK_STOCK_OPEN,
file_actions_setup,
file_actions_update },
{ "fonts", N_("Fonts"), GIMP_STOCK_FONT,
fonts_actions_setup,
fonts_actions_update },
{ "gradient-editor", N_("Gradient Editor"), GIMP_STOCK_GRADIENT,
gradient_editor_actions_setup,
gradient_editor_actions_update },
{ "gradients", N_("Gradients"), GIMP_STOCK_GRADIENT,
gradients_actions_setup,
gradients_actions_update },
{ "help", N_("Help"), GTK_STOCK_HELP,
help_actions_setup,
help_actions_update },
{ "image", N_("Image"), GIMP_STOCK_IMAGE,
image_actions_setup,
image_actions_update },
{ "images", N_("Images"), GIMP_STOCK_IMAGE,
images_actions_setup,
images_actions_update },
{ "layers", N_("Layers"), GIMP_STOCK_LAYER,
layers_actions_setup,
layers_actions_update },
{ "palette-editor", N_("Palette Editor"), GIMP_STOCK_PALETTE,
palette_editor_actions_setup,
palette_editor_actions_update },
{ "palettes", N_("Palettes"), GIMP_STOCK_PALETTE,
palettes_actions_setup,
palettes_actions_update },
{ "patterns", N_("Patterns"), GIMP_STOCK_PATTERN,
patterns_actions_setup,
patterns_actions_update },
{ "plug-in", N_("Plug-Ins"), GIMP_STOCK_PLUGIN,
plug_in_actions_setup,
plug_in_actions_update },
{ "qmask", N_("QuickMask"), GIMP_STOCK_QMASK_ON,
qmask_actions_setup,
qmask_actions_update },
{ "select", N_("Select"), GIMP_STOCK_SELECTION,
select_actions_setup,
select_actions_update },
{ "templates", N_("Templates"), GIMP_STOCK_TEMPLATE,
templates_actions_setup,
templates_actions_update },
{ "text-editor", N_("Text Editor"), GIMP_STOCK_EDIT,
text_editor_actions_setup,
text_editor_actions_update },
{ "tool-options", N_("Tool Options"), GIMP_STOCK_TOOL_OPTIONS,
tool_options_actions_setup,
tool_options_actions_update },
{ "tools", N_("Tools"), GIMP_STOCK_TOOLS,
tools_actions_setup,
tools_actions_update },
{ "vectors", N_("Paths"), GIMP_STOCK_PATH,
vectors_actions_setup,
vectors_actions_update },
{ "view", N_("View"), GIMP_STOCK_VISIBLE,
view_actions_setup,
view_actions_update }
};
/* public functions */
void
actions_init (Gimp *gimp)
{
GimpGuiConfig *gui_config;
gint i;
g_return_if_fail (GIMP_IS_GIMP (gimp));
g_return_if_fail (global_action_factory == NULL);
gui_config = GIMP_GUI_CONFIG (gimp->config);
global_action_factory = gimp_action_factory_new (gimp,
gui_config->menu_mnemonics);
for (i = 0; i < G_N_ELEMENTS (action_groups); i++)
gimp_action_factory_group_register (global_action_factory,
action_groups[i].identifier,
gettext (action_groups[i].label),
action_groups[i].stock_id,
action_groups[i].setup_func,
action_groups[i].update_func);
}
void
actions_exit (Gimp *gimp)
{
g_return_if_fail (GIMP_IS_GIMP (gimp));
g_return_if_fail (global_action_factory != NULL);
g_return_if_fail (global_action_factory->gimp == gimp);
g_object_unref (global_action_factory);
global_action_factory = NULL;
}
Gimp *
action_data_get_gimp (gpointer data)
{
GimpContext *context = NULL;
if (! data)
return NULL;
if (GIMP_IS_DISPLAY (data))
return ((GimpDisplay *) data)->gimage->gimp;
else if (GIMP_IS_GIMP (data))
return data;
else if (GIMP_IS_DOCK (data))
context = ((GimpDock *) data)->context;
else if (GIMP_IS_ITEM_TREE_VIEW (data))
context = ((GimpItemTreeView *) data)->context;
else if (GIMP_IS_IMAGE_EDITOR (data))
context = ((GimpImageEditor *) data)->context;
else if (GIMP_IS_NAVIGATION_EDITOR (data))
context = ((GimpNavigationEditor *) data)->context;
if (context)
return context->gimp;
return NULL;
}
GimpContext *
action_data_get_context (gpointer data)
{
if (! data)
return NULL;
if (GIMP_IS_DISPLAY (data))
return gimp_get_user_context (((GimpDisplay *) data)->gimage->gimp);
else if (GIMP_IS_GIMP (data))
return gimp_get_user_context (data);
else if (GIMP_IS_DOCK (data))
return ((GimpDock *) data)->context;
else if (GIMP_IS_ITEM_TREE_VIEW (data))
return ((GimpItemTreeView *) data)->context;
else if (GIMP_IS_CONTAINER_VIEW (data))
return gimp_container_view_get_context ((GimpContainerView *) data);
else if (GIMP_IS_CONTAINER_EDITOR (data))
return gimp_container_view_get_context (((GimpContainerEditor *) data)->view);
else if (GIMP_IS_IMAGE_EDITOR (data))
return ((GimpImageEditor *) data)->context;
else if (GIMP_IS_NAVIGATION_EDITOR (data))
return ((GimpNavigationEditor *) data)->context;
return NULL;
}
GimpImage *
action_data_get_image (gpointer data)
{
GimpContext *context = NULL;
if (! data)
return NULL;
if (GIMP_IS_DISPLAY (data))
return ((GimpDisplay *) data)->gimage;
else if (GIMP_IS_GIMP (data))
context = gimp_get_user_context (data);
else if (GIMP_IS_DOCK (data))
context = ((GimpDock *) data)->context;
else if (GIMP_IS_ITEM_TREE_VIEW (data))
return ((GimpItemTreeView *) data)->gimage;
else if (GIMP_IS_IMAGE_EDITOR (data))
return ((GimpImageEditor *) data)->gimage;
else if (GIMP_IS_NAVIGATION_EDITOR (data))
context = ((GimpNavigationEditor *) data)->context;
if (context)
return gimp_context_get_image (context);
return NULL;
}
GimpDisplay *
action_data_get_display (gpointer data)
{
GimpContext *context = NULL;
if (! data)
return NULL;
if (GIMP_IS_DISPLAY (data))
return data;
else if (GIMP_IS_GIMP (data))
context = gimp_get_user_context (data);
else if (GIMP_IS_DOCK (data))
context = ((GimpDock *) data)->context;
else if (GIMP_IS_NAVIGATION_EDITOR (data))
context = ((GimpNavigationEditor *) data)->context;
if (context)
return gimp_context_get_display (context);
return NULL;
}
GtkWidget *
action_data_get_widget (gpointer data)
{
if (! data)
return NULL;
if (GIMP_IS_DISPLAY (data))
return ((GimpDisplay *) data)->shell;
else if (GIMP_IS_GIMP (data))
return dialogs_get_toolbox ();
else if (GTK_IS_WIDGET (data))
return data;
return NULL;
}
gdouble
action_select_value (GimpActionSelectType select_type,
gdouble value,
gdouble min,
gdouble max,
gdouble inc,
gdouble skip_inc,
gboolean wrap)
{
switch (select_type)
{
case GIMP_ACTION_SELECT_FIRST:
value = min;
break;
case GIMP_ACTION_SELECT_LAST:
value = max;
break;
case GIMP_ACTION_SELECT_PREVIOUS:
value -= inc;
break;
case GIMP_ACTION_SELECT_NEXT:
value += inc;
break;
case GIMP_ACTION_SELECT_SKIP_PREVIOUS:
value -= skip_inc;
break;
case GIMP_ACTION_SELECT_SKIP_NEXT:
value += skip_inc;
break;
default:
if (value >= 0)
value = (gdouble) select_type * (max - min) / 1000.0 + min;
else
g_return_val_if_reached (value);
break;
}
if (wrap)
{
while (value < min)
value = max - (min - value);
while (value > max)
value = min + (max - value);
}
else
{
value = CLAMP (value, min, max);
}
return value;
}
GimpObject *
action_select_object (GimpActionSelectType select_type,
GimpContainer *container,
GimpObject *current)
{
gint select_index;
gint n_children;
g_return_val_if_fail (GIMP_IS_CONTAINER (container), NULL);
g_return_val_if_fail (current == NULL || GIMP_IS_OBJECT (current), NULL);
if (! current)
return NULL;
n_children = gimp_container_num_children (container);
if (n_children == 0)
return NULL;
switch (select_type)
{
case GIMP_ACTION_SELECT_FIRST:
select_index = 0;
break;
case GIMP_ACTION_SELECT_LAST:
select_index = n_children - 1;
break;
case GIMP_ACTION_SELECT_PREVIOUS:
select_index = gimp_container_get_child_index (container, current) - 1;
break;
case GIMP_ACTION_SELECT_NEXT:
select_index = gimp_container_get_child_index (container, current) + 1;
break;
case GIMP_ACTION_SELECT_SKIP_PREVIOUS:
select_index = gimp_container_get_child_index (container, current) - 10;
break;
case GIMP_ACTION_SELECT_SKIP_NEXT:
select_index = gimp_container_get_child_index (container, current) + 10;
break;
default:
g_return_val_if_reached (current);
break;
}
select_index = CLAMP (select_index, 0, n_children - 1);
return gimp_container_get_child_by_index (container, select_index);
}

98
app/actions/actions.h Normal file
View File

@ -0,0 +1,98 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __ACTIONS_H__
#define __ACTIONS_H__
extern GimpActionFactory *global_action_factory;
void actions_init (Gimp *gimp);
void actions_exit (Gimp *gimp);
Gimp * action_data_get_gimp (gpointer data);
GimpContext * action_data_get_context (gpointer data);
GimpImage * action_data_get_image (gpointer data);
GimpDisplay * action_data_get_display (gpointer data);
GtkWidget * action_data_get_widget (gpointer data);
gdouble action_select_value (GimpActionSelectType select_type,
gdouble value,
gdouble min,
gdouble max,
gdouble inc,
gdouble skip_inc,
gboolean wrap);
GimpObject * action_select_object (GimpActionSelectType select_type,
GimpContainer *container,
GimpObject *current);
#define return_if_no_gimp(gimp,data) \
gimp = action_data_get_gimp (data); \
if (! gimp) \
return
#define return_if_no_context(context,data) \
context = action_data_get_context (data); \
if (! context) \
return
#define return_if_no_image(gimage,data) \
gimage = action_data_get_image (data); \
if (! gimage) \
return
#define return_if_no_display(gdisp,data) \
gdisp = action_data_get_display (data); \
if (! gdisp) \
return
#define return_if_no_widget(widget,data) \
widget = action_data_get_widget (data); \
if (! widget) \
return
#define return_if_no_drawable(gimage,drawable,data) \
return_if_no_image (gimage,data); \
drawable = gimp_image_active_drawable (gimage); \
if (! drawable) \
return
#define return_if_no_layer(gimage,layer,data) \
return_if_no_image (gimage,data); \
layer = gimp_image_get_active_layer (gimage); \
if (! layer) \
return
#define return_if_no_channel(gimage,channel,data) \
return_if_no_image (gimage,data); \
channel = gimp_image_get_active_channel (gimage); \
if (! channel) \
return
#define return_if_no_vectors(gimage,vectors,data) \
return_if_no_image (gimage,data); \
vectors = gimp_image_get_active_vectors (gimage); \
if (! vectors) \
return
#endif /* __ACTIONS_H__ */

View File

@ -0,0 +1,118 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"
#include "actions-types.h"
#include "core/gimpcontext.h"
#include "core/gimpdata.h"
#include "widgets/gimpactiongroup.h"
#include "widgets/gimphelp-ids.h"
#include "actions.h"
#include "brushes-actions.h"
#include "data-commands.h"
#include "gimp-intl.h"
static GimpActionEntry brushes_actions[] =
{
{ "brushes-popup", GIMP_STOCK_BRUSH,
N_("Brushes Menu"), NULL, NULL, NULL,
GIMP_HELP_BRUSH_DIALOG },
{ "brushes-new", GTK_STOCK_NEW,
N_("_New Brush"), "",
N_("New brush"),
G_CALLBACK (data_new_data_cmd_callback),
GIMP_HELP_BRUSH_NEW },
{ "brushes-duplicate", GIMP_STOCK_DUPLICATE,
N_("D_uplicate Brush"), NULL,
N_("Duplicate brush"),
G_CALLBACK (data_duplicate_data_cmd_callback),
GIMP_HELP_BRUSH_DUPLICATE },
{ "brushes-delete", GTK_STOCK_DELETE,
N_("_Delete Brush"), "",
N_("Delete brush"),
G_CALLBACK (data_delete_data_cmd_callback),
GIMP_HELP_BRUSH_DELETE },
{ "brushes-refresh", GTK_STOCK_REFRESH,
N_("_Refresh Brushes"), "",
N_("Refresh brushes"),
G_CALLBACK (data_refresh_data_cmd_callback),
GIMP_HELP_BRUSH_REFRESH }
};
static GimpStringActionEntry brushes_edit_actions[] =
{
{ "brushes-edit", GIMP_STOCK_EDIT,
N_("_Edit Brush..."), NULL,
N_("Edit brush"),
"gimp-brush-editor",
GIMP_HELP_BRUSH_EDIT }
};
void
brushes_actions_setup (GimpActionGroup *group)
{
gimp_action_group_add_actions (group,
brushes_actions,
G_N_ELEMENTS (brushes_actions));
gimp_action_group_add_string_actions (group,
brushes_edit_actions,
G_N_ELEMENTS (brushes_edit_actions),
G_CALLBACK (data_edit_data_cmd_callback));
}
void
brushes_actions_update (GimpActionGroup *group,
gpointer user_data)
{
GimpContext *context = action_data_get_context (user_data);
GimpBrush *brush = NULL;
GimpData *data = NULL;
if (context)
{
brush = gimp_context_get_brush (context);
if (brush)
data = GIMP_DATA (brush);
}
#define SET_SENSITIVE(action,condition) \
gimp_action_group_set_action_sensitive (group, action, (condition) != 0)
SET_SENSITIVE ("brushes-edit", brush);
SET_SENSITIVE ("brushes-duplicate", brush && GIMP_DATA_GET_CLASS (data)->duplicate);
SET_SENSITIVE ("brushes-delete", brush && data->deletable);
#undef SET_SENSITIVE
}

View File

@ -0,0 +1,28 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __BRUSHES_ACTIONS_H__
#define __BRUSHES_ACTIONS_H__
void brushes_actions_setup (GimpActionGroup *group);
void brushes_actions_update (GimpActionGroup *group,
gpointer data);
#endif /* __BRUSHES_ACTIONS_H__ */

View File

@ -0,0 +1,98 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"
#include "actions-types.h"
#include "core/gimpcontext.h"
#include "widgets/gimpactiongroup.h"
#include "widgets/gimphelp-ids.h"
#include "actions.h"
#include "buffers-actions.h"
#include "buffers-commands.h"
#include "gimp-intl.h"
static GimpActionEntry buffers_actions[] =
{
{ "buffers-popup", GIMP_STOCK_BUFFER,
N_("Buffers Menu"), NULL, NULL, NULL,
GIMP_HELP_BUFFER_DIALOG },
{ "buffers-paste", GTK_STOCK_PASTE,
N_("_Paste Buffer"), "",
N_("Paste the selected buffer"),
G_CALLBACK (buffers_paste_buffer_cmd_callback),
GIMP_HELP_BUFFER_PASTE },
{ "buffers-paste-into", GIMP_STOCK_PASTE_INTO,
N_("Paste Buffer _Into"), NULL,
N_("Paste the selected buffer into the selection"),
G_CALLBACK (buffers_paste_buffer_into_cmd_callback),
GIMP_HELP_BUFFER_PASTE_INTO },
{ "buffers-paste-as-new", GIMP_STOCK_PASTE_AS_NEW,
N_("Paste Buffer as _New"), NULL,
N_("Paste the selected buffer as new image"),
G_CALLBACK (buffers_paste_buffer_as_new_cmd_callback),
GIMP_HELP_BUFFER_PASTE_AS_NEW },
{ "buffers-delete", GTK_STOCK_DELETE,
N_("_Delete Buffer"), "",
N_("Delete the selected buffer"),
G_CALLBACK (buffers_delete_buffer_cmd_callback),
GIMP_HELP_BUFFER_DELETE }
};
void
buffers_actions_setup (GimpActionGroup *group)
{
gimp_action_group_add_actions (group,
buffers_actions,
G_N_ELEMENTS (buffers_actions));
}
void
buffers_actions_update (GimpActionGroup *group,
gpointer data)
{
GimpContext *context = action_data_get_context (data);
GimpBuffer *buffer = NULL;
if (context)
buffer = gimp_context_get_buffer (context);
#define SET_SENSITIVE(action,condition) \
gimp_action_group_set_action_sensitive (group, action, (condition) != 0)
SET_SENSITIVE ("buffers-paste", buffer);
SET_SENSITIVE ("buffers-paste-into", buffer);
SET_SENSITIVE ("buffers-paste-as-new", buffer);
SET_SENSITIVE ("buffers-delete", buffer);
#undef SET_SENSITIVE
}

View File

@ -0,0 +1,28 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __BUFFERS_ACTIONS_H__
#define __BUFFERS_ACTIONS_H__
void buffers_actions_setup (GimpActionGroup *group);
void buffers_actions_update (GimpActionGroup *group,
gpointer data);
#endif /* __BUFFERS_ACTIONS_H__ */

View File

@ -0,0 +1,155 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <gtk/gtk.h>
#include "actions-types.h"
#include "core/gimp-edit.h"
#include "core/gimpcontainer.h"
#include "core/gimpcontext.h"
#include "core/gimpimage.h"
#include "widgets/gimpbufferview.h"
#include "widgets/gimpcontainerview.h"
#include "display/gimpdisplay.h"
#include "display/gimpdisplayshell.h"
#include "display/gimpdisplayshell-transform.h"
#include "buffers-commands.h"
#include "gimp-intl.h"
/* local function prototypes */
static void buffers_paste (GimpBufferView *view,
gboolean paste_into);
/* public functionss */
void
buffers_paste_buffer_cmd_callback (GtkAction *action,
gpointer data)
{
buffers_paste (GIMP_BUFFER_VIEW (data), FALSE);
}
void
buffers_paste_buffer_into_cmd_callback (GtkAction *action,
gpointer data)
{
buffers_paste (GIMP_BUFFER_VIEW (data), TRUE);
}
void
buffers_paste_buffer_as_new_cmd_callback (GtkAction *action,
gpointer data)
{
GimpContainerEditor *editor = GIMP_CONTAINER_EDITOR (data);
GimpContainer *container;
GimpContext *context;
GimpBuffer *buffer;
container = gimp_container_view_get_container (editor->view);
context = gimp_container_view_get_context (editor->view);
buffer = gimp_context_get_buffer (context);
if (buffer && gimp_container_have (container, GIMP_OBJECT (buffer)))
{
GimpImage *gimage = gimp_context_get_image (context);
if (gimage)
gimp_edit_paste_as_new (gimage->gimp, gimage, buffer);
}
}
void
buffers_delete_buffer_cmd_callback (GtkAction *action,
gpointer data)
{
GimpContainerEditor *editor = GIMP_CONTAINER_EDITOR (data);
GimpContainer *container;
GimpContext *context;
GimpBuffer *buffer;
container = gimp_container_view_get_container (editor->view);
context = gimp_container_view_get_context (editor->view);
buffer = gimp_context_get_buffer (context);
if (buffer && gimp_container_have (container, GIMP_OBJECT (buffer)))
{
gimp_container_remove (container, GIMP_OBJECT (buffer));
}
}
/* private functions */
static void
buffers_paste (GimpBufferView *view,
gboolean paste_into)
{
GimpContainerEditor *editor = GIMP_CONTAINER_EDITOR (view);
GimpContainer *container;
GimpContext *context;
GimpBuffer *buffer;
container = gimp_container_view_get_container (editor->view);
context = gimp_container_view_get_context (editor->view);
buffer = gimp_context_get_buffer (context);
if (buffer && gimp_container_have (container, GIMP_OBJECT (buffer)))
{
GimpDisplay *gdisp = gimp_context_get_display (context);
GimpImage *gimage = NULL;
gint x = -1;
gint y = -1;
gint width = -1;
gint height = -1;
if (gdisp)
{
GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (gdisp->shell);
gimp_display_shell_untransform_viewport (shell,
&x, &y, &width, &height);
gimage = gdisp->gimage;
}
else
{
gimage = gimp_context_get_image (context);
}
if (gimage)
{
gimp_edit_paste (gimage, gimp_image_active_drawable (gimage),
buffer, paste_into, x, y, width, height);
gimp_image_flush (gimage);
}
}
}

View File

@ -0,0 +1,33 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __BUFFERS_COMMANDS_H__
#define __BUFFERS_COMMANDS_H__
void buffers_paste_buffer_cmd_callback (GtkAction *action,
gpointer data);
void buffers_paste_buffer_into_cmd_callback (GtkAction *action,
gpointer data);
void buffers_paste_buffer_as_new_cmd_callback (GtkAction *action,
gpointer data);
void buffers_delete_buffer_cmd_callback (GtkAction *action,
gpointer data);
#endif /* __BUFFERS_COMMANDS_H__ */

View File

@ -0,0 +1,203 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"
#include "actions-types.h"
#include "core/gimpimage.h"
#include "core/gimplist.h"
#include "widgets/gimpactiongroup.h"
#include "widgets/gimpcomponenteditor.h"
#include "widgets/gimphelp-ids.h"
#include "actions.h"
#include "channels-actions.h"
#include "channels-commands.h"
#include "gimp-intl.h"
static GimpActionEntry channels_actions[] =
{
{ "channels-popup", GIMP_STOCK_CHANNELS,
N_("Channels Menu"), NULL, NULL, NULL,
GIMP_HELP_CHANNEL_DIALOG },
{ "channels-edit-attributes", GIMP_STOCK_EDIT,
N_("_Edit Channel Attributes..."), NULL,
N_("Edit channel attributes"),
G_CALLBACK (channels_edit_attributes_cmd_callback),
GIMP_HELP_CHANNEL_EDIT },
{ "channels-new", GTK_STOCK_NEW,
N_("_New Channel..."), "",
N_("New channel..."),
G_CALLBACK (channels_new_cmd_callback),
GIMP_HELP_CHANNEL_NEW },
{ "channels-new-last-values", GTK_STOCK_NEW,
N_("_New Channel"), "",
N_("New channel with last values"),
G_CALLBACK (channels_new_last_vals_cmd_callback),
GIMP_HELP_CHANNEL_NEW },
{ "channels-duplicate", GIMP_STOCK_DUPLICATE,
N_("D_uplicate Channel"), NULL,
N_("Duplicate channel"),
G_CALLBACK (channels_duplicate_cmd_callback),
GIMP_HELP_CHANNEL_DUPLICATE },
{ "channels-delete", GTK_STOCK_DELETE,
N_("_Delete Channel"), "",
N_("Delete channel"),
G_CALLBACK (channels_delete_cmd_callback),
GIMP_HELP_CHANNEL_DELETE },
{ "channels-raise", GTK_STOCK_GO_UP,
N_("_Raise Channel"), "",
N_("Raise channel"),
G_CALLBACK (channels_raise_cmd_callback),
GIMP_HELP_CHANNEL_RAISE },
{ "channels-raise-to-top", GTK_STOCK_GOTO_TOP,
N_("Raise Channel to _Top"), "",
N_("Raise channel to top"),
G_CALLBACK (channels_raise_to_top_cmd_callback),
GIMP_HELP_CHANNEL_RAISE_TO_TOP },
{ "channels-lower", GTK_STOCK_GO_DOWN,
N_("_Lower Channel"), "",
N_("Lower channel"),
G_CALLBACK (channels_lower_cmd_callback),
GIMP_HELP_CHANNEL_LOWER },
{ "channels-lower-to-bottom", GTK_STOCK_GOTO_BOTTOM,
N_("Lower Channel to _Bottom"), "",
N_("Lower channel to bottom"),
G_CALLBACK (channels_lower_to_bottom_cmd_callback),
GIMP_HELP_CHANNEL_LOWER_TO_BOTTOM }
};
static GimpEnumActionEntry channels_to_selection_actions[] =
{
{ "channels-selection-replace", GIMP_STOCK_SELECTION_REPLACE,
N_("Channel to Sele_ction"), NULL,
N_("Channel to selection"),
GIMP_CHANNEL_OP_REPLACE, FALSE,
GIMP_HELP_CHANNEL_SELECTION_REPLACE },
{ "channels-selection-add", GIMP_STOCK_SELECTION_ADD,
N_("_Add to Selection"), NULL,
N_("Add"),
GIMP_CHANNEL_OP_ADD, FALSE,
GIMP_HELP_CHANNEL_SELECTION_ADD },
{ "channels-selection-subtract", GIMP_STOCK_SELECTION_SUBTRACT,
N_("_Subtract from Selection"), NULL,
N_("Subtract"),
GIMP_CHANNEL_OP_SUBTRACT, FALSE,
GIMP_HELP_CHANNEL_SELECTION_SUBTRACT },
{ "channels-selection-intersect", GIMP_STOCK_SELECTION_INTERSECT,
N_("_Intersect with Selection"), NULL,
N_("Intersect"),
GIMP_CHANNEL_OP_INTERSECT, FALSE,
GIMP_HELP_CHANNEL_SELECTION_INTERSECT }
};
void
channels_actions_setup (GimpActionGroup *group)
{
gimp_action_group_add_actions (group,
channels_actions,
G_N_ELEMENTS (channels_actions));
gimp_action_group_add_enum_actions (group,
channels_to_selection_actions,
G_N_ELEMENTS (channels_to_selection_actions),
G_CALLBACK (channels_to_selection_cmd_callback));
}
void
channels_actions_update (GimpActionGroup *group,
gpointer data)
{
GimpImage *gimage = action_data_get_image (data);
GimpChannel *channel = NULL;
gboolean fs = FALSE;
gboolean component = FALSE;
GList *next = NULL;
GList *prev = NULL;
if (gimage)
{
fs = (gimp_image_floating_sel (gimage) != NULL);
if (GIMP_IS_COMPONENT_EDITOR (data))
{
if (GIMP_COMPONENT_EDITOR (data)->clicked_component != -1)
component = TRUE;
}
else
{
channel = gimp_image_get_active_channel (gimage);
if (channel)
{
GList *list;
list = g_list_find (GIMP_LIST (gimage->channels)->list, channel);
if (list)
{
prev = g_list_previous (list);
next = g_list_next (list);
}
}
}
}
#define SET_SENSITIVE(action,condition) \
gimp_action_group_set_action_sensitive (group, action, (condition) != 0)
SET_SENSITIVE ("channels-edit-attributes", !fs && channel);
SET_SENSITIVE ("channels-new", !fs && gimage);
SET_SENSITIVE ("channels-new-last-values", !fs && gimage);
SET_SENSITIVE ("channels-duplicate", !fs && (channel || component));
SET_SENSITIVE ("channels-delete", !fs && channel);
SET_SENSITIVE ("channels-raise", !fs && channel && prev);
SET_SENSITIVE ("channels-raise-to-top", !fs && channel && prev);
SET_SENSITIVE ("channels-lower", !fs && channel && next);
SET_SENSITIVE ("channels-lower-to-bottom", !fs && channel && next);
SET_SENSITIVE ("channels-selection-replace", !fs && (channel || component));
SET_SENSITIVE ("channels-selection-add", !fs && (channel || component));
SET_SENSITIVE ("channels-selection-subtract", !fs && (channel || component));
SET_SENSITIVE ("channels-selection-intersect", !fs && (channel || component));
#undef SET_SENSITIVE
}

View File

@ -0,0 +1,28 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __CHANNELS_ACTIONS_H__
#define __CHANNELS_ACTIONS_H__
void channels_actions_setup (GimpActionGroup *group);
void channels_actions_update (GimpActionGroup *group,
gpointer data);
#endif /* __CHANNELS_ACTIONS_H__ */

View File

@ -0,0 +1,399 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <string.h>
#include <gtk/gtk.h>
#include "libgimpbase/gimpbase.h"
#include "libgimpcolor/gimpcolor.h"
#include "libgimpwidgets/gimpwidgets.h"
#include "actions-types.h"
#include "core/gimpchannel.h"
#include "core/gimpchannel-select.h"
#include "core/gimpcontext.h"
#include "core/gimpimage.h"
#include "core/gimpimage-undo.h"
#include "widgets/gimpaction.h"
#include "widgets/gimpcolorpanel.h"
#include "widgets/gimpcomponenteditor.h"
#include "widgets/gimpdock.h"
#include "widgets/gimphelp-ids.h"
#include "dialogs/channel-options-dialog.h"
#include "actions.h"
#include "channels-commands.h"
#include "gimp-intl.h"
/* local function prototypes */
static void channels_new_channel_response (GtkWidget *widget,
gint response_id,
ChannelOptionsDialog *options);
static void channels_edit_channel_response (GtkWidget *widget,
gint response_id,
ChannelOptionsDialog *options);
/* private variables */
static gchar *channel_name = NULL;
static GimpRGB channel_color = { 0.0, 0.0, 0.0, 0.5 };
/* public functions */
void
channels_edit_attributes_cmd_callback (GtkAction *action,
gpointer data)
{
ChannelOptionsDialog *options;
GimpImage *gimage;
GimpChannel *channel;
GtkWidget *widget;
return_if_no_channel (gimage, channel, data);
return_if_no_widget (widget, data);
options = channel_options_dialog_new (gimage,
action_data_get_context (data),
channel,
widget,
&channel->color,
gimp_object_get_name (GIMP_OBJECT (channel)),
_("Channel Attributes"),
"gimp-channel-edit",
GIMP_STOCK_EDIT,
_("Edit Channel Attributes"),
GIMP_HELP_CHANNEL_EDIT,
_("Edit Channel Color"),
_("Fill Opacity:"));
g_signal_connect (options->dialog, "response",
G_CALLBACK (channels_edit_channel_response),
options);
gtk_widget_show (options->dialog);
}
void
channels_new_cmd_callback (GtkAction *action,
gpointer data)
{
ChannelOptionsDialog *options;
GimpImage *gimage;
GtkWidget *widget;
return_if_no_image (gimage, data);
return_if_no_widget (widget, data);
options = channel_options_dialog_new (gimage,
action_data_get_context (data),
NULL,
widget,
&channel_color,
channel_name ? channel_name :
_("New Channel"),
_("New Channel"),
"gimp-channel-new",
GIMP_STOCK_CHANNEL,
_("New Channel Options"),
GIMP_HELP_CHANNEL_NEW,
_("New Channel Color"),
_("Fill Opacity:"));
g_signal_connect (options->dialog, "response",
G_CALLBACK (channels_new_channel_response),
options);
gtk_widget_show (options->dialog);
}
void
channels_new_last_vals_cmd_callback (GtkAction *action,
gpointer data)
{
GimpImage *gimage;
GimpChannel *new_channel;
gint width, height;
GimpRGB color;
return_if_no_image (gimage, data);
if (GIMP_IS_CHANNEL (GIMP_ACTION (action)->viewable))
{
GimpChannel *template = GIMP_CHANNEL (GIMP_ACTION (action)->viewable);
width = gimp_item_width (GIMP_ITEM (template));
height = gimp_item_height (GIMP_ITEM (template));
color = template->color;
}
else
{
width = gimp_image_get_width (gimage);
height = gimp_image_get_height (gimage);
color = channel_color;
}
gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_EDIT_PASTE,
_("New Channel"));
new_channel = gimp_channel_new (gimage, width, height,
channel_name ? channel_name :
_("New Channel"), &color);
gimp_drawable_fill_by_type (GIMP_DRAWABLE (new_channel),
action_data_get_context (data),
GIMP_TRANSPARENT_FILL);
gimp_image_add_channel (gimage, new_channel, -1);
gimp_image_undo_group_end (gimage);
gimp_image_flush (gimage);
}
void
channels_raise_cmd_callback (GtkAction *action,
gpointer data)
{
GimpImage *gimage;
GimpChannel *channel;
return_if_no_channel (gimage, channel, data);
gimp_image_raise_channel (gimage, channel);
gimp_image_flush (gimage);
}
void
channels_raise_to_top_cmd_callback (GtkAction *action,
gpointer data)
{
GimpImage *gimage;
GimpChannel *channel;
return_if_no_channel (gimage, channel, data);
gimp_image_raise_channel_to_top (gimage, channel);
gimp_image_flush (gimage);
}
void
channels_lower_cmd_callback (GtkAction *action,
gpointer data)
{
GimpImage *gimage;
GimpChannel *channel;
return_if_no_channel (gimage, channel, data);
gimp_image_lower_channel (gimage, channel);
gimp_image_flush (gimage);
}
void
channels_lower_to_bottom_cmd_callback (GtkAction *action,
gpointer data)
{
GimpImage *gimage;
GimpChannel *channel;
return_if_no_channel (gimage, channel, data);
gimp_image_lower_channel_to_bottom (gimage, channel);
gimp_image_flush (gimage);
}
void
channels_duplicate_cmd_callback (GtkAction *action,
gpointer data)
{
GimpImage *gimage;
GimpChannel *new_channel;
if (GIMP_IS_COMPONENT_EDITOR (data))
{
GimpRGB color;
GimpChannelType component;
const gchar *desc;
gchar *name;
return_if_no_image (gimage, data);
gimp_rgba_set (&color, 0, 0, 0, 0.5);
component = GIMP_COMPONENT_EDITOR (data)->clicked_component;
gimp_enum_get_value (GIMP_TYPE_CHANNEL_TYPE, component,
NULL, NULL, &desc, NULL);
name = g_strdup_printf (_("%s Channel Copy"), desc);
new_channel = gimp_channel_new_from_component (gimage, component,
name, &color);
/* copied components are invisible by default so subsequent copies
* of components don't affect each other
*/
gimp_item_set_visible (GIMP_ITEM (new_channel), FALSE, FALSE);
g_free (name);
}
else
{
GimpChannel *channel;
return_if_no_channel (gimage, channel, data);
new_channel =
GIMP_CHANNEL (gimp_item_duplicate (GIMP_ITEM (channel),
G_TYPE_FROM_INSTANCE (channel),
TRUE));
}
gimp_image_add_channel (gimage, new_channel, -1);
gimp_image_flush (gimage);
}
void
channels_delete_cmd_callback (GtkAction *action,
gpointer data)
{
GimpImage *gimage;
GimpChannel *channel;
return_if_no_channel (gimage, channel, data);
gimp_image_remove_channel (gimage, channel);
gimp_image_flush (gimage);
}
void
channels_to_selection_cmd_callback (GtkAction *action,
gint value,
gpointer data)
{
GimpChannelOps op;
GimpImage *gimage;
op = (GimpChannelOps) value;
if (GIMP_IS_COMPONENT_EDITOR (data))
{
GimpChannelType component;
return_if_no_image (gimage, data);
component = GIMP_COMPONENT_EDITOR (data)->clicked_component;
gimp_channel_select_component (gimp_image_get_mask (gimage), component,
op, FALSE, 0.0, 0.0);
}
else
{
GimpChannel *channel;
return_if_no_channel (gimage, channel, data);
gimp_channel_select_channel (gimp_image_get_mask (gimage),
_("Channel to Selection"),
channel, 0, 0,
op, FALSE, 0.0, 0.0);
}
gimp_image_flush (gimage);
}
/* private functions */
static void
channels_new_channel_response (GtkWidget *widget,
gint response_id,
ChannelOptionsDialog *options)
{
if (response_id == GTK_RESPONSE_OK)
{
GimpChannel *new_channel;
if (channel_name)
g_free (channel_name);
channel_name =
g_strdup (gtk_entry_get_text (GTK_ENTRY (options->name_entry)));
gimp_color_button_get_color (GIMP_COLOR_BUTTON (options->color_panel),
&channel_color);
new_channel = gimp_channel_new (options->gimage,
options->gimage->width,
options->gimage->height,
channel_name,
&channel_color);
gimp_drawable_fill_by_type (GIMP_DRAWABLE (new_channel),
options->context,
GIMP_TRANSPARENT_FILL);
gimp_image_add_channel (options->gimage, new_channel, -1);
gimp_image_flush (options->gimage);
}
gtk_widget_destroy (options->dialog);
}
static void
channels_edit_channel_response (GtkWidget *widget,
gint response_id,
ChannelOptionsDialog *options)
{
if (response_id == GTK_RESPONSE_OK)
{
GimpChannel *channel = options->channel;
const gchar *new_name;
GimpRGB color;
gboolean name_changed = FALSE;
gboolean color_changed = FALSE;
new_name = gtk_entry_get_text (GTK_ENTRY (options->name_entry));
gimp_color_button_get_color (GIMP_COLOR_BUTTON (options->color_panel),
&color);
if (strcmp (new_name, gimp_object_get_name (GIMP_OBJECT (channel))))
name_changed = TRUE;
if (gimp_rgba_distance (&color, &channel->color) > 0.0001)
color_changed = TRUE;
if (name_changed && color_changed)
gimp_image_undo_group_start (options->gimage,
GIMP_UNDO_GROUP_ITEM_PROPERTIES,
_("Channel Attributes"));
if (name_changed)
gimp_item_rename (GIMP_ITEM (channel), new_name);
if (color_changed)
gimp_channel_set_color (channel, &color, TRUE);
if (name_changed && color_changed)
gimp_image_undo_group_end (options->gimage);
if (name_changed || color_changed)
gimp_image_flush (options->gimage);
}
gtk_widget_destroy (options->dialog);
}

View File

@ -0,0 +1,48 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __CHANNELS_COMMANDS_H__
#define __CHANNELS_COMMANDS_H__
void channels_edit_attributes_cmd_callback (GtkAction *action,
gpointer data);
void channels_new_cmd_callback (GtkAction *action,
gpointer data);
void channels_new_last_vals_cmd_callback (GtkAction *action,
gpointer data);
void channels_raise_cmd_callback (GtkAction *action,
gpointer data);
void channels_raise_to_top_cmd_callback (GtkAction *action,
gpointer data);
void channels_lower_cmd_callback (GtkAction *action,
gpointer data);
void channels_lower_to_bottom_cmd_callback (GtkAction *action,
gpointer data);
void channels_duplicate_cmd_callback (GtkAction *action,
gpointer data);
void channels_delete_cmd_callback (GtkAction *action,
gpointer data);
void channels_to_selection_cmd_callback (GtkAction *action,
gint value,
gpointer data);
#endif /* __CHANNELS_COMMANDS_H__ */

View File

@ -0,0 +1,122 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"
#include "actions-types.h"
#include "core/gimpcontext.h"
#include "core/gimpimage.h"
#include "widgets/gimpactiongroup.h"
#include "widgets/gimphelp-ids.h"
#include "actions.h"
#include "colormap-editor-actions.h"
#include "colormap-editor-commands.h"
#include "gimp-intl.h"
static GimpActionEntry colormap_editor_actions[] =
{
{ "colormap-editor-popup", GIMP_STOCK_INDEXED_PALETTE,
N_("Colormap Menu"), NULL, NULL, NULL,
GIMP_HELP_INDEXED_PALETTE_DIALOG },
{ "colormap-editor-edit-color", GIMP_STOCK_EDIT,
N_("_Edit Color..."), NULL,
N_("Edit color"),
G_CALLBACK (colormap_editor_edit_color_cmd_callback),
GIMP_HELP_INDEXED_PALETTE_EDIT }
};
static GimpEnumActionEntry colormap_editor_add_color_actions[] =
{
{ "colormap-editor-add-color-from-fg", GTK_STOCK_ADD,
N_("_Add Color from FG"), "",
N_("Add color from FG"),
FALSE, FALSE,
GIMP_HELP_INDEXED_PALETTE_ADD },
{ "colormap-editor-add-color-from-bg", GTK_STOCK_ADD,
N_("_Add Color from BG"), "",
N_("Add color from BG"),
TRUE, FALSE,
GIMP_HELP_INDEXED_PALETTE_ADD }
};
void
colormap_editor_actions_setup (GimpActionGroup *group)
{
gimp_action_group_add_actions (group,
colormap_editor_actions,
G_N_ELEMENTS (colormap_editor_actions));
gimp_action_group_add_enum_actions (group,
colormap_editor_add_color_actions,
G_N_ELEMENTS (colormap_editor_add_color_actions),
G_CALLBACK (colormap_editor_add_color_cmd_callback));
}
void
colormap_editor_actions_update (GimpActionGroup *group,
gpointer data)
{
GimpImage *gimage = action_data_get_image (data);
GimpContext *context = action_data_get_context (data);
gboolean indexed = FALSE;
gint num_colors = 0;
GimpRGB fg;
GimpRGB bg;
if (gimage)
{
indexed = gimp_image_base_type (gimage) == GIMP_INDEXED;
num_colors = gimage->num_cols;
}
if (context)
{
gimp_context_get_foreground (context, &fg);
gimp_context_get_background (context, &bg);
}
#define SET_SENSITIVE(action,condition) \
gimp_action_group_set_action_sensitive (group, action, (condition) != 0)
#define SET_COLOR(action,color) \
gimp_action_group_set_action_color (group, action, color, FALSE);
SET_SENSITIVE ("colormap-editor-edit-color",
gimage && indexed);
SET_SENSITIVE ("colormap-editor-add-color-from-fg",
gimage && indexed && num_colors < 256);
SET_SENSITIVE ("colormap-editor-add-color-from-bg",
gimage && indexed && num_colors < 256);
SET_COLOR ("colormap-editor-add-color-from-fg", context ? &fg : NULL);
SET_COLOR ("colormap-editor-add-color-from-bg", context ? &bg : NULL);
#undef SET_SENSITIVE
#undef SET_COLOR
}

View File

@ -0,0 +1,28 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __COLORMAP_EDITOR_ACTIONS_H__
#define __COLORMAP_EDITOR_ACTIONS_H__
void colormap_editor_actions_setup (GimpActionGroup *group);
void colormap_editor_actions_update (GimpActionGroup *group,
gpointer data);
#endif /* __COLORMAP_EDITOR_ACTIONS_H__ */

View File

@ -0,0 +1,156 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <gtk/gtk.h>
#include "libgimpcolor/gimpcolor.h"
#include "libgimpwidgets/gimpwidgets.h"
#include "actions-types.h"
#include "core/gimpcontext.h"
#include "core/gimpimage.h"
#include "core/gimpimage-colormap.h"
#include "widgets/gimpcolordialog.h"
#include "widgets/gimpcolormapeditor.h"
#include "widgets/gimpdialogfactory.h"
#include "actions.h"
#include "colormap-editor-commands.h"
#include "gimp-intl.h"
/* local function prototypes */
static void colormap_editor_edit_color_update (GimpColorDialog *dialog,
const GimpRGB *color,
GimpColorDialogState state,
GimpColormapEditor *editor);
/* public functions */
void
colormap_editor_edit_color_cmd_callback (GtkAction *action,
gpointer data)
{
GimpColormapEditor *editor;
GimpImage *gimage;
GimpRGB color;
gchar *desc;
return_if_no_image (gimage, data);
editor = GIMP_COLORMAP_EDITOR (data);
gimp_rgba_set_uchar (&color,
gimage->cmap[editor->col_index * 3],
gimage->cmap[editor->col_index * 3 + 1],
gimage->cmap[editor->col_index * 3 + 2],
OPAQUE_OPACITY);
desc = g_strdup_printf (_("Edit colormap entry #%d"), editor->col_index);
if (! editor->color_dialog)
{
editor->color_dialog =
gimp_color_dialog_new (GIMP_VIEWABLE (gimage),
_("Edit Colormap Entry"),
GIMP_STOCK_INDEXED_PALETTE,
desc,
GTK_WIDGET (editor),
gimp_dialog_factory_from_name ("toplevel"),
"gimp-colormap-editor-color-dialog",
(const GimpRGB *) &color,
FALSE, FALSE);
g_signal_connect (editor->color_dialog, "destroy",
G_CALLBACK (gtk_widget_destroyed),
&editor->color_dialog);
g_signal_connect (editor->color_dialog, "update",
G_CALLBACK (colormap_editor_edit_color_update),
editor);
}
else
{
gimp_viewable_dialog_set_viewable (GIMP_VIEWABLE_DIALOG (editor->color_dialog),
GIMP_VIEWABLE (gimage));
g_object_set (editor->color_dialog, "description", desc, NULL);
gimp_color_dialog_set_color (GIMP_COLOR_DIALOG (editor->color_dialog),
&color);
}
g_free (desc);
gtk_window_present (GTK_WINDOW (editor->color_dialog));
}
void
colormap_editor_add_color_cmd_callback (GtkAction *action,
gint value,
gpointer data)
{
GimpContext *context;
GimpImage *gimage;
return_if_no_context (context, data);
return_if_no_image (gimage, data);
if (gimage->num_cols < 256)
{
GimpRGB color;
if (value)
gimp_context_get_background (context, &color);
else
gimp_context_get_foreground (context, &color);
gimp_image_add_colormap_entry (gimage, &color);
gimp_image_flush (gimage);
}
}
/* private functions */
static void
colormap_editor_edit_color_update (GimpColorDialog *dialog,
const GimpRGB *color,
GimpColorDialogState state,
GimpColormapEditor *editor)
{
GimpImage *gimage = GIMP_IMAGE_EDITOR (editor)->gimage;
switch (state)
{
case GIMP_COLOR_DIALOG_UPDATE:
break;
case GIMP_COLOR_DIALOG_OK:
gimp_image_set_colormap_entry (gimage, editor->col_index, color, TRUE);
gimp_image_flush (gimage);
/* Fall through */
case GIMP_COLOR_DIALOG_CANCEL:
gtk_widget_hide (editor->color_dialog);
break;
}
}

View File

@ -0,0 +1,30 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __COLORMAP_EDITOR_COMMANDS_H__
#define __COLORMAP_EDITOR_COMMANDS_H__
void colormap_editor_edit_color_cmd_callback (GtkAction *action,
gpointer data);
void colormap_editor_add_color_cmd_callback (GtkAction *action,
gint value,
gpointer data);
#endif /* __COLORMAP_EDITOR_COMMANDS_H__ */

View File

@ -0,0 +1,761 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"
#include "actions-types.h"
#include "core/gimp.h"
#include "core/gimpbrushgenerated.h"
#include "core/gimpcontext.h"
#include "core/gimplist.h"
#include "widgets/gimpactiongroup.h"
#include "widgets/gimphelp-ids.h"
#include "actions.h"
#include "context-actions.h"
#include "context-commands.h"
#include "gimp-intl.h"
/* local function prototypes */
static GimpActionEntry context_actions[] =
{
{ "context-menu", NULL, N_("_Context") },
{ "context-colors-menu", GIMP_STOCK_DEFAULT_COLORS, N_("_Colors") },
{ "context-opacity-menu", GIMP_STOCK_TRANSPARENCY, N_("_Opacity") },
{ "context-paint-mode-menu", GIMP_STOCK_TOOL_PENCIL, N_("Paint _Mode") },
{ "context-tool-menu", GIMP_STOCK_TOOLS, N_("_Tool") },
{ "context-brush-menu", GIMP_STOCK_BRUSH, N_("_Brush") },
{ "context-pattern-menu", GIMP_STOCK_PATTERN, N_("_Pattern") },
{ "context-palette-menu", GIMP_STOCK_PALETTE, N_("_Palette") },
{ "context-gradient-menu", GIMP_STOCK_GRADIENT, N_("_Gradient") },
{ "context-font-menu", GIMP_STOCK_FONT, N_("_Font") },
{ "context-brush-shape-menu", NULL, N_("_Shape") },
{ "context-brush-radius-menu", NULL, N_("_Radius") },
{ "context-brush-spikes-menu", NULL, N_("S_pikes") },
{ "context-brush-hardness-menu", NULL, N_("_Hardness") },
{ "context-brush-aspect-menu", NULL, N_("_Aspect") },
{ "context-brush-angle-menu", NULL, N_("A_ngle") },
{ "context-colors-default", GIMP_STOCK_DEFAULT_COLORS,
N_("_Default Colors"), "D", NULL,
G_CALLBACK (context_colors_default_cmd_callback),
GIMP_HELP_TOOLBOX_DEFAULT_COLORS },
{ "context-colors-swap", GIMP_STOCK_SWAP_COLORS,
N_("S_wap Colors"), "X", NULL,
G_CALLBACK (context_colors_swap_cmd_callback),
GIMP_HELP_TOOLBOX_SWAP_COLORS }
};
static GimpEnumActionEntry context_foreground_red_actions[] =
{
{ "context-foreground-red-set", GIMP_STOCK_CHANNEL_RED,
"Foreground Red Set", NULL, NULL,
GIMP_ACTION_SELECT_SET, TRUE,
NULL },
{ "context-foreground-red-minimum", GIMP_STOCK_CHANNEL_RED,
"Foreground Red Minimum", NULL, NULL,
GIMP_ACTION_SELECT_FIRST, FALSE,
NULL },
{ "context-foreground-red-maximum", GIMP_STOCK_CHANNEL_RED,
"Foreground Red Maximum", NULL, NULL,
GIMP_ACTION_SELECT_LAST, FALSE,
NULL },
{ "context-foreground-red-decrease", GIMP_STOCK_CHANNEL_RED,
"Foreground Red Decrease", NULL, NULL,
GIMP_ACTION_SELECT_PREVIOUS, FALSE,
NULL },
{ "context-foreground-red-increase", GIMP_STOCK_CHANNEL_RED,
"Foreground Red Increase", NULL, NULL,
GIMP_ACTION_SELECT_NEXT, FALSE,
NULL },
{ "context-foreground-red-decrease-skip", GIMP_STOCK_CHANNEL_RED,
"Foreground Red Decrease 10%", NULL, NULL,
GIMP_ACTION_SELECT_SKIP_PREVIOUS, FALSE,
NULL },
{ "context-foreground-red-increase-skip", GIMP_STOCK_CHANNEL_RED,
"Foreground Red Increase 10%", NULL, NULL,
GIMP_ACTION_SELECT_SKIP_NEXT, FALSE,
NULL }
};
static GimpEnumActionEntry context_foreground_green_actions[] =
{
{ "context-foreground-green-set", GIMP_STOCK_CHANNEL_GREEN,
"Foreground Green Set", NULL, NULL,
GIMP_ACTION_SELECT_SET, TRUE,
NULL },
{ "context-foreground-green-minimum", GIMP_STOCK_CHANNEL_GREEN,
"Foreground Green Minimum", NULL, NULL,
GIMP_ACTION_SELECT_FIRST, FALSE,
NULL },
{ "context-foreground-green-maximum", GIMP_STOCK_CHANNEL_GREEN,
"Foreground Green Maximum", NULL, NULL,
GIMP_ACTION_SELECT_LAST, FALSE,
NULL },
{ "context-foreground-green-decrease", GIMP_STOCK_CHANNEL_GREEN,
"Foreground Green Decrease", NULL, NULL,
GIMP_ACTION_SELECT_PREVIOUS, FALSE,
NULL },
{ "context-foreground-green-increase", GIMP_STOCK_CHANNEL_GREEN,
"Foreground Green Increase", NULL, NULL,
GIMP_ACTION_SELECT_NEXT, FALSE,
NULL },
{ "context-foreground-green-decrease-skip", GIMP_STOCK_CHANNEL_GREEN,
"Foreground Green Decrease 10%", NULL, NULL,
GIMP_ACTION_SELECT_SKIP_PREVIOUS, FALSE,
NULL },
{ "context-foreground-green-increase-skip", GIMP_STOCK_CHANNEL_GREEN,
"Foreground Green Increase 10%", NULL, NULL,
GIMP_ACTION_SELECT_SKIP_NEXT, FALSE,
NULL }
};
static GimpEnumActionEntry context_foreground_blue_actions[] =
{
{ "context-foreground-blue-set", GIMP_STOCK_CHANNEL_BLUE,
"Foreground Blue Set", NULL, NULL,
GIMP_ACTION_SELECT_SET, TRUE,
NULL },
{ "context-foreground-blue-minimum", GIMP_STOCK_CHANNEL_BLUE,
"Foreground Blue Minimum", NULL, NULL,
GIMP_ACTION_SELECT_FIRST, FALSE,
NULL },
{ "context-foreground-blue-maximum", GIMP_STOCK_CHANNEL_BLUE,
"Foreground Blue Maximum", NULL, NULL,
GIMP_ACTION_SELECT_LAST, FALSE,
NULL },
{ "context-foreground-blue-decrease", GIMP_STOCK_CHANNEL_BLUE,
"Foreground Blue Decrease", NULL, NULL,
GIMP_ACTION_SELECT_PREVIOUS, FALSE,
NULL },
{ "context-foreground-blue-increase", GIMP_STOCK_CHANNEL_BLUE,
"Foreground Blue Increase", NULL, NULL,
GIMP_ACTION_SELECT_NEXT, FALSE,
NULL },
{ "context-foreground-blue-decrease-skip", GIMP_STOCK_CHANNEL_BLUE,
"Foreground Blue Decrease 10%", NULL, NULL,
GIMP_ACTION_SELECT_SKIP_PREVIOUS, FALSE,
NULL },
{ "context-foreground-blue-increase-skip", GIMP_STOCK_CHANNEL_BLUE,
"Foreground Blue Increase 10%", NULL, NULL,
GIMP_ACTION_SELECT_SKIP_NEXT, FALSE,
NULL }
};
static GimpEnumActionEntry context_background_red_actions[] =
{
{ "context-background-red-set", GIMP_STOCK_CHANNEL_RED,
"Background Red Set", NULL, NULL,
GIMP_ACTION_SELECT_SET, TRUE,
NULL },
{ "context-background-red-minimum", GIMP_STOCK_CHANNEL_RED,
"Background Red Minimum", NULL, NULL,
GIMP_ACTION_SELECT_FIRST, FALSE,
NULL },
{ "context-background-red-maximum", GIMP_STOCK_CHANNEL_RED,
"Background Red Maximum", NULL, NULL,
GIMP_ACTION_SELECT_LAST, FALSE,
NULL },
{ "context-background-red-decrease", GIMP_STOCK_CHANNEL_RED,
"Background Red Decrease", NULL, NULL,
GIMP_ACTION_SELECT_PREVIOUS, FALSE,
NULL },
{ "context-background-red-increase", GIMP_STOCK_CHANNEL_RED,
"Background Red Increase", NULL, NULL,
GIMP_ACTION_SELECT_NEXT, FALSE,
NULL },
{ "context-background-red-decrease-skip", GIMP_STOCK_CHANNEL_RED,
"Background Red Decrease 10%", NULL, NULL,
GIMP_ACTION_SELECT_SKIP_PREVIOUS, FALSE,
NULL },
{ "context-background-red-increase-skip", GIMP_STOCK_CHANNEL_RED,
"Background Red Increase 10%", NULL, NULL,
GIMP_ACTION_SELECT_SKIP_NEXT, FALSE,
NULL }
};
static GimpEnumActionEntry context_background_green_actions[] =
{
{ "context-background-green-set", GIMP_STOCK_CHANNEL_GREEN,
"Background Green Set", NULL, NULL,
GIMP_ACTION_SELECT_SET, TRUE,
NULL },
{ "context-background-green-minimum", GIMP_STOCK_CHANNEL_GREEN,
"Background Green Minimum", NULL, NULL,
GIMP_ACTION_SELECT_FIRST, FALSE,
NULL },
{ "context-background-green-maximum", GIMP_STOCK_CHANNEL_GREEN,
"Background Green Maximum", NULL, NULL,
GIMP_ACTION_SELECT_LAST, FALSE,
NULL },
{ "context-background-green-decrease", GIMP_STOCK_CHANNEL_GREEN,
"Background Green Decrease", NULL, NULL,
GIMP_ACTION_SELECT_PREVIOUS, FALSE,
NULL },
{ "context-background-green-increase", GIMP_STOCK_CHANNEL_GREEN,
"Background Green Increase", NULL, NULL,
GIMP_ACTION_SELECT_NEXT, FALSE,
NULL },
{ "context-background-green-decrease-skip", GIMP_STOCK_CHANNEL_GREEN,
"Background Green Decrease 10%", NULL, NULL,
GIMP_ACTION_SELECT_SKIP_PREVIOUS, FALSE,
NULL },
{ "context-background-green-increase-skip", GIMP_STOCK_CHANNEL_GREEN,
"Background Green Increase 10%", NULL, NULL,
GIMP_ACTION_SELECT_SKIP_NEXT, FALSE,
NULL }
};
static GimpEnumActionEntry context_background_blue_actions[] =
{
{ "context-background-blue-set", GIMP_STOCK_CHANNEL_BLUE,
"Background Blue Set", NULL, NULL,
GIMP_ACTION_SELECT_SET, TRUE,
NULL },
{ "context-background-blue-minimum", GIMP_STOCK_CHANNEL_BLUE,
"Background Blue Minimum", NULL, NULL,
GIMP_ACTION_SELECT_FIRST, FALSE,
NULL },
{ "context-background-blue-maximum", GIMP_STOCK_CHANNEL_BLUE,
"Background Blue Maximum", NULL, NULL,
GIMP_ACTION_SELECT_LAST, FALSE,
NULL },
{ "context-background-blue-decrease", GIMP_STOCK_CHANNEL_BLUE,
"Background Blue Decrease", NULL, NULL,
GIMP_ACTION_SELECT_PREVIOUS, FALSE,
NULL },
{ "context-background-blue-increase", GIMP_STOCK_CHANNEL_BLUE,
"Background Blue Increase", NULL, NULL,
GIMP_ACTION_SELECT_NEXT, FALSE,
NULL },
{ "context-background-blue-decrease-skip", GIMP_STOCK_CHANNEL_BLUE,
"Background Blue Decrease 10%", NULL, NULL,
GIMP_ACTION_SELECT_SKIP_PREVIOUS, FALSE,
NULL },
{ "context-background-blue-increase-skip", GIMP_STOCK_CHANNEL_BLUE,
"Background Blue Increase 10%", NULL, NULL,
GIMP_ACTION_SELECT_SKIP_NEXT, FALSE,
NULL }
};
static GimpEnumActionEntry context_opacity_actions[] =
{
{ "context-opacity-set", GIMP_STOCK_TRANSPARENCY,
"Set Transparency", NULL, NULL,
GIMP_ACTION_SELECT_SET, TRUE,
NULL },
{ "context-opacity-transparent", GIMP_STOCK_TRANSPARENCY,
"Completely Transparent", NULL, NULL,
GIMP_ACTION_SELECT_FIRST, FALSE,
NULL },
{ "context-opacity-opaque", GIMP_STOCK_TRANSPARENCY,
"Completely Opaque", NULL, NULL,
GIMP_ACTION_SELECT_LAST, FALSE,
NULL },
{ "context-opacity-decrease", GIMP_STOCK_TRANSPARENCY,
"More Transparent", NULL, NULL,
GIMP_ACTION_SELECT_PREVIOUS, FALSE,
NULL },
{ "context-opacity-increase", GIMP_STOCK_TRANSPARENCY,
"More Opaque", NULL, NULL,
GIMP_ACTION_SELECT_NEXT, FALSE,
NULL },
{ "context-opacity-decrease-skip", GIMP_STOCK_TRANSPARENCY,
"10% More Transparent", NULL, NULL,
GIMP_ACTION_SELECT_SKIP_PREVIOUS, FALSE,
NULL },
{ "context-opacity-increase-skip", GIMP_STOCK_TRANSPARENCY,
"10% More Opaque", NULL, NULL,
GIMP_ACTION_SELECT_SKIP_NEXT, FALSE,
NULL }
};
static GimpEnumActionEntry context_paint_mode_actions[] =
{
{ "context-paint-mode-first", GIMP_STOCK_TOOL_PENCIL,
"First Paint Mode", NULL, NULL,
GIMP_ACTION_SELECT_FIRST, FALSE,
NULL },
{ "context-paint-mode-last", GIMP_STOCK_TOOL_PENCIL,
"Last Paint Mode", NULL, NULL,
GIMP_ACTION_SELECT_LAST, FALSE,
NULL },
{ "context-paint-mode-previous", GIMP_STOCK_TOOL_PENCIL,
"Previous Paint Mode", NULL, NULL,
GIMP_ACTION_SELECT_PREVIOUS, FALSE,
NULL },
{ "context-paint-mode-next", GIMP_STOCK_TOOL_PENCIL,
"Next Paint Mode", NULL, NULL,
GIMP_ACTION_SELECT_NEXT, FALSE,
NULL }
};
static GimpEnumActionEntry context_tool_select_actions[] =
{
{ "context-tool-select-first", GIMP_STOCK_TOOLS,
"First Tool", NULL, NULL,
GIMP_ACTION_SELECT_FIRST, FALSE,
NULL },
{ "context-tool-select-last", GIMP_STOCK_TOOLS,
"Last Tool", NULL, NULL,
GIMP_ACTION_SELECT_LAST, FALSE,
NULL },
{ "context-tool-select-previous", GIMP_STOCK_TOOLS,
"Previous Tool", NULL, NULL,
GIMP_ACTION_SELECT_PREVIOUS, FALSE,
NULL },
{ "context-tool-select-next", GIMP_STOCK_TOOLS,
"Next Tool", NULL, NULL,
GIMP_ACTION_SELECT_NEXT, FALSE,
NULL }
};
static GimpEnumActionEntry context_brush_select_actions[] =
{
{ "context-brush-select-first", GIMP_STOCK_BRUSH,
"First Brush", NULL, NULL,
GIMP_ACTION_SELECT_FIRST, FALSE,
NULL },
{ "context-brush-select-last", GIMP_STOCK_BRUSH,
"Last Brush", NULL, NULL,
GIMP_ACTION_SELECT_LAST, FALSE,
NULL },
{ "context-brush-select-previous", GIMP_STOCK_BRUSH,
"Previous Brush", NULL, NULL,
GIMP_ACTION_SELECT_PREVIOUS, FALSE,
NULL },
{ "context-brush-select-next", GIMP_STOCK_BRUSH,
"Next Brush", NULL, NULL,
GIMP_ACTION_SELECT_NEXT, FALSE,
NULL }
};
static GimpEnumActionEntry context_pattern_select_actions[] =
{
{ "context-pattern-select-first", GIMP_STOCK_PATTERN,
"First Pattern", NULL, NULL,
GIMP_ACTION_SELECT_FIRST, FALSE,
NULL },
{ "context-pattern-select-last", GIMP_STOCK_PATTERN,
"Last Pattern", NULL, NULL,
GIMP_ACTION_SELECT_LAST, FALSE,
NULL },
{ "context-pattern-select-previous", GIMP_STOCK_PATTERN,
"Previous Pattern", NULL, NULL,
GIMP_ACTION_SELECT_PREVIOUS, FALSE,
NULL },
{ "context-pattern-select-next", GIMP_STOCK_PATTERN,
"Next Pattern", NULL, NULL,
GIMP_ACTION_SELECT_NEXT, FALSE,
NULL }
};
static GimpEnumActionEntry context_palette_select_actions[] =
{
{ "context-palette-select-first", GIMP_STOCK_PALETTE,
"First Palette", NULL, NULL,
GIMP_ACTION_SELECT_FIRST, FALSE,
NULL },
{ "context-palette-select-last", GIMP_STOCK_PALETTE,
"Last Palette", NULL, NULL,
GIMP_ACTION_SELECT_LAST, FALSE,
NULL },
{ "context-palette-select-previous", GIMP_STOCK_PALETTE,
"Previous Palette", NULL, NULL,
GIMP_ACTION_SELECT_PREVIOUS, FALSE,
NULL },
{ "context-palette-select-next", GIMP_STOCK_PALETTE,
"Next Palette", NULL, NULL,
GIMP_ACTION_SELECT_NEXT, FALSE,
NULL }
};
static GimpEnumActionEntry context_gradient_select_actions[] =
{
{ "context-gradient-select-first", GIMP_STOCK_GRADIENT,
"First Gradient", NULL, NULL,
GIMP_ACTION_SELECT_FIRST, FALSE,
NULL },
{ "context-gradient-select-last", GIMP_STOCK_GRADIENT,
"Last Gradient", NULL, NULL,
GIMP_ACTION_SELECT_LAST, FALSE,
NULL },
{ "context-gradient-select-previous", GIMP_STOCK_GRADIENT,
"Previous Gradient", NULL, NULL,
GIMP_ACTION_SELECT_PREVIOUS, FALSE,
NULL },
{ "context-gradient-select-next", GIMP_STOCK_GRADIENT,
"Next Gradient", NULL, NULL,
GIMP_ACTION_SELECT_NEXT, FALSE,
NULL }
};
static GimpEnumActionEntry context_font_select_actions[] =
{
{ "context-font-select-first", GIMP_STOCK_FONT,
"First Font", NULL, NULL,
GIMP_ACTION_SELECT_FIRST, FALSE,
NULL },
{ "context-font-select-last", GIMP_STOCK_FONT,
"Last Font", NULL, NULL,
GIMP_ACTION_SELECT_LAST, FALSE,
NULL },
{ "context-font-select-previous", GIMP_STOCK_FONT,
"Previous Font", NULL, NULL,
GIMP_ACTION_SELECT_PREVIOUS, FALSE,
NULL },
{ "context-font-select-next", GIMP_STOCK_FONT,
"Next Font", NULL, NULL,
GIMP_ACTION_SELECT_NEXT, FALSE,
NULL }
};
static GimpEnumActionEntry context_brush_shape_actions[] =
{
{ "context-brush-shape-circle", GIMP_STOCK_BRUSH,
"Circular Brush", NULL, NULL,
GIMP_BRUSH_GENERATED_CIRCLE, FALSE,
NULL },
{ "context-brush-shape-square", GIMP_STOCK_BRUSH,
"Square Brush", NULL, NULL,
GIMP_BRUSH_GENERATED_SQUARE, FALSE,
NULL },
{ "context-brush-shape-diamond", GIMP_STOCK_BRUSH,
"Diamond Brush", NULL, NULL,
GIMP_BRUSH_GENERATED_DIAMOND, FALSE,
NULL }
};
static GimpEnumActionEntry context_brush_radius_actions[] =
{
{ "context-brush-radius-set", GIMP_STOCK_BRUSH,
"Set Brush Radius", NULL, NULL,
GIMP_ACTION_SELECT_SET, TRUE,
NULL },
{ "context-brush-radius-minimum", GIMP_STOCK_BRUSH,
"Minumum Radius", NULL, NULL,
GIMP_ACTION_SELECT_FIRST, FALSE,
NULL },
{ "context-brush-radius-maximum", GIMP_STOCK_BRUSH,
"Maximum Radius", NULL, NULL,
GIMP_ACTION_SELECT_LAST, FALSE,
NULL },
{ "context-brush-radius-decrease", GIMP_STOCK_BRUSH,
"Decrease Radius", NULL, NULL,
GIMP_ACTION_SELECT_PREVIOUS, FALSE,
NULL },
{ "context-brush-radius-increase", GIMP_STOCK_BRUSH,
"Increase Radius", NULL, NULL,
GIMP_ACTION_SELECT_NEXT, FALSE,
NULL },
{ "context-brush-radius-decrease-skip", GIMP_STOCK_BRUSH,
"Decrease Radius More", NULL, NULL,
GIMP_ACTION_SELECT_SKIP_PREVIOUS, FALSE,
NULL },
{ "context-brush-radius-increase-skip", GIMP_STOCK_BRUSH,
"Increase Radius More", NULL, NULL,
GIMP_ACTION_SELECT_SKIP_NEXT, FALSE,
NULL },
};
static GimpEnumActionEntry context_brush_spikes_actions[] =
{
{ "context-brush-spikes-set", GIMP_STOCK_BRUSH,
"Set Brush Spikes", NULL, NULL,
GIMP_ACTION_SELECT_SET, TRUE,
NULL },
{ "context-brush-spikes-minimum", GIMP_STOCK_BRUSH,
"Minumum Spikes", NULL, NULL,
GIMP_ACTION_SELECT_FIRST, FALSE,
NULL },
{ "context-brush-spikes-maximum", GIMP_STOCK_BRUSH,
"Maximum Spikes", NULL, NULL,
GIMP_ACTION_SELECT_LAST, FALSE,
NULL },
{ "context-brush-spikes-decrease", GIMP_STOCK_BRUSH,
"Decrease Spikes", NULL, NULL,
GIMP_ACTION_SELECT_PREVIOUS, FALSE,
NULL },
{ "context-brush-spikes-increase", GIMP_STOCK_BRUSH,
"Increase Spikes", NULL, NULL,
GIMP_ACTION_SELECT_NEXT, FALSE,
NULL },
{ "context-brush-spikes-decrease-skip", GIMP_STOCK_BRUSH,
"Decrease Spikes More", NULL, NULL,
GIMP_ACTION_SELECT_SKIP_PREVIOUS, FALSE,
NULL },
{ "context-brush-spikes-increase-skip", GIMP_STOCK_BRUSH,
"Increase Spikes More", NULL, NULL,
GIMP_ACTION_SELECT_SKIP_NEXT, FALSE,
NULL },
};
static GimpEnumActionEntry context_brush_hardness_actions[] =
{
{ "context-brush-hardness-set", GIMP_STOCK_BRUSH,
"Set Brush Hardness", NULL, NULL,
GIMP_ACTION_SELECT_SET, TRUE,
NULL },
{ "context-brush-hardness-minimum", GIMP_STOCK_BRUSH,
"Minumum Hardness", NULL, NULL,
GIMP_ACTION_SELECT_FIRST, FALSE,
NULL },
{ "context-brush-hardness-maximum", GIMP_STOCK_BRUSH,
"Maximum Hardness", NULL, NULL,
GIMP_ACTION_SELECT_LAST, FALSE,
NULL },
{ "context-brush-hardness-decrease", GIMP_STOCK_BRUSH,
"Decrease Hardness", NULL, NULL,
GIMP_ACTION_SELECT_PREVIOUS, FALSE,
NULL },
{ "context-brush-hardness-increase", GIMP_STOCK_BRUSH,
"Increase Hardness", NULL, NULL,
GIMP_ACTION_SELECT_NEXT, FALSE,
NULL },
{ "context-brush-hardness-decrease-skip", GIMP_STOCK_BRUSH,
"Decrease Hardness More", NULL, NULL,
GIMP_ACTION_SELECT_SKIP_PREVIOUS, FALSE,
NULL },
{ "context-brush-hardness-increase-skip", GIMP_STOCK_BRUSH,
"Increase Hardness More", NULL, NULL,
GIMP_ACTION_SELECT_SKIP_NEXT, FALSE,
NULL },
};
static GimpEnumActionEntry context_brush_aspect_actions[] =
{
{ "context-brush-aspect-set", GIMP_STOCK_BRUSH,
"Set Brush Aspect", NULL, NULL,
GIMP_ACTION_SELECT_SET, TRUE,
NULL },
{ "context-brush-aspect-minimum", GIMP_STOCK_BRUSH,
"Minumum Aspect", NULL, NULL,
GIMP_ACTION_SELECT_FIRST, FALSE,
NULL },
{ "context-brush-aspect-maximum", GIMP_STOCK_BRUSH,
"Maximum Aspect", NULL, NULL,
GIMP_ACTION_SELECT_LAST, FALSE,
NULL },
{ "context-brush-aspect-decrease", GIMP_STOCK_BRUSH,
"Decrease Aspect", NULL, NULL,
GIMP_ACTION_SELECT_PREVIOUS, FALSE,
NULL },
{ "context-brush-aspect-increase", GIMP_STOCK_BRUSH,
"Increase Aspect", NULL, NULL,
GIMP_ACTION_SELECT_NEXT, FALSE,
NULL },
{ "context-brush-aspect-decrease-skip", GIMP_STOCK_BRUSH,
"Decrease Aspect More", NULL, NULL,
GIMP_ACTION_SELECT_SKIP_PREVIOUS, FALSE,
NULL },
{ "context-brush-aspect-increase-skip", GIMP_STOCK_BRUSH,
"Increase Aspect More", NULL, NULL,
GIMP_ACTION_SELECT_SKIP_NEXT, FALSE,
NULL },
};
static GimpEnumActionEntry context_brush_angle_actions[] =
{
{ "context-brush-angle-set", GIMP_STOCK_BRUSH,
"Set Brush Angle", NULL, NULL,
GIMP_ACTION_SELECT_SET, TRUE,
NULL },
{ "context-brush-angle-minimum", GIMP_STOCK_BRUSH,
"Horizontal", NULL, NULL,
GIMP_ACTION_SELECT_FIRST, FALSE,
NULL },
{ "context-brush-angle-maximum", GIMP_STOCK_BRUSH,
"Vertical", NULL, NULL,
GIMP_ACTION_SELECT_LAST, FALSE,
NULL },
{ "context-brush-angle-decrease", GIMP_STOCK_BRUSH,
"Rotate Right", NULL, NULL,
GIMP_ACTION_SELECT_PREVIOUS, FALSE,
NULL },
{ "context-brush-angle-increase", GIMP_STOCK_BRUSH,
"Rotate Left", NULL, NULL,
GIMP_ACTION_SELECT_NEXT, FALSE,
NULL },
{ "context-brush-angle-decrease-skip", GIMP_STOCK_BRUSH,
"Rotate Right 15 degrees", NULL, NULL,
GIMP_ACTION_SELECT_SKIP_PREVIOUS, FALSE,
NULL },
{ "context-brush-angle-increase-skip", GIMP_STOCK_BRUSH,
"Rotate Left 15 degrees", NULL, NULL,
GIMP_ACTION_SELECT_SKIP_NEXT, FALSE,
NULL },
};
void
context_actions_setup (GimpActionGroup *group)
{
gimp_action_group_add_actions (group,
context_actions,
G_N_ELEMENTS (context_actions));
gimp_action_group_add_enum_actions (group,
context_foreground_red_actions,
G_N_ELEMENTS (context_foreground_red_actions),
G_CALLBACK (context_foreground_red_cmd_callback));
gimp_action_group_add_enum_actions (group,
context_foreground_green_actions,
G_N_ELEMENTS (context_foreground_green_actions),
G_CALLBACK (context_foreground_green_cmd_callback));
gimp_action_group_add_enum_actions (group,
context_foreground_blue_actions,
G_N_ELEMENTS (context_foreground_blue_actions),
G_CALLBACK (context_foreground_blue_cmd_callback));
gimp_action_group_add_enum_actions (group,
context_background_red_actions,
G_N_ELEMENTS (context_background_red_actions),
G_CALLBACK (context_background_red_cmd_callback));
gimp_action_group_add_enum_actions (group,
context_background_green_actions,
G_N_ELEMENTS (context_background_green_actions),
G_CALLBACK (context_background_green_cmd_callback));
gimp_action_group_add_enum_actions (group,
context_background_blue_actions,
G_N_ELEMENTS (context_background_blue_actions),
G_CALLBACK (context_background_blue_cmd_callback));
gimp_action_group_add_enum_actions (group,
context_opacity_actions,
G_N_ELEMENTS (context_opacity_actions),
G_CALLBACK (context_opacity_cmd_callback));
gimp_action_group_add_enum_actions (group,
context_paint_mode_actions,
G_N_ELEMENTS (context_paint_mode_actions),
G_CALLBACK (context_paint_mode_cmd_callback));
gimp_action_group_add_enum_actions (group,
context_tool_select_actions,
G_N_ELEMENTS (context_tool_select_actions),
G_CALLBACK (context_tool_select_cmd_callback));
gimp_action_group_add_enum_actions (group,
context_brush_select_actions,
G_N_ELEMENTS (context_brush_select_actions),
G_CALLBACK (context_brush_select_cmd_callback));
gimp_action_group_add_enum_actions (group,
context_pattern_select_actions,
G_N_ELEMENTS (context_pattern_select_actions),
G_CALLBACK (context_pattern_select_cmd_callback));
gimp_action_group_add_enum_actions (group,
context_palette_select_actions,
G_N_ELEMENTS (context_palette_select_actions),
G_CALLBACK (context_palette_select_cmd_callback));
gimp_action_group_add_enum_actions (group,
context_gradient_select_actions,
G_N_ELEMENTS (context_gradient_select_actions),
G_CALLBACK (context_gradient_select_cmd_callback));
gimp_action_group_add_enum_actions (group,
context_font_select_actions,
G_N_ELEMENTS (context_font_select_actions),
G_CALLBACK (context_font_select_cmd_callback));
gimp_action_group_add_enum_actions (group,
context_brush_shape_actions,
G_N_ELEMENTS (context_brush_shape_actions),
G_CALLBACK (context_brush_shape_cmd_callback));
gimp_action_group_add_enum_actions (group,
context_brush_radius_actions,
G_N_ELEMENTS (context_brush_radius_actions),
G_CALLBACK (context_brush_radius_cmd_callback));
gimp_action_group_add_enum_actions (group,
context_brush_spikes_actions,
G_N_ELEMENTS (context_brush_spikes_actions),
G_CALLBACK (context_brush_spikes_cmd_callback));
gimp_action_group_add_enum_actions (group,
context_brush_hardness_actions,
G_N_ELEMENTS (context_brush_hardness_actions),
G_CALLBACK (context_brush_hardness_cmd_callback));
gimp_action_group_add_enum_actions (group,
context_brush_aspect_actions,
G_N_ELEMENTS (context_brush_aspect_actions),
G_CALLBACK (context_brush_aspect_cmd_callback));
gimp_action_group_add_enum_actions (group,
context_brush_angle_actions,
G_N_ELEMENTS (context_brush_angle_actions),
G_CALLBACK (context_brush_angle_cmd_callback));
}
void
context_actions_update (GimpActionGroup *group,
gpointer data)
{
GimpContext *context = action_data_get_context (data);
gboolean generated = FALSE;
gdouble radius = 0.0;
gint spikes = 0;
gdouble hardness = 0.0;
gdouble aspect = 0.0;
gdouble angle = 0.0;
if (context)
{
GimpBrush *brush = gimp_context_get_brush (context);
if (GIMP_IS_BRUSH_GENERATED (brush))
{
GimpBrushGenerated *gen = GIMP_BRUSH_GENERATED (brush);
generated = TRUE;
radius = gimp_brush_generated_get_radius (gen);
spikes = gimp_brush_generated_get_spikes (gen);
hardness = gimp_brush_generated_get_hardness (gen);
aspect = gimp_brush_generated_get_aspect_ratio (gen);
angle = gimp_brush_generated_get_angle (gen);
}
}
#define SET_SENSITIVE(action,condition) \
gimp_action_group_set_action_sensitive (group, "context-" action, (condition) != 0)
#if 0
SET_SENSITIVE ("brush-radius-minimum", generated && radius > 1.0);
SET_SENSITIVE ("brush-radius-decrease", generated && radius > 1.0);
SET_SENSITIVE ("brush-radius-decrease-skip", generated && radius > 1.0);
SET_SENSITIVE ("brush-radius-maximum", generated && radius < 4096.0);
SET_SENSITIVE ("brush-radius-increase", generated && radius < 4096.0);
SET_SENSITIVE ("brush-radius-increase-skip", generated && radius < 4096.0);
SET_SENSITIVE ("brush-angle-minimum", generated);
SET_SENSITIVE ("brush-angle-decrease", generated);
SET_SENSITIVE ("brush-angle-decrease-skip", generated);
SET_SENSITIVE ("brush-angle-maximum", generated);
SET_SENSITIVE ("brush-angle-increase", generated);
SET_SENSITIVE ("brush-angle-increase-skip", generated);
#endif
#undef SET_SENSITIVE
}

View File

@ -0,0 +1,28 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __CONTEXT_ACTIONS_H__
#define __CONTEXT_ACTIONS_H__
void context_actions_setup (GimpActionGroup *group);
void context_actions_update (GimpActionGroup *group,
gpointer data);
#endif /* __CONTEXT_ACTIONS_H__ */

View File

@ -0,0 +1,489 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <string.h>
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"
#include "actions-types.h"
#include "core/gimp.h"
#include "core/gimpbrushgenerated.h"
#include "core/gimpcontext.h"
#include "core/gimpdatafactory.h"
#include "core/gimplist.h"
#include "actions.h"
#include "context-commands.h"
static const GimpLayerModeEffects paint_modes[] =
{
GIMP_NORMAL_MODE,
GIMP_DISSOLVE_MODE,
GIMP_BEHIND_MODE,
GIMP_COLOR_ERASE_MODE,
GIMP_MULTIPLY_MODE,
GIMP_DIVIDE_MODE,
GIMP_SCREEN_MODE,
GIMP_OVERLAY_MODE,
GIMP_DODGE_MODE,
GIMP_BURN_MODE,
GIMP_HARDLIGHT_MODE,
GIMP_SOFTLIGHT_MODE,
GIMP_GRAIN_EXTRACT_MODE,
GIMP_GRAIN_MERGE_MODE,
GIMP_DIFFERENCE_MODE,
GIMP_ADDITION_MODE,
GIMP_SUBTRACT_MODE,
GIMP_DARKEN_ONLY_MODE,
GIMP_LIGHTEN_ONLY_MODE,
GIMP_HUE_MODE,
GIMP_SATURATION_MODE,
GIMP_COLOR_MODE,
GIMP_VALUE_MODE
};
/* local function prototypes */
static void context_select_object (GimpActionSelectType select_type,
GimpContext *context,
GimpContainer *container);
static gint context_paint_mode_index (GimpLayerModeEffects paint_mode);
/* public functions */
void
context_colors_default_cmd_callback (GtkAction *action,
gpointer data)
{
GimpContext *context;
return_if_no_context (context, data);
gimp_context_set_default_colors (context);
}
void
context_colors_swap_cmd_callback (GtkAction *action,
gpointer data)
{
GimpContext *context;
return_if_no_context (context, data);
gimp_context_swap_colors (context);
}
void
context_foreground_red_cmd_callback (GtkAction *action,
gint value,
gpointer data)
{
GimpContext *context;
GimpRGB color;
return_if_no_context (context, data);
gimp_context_get_foreground (context, &color);
color.r = action_select_value ((GimpActionSelectType) value,
color.r,
0.0, 1.0,
0.01, 0.1, FALSE);
gimp_context_set_foreground (context, &color);
}
void
context_foreground_green_cmd_callback (GtkAction *action,
gint value,
gpointer data)
{
GimpContext *context;
GimpRGB color;
return_if_no_context (context, data);
gimp_context_get_foreground (context, &color);
color.g = action_select_value ((GimpActionSelectType) value,
color.g,
0.0, 1.0,
0.01, 0.1, FALSE);
gimp_context_set_foreground (context, &color);
}
void
context_foreground_blue_cmd_callback (GtkAction *action,
gint value,
gpointer data)
{
GimpContext *context;
GimpRGB color;
return_if_no_context (context, data);
gimp_context_get_foreground (context, &color);
color.b = action_select_value ((GimpActionSelectType) value,
color.b,
0.0, 1.0,
0.01, 0.1, FALSE);
gimp_context_set_foreground (context, &color);
}
void
context_background_red_cmd_callback (GtkAction *action,
gint value,
gpointer data)
{
GimpContext *context;
GimpRGB color;
return_if_no_context (context, data);
gimp_context_get_background (context, &color);
color.r = action_select_value ((GimpActionSelectType) value,
color.r,
0.0, 1.0,
0.01, 0.1, FALSE);
gimp_context_set_background (context, &color);
}
void
context_background_green_cmd_callback (GtkAction *action,
gint value,
gpointer data)
{
GimpContext *context;
GimpRGB color;
return_if_no_context (context, data);
gimp_context_get_background (context, &color);
color.g = action_select_value ((GimpActionSelectType) value,
color.g,
0.0, 1.0,
0.01, 0.1, FALSE);
gimp_context_set_background (context, &color);
}
void
context_background_blue_cmd_callback (GtkAction *action,
gint value,
gpointer data)
{
GimpContext *context;
GimpRGB color;
return_if_no_context (context, data);
gimp_context_get_background (context, &color);
color.b = action_select_value ((GimpActionSelectType) value,
color.b,
0.0, 1.0,
0.01, 0.1, FALSE);
gimp_context_set_background (context, &color);
}
void
context_opacity_cmd_callback (GtkAction *action,
gint value,
gpointer data)
{
GimpContext *context;
gdouble opacity;
return_if_no_context (context, data);
opacity = action_select_value ((GimpActionSelectType) value,
gimp_context_get_opacity (context),
GIMP_OPACITY_TRANSPARENT,
GIMP_OPACITY_OPAQUE,
0.01, 0.1, FALSE);
gimp_context_set_opacity (context, opacity);
}
void
context_paint_mode_cmd_callback (GtkAction *action,
gint value,
gpointer data)
{
GimpContext *context;
GimpLayerModeEffects paint_mode;
gint index;
return_if_no_context (context, data);
paint_mode = gimp_context_get_paint_mode (context);
index = action_select_value ((GimpActionSelectType) value,
context_paint_mode_index (paint_mode),
0, G_N_ELEMENTS (paint_modes) - 1,
1.0, 1.0, FALSE);
gimp_context_set_paint_mode (context, paint_modes[index]);
}
void
context_tool_select_cmd_callback (GtkAction *action,
gint value,
gpointer data)
{
GimpContext *context;
return_if_no_context (context, data);
context_select_object ((GimpActionSelectType) value,
context, context->gimp->tool_info_list);
}
void
context_brush_select_cmd_callback (GtkAction *action,
gint value,
gpointer data)
{
GimpContext *context;
return_if_no_context (context, data);
context_select_object ((GimpActionSelectType) value,
context, context->gimp->brush_factory->container);
}
void
context_pattern_select_cmd_callback (GtkAction *action,
gint value,
gpointer data)
{
GimpContext *context;
return_if_no_context (context, data);
context_select_object ((GimpActionSelectType) value,
context, context->gimp->pattern_factory->container);
}
void
context_palette_select_cmd_callback (GtkAction *action,
gint value,
gpointer data)
{
GimpContext *context;
return_if_no_context (context, data);
context_select_object ((GimpActionSelectType) value,
context, context->gimp->palette_factory->container);
}
void
context_gradient_select_cmd_callback (GtkAction *action,
gint value,
gpointer data)
{
GimpContext *context;
return_if_no_context (context, data);
context_select_object ((GimpActionSelectType) value,
context, context->gimp->gradient_factory->container);
}
void
context_font_select_cmd_callback (GtkAction *action,
gint value,
gpointer data)
{
GimpContext *context;
return_if_no_context (context, data);
context_select_object ((GimpActionSelectType) value,
context, context->gimp->fonts);
}
void
context_brush_shape_cmd_callback (GtkAction *action,
gint value,
gpointer data)
{
GimpContext *context;
GimpBrush *brush;
return_if_no_context (context, data);
brush = gimp_context_get_brush (context);
if (GIMP_IS_BRUSH_GENERATED (brush))
{
GimpBrushGenerated *generated = GIMP_BRUSH_GENERATED (brush);
gimp_brush_generated_set_shape (generated,
(GimpBrushGeneratedShape) value);
}
}
void
context_brush_radius_cmd_callback (GtkAction *action,
gint value,
gpointer data)
{
GimpContext *context;
GimpBrush *brush;
return_if_no_context (context, data);
brush = gimp_context_get_brush (context);
if (GIMP_IS_BRUSH_GENERATED (brush))
{
GimpBrushGenerated *generated = GIMP_BRUSH_GENERATED (brush);
gdouble radius;
radius = gimp_brush_generated_get_radius (generated);
radius = action_select_value ((GimpActionSelectType) value,
radius,
1.0, 256.0,
1.0, 10.0, FALSE);
gimp_brush_generated_set_radius (generated, radius);
}
}
void
context_brush_spikes_cmd_callback (GtkAction *action,
gint value,
gpointer data)
{
GimpContext *context;
GimpBrush *brush;
return_if_no_context (context, data);
brush = gimp_context_get_brush (context);
if (GIMP_IS_BRUSH_GENERATED (brush))
{
GimpBrushGenerated *generated = GIMP_BRUSH_GENERATED (brush);
gint spikes;
spikes = gimp_brush_generated_get_spikes (generated);
spikes = action_select_value ((GimpActionSelectType) value,
spikes,
2.0, 20.0,
1.0, 4.0, FALSE);
gimp_brush_generated_set_spikes (generated, spikes);
}
}
void
context_brush_hardness_cmd_callback (GtkAction *action,
gint value,
gpointer data)
{
GimpContext *context;
GimpBrush *brush;
return_if_no_context (context, data);
brush = gimp_context_get_brush (context);
if (GIMP_IS_BRUSH_GENERATED (brush))
{
GimpBrushGenerated *generated = GIMP_BRUSH_GENERATED (brush);
gdouble hardness;
hardness = gimp_brush_generated_get_hardness (generated);
hardness = action_select_value ((GimpActionSelectType) value,
hardness,
0.0, 1.0,
0.01, 0.1, FALSE);
gimp_brush_generated_set_hardness (generated, hardness);
}
}
void
context_brush_aspect_cmd_callback (GtkAction *action,
gint value,
gpointer data)
{
GimpContext *context;
GimpBrush *brush;
return_if_no_context (context, data);
brush = gimp_context_get_brush (context);
if (GIMP_IS_BRUSH_GENERATED (brush))
{
GimpBrushGenerated *generated = GIMP_BRUSH_GENERATED (brush);
gdouble aspect;
aspect = gimp_brush_generated_get_aspect_ratio (generated);
aspect = action_select_value ((GimpActionSelectType) value,
aspect,
1.0, 20.0,
1.0, 4.0, FALSE);
gimp_brush_generated_set_aspect_ratio (generated, aspect);
}
}
void
context_brush_angle_cmd_callback (GtkAction *action,
gint value,
gpointer data)
{
GimpContext *context;
GimpBrush *brush;
return_if_no_context (context, data);
brush = gimp_context_get_brush (context);
if (GIMP_IS_BRUSH_GENERATED (brush))
{
GimpBrushGenerated *generated = GIMP_BRUSH_GENERATED (brush);
gdouble angle;
angle = gimp_brush_generated_get_angle (generated);
if (value == GIMP_ACTION_SELECT_FIRST)
angle = 0.0;
else if (value == GIMP_ACTION_SELECT_LAST)
angle = 90.0;
else
angle = action_select_value ((GimpActionSelectType) value,
angle,
0.0, 180.0,
1.0, 15.0, TRUE);
gimp_brush_generated_set_angle (generated, angle);
}
}
/* private functions */
static void
context_select_object (GimpActionSelectType select_type,
GimpContext *context,
GimpContainer *container)
{
GimpObject *current;
current = gimp_context_get_by_type (context, container->children_type);
current = action_select_object (select_type, container, current);
if (current)
gimp_context_set_by_type (context, container->children_type, current);
}
static gint
context_paint_mode_index (GimpLayerModeEffects paint_mode)
{
gint i = 0;
while (i < (G_N_ELEMENTS (paint_modes) - 1) && paint_modes[i] != paint_mode)
i++;
return i;
}

View File

@ -0,0 +1,94 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __CONTEXT_COMMANDS_H__
#define __CONTEXT_COMMANDS_H__
void context_colors_default_cmd_callback (GtkAction *action,
gpointer data);
void context_colors_swap_cmd_callback (GtkAction *action,
gpointer data);
void context_foreground_red_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void context_foreground_green_cmd_callback(GtkAction *action,
gint value,
gpointer data);
void context_foreground_blue_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void context_background_red_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void context_background_green_cmd_callback(GtkAction *action,
gint value,
gpointer data);
void context_background_blue_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void context_opacity_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void context_paint_mode_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void context_tool_select_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void context_brush_select_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void context_pattern_select_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void context_palette_select_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void context_gradient_select_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void context_font_select_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void context_brush_shape_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void context_brush_radius_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void context_brush_spikes_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void context_brush_hardness_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void context_brush_aspect_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void context_brush_angle_cmd_callback (GtkAction *action,
gint value,
gpointer data);
#endif /* __CONTEXT_COMMANDS_H__ */

237
app/actions/data-commands.c Normal file
View File

@ -0,0 +1,237 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"
#include "actions-types.h"
#include "core/gimpcontainer.h"
#include "core/gimpcontext.h"
#include "core/gimpdata.h"
#include "core/gimpdatafactory.h"
#include "widgets/gimpcontainerview.h"
#include "widgets/gimpdataeditor.h"
#include "widgets/gimpdatafactoryview.h"
#include "widgets/gimpdialogfactory.h"
#include "widgets/gimpmessagebox.h"
#include "widgets/gimpmessagedialog.h"
#include "dialogs/dialogs.h"
#include "actions.h"
#include "data-commands.h"
#include "gimp-intl.h"
typedef struct _GimpDataDeleteData GimpDataDeleteData;
struct _GimpDataDeleteData
{
GimpDataFactory *factory;
GimpData *data;
};
/* local function prototypes */
static void data_delete_confirm_response (GtkWidget *dialog,
gint response_id,
GimpDataDeleteData *delete_data);
/* public functions */
void
data_new_data_cmd_callback (GtkAction *action,
gpointer user_data)
{
GimpDataFactoryView *view = GIMP_DATA_FACTORY_VIEW (user_data);
if (view->factory->data_new_func)
{
GimpContext *context;
GimpData *data;
context =
gimp_container_view_get_context (GIMP_CONTAINER_EDITOR (view)->view);
data = gimp_data_factory_data_new (view->factory, _("Untitled"));
if (data)
{
gimp_context_set_by_type (context,
view->factory->container->children_type,
GIMP_OBJECT (data));
gtk_button_clicked (GTK_BUTTON (view->edit_button));
}
}
}
void
data_duplicate_data_cmd_callback (GtkAction *action,
gpointer user_data)
{
GimpDataFactoryView *view = GIMP_DATA_FACTORY_VIEW (user_data);
GimpContext *context;
GimpData *data;
context = gimp_container_view_get_context (GIMP_CONTAINER_EDITOR (view)->view);
data = (GimpData *)
gimp_context_get_by_type (context,
view->factory->container->children_type);
if (data && gimp_container_have (view->factory->container,
GIMP_OBJECT (data)))
{
GimpData *new_data;
new_data = gimp_data_factory_data_duplicate (view->factory, data);
if (new_data)
{
gimp_context_set_by_type (context,
view->factory->container->children_type,
GIMP_OBJECT (new_data));
gtk_button_clicked (GTK_BUTTON (view->edit_button));
}
}
}
void
data_delete_data_cmd_callback (GtkAction *action,
gpointer user_data)
{
GimpDataFactoryView *view = GIMP_DATA_FACTORY_VIEW (user_data);
GimpContext *context;
GimpData *data;
context = gimp_container_view_get_context (GIMP_CONTAINER_EDITOR (view)->view);
data = (GimpData *)
gimp_context_get_by_type (context,
view->factory->container->children_type);
if (data && data->deletable && gimp_container_have (view->factory->container,
GIMP_OBJECT (data)))
{
GimpDataDeleteData *delete_data;
GtkWidget *dialog;
delete_data = g_new0 (GimpDataDeleteData, 1);
delete_data->factory = view->factory;
delete_data->data = data;
dialog = gimp_message_dialog_new (_("Delete Object"), GIMP_STOCK_QUESTION,
GTK_WIDGET (view), 0,
gimp_standard_help_func, NULL,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_DELETE, GTK_RESPONSE_OK,
NULL);
g_signal_connect_object (data, "disconnect",
G_CALLBACK (gtk_widget_destroy),
dialog, G_CONNECT_SWAPPED);
g_signal_connect (dialog, "response",
G_CALLBACK (data_delete_confirm_response),
delete_data);
gimp_message_box_set_primary_text (GIMP_MESSAGE_DIALOG (dialog)->box,
_("Are you sure you want to delete "
"'%s' from the list and from disk?"),
GIMP_OBJECT (data)->name);
gtk_widget_show (dialog);
}
}
void
data_refresh_data_cmd_callback (GtkAction *action,
gpointer user_data)
{
GimpDataFactoryView *view = GIMP_DATA_FACTORY_VIEW (user_data);
gimp_data_factory_data_save (view->factory);
gimp_data_factory_data_init (view->factory, FALSE);
}
void
data_edit_data_cmd_callback (GtkAction *action,
const gchar *value,
gpointer user_data)
{
GimpDataFactoryView *view = GIMP_DATA_FACTORY_VIEW (user_data);
GimpContext *context;
GimpData *data;
context = gimp_container_view_get_context (GIMP_CONTAINER_EDITOR (view)->view);
data = (GimpData *)
gimp_context_get_by_type (context,
view->factory->container->children_type);
if (data && gimp_container_have (view->factory->container,
GIMP_OBJECT (data)))
{
GdkScreen *screen = gtk_widget_get_screen (GTK_WIDGET (view));
GtkWidget *dockable;
dockable = gimp_dialog_factory_dialog_raise (global_dock_factory, screen,
value, -1);
gimp_data_editor_set_data (GIMP_DATA_EDITOR (GTK_BIN (dockable)->child),
data);
}
}
/* private functions */
static void
data_delete_confirm_response (GtkWidget *dialog,
gint response_id,
GimpDataDeleteData *delete_data)
{
gtk_widget_destroy (dialog);
if (response_id == GTK_RESPONSE_OK)
{
GError *error = NULL;
if (! gimp_data_factory_data_delete (delete_data->factory,
delete_data->data,
TRUE, &error))
{
g_message (error->message);
g_clear_error (&error);
}
}
g_free (delete_data);
}

View File

@ -0,0 +1,36 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __DATA_COMMANDS_H__
#define __DATA_COMMANDS_H__
void data_new_data_cmd_callback (GtkAction *action,
gpointer data);
void data_duplicate_data_cmd_callback (GtkAction *action,
gpointer data);
void data_delete_data_cmd_callback (GtkAction *action,
gpointer data);
void data_refresh_data_cmd_callback (GtkAction *action,
gpointer data);
void data_edit_data_cmd_callback (GtkAction *action,
const gchar *value,
gpointer data);
#endif /* __DATA_COMMANDS_H__ */

View File

@ -0,0 +1,70 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"
#include "actions-types.h"
#include "widgets/gimpactiongroup.h"
#include "debug-actions.h"
#include "debug-commands.h"
#ifdef ENABLE_DEBUG_MENU
static GimpActionEntry debug_actions[] =
{
{ "debug-menu", NULL, "D_ebug" },
{ "debug-mem-profile", NULL,
"_Mem Profile", NULL, NULL,
G_CALLBACK (debug_mem_profile_cmd_callback),
NULL },
{ "debug-dump-items", NULL,
"_Dump Items", NULL, NULL,
G_CALLBACK (debug_dump_menus_cmd_callback),
NULL },
{ "debug-dump-managers", NULL,
"Dump _UI Managers", NULL, NULL,
G_CALLBACK (debug_dump_managers_cmd_callback),
NULL }
};
#endif
void
debug_actions_setup (GimpActionGroup *group)
{
#ifdef ENABLE_DEBUG_MENU
gimp_action_group_add_actions (group,
debug_actions,
G_N_ELEMENTS (debug_actions));
#endif
}
void
debug_actions_update (GimpActionGroup *group,
gpointer data)
{
}

View File

@ -0,0 +1,28 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __DEBUG_ACTIONS_H__
#define __DEBUG_ACTIONS_H__
void debug_actions_setup (GimpActionGroup *group);
void debug_actions_update (GimpActionGroup *group,
gpointer data);
#endif /* __DEBUG_ACTIONS_H__ */

View File

@ -0,0 +1,177 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <string.h>
#include <gtk/gtk.h>
#include "libgimpbase/gimpbase.h"
#include "actions-types.h"
#include "core/gimpobject.h"
#include "widgets/gimpmenufactory.h"
#include "widgets/gimpuimanager.h"
#include "menus/menus.h"
#include "debug-commands.h"
#ifdef ENABLE_DEBUG_MENU
/* local function prototypes */
static void debug_dump_menus_recurse_menu (GtkWidget *menu,
gint depth,
gchar *path);
/* public functions */
void
debug_mem_profile_cmd_callback (GtkAction *action,
gpointer data)
{
extern gboolean gimp_debug_memsize;
gimp_debug_memsize = TRUE;
gimp_object_get_memsize (GIMP_OBJECT (data), NULL);
gimp_debug_memsize = FALSE;
}
void
debug_dump_menus_cmd_callback (GtkAction *action,
gpointer data)
{
GList *list;
for (list = global_menu_factory->registered_menus;
list;
list = g_list_next (list))
{
#if 0
FIXME
GimpMenuFactoryEntry *entry = list->data;
GimpItemFactory *item_factory;
item_factory = gimp_item_factory_from_path (entry->identifier);
if (item_factory)
{
GtkWidget *menu_item;
g_print ("%s\n", entry->identifier);
menu_item = gtk_item_factory_get_item (GTK_ITEM_FACTORY (item_factory),
entry->entries[0].entry.path);
if (menu_item &&
menu_item->parent &&
GTK_IS_MENU (menu_item->parent))
debug_dump_menus_recurse_menu (menu_item->parent, 1,
entry->identifier);
g_print ("\n");
}
#endif
}
}
void
debug_dump_managers_cmd_callback (GtkAction *action,
gpointer data)
{
GList *list;
for (list = global_menu_factory->registered_menus;
list;
list = g_list_next (list))
{
GimpMenuFactoryEntry *entry = list->data;
GList *managers;
managers = gimp_ui_managers_from_name (entry->identifier);
if (managers)
{
g_print ("\n\n========================================\n"
"UI Manager: %s\n"
"========================================\n\n",
entry->identifier);
g_print (gtk_ui_manager_get_ui (managers->data));
}
}
}
/* private functions */
static void
debug_dump_menus_recurse_menu (GtkWidget *menu,
gint depth,
gchar *path)
{
#if 0
GtkItemFactory *item_factory;
GtkWidget *menu_item;
GList *list;
const gchar *label;
gchar *help_page;
gchar *full_path;
gchar *format_str;
for (list = GTK_MENU_SHELL (menu)->children; list; list = g_list_next (list))
{
menu_item = GTK_WIDGET (list->data);
if (GTK_IS_LABEL (GTK_BIN (menu_item)->child))
{
label = gtk_label_get_text (GTK_LABEL (GTK_BIN (menu_item)->child));
full_path = g_strconcat (path, "/", label, NULL);
item_factory = GTK_ITEM_FACTORY (gimp_item_factory_from_path (path));
help_page = g_object_get_data (G_OBJECT (menu_item),
"gimp-help-id");
help_page = g_strdup (help_page);
format_str = g_strdup_printf ("%%%ds%%%ds %%-20s %%s\n",
depth * 2, depth * 2 - 40);
g_print (format_str,
"", label, "", help_page ? help_page : "");
g_free (format_str);
g_free (help_page);
if (GTK_MENU_ITEM (menu_item)->submenu)
debug_dump_menus_recurse_menu (GTK_MENU_ITEM (menu_item)->submenu,
depth + 1, full_path);
g_free (full_path);
}
}
#endif
}
#endif /* ENABLE_DEBUG_MENU */

View File

@ -0,0 +1,40 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __DEBUG_COMMANDS_H__
#define __DEBUG_COMMANDS_H__
#ifdef GIMP_UNSTABLE
#define ENABLE_DEBUG_MENU 1
#endif
#ifdef ENABLE_DEBUG_MENU
void debug_mem_profile_cmd_callback (GtkAction *action,
gpointer data);
void debug_dump_menus_cmd_callback (GtkAction *action,
gpointer data);
void debug_dump_managers_cmd_callback (GtkAction *action,
gpointer data);
#endif /* ENABLE_DEBUG_MENU */
#endif /* __DEBUG_COMMANDS_H__ */

View File

@ -0,0 +1,223 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"
#include "actions-types.h"
#include "widgets/gimpactiongroup.h"
#include "widgets/gimphelp-ids.h"
#include "dialogs-actions.h"
#include "dialogs-commands.h"
#include "gimp-intl.h"
static GimpActionEntry dialogs_actions[] =
{
{ "dialogs-menu", NULL, N_("_Dialogs") },
{ "dialogs-new-dock-menu", NULL, N_("Create New Doc_k") },
{ "dialogs-new-dock-lcp", NULL,
N_("_Layers, Channels & Paths"), NULL, NULL,
G_CALLBACK (dialogs_create_lc_cmd_callback),
GIMP_HELP_DOCK },
{ "dialogs-new-dock-data", NULL,
N_("_Brushes, Patterns & Gradients"), NULL, NULL,
G_CALLBACK (dialogs_create_data_cmd_callback),
GIMP_HELP_DOCK },
{ "dialogs-new-dock-stuff", NULL,
N_("_Misc. Stuff"), NULL, NULL,
G_CALLBACK (dialogs_create_stuff_cmd_callback),
GIMP_HELP_DOCK },
{ "dialogs-toolbox", NULL,
N_("Tool_box"), NULL, NULL,
G_CALLBACK (dialogs_show_toolbox_cmd_callback),
GIMP_HELP_TOOLBOX }
};
GimpStringActionEntry dialogs_dockable_actions[] =
{
{ "dialogs-tool-options", GIMP_STOCK_TOOL_OPTIONS,
N_("Tool _Options"), "<control><shift>T", NULL,
"gimp-tool-options",
GIMP_HELP_TOOL_OPTIONS_DIALOG },
{ "dialogs-device-status", GIMP_STOCK_DEVICE_STATUS,
N_("_Device Status"), NULL, NULL,
"gimp-device-status",
GIMP_HELP_DEVICE_STATUS_DIALOG },
{ "dialogs-layers", GIMP_STOCK_LAYERS,
N_("_Layers"), "<control>L", NULL,
"gimp-layer-list",
GIMP_HELP_LAYER_DIALOG },
{ "dialogs-channels", GIMP_STOCK_CHANNELS,
N_("_Channels"), NULL, NULL,
"gimp-channel-list",
GIMP_HELP_CHANNEL_DIALOG },
{ "dialogs-vectors", GIMP_STOCK_PATHS,
N_("_Paths"), NULL, NULL,
"gimp-vectors-list",
GIMP_HELP_PATH_DIALOG },
{ "dialogs-indexed-palette", GIMP_STOCK_INDEXED_PALETTE,
N_("Color_map"), NULL, NULL,
"gimp-indexed-palette",
GIMP_HELP_INDEXED_PALETTE_DIALOG },
{ "dialogs-histogram", GIMP_STOCK_HISTOGRAM,
N_("Histogra_m"), NULL, NULL,
"gimp-histogram-editor",
GIMP_HELP_HISTOGRAM_DIALOG },
{ "dialogs-selection-editor", GIMP_STOCK_TOOL_RECT_SELECT,
N_("_Selection Editor"), NULL, NULL,
"gimp-selection-editor",
GIMP_HELP_SELECTION_DIALOG },
{ "dialogs-navigation", GIMP_STOCK_NAVIGATION,
N_("Na_vigation"), NULL, NULL,
"gimp-navigation-view",
GIMP_HELP_NAVIGATION_DIALOG },
{ "dialogs-undo-history", GIMP_STOCK_UNDO_HISTORY,
N_("Undo _History"), NULL, NULL,
"gimp-undo-history",
GIMP_HELP_UNDO_DIALOG },
{ "dialogs-colors", GIMP_STOCK_DEFAULT_COLORS,
N_("Colo_rs"), NULL, NULL,
"gimp-color-editor",
GIMP_HELP_COLOR_DIALOG },
{ "dialogs-brushes", GIMP_STOCK_BRUSH,
N_("_Brushes"), "<control><shift>B", NULL,
"gimp-brush-grid|gimp-brush-list",
GIMP_HELP_BRUSH_DIALOG },
{ "dialogs-patterns", GIMP_STOCK_PATTERN,
N_("P_atterns"), "<control><shift>P", NULL,
"gimp-pattern-grid|gimp-pattern-list",
GIMP_HELP_PATTERN_DIALOG },
{ "dialogs-gradients", GIMP_STOCK_GRADIENT,
N_("_Gradients"), "<control>G", NULL,
"gimp-gradient-list|gimp-gradient-grid",
GIMP_HELP_GRADIENT_DIALOG },
{ "dialogs-palettes", GIMP_STOCK_PALETTE,
N_("Pal_ettes"), "<control>P", NULL,
"gimp-palette-list|gimp-palette-list",
GIMP_HELP_PALETTE_DIALOG },
{ "dialogs-fonts", GIMP_STOCK_FONT,
N_("_Fonts"), NULL, NULL,
"gimp-font-list|gimp-font-grid",
GIMP_HELP_FONT_DIALOG },
{ "dialogs-buffers", GIMP_STOCK_BUFFER,
N_("B_uffers"), "", NULL,
"gimp-buffer-list|gimp-buffer-grid",
GIMP_HELP_BUFFER_DIALOG },
{ "dialogs-images", GIMP_STOCK_IMAGES,
N_("_Images"), NULL, NULL,
"gimp-image-list|gimp-image-grid",
GIMP_HELP_IMAGE_DIALOG },
{ "dialogs-document-history", GTK_STOCK_OPEN,
N_("Document Histor_y"), "", NULL,
"gimp-document-list|gimp-document-grid",
GIMP_HELP_DOCUMENT_DIALOG },
{ "dialogs-templates", GIMP_STOCK_TEMPLATE,
N_("_Templates"), "", NULL,
"gimp-template-list|gimp-template-grid",
GIMP_HELP_TEMPLATE_DIALOG },
{ "dialogs-tools", GIMP_STOCK_TOOLS,
N_("T_ools"), NULL, NULL,
"gimp-tool-list|gimp-tool-grid",
GIMP_HELP_TOOLS_DIALOG },
{ "dialogs-error-console", GIMP_STOCK_WARNING,
N_("Error Co_nsole"), NULL, NULL,
"gimp-error-console",
GIMP_HELP_ERRORS_DIALOG }
};
gint n_dialogs_dockable_actions = G_N_ELEMENTS (dialogs_dockable_actions);
static GimpStringActionEntry dialogs_toplevel_actions[] =
{
{ "dialogs-preferences", GTK_STOCK_PREFERENCES,
N_("_Preferences"), NULL, NULL,
"gimp-preferences-dialog",
GIMP_HELP_PREFS_DIALOG },
{ "dialogs-module-dialog", GTK_STOCK_EXECUTE,
N_("_Module Manager"), NULL, NULL,
"gimp-module-dialog",
GIMP_HELP_MODULE_DIALOG },
{ "dialogs-tips", GIMP_STOCK_INFO,
N_("_Tip of the Day"), NULL, NULL,
"gimp-tips-dialog",
GIMP_HELP_TIPS_DIALOG },
{ "dialogs-about", GIMP_STOCK_WILBER,
N_("_About"), NULL, NULL,
"gimp-about-dialog",
GIMP_HELP_ABOUT_DIALOG }
};
void
dialogs_actions_setup (GimpActionGroup *group)
{
gimp_action_group_add_actions (group,
dialogs_actions,
G_N_ELEMENTS (dialogs_actions));
gimp_action_group_add_string_actions (group,
dialogs_dockable_actions,
G_N_ELEMENTS (dialogs_dockable_actions),
G_CALLBACK (dialogs_create_dockable_cmd_callback));
gimp_action_group_add_string_actions (group,
dialogs_toplevel_actions,
G_N_ELEMENTS (dialogs_toplevel_actions),
G_CALLBACK (dialogs_create_toplevel_cmd_callback));
}
void
dialogs_actions_update (GimpActionGroup *group,
gpointer data)
{
}

View File

@ -0,0 +1,32 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __DIALOGS_ACTIONS_H__
#define __DIALOGS_ACTIONS_H__
extern GimpStringActionEntry dialogs_dockable_actions[];
extern gint n_dialogs_dockable_actions;
void dialogs_actions_setup (GimpActionGroup *group);
void dialogs_actions_update (GimpActionGroup *group,
gpointer data);
#endif /* __DIALOGS_ACTIONS_H__ */

View File

@ -0,0 +1,196 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <string.h>
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"
#include "actions-types.h"
#include "core/gimp.h"
#include "widgets/gimpdialogfactory.h"
#include "widgets/gimpdockable.h"
#include "widgets/gimpdockbook.h"
#include "widgets/gimpimagedock.h"
#include "dialogs/dialogs.h"
#include "actions.h"
#include "dialogs-commands.h"
/* local function prototypes */
static void dialogs_create_dock (GdkScreen *screen,
gboolean show_image_menu,
const gchar *tabs[],
gint n_tabs);
/* public functions */
void
dialogs_show_toolbox_cmd_callback (GtkAction *action,
gpointer data)
{
dialogs_show_toolbox ();
}
void
dialogs_create_toplevel_cmd_callback (GtkAction *action,
const gchar *value,
gpointer data)
{
GtkWidget *widget;
return_if_no_widget (widget, data);
if (value)
gimp_dialog_factory_dialog_new (global_dialog_factory,
gtk_widget_get_screen (widget),
value, -1, TRUE);
}
void
dialogs_create_dockable_cmd_callback (GtkAction *action,
const gchar *value,
gpointer data)
{
GtkWidget *widget;
return_if_no_widget (widget, data);
if (value)
gimp_dialog_factory_dialog_raise (global_dock_factory,
gtk_widget_get_screen (widget),
value, -1);
}
void
dialogs_create_lc_cmd_callback (GtkAction *action,
gpointer data)
{
static const gchar *tabs[] =
{
"gimp-layer-list",
"gimp-channel-list",
"gimp-vectors-list",
"gimp-undo-history"
};
GtkWidget *widget;
return_if_no_widget (widget, data);
dialogs_create_dock (gtk_widget_get_screen (widget), TRUE,
tabs, G_N_ELEMENTS (tabs));
}
void
dialogs_create_data_cmd_callback (GtkAction *action,
gpointer data)
{
static const gchar *tabs[] =
{
"gimp-brush-grid",
"gimp-pattern-grid",
"gimp-gradient-list",
"gimp-palette-list",
"gimp-font-list"
};
GtkWidget *widget;
return_if_no_widget (widget, data);
dialogs_create_dock (gtk_widget_get_screen (widget), FALSE,
tabs, G_N_ELEMENTS (tabs));
}
void
dialogs_create_stuff_cmd_callback (GtkAction *action,
gpointer data)
{
static const gchar *tabs[] =
{
"gimp-buffer-list",
"gimp-image-list",
"gimp-document-list",
"gimp-template-list"
};
GtkWidget *widget;
return_if_no_widget (widget, data);
dialogs_create_dock (gtk_widget_get_screen (widget), FALSE,
tabs, G_N_ELEMENTS (tabs));
}
void
dialogs_show_toolbox (void)
{
if (! global_toolbox_factory->open_dialogs)
{
GtkWidget *toolbox;
toolbox = gimp_dialog_factory_dock_new (global_toolbox_factory,
gdk_screen_get_default ());
gtk_widget_show (toolbox);
}
else
{
gimp_dialog_factories_toggle (global_toolbox_factory, TRUE);
}
}
/* private functions */
static void
dialogs_create_dock (GdkScreen *screen,
gboolean show_image_menu,
const gchar *tabs[],
gint n_tabs)
{
GtkWidget *dock;
GtkWidget *dockbook;
GtkWidget *dockable;
gint i;
dock = gimp_dialog_factory_dock_new (global_dock_factory, screen);
gimp_image_dock_set_show_image_menu (GIMP_IMAGE_DOCK (dock), show_image_menu);
dockbook = gimp_dockbook_new (global_dock_factory->menu_factory);
gimp_dock_add_book (GIMP_DOCK (dock), GIMP_DOCKBOOK (dockbook), 0);
for (i = 0; i < n_tabs; i++)
{
dockable = gimp_dialog_factory_dialog_new (global_dock_factory,
screen,
tabs[i], -1, TRUE);
if (dockable && ! GIMP_DOCKABLE (dockable)->dockbook)
gimp_dock_add (GIMP_DOCK (dock), GIMP_DOCKABLE (dockable), -1, -1);
}
gtk_widget_show (dock);
}

View File

@ -0,0 +1,42 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __DIALOGS_COMMANDS_H__
#define __DIALOGS_COMMANDS_H__
void dialogs_show_toolbox_cmd_callback (GtkAction *action,
gpointer data);
void dialogs_create_toplevel_cmd_callback (GtkAction *action,
const gchar *value,
gpointer data);
void dialogs_create_dockable_cmd_callback (GtkAction *action,
const gchar *value,
gpointer data);
void dialogs_create_lc_cmd_callback (GtkAction *action,
gpointer data);
void dialogs_create_data_cmd_callback (GtkAction *action,
gpointer data);
void dialogs_create_stuff_cmd_callback (GtkAction *action,
gpointer data);
void dialogs_show_toolbox (void);
#endif /* __DIALOGS_COMMANDS_H__ */

View File

@ -0,0 +1,361 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <string.h>
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"
#include "actions-types.h"
#include "widgets/gimpactiongroup.h"
#include "widgets/gimpcontainerview.h"
#include "widgets/gimpcontainerview-utils.h"
#include "widgets/gimpdialogfactory.h"
#include "widgets/gimpdockable.h"
#include "widgets/gimpdockbook.h"
#include "widgets/gimpdocked.h"
#include "widgets/gimphelp-ids.h"
#include "widgets/gimpimagedock.h"
#include "dialogs-actions.h"
#include "dockable-actions.h"
#include "dockable-commands.h"
#include "gimp-intl.h"
static GimpActionEntry dockable_actions[] =
{
{ "dockable-popup", NULL,
N_("Dialogs Menu"), NULL, NULL, NULL,
GIMP_HELP_DOCK },
{ "dockable-menu", GTK_STOCK_MISSING_IMAGE, "" },
{ "dockable-add-tab-menu", NULL, N_("_Add Tab") },
{ "dockable-preview-size-menu", NULL, N_("_Preview Size") },
{ "dockable-tab-style-menu", NULL, N_("_Tab Style") },
{ "dockable-close-tab", GTK_STOCK_CLOSE,
N_("_Close Tab"), "", NULL,
G_CALLBACK (dockable_close_tab_cmd_callback),
GIMP_HELP_DOCK_TAB_CLOSE },
{ "dockable-detach-tab", GTK_STOCK_CONVERT,
N_("_Detach Tab"), "", NULL,
G_CALLBACK (dockable_detach_tab_cmd_callback),
GIMP_HELP_DOCK_TAB_DETACH },
{ "dockable-move-to-screen", GIMP_STOCK_MOVE_TO_SCREEN,
N_("M_ove to Screen..."), NULL, NULL,
G_CALLBACK (dockable_change_screen_cmd_callback),
GIMP_HELP_DOCK_CHANGE_SCREEN }
};
static GimpToggleActionEntry dockable_toggle_actions[] =
{
{ "dockable-show-image-menu", NULL,
N_("_Show Image Selection"), NULL, NULL,
G_CALLBACK (dockable_toggle_image_menu_cmd_callback),
TRUE,
GIMP_HELP_DOCK_IMAGE_MENU },
{ "dockable-auto-follow-active", NULL,
N_("Auto _Follow Active Image"), NULL, NULL,
G_CALLBACK (dockable_toggle_auto_cmd_callback),
TRUE,
GIMP_HELP_DOCK_AUTO_BUTTON }
};
#define PREVIEW_SIZE(action,label,size) \
{ "dockable-preview-size-" action, NULL, \
(label), NULL, NULL, \
(size), \
GIMP_HELP_DOCK_PREVIEW_SIZE }
#define TAB_STYLE(action,label,style) \
{ "dockable-tab-style-" action, NULL, \
(label), NULL, NULL, \
(style), \
GIMP_HELP_DOCK_TAB_STYLE }
static GimpRadioActionEntry dockable_preview_size_actions[] =
{
PREVIEW_SIZE ("tiny", N_("_Tiny"), GIMP_VIEW_SIZE_TINY),
PREVIEW_SIZE ("extra-small", N_("E_xtra Small"), GIMP_VIEW_SIZE_EXTRA_SMALL),
PREVIEW_SIZE ("small", N_("_Small"), GIMP_VIEW_SIZE_SMALL),
PREVIEW_SIZE ("medium", N_("_Medium"), GIMP_VIEW_SIZE_MEDIUM),
PREVIEW_SIZE ("large", N_("_Large"), GIMP_VIEW_SIZE_LARGE),
PREVIEW_SIZE ("extra-large", N_("Ex_tra Large"), GIMP_VIEW_SIZE_EXTRA_LARGE),
PREVIEW_SIZE ("huge", N_("_Huge"), GIMP_VIEW_SIZE_HUGE),
PREVIEW_SIZE ("enormous", N_("_Enormous"), GIMP_VIEW_SIZE_ENORMOUS),
PREVIEW_SIZE ("gigantic", N_("_Gigantic"), GIMP_VIEW_SIZE_GIGANTIC)
};
static GimpRadioActionEntry dockable_tab_style_actions[] =
{
TAB_STYLE ("icon", N_("_Icon"), GIMP_TAB_STYLE_ICON),
TAB_STYLE ("preview", N_("Current _Status"), GIMP_TAB_STYLE_PREVIEW),
TAB_STYLE ("name", N_("_Text"), GIMP_TAB_STYLE_NAME),
TAB_STYLE ("icon-name", N_("I_con & Text"), GIMP_TAB_STYLE_ICON_NAME),
TAB_STYLE ("preview-name", N_("St_atus & Text"), GIMP_TAB_STYLE_PREVIEW_NAME)
};
#undef PREVIEW_SIZE
#undef TAB_STYLE
static GimpRadioActionEntry dockable_view_type_actions[] =
{
{ "dockable-view-type-list", NULL,
N_("View as _List"), NULL, NULL,
GIMP_VIEW_TYPE_LIST,
GIMP_HELP_DOCK_VIEW_AS_LIST },
{ "dockable-view-type-grid", NULL,
N_("View as _Grid"), NULL, NULL,
GIMP_VIEW_TYPE_GRID,
GIMP_HELP_DOCK_VIEW_AS_GRID }
};
void
dockable_actions_setup (GimpActionGroup *group)
{
gimp_action_group_add_actions (group,
dockable_actions,
G_N_ELEMENTS (dockable_actions));
gimp_action_group_add_toggle_actions (group,
dockable_toggle_actions,
G_N_ELEMENTS (dockable_toggle_actions));
gimp_action_group_add_string_actions (group,
dialogs_dockable_actions,
n_dialogs_dockable_actions,
G_CALLBACK (dockable_add_tab_cmd_callback));
gimp_action_group_add_radio_actions (group,
dockable_preview_size_actions,
G_N_ELEMENTS (dockable_preview_size_actions),
GIMP_VIEW_SIZE_MEDIUM,
G_CALLBACK (dockable_preview_size_cmd_callback));
gimp_action_group_add_radio_actions (group,
dockable_tab_style_actions,
G_N_ELEMENTS (dockable_tab_style_actions),
GIMP_TAB_STYLE_PREVIEW,
G_CALLBACK (dockable_tab_style_cmd_callback));
gimp_action_group_add_radio_actions (group,
dockable_view_type_actions,
G_N_ELEMENTS (dockable_view_type_actions),
GIMP_VIEW_TYPE_LIST,
G_CALLBACK (dockable_toggle_view_cmd_callback));
}
void
dockable_actions_update (GimpActionGroup *group,
gpointer data)
{
GimpDockable *dockable;
GimpDockbook *dockbook;
GimpDialogFactoryEntry *entry;
GimpContainerView *view;
GimpViewType view_type = -1;
gboolean list_view_available = FALSE;
gboolean grid_view_available = FALSE;
GimpViewSize preview_size = -1;
GimpTabStyle tab_style = -1;
gint n_pages = 0;
gint n_screens = 1;
if (GIMP_IS_DOCKBOOK (data))
{
gint page_num;
dockbook = GIMP_DOCKBOOK (data);
page_num = gtk_notebook_get_current_page (GTK_NOTEBOOK (dockbook));
dockable = (GimpDockable *)
gtk_notebook_get_nth_page (GTK_NOTEBOOK (dockbook), page_num);
}
else if (GIMP_IS_DOCKABLE (data))
{
dockable = GIMP_DOCKABLE (data);
dockbook = dockable->dockbook;
}
else
{
return;
}
gimp_dialog_factory_from_widget (GTK_WIDGET (dockable), &entry);
if (entry)
{
gchar *identifier;
gchar *substring = NULL;
identifier = g_strdup (entry->identifier);
if ((substring = strstr (identifier, "grid")))
view_type = GIMP_VIEW_TYPE_GRID;
else if ((substring = strstr (identifier, "list")))
view_type = GIMP_VIEW_TYPE_LIST;
if (substring)
{
memcpy (substring, "list", 4);
if (gimp_dialog_factory_find_entry (dockbook->dock->dialog_factory,
identifier))
list_view_available = TRUE;
memcpy (substring, "grid", 4);
if (gimp_dialog_factory_find_entry (dockbook->dock->dialog_factory,
identifier))
grid_view_available = TRUE;
}
g_free (identifier);
}
view = gimp_container_view_get_by_dockable (dockable);
if (view)
preview_size = gimp_container_view_get_preview_size (view, NULL);
tab_style = dockable->tab_style;
n_pages = gtk_notebook_get_n_pages (GTK_NOTEBOOK (dockbook));
#define SET_ACTIVE(action,active) \
gimp_action_group_set_action_active (group, action, (active) != 0)
#define SET_VISIBLE(action,active) \
gimp_action_group_set_action_visible (group, action, (active) != 0)
#define SET_SENSITIVE(action,sensitive) \
gimp_action_group_set_action_sensitive (group, action, (sensitive) != 0)
SET_VISIBLE ("dockable-preview-size-menu", preview_size != -1);
if (preview_size != -1)
{
if (preview_size >= GIMP_VIEW_SIZE_GIGANTIC)
{
SET_ACTIVE ("dockable-preview-size-gigantic", TRUE);
}
else if (preview_size >= GIMP_VIEW_SIZE_ENORMOUS)
{
SET_ACTIVE ("dockable-preview-size-enormous", TRUE);
}
else if (preview_size >= GIMP_VIEW_SIZE_HUGE)
{
SET_ACTIVE ("dockable-preview-size-huge", TRUE);
}
else if (preview_size >= GIMP_VIEW_SIZE_EXTRA_LARGE)
{
SET_ACTIVE ("dockable-preview-size-extra-large", TRUE);
}
else if (preview_size >= GIMP_VIEW_SIZE_LARGE)
{
SET_ACTIVE ("dockable-preview-size-large", TRUE);
}
else if (preview_size >= GIMP_VIEW_SIZE_MEDIUM)
{
SET_ACTIVE ("dockable-preview-size-medium", TRUE);
}
else if (preview_size >= GIMP_VIEW_SIZE_SMALL)
{
SET_ACTIVE ("dockable-preview-size-small", TRUE);
}
else if (preview_size >= GIMP_VIEW_SIZE_EXTRA_SMALL)
{
SET_ACTIVE ("dockable-preview-size-extra-small", TRUE);
}
else if (preview_size >= GIMP_VIEW_SIZE_TINY)
{
SET_ACTIVE ("dockable-preview-size-tiny", TRUE);
}
}
SET_VISIBLE ("dockable-tab-style-menu", n_pages > 1);
if (n_pages > 1)
{
GimpDockedInterface *docked_iface;
docked_iface = GIMP_DOCKED_GET_INTERFACE (GTK_BIN (dockable)->child);
if (tab_style == GIMP_TAB_STYLE_ICON)
SET_ACTIVE ("dockable-tab-style-icon", TRUE);
else if (tab_style == GIMP_TAB_STYLE_PREVIEW)
SET_ACTIVE ("dockable-tab-style-preview", TRUE);
else if (tab_style == GIMP_TAB_STYLE_NAME)
SET_ACTIVE ("dockable-tab-style-name", TRUE);
else if (tab_style == GIMP_TAB_STYLE_ICON_NAME)
SET_ACTIVE ("dockable-tab-style-icon-name", TRUE);
else if (tab_style == GIMP_TAB_STYLE_PREVIEW_NAME)
SET_ACTIVE ("dockable-tab-style-preview-name", TRUE);
SET_SENSITIVE ("dockable-tab-style-preview",
docked_iface->get_preview);
SET_SENSITIVE ("dockable-tab-style-preview-name",
docked_iface->get_preview);
}
SET_VISIBLE ("dockable-view-type-grid", view_type != -1);
SET_VISIBLE ("dockable-view-type-list", view_type != -1);
if (view_type != -1)
{
if (view_type == GIMP_VIEW_TYPE_LIST)
SET_ACTIVE ("dockable-view-type-list", TRUE);
else
SET_ACTIVE ("dockable-view-type-grid", TRUE);
SET_SENSITIVE ("dockable-view-type-grid", grid_view_available);
SET_SENSITIVE ("dockable-view-type-list", list_view_available);
}
n_screens = gdk_display_get_n_screens
(gtk_widget_get_display (GTK_WIDGET (dockbook->dock)));
if (GIMP_IS_IMAGE_DOCK (dockbook->dock))
{
GimpImageDock *image_dock = GIMP_IMAGE_DOCK (dockbook->dock);
SET_VISIBLE ("dockable-show-image-menu", TRUE);
SET_VISIBLE ("dockable-auto-follow-active", TRUE);
SET_ACTIVE ("dockable-show-image-menu", image_dock->show_image_menu);
SET_ACTIVE ("dockable-auto-follow-active", image_dock->auto_follow_active);
}
else
{
SET_VISIBLE ("dockable-show-image-menu", FALSE);
SET_VISIBLE ("dockable-auto-follow-active", FALSE);
}
SET_VISIBLE ("dockable-move-to-screen", n_screens > 1);
#undef SET_ACTIVE
#undef SET_VISIBLE
#undef SET_SENSITIVE
}

View File

@ -0,0 +1,28 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __DOCKABLE_ACTIONS_H__
#define __DOCKABLE_ACTIONS_H__
void dockable_actions_setup (GimpActionGroup *group);
void dockable_actions_update (GimpActionGroup *group,
gpointer data);
#endif /* __DOCKABLE_ACTIONS_H__ */

View File

@ -0,0 +1,375 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <string.h>
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"
#include "actions-types.h"
#include "widgets/gimpcontainerview.h"
#include "widgets/gimpcontainerview-utils.h"
#include "widgets/gimpdialogfactory.h"
#include "widgets/gimpdockable.h"
#include "widgets/gimpdockbook.h"
#include "widgets/gimpimagedock.h"
#include "widgets/gimpsessioninfo.h"
#include "dialogs/dialogs.h"
#include "dockable-commands.h"
/* local function prototypes */
static void dockable_change_screen_confirm_callback (GtkWidget *dialog,
gint value,
gpointer data);
static void dockable_change_screen_destroy_callback (GtkWidget *dialog,
GtkWidget *dock);
/* public functions */
void
dockable_add_tab_cmd_callback (GtkAction *action,
const gchar *value,
gpointer data)
{
GimpDockbook *dockbook = GIMP_DOCKBOOK (data);
if (value)
{
GtkWidget *dockable;
gchar *identifier;
gchar *p;
identifier = g_strdup (value);
p = strchr (identifier, '|');
if (p)
*p = '\0';
dockable =
gimp_dialog_factory_dockable_new (dockbook->dock->dialog_factory,
dockbook->dock,
identifier, -1);
g_free (identifier);
/* Maybe gimp_dialog_factory_dockable_new() returned an already
* existing singleton dockable, so check if it already is
* attached to a dockbook.
*/
if (dockable && ! GIMP_DOCKABLE (dockable)->dockbook)
gimp_dockbook_add (dockbook, GIMP_DOCKABLE (dockable), -1);
}
}
void
dockable_close_tab_cmd_callback (GtkAction *action,
gpointer data)
{
GimpDockbook *dockbook = GIMP_DOCKBOOK (data);
GimpDockable *dockable;
gint page_num;
page_num = gtk_notebook_get_current_page (GTK_NOTEBOOK (dockbook));
dockable = (GimpDockable *)
gtk_notebook_get_nth_page (GTK_NOTEBOOK (dockbook), page_num);
if (dockable)
gimp_dockbook_remove (dockbook, dockable);
}
void
dockable_detach_tab_cmd_callback (GtkAction *action,
gpointer data)
{
GimpDockbook *dockbook = GIMP_DOCKBOOK (data);
GimpDockable *dockable;
gint page_num;
page_num = gtk_notebook_get_current_page (GTK_NOTEBOOK (dockbook));
dockable = (GimpDockable *)
gtk_notebook_get_nth_page (GTK_NOTEBOOK (dockbook), page_num);
if (dockable)
gimp_dockable_detach (dockable);
}
void
dockable_toggle_view_cmd_callback (GtkAction *action,
GtkAction *current,
gpointer data)
{
GimpDockbook *dockbook = GIMP_DOCKBOOK (data);
GimpDockable *dockable;
GimpViewType view_type;
gint page_num;
view_type = (GimpViewType)
gtk_radio_action_get_current_value (GTK_RADIO_ACTION (action));
page_num = gtk_notebook_get_current_page (GTK_NOTEBOOK (dockbook));
dockable = (GimpDockable *)
gtk_notebook_get_nth_page (GTK_NOTEBOOK (dockbook), page_num);
if (dockable)
{
GimpDialogFactoryEntry *entry;
gimp_dialog_factory_from_widget (GTK_WIDGET (dockable), &entry);
if (entry)
{
gchar *identifier;
gchar *substring = NULL;
identifier = g_strdup (entry->identifier);
substring = strstr (identifier, "grid");
if (substring && view_type == GIMP_VIEW_TYPE_GRID)
return;
if (! substring)
{
substring = strstr (identifier, "list");
if (substring && view_type == GIMP_VIEW_TYPE_LIST)
return;
}
if (substring)
{
GimpContainerView *old_view;
GtkWidget *new_dockable;
gint preview_size = -1;
if (view_type == GIMP_VIEW_TYPE_LIST)
memcpy (substring, "list", 4);
else if (view_type == GIMP_VIEW_TYPE_GRID)
memcpy (substring, "grid", 4);
old_view = gimp_container_view_get_by_dockable (dockable);
if (old_view)
preview_size = gimp_container_view_get_preview_size (old_view,
NULL);
new_dockable =
gimp_dialog_factory_dockable_new (dockbook->dock->dialog_factory,
dockbook->dock,
identifier,
preview_size);
/* Maybe gimp_dialog_factory_dockable_new() returned
* an already existing singleton dockable, so check
* if it already is attached to a dockbook.
*/
if (new_dockable && ! GIMP_DOCKABLE (new_dockable)->dockbook)
{
gimp_dockbook_add (dockbook, GIMP_DOCKABLE (new_dockable),
page_num);
gimp_dockbook_remove (dockbook, dockable);
gtk_notebook_set_current_page (GTK_NOTEBOOK (dockbook),
page_num);
}
}
g_free (identifier);
}
}
}
void
dockable_preview_size_cmd_callback (GtkAction *action,
GtkAction *current,
gpointer data)
{
GimpDockbook *dockbook = GIMP_DOCKBOOK (data);
GimpDockable *dockable;
gint preview_size;
gint page_num;
preview_size = gtk_radio_action_get_current_value (GTK_RADIO_ACTION (action));
page_num = gtk_notebook_get_current_page (GTK_NOTEBOOK (dockbook));
dockable = (GimpDockable *)
gtk_notebook_get_nth_page (GTK_NOTEBOOK (dockbook), page_num);
if (dockable)
{
GimpContainerView *view = gimp_container_view_get_by_dockable (dockable);
if (view)
{
gint old_size;
gint border_width;
old_size = gimp_container_view_get_preview_size (view,
&border_width);
if (old_size != preview_size)
gimp_container_view_set_preview_size (view, preview_size,
border_width);
}
}
}
void
dockable_tab_style_cmd_callback (GtkAction *action,
GtkAction *current,
gpointer data)
{
GimpDockbook *dockbook = GIMP_DOCKBOOK (data);
GimpDockable *dockable;
GimpTabStyle tab_style;
gint page_num;
tab_style = (GimpTabStyle)
gtk_radio_action_get_current_value (GTK_RADIO_ACTION (action));
page_num = gtk_notebook_get_current_page (GTK_NOTEBOOK (dockbook));
dockable = (GimpDockable *)
gtk_notebook_get_nth_page (GTK_NOTEBOOK (dockbook), page_num);
if (dockable && dockable->tab_style != tab_style)
{
GtkWidget *tab_widget;
gimp_dockable_set_tab_style (dockable, tab_style);
tab_widget = gimp_dockbook_get_tab_widget (dockbook, dockable);
gtk_notebook_set_tab_label (GTK_NOTEBOOK (dockbook),
GTK_WIDGET (dockable),
tab_widget);
}
}
void
dockable_toggle_image_menu_cmd_callback (GtkAction *action,
gpointer data)
{
GimpDockbook *dockbook = GIMP_DOCKBOOK (data);
gboolean active;
active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
if (GIMP_IS_IMAGE_DOCK (dockbook->dock))
gimp_image_dock_set_show_image_menu (GIMP_IMAGE_DOCK (dockbook->dock),
active);
}
void
dockable_toggle_auto_cmd_callback (GtkAction *action,
gpointer data)
{
GimpDockbook *dockbook = GIMP_DOCKBOOK (data);
gboolean active;
active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
if (GIMP_IS_IMAGE_DOCK (dockbook->dock))
gimp_image_dock_set_auto_follow_active (GIMP_IMAGE_DOCK (dockbook->dock),
active);
}
void
dockable_change_screen_cmd_callback (GtkAction *action,
gpointer data)
{
GimpDockbook *dockbook = GIMP_DOCKBOOK (data);
GtkWidget *dock;
GdkScreen *screen;
GdkDisplay *display;
gint cur_screen;
gint num_screens;
GtkWidget *dialog;
dock = GTK_WIDGET (dockbook->dock);
dialog = g_object_get_data (G_OBJECT (dock), "gimp-change-screen-dialog");
if (dialog)
{
gtk_window_present (GTK_WINDOW (dialog));
return;
}
screen = gtk_widget_get_screen (dock);
display = gtk_widget_get_display (dock);
cur_screen = gdk_screen_get_number (screen);
num_screens = gdk_display_get_n_screens (display);
dialog = gimp_query_int_box ("Move Dock to Screen",
dock,
NULL, NULL,
"Enter destination screen",
cur_screen, 0, num_screens - 1,
G_OBJECT (dock), "destroy",
dockable_change_screen_confirm_callback,
dock);
g_object_set_data (G_OBJECT (dock), "gimp-change-screen-dialog", dialog);
g_signal_connect (dialog, "destroy",
G_CALLBACK (dockable_change_screen_destroy_callback),
dock);
gtk_widget_show (dialog);
}
/* private functions */
static void
dockable_change_screen_confirm_callback (GtkWidget *dialog,
gint value,
gpointer data)
{
GdkScreen *screen;
screen = gdk_display_get_screen (gtk_widget_get_display (GTK_WIDGET (data)),
value);
if (screen)
gtk_window_set_screen (GTK_WINDOW (data), screen);
}
static void
dockable_change_screen_destroy_callback (GtkWidget *dialog,
GtkWidget *dock)
{
g_object_set_data (G_OBJECT (dock), "gimp-change-screen-dialog", NULL);
}

View File

@ -0,0 +1,49 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __DOCKABLE_COMMANDS_H__
#define __DOCKABLE_COMMANDS_H__
void dockable_add_tab_cmd_callback (GtkAction *action,
const gchar *value,
gpointer data);
void dockable_close_tab_cmd_callback (GtkAction *action,
gpointer data);
void dockable_detach_tab_cmd_callback (GtkAction *action,
gpointer data);
void dockable_toggle_view_cmd_callback (GtkAction *action,
GtkAction *current,
gpointer data);
void dockable_preview_size_cmd_callback (GtkAction *action,
GtkAction *current,
gpointer data);
void dockable_tab_style_cmd_callback (GtkAction *action,
GtkAction *current,
gpointer data);
void dockable_toggle_image_menu_cmd_callback (GtkAction *action,
gpointer data);
void dockable_toggle_auto_cmd_callback (GtkAction *action,
gpointer data);
void dockable_change_screen_cmd_callback (GtkAction *action,
gpointer data);
#endif /* __DOCKABLE_COMMANDS_H__ */

View File

@ -0,0 +1,121 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"
#include "actions-types.h"
#include "core/gimpcontext.h"
#include "widgets/gimpactiongroup.h"
#include "widgets/gimphelp-ids.h"
#include "actions.h"
#include "documents-actions.h"
#include "documents-commands.h"
#include "gimp-intl.h"
static GimpActionEntry documents_actions[] =
{
{ "documents-popup", GTK_STOCK_OPEN,
N_("Documents Menu"), NULL, NULL, NULL,
GIMP_HELP_DOCUMENT_DIALOG },
{ "documents-open", GTK_STOCK_OPEN,
N_("_Open Image"), "",
N_("Open the selected entry"),
G_CALLBACK (documents_open_document_cmd_callback),
GIMP_HELP_DOCUMENT_OPEN },
{ "documents-raise-or-open", GTK_STOCK_OPEN,
N_("_Raise or Open Image"), "",
N_("Raise window if already open"),
G_CALLBACK (documents_raise_or_open_document_cmd_callback),
GIMP_HELP_DOCUMENT_OPEN },
{ "documents-file-open-dialog", GTK_STOCK_OPEN,
N_("File Open _Dialog"), "",
N_("Open image dialog"),
G_CALLBACK (documents_file_open_dialog_cmd_callback),
GIMP_HELP_DOCUMENT_OPEN },
{ "documents-remove", GTK_STOCK_REMOVE,
N_("Remove _Entry"), "",
N_("Remove the selected entry"),
G_CALLBACK (documents_remove_document_cmd_callback),
GIMP_HELP_DOCUMENT_REMOVE },
{ "documents-recreate-preview", GTK_STOCK_REFRESH,
N_("Recreate _Preview"), "",
N_("Recreate preview"),
G_CALLBACK (documents_recreate_preview_cmd_callback),
GIMP_HELP_DOCUMENT_REFRESH },
{ "documents-reload-previews", GTK_STOCK_REFRESH,
N_("Reload _all Previews"), "",
N_("Reload all previews"),
G_CALLBACK (documents_reload_previews_cmd_callback),
GIMP_HELP_DOCUMENT_REFRESH },
{ "documents-remove-dangling", GTK_STOCK_REFRESH,
N_("Remove Dangling E_ntries"), "",
N_("Remove dangling entries"),
G_CALLBACK (documents_delete_dangling_documents_cmd_callback),
GIMP_HELP_DOCUMENT_REFRESH }
};
void
documents_actions_setup (GimpActionGroup *group)
{
gimp_action_group_add_actions (group,
documents_actions,
G_N_ELEMENTS (documents_actions));
}
void
documents_actions_update (GimpActionGroup *group,
gpointer data)
{
GimpContext *context;
GimpImagefile *imagefile = NULL;
context = action_data_get_context (data);
if (context)
imagefile = gimp_context_get_imagefile (context);
#define SET_SENSITIVE(action,condition) \
gimp_action_group_set_action_sensitive (group, action, (condition) != 0)
SET_SENSITIVE ("documents-open", imagefile);
SET_SENSITIVE ("documents-raise-or-open", imagefile);
SET_SENSITIVE ("documents-file-open-dialog", TRUE);
SET_SENSITIVE ("documents-remove", imagefile);
SET_SENSITIVE ("documents-recreate-preview", imagefile);
SET_SENSITIVE ("documents-reload-previews", imagefile);
SET_SENSITIVE ("documents-remove-dangling", imagefile);
#undef SET_SENSITIVE
}

View File

@ -0,0 +1,28 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __DOCUMENTS_ACTIONS_H__
#define __DOCUMENTS_ACTIONS_H__
void documents_actions_setup (GimpActionGroup *group);
void documents_actions_update (GimpActionGroup *group,
gpointer data);
#endif /* __DOCUMENTS_ACTIONS_H__ */

View File

@ -0,0 +1,274 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <string.h>
#include <gtk/gtk.h>
#include "libgimpthumb/gimpthumb.h"
#include "libgimpwidgets/gimpwidgets.h"
#include "actions-types.h"
#include "config/gimpcoreconfig.h"
#include "core/gimp.h"
#include "core/gimpcontainer.h"
#include "core/gimpcontext.h"
#include "core/gimpimagefile.h"
#include "file/file-open.h"
#include "file/file-utils.h"
#include "widgets/gimpcontainerview.h"
#include "widgets/gimpdocumentview.h"
#include "display/gimpdisplay.h"
#include "display/gimpdisplay-foreach.h"
#include "documents-commands.h"
#include "file-commands.h"
#include "gimp-intl.h"
typedef struct _RaiseClosure RaiseClosure;
struct _RaiseClosure
{
const gchar *name;
gboolean found;
};
/* local function prototypes */
static void documents_open_image (GimpContext *context,
GimpImagefile *imagefile);
static void documents_raise_display (gpointer data,
gpointer user_data);
/* public functions */
void
documents_open_document_cmd_callback (GtkAction *action,
gpointer data)
{
GimpContainerEditor *editor = GIMP_CONTAINER_EDITOR (data);
GimpContext *context;
GimpContainer *container;
GimpImagefile *imagefile;
context = gimp_container_view_get_context (editor->view);
container = gimp_container_view_get_container (editor->view);
imagefile = gimp_context_get_imagefile (context);
if (imagefile && gimp_container_have (container, GIMP_OBJECT (imagefile)))
{
documents_open_image (context, imagefile);
}
else
{
file_file_open_dialog (context->gimp, NULL, GTK_WIDGET (editor));
}
}
void
documents_raise_or_open_document_cmd_callback (GtkAction *action,
gpointer data)
{
GimpContainerEditor *editor = GIMP_CONTAINER_EDITOR (data);
GimpContext *context;
GimpContainer *container;
GimpImagefile *imagefile;
context = gimp_container_view_get_context (editor->view);
container = gimp_container_view_get_container (editor->view);
imagefile = gimp_context_get_imagefile (context);
if (imagefile && gimp_container_have (container, GIMP_OBJECT (imagefile)))
{
RaiseClosure closure;
closure.name = gimp_object_get_name (GIMP_OBJECT (imagefile));
closure.found = FALSE;
gimp_container_foreach (context->gimp->displays,
documents_raise_display,
&closure);
if (! closure.found)
documents_open_image (context, imagefile);
}
}
void
documents_file_open_dialog_cmd_callback (GtkAction *action,
gpointer data)
{
GimpContainerEditor *editor = GIMP_CONTAINER_EDITOR (data);
GimpContext *context;
GimpContainer *container;
GimpImagefile *imagefile;
context = gimp_container_view_get_context (editor->view);
container = gimp_container_view_get_container (editor->view);
imagefile = gimp_context_get_imagefile (context);
if (imagefile && gimp_container_have (container, GIMP_OBJECT (imagefile)))
{
file_file_open_dialog (context->gimp,
gimp_object_get_name (GIMP_OBJECT (imagefile)),
GTK_WIDGET (editor));
}
}
void
documents_remove_document_cmd_callback (GtkAction *action,
gpointer data)
{
GimpContainerEditor *editor = GIMP_CONTAINER_EDITOR (data);
GimpContext *context;
GimpContainer *container;
GimpImagefile *imagefile;
context = gimp_container_view_get_context (editor->view);
container = gimp_container_view_get_container (editor->view);
imagefile = gimp_context_get_imagefile (context);
if (imagefile && gimp_container_have (container, GIMP_OBJECT (imagefile)))
{
gimp_container_remove (container, GIMP_OBJECT (imagefile));
}
}
void
documents_recreate_preview_cmd_callback (GtkAction *action,
gpointer data)
{
GimpContainerEditor *editor = GIMP_CONTAINER_EDITOR (data);
GimpContext *context;
GimpContainer *container;
GimpImagefile *imagefile;
context = gimp_container_view_get_context (editor->view);
container = gimp_container_view_get_container (editor->view);
imagefile = gimp_context_get_imagefile (context);
if (imagefile && gimp_container_have (container, GIMP_OBJECT (imagefile)))
{
gimp_imagefile_create_thumbnail (imagefile,
context, NULL,
imagefile->gimp->config->thumbnail_size,
FALSE);
}
}
void
documents_reload_previews_cmd_callback (GtkAction *action,
gpointer data)
{
GimpContainerEditor *editor = GIMP_CONTAINER_EDITOR (data);
GimpContainer *container;
container = gimp_container_view_get_container (editor->view);
gimp_container_foreach (container,
(GFunc) gimp_imagefile_update,
editor->view);
}
static void
documents_delete_dangling_foreach (GimpImagefile *imagefile,
GimpContainer *container)
{
if (gimp_thumbnail_peek_image (imagefile->thumbnail) ==
GIMP_THUMB_STATE_NOT_FOUND)
{
gimp_container_remove (container, GIMP_OBJECT (imagefile));
}
}
void
documents_delete_dangling_documents_cmd_callback (GtkAction *action,
gpointer data)
{
GimpContainerEditor *editor = GIMP_CONTAINER_EDITOR (data);
GimpContainer *container;
container = gimp_container_view_get_container (editor->view);
gimp_container_foreach (container,
(GFunc) documents_delete_dangling_foreach,
container);
}
/* private functions */
static void
documents_open_image (GimpContext *context,
GimpImagefile *imagefile)
{
const gchar *uri;
GimpImage *gimage;
GimpPDBStatusType status;
GError *error = NULL;
uri = gimp_object_get_name (GIMP_OBJECT (imagefile));
gimage = file_open_with_display (context->gimp, context, NULL,
uri, &status, &error);
if (! gimage && status != GIMP_PDB_CANCEL)
{
gchar *filename;
filename = file_utils_uri_to_utf8_filename (uri);
g_message (_("Opening '%s' failed:\n\n%s"),
filename, error->message);
g_clear_error (&error);
g_free (filename);
}
}
static void
documents_raise_display (gpointer data,
gpointer user_data)
{
GimpDisplay *gdisp = data;
RaiseClosure *closure = user_data;
const gchar *uri;
uri = gimp_object_get_name (GIMP_OBJECT (gdisp->gimage));
if (uri && ! strcmp (closure->name, uri))
{
closure->found = TRUE;
gtk_window_present (GTK_WINDOW (gdisp->shell));
}
}

View File

@ -0,0 +1,39 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __DOCUMENTS_COMMANDS_H__
#define __DOCUMENTS_COMMANDS_H__
void documents_open_document_cmd_callback (GtkAction *action,
gpointer data);
void documents_raise_or_open_document_cmd_callback (GtkAction *action,
gpointer data);
void documents_file_open_dialog_cmd_callback (GtkAction *action,
gpointer data);
void documents_remove_document_cmd_callback (GtkAction *action,
gpointer data);
void documents_recreate_preview_cmd_callback (GtkAction *action,
gpointer data);
void documents_reload_previews_cmd_callback (GtkAction *action,
gpointer data);
void documents_delete_dangling_documents_cmd_callback (GtkAction *action,
gpointer data);
#endif /* __DOCUMENTS_COMMANDS_H__ */

View File

@ -0,0 +1,202 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"
#include "actions-types.h"
#include "core/gimp.h"
#include "core/gimpcontext.h"
#include "core/gimpimage.h"
#include "core/gimplayermask.h"
#include "widgets/gimpactiongroup.h"
#include "widgets/gimphelp-ids.h"
#include "actions.h"
#include "drawable-actions.h"
#include "drawable-commands.h"
#include "gimp-intl.h"
static GimpActionEntry drawable_actions[] =
{
{ "drawable-desaturate", GIMP_STOCK_CONVERT_GRAYSCALE,
N_("_Desaturate"), NULL, NULL,
G_CALLBACK (drawable_desaturate_cmd_callback),
GIMP_HELP_LAYER_DESATURATE },
{ "drawable-equalize", NULL,
N_("_Equalize"), NULL, NULL,
G_CALLBACK (drawable_equalize_cmd_callback),
GIMP_HELP_LAYER_EQUALIZE },
{ "drawable-invert", GIMP_STOCK_INVERT,
N_("In_vert"), NULL, NULL,
G_CALLBACK (drawable_invert_cmd_callback),
GIMP_HELP_LAYER_INVERT },
{ "drawable-levels-stretch", NULL,
N_("_White Balance"), NULL, NULL,
G_CALLBACK (drawable_levels_stretch_cmd_callback),
GIMP_HELP_LAYER_WHITE_BALANCE},
{ "drawable-offset", NULL,
N_("_Offset..."), "<control><shift>O", NULL,
G_CALLBACK (drawable_offset_cmd_callback),
GIMP_HELP_LAYER_OFFSET }
};
static GimpToggleActionEntry drawable_toggle_actions[] =
{
{ "drawable-linked", GIMP_STOCK_LINKED,
N_("_Linked"), NULL, NULL,
G_CALLBACK (drawable_linked_cmd_callback),
FALSE,
GIMP_HELP_LAYER_LINKED },
{ "drawable-visible", GIMP_STOCK_VISIBLE,
N_("_Visible"), NULL, NULL,
G_CALLBACK (drawable_visible_cmd_callback),
FALSE,
GIMP_HELP_LAYER_VISIBLE }
};
static GimpEnumActionEntry drawable_flip_actions[] =
{
{ "drawable-flip-horizontal", GIMP_STOCK_FLIP_HORIZONTAL,
N_("Flip _Horizontally"), NULL, NULL,
GIMP_ORIENTATION_HORIZONTAL, FALSE,
GIMP_HELP_LAYER_FLIP_HORIZONTAL },
{ "drawable-flip-vertical", GIMP_STOCK_FLIP_VERTICAL,
N_("Flip _Vertically"), NULL, NULL,
GIMP_ORIENTATION_VERTICAL, FALSE,
GIMP_HELP_LAYER_FLIP_VERTICAL }
};
static GimpEnumActionEntry drawable_rotate_actions[] =
{
{ "drawable-rotate-90", GIMP_STOCK_ROTATE_90,
N_("Rotate 90 degrees _CW"), NULL, NULL,
GIMP_ROTATE_90, FALSE,
GIMP_HELP_LAYER_ROTATE_90 },
{ "drawable-rotate-180", GIMP_STOCK_ROTATE_180,
N_("Rotate _180 degrees"), NULL, NULL,
GIMP_ROTATE_180, FALSE,
GIMP_HELP_LAYER_ROTATE_180 },
{ "drawable-rotate-270", GIMP_STOCK_ROTATE_270,
N_("Rotate 90 degrees CC_W"), NULL, NULL,
GIMP_ROTATE_270, FALSE,
GIMP_HELP_LAYER_ROTATE_270 }
};
void
drawable_actions_setup (GimpActionGroup *group)
{
gimp_action_group_add_actions (group,
drawable_actions,
G_N_ELEMENTS (drawable_actions));
gimp_action_group_add_toggle_actions (group,
drawable_toggle_actions,
G_N_ELEMENTS (drawable_toggle_actions));
gimp_action_group_add_enum_actions (group,
drawable_flip_actions,
G_N_ELEMENTS (drawable_flip_actions),
G_CALLBACK (drawable_flip_cmd_callback));
gimp_action_group_add_enum_actions (group,
drawable_rotate_actions,
G_N_ELEMENTS (drawable_rotate_actions),
G_CALLBACK (drawable_rotate_cmd_callback));
}
void
drawable_actions_update (GimpActionGroup *group,
gpointer data)
{
GimpImage *gimage;
GimpDrawable *drawable = NULL;
gboolean is_rgb = FALSE;
gboolean is_gray = FALSE;
gboolean is_indexed = FALSE;
gboolean visible = FALSE;
gboolean linked = FALSE;
gimage = action_data_get_image (data);
if (gimage)
{
drawable = gimp_image_active_drawable (gimage);
if (drawable)
{
GimpImageType drawable_type = gimp_drawable_type (drawable);
GimpItem *item;
is_rgb = GIMP_IMAGE_TYPE_IS_RGB (drawable_type);
is_gray = GIMP_IMAGE_TYPE_IS_GRAY (drawable_type);
is_indexed = GIMP_IMAGE_TYPE_IS_INDEXED (drawable_type);
if (GIMP_IS_LAYER_MASK (drawable))
item = GIMP_ITEM (gimp_layer_mask_get_layer (GIMP_LAYER_MASK (drawable)));
else
item = GIMP_ITEM (drawable);
visible = gimp_item_get_visible (item);
linked = gimp_item_get_linked (item);
}
}
#define SET_SENSITIVE(action,condition) \
gimp_action_group_set_action_sensitive (group, action, (condition) != 0)
#define SET_ACTIVE(action,condition) \
gimp_action_group_set_action_active (group, action, (condition) != 0)
SET_SENSITIVE ("drawable-desaturate", drawable && is_rgb);
SET_SENSITIVE ("drawable-equalize", drawable && ! is_indexed);
SET_SENSITIVE ("drawable-invert", drawable && ! is_indexed);
SET_SENSITIVE ("drawable-levels-stretch", drawable && is_rgb);
SET_SENSITIVE ("drawable-offset", drawable);
SET_SENSITIVE ("drawable-visible", drawable);
SET_SENSITIVE ("drawable-linked", drawable);
SET_ACTIVE ("drawable-visible", visible);
SET_ACTIVE ("drawable-linked", linked);
SET_SENSITIVE ("drawable-flip-horizontal", drawable);
SET_SENSITIVE ("drawable-flip-vertical", drawable);
SET_SENSITIVE ("drawable-rotate-90", drawable);
SET_SENSITIVE ("drawable-rotate-180", drawable);
SET_SENSITIVE ("drawable-rotate-270", drawable);
#undef SET_SENSITIVE
#undef SET_ACTIVE
}

View File

@ -0,0 +1,28 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __DRAWABLE_ACTIONS_H__
#define __DRAWABLE_ACTIONS_H__
void drawable_actions_setup (GimpActionGroup *group);
void drawable_actions_update (GimpActionGroup *group,
gpointer data);
#endif /* __DRAWABLE_ACTIONS_H__ */

View File

@ -0,0 +1,289 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"
#include "actions-types.h"
#include "core/gimp.h"
#include "core/gimpdrawable-desaturate.h"
#include "core/gimpdrawable-equalize.h"
#include "core/gimpdrawable-invert.h"
#include "core/gimpdrawable-levels.h"
#include "core/gimpimage.h"
#include "core/gimpimage-undo.h"
#include "core/gimpitem-linked.h"
#include "core/gimpitemundo.h"
#include "core/gimplayermask.h"
#include "dialogs/offset-dialog.h"
#include "actions.h"
#include "drawable-commands.h"
#include "gimp-intl.h"
/* public functions */
void
drawable_desaturate_cmd_callback (GtkAction *action,
gpointer data)
{
GimpImage *gimage;
GimpDrawable *drawable;
return_if_no_drawable (gimage, drawable, data);
if (! gimp_drawable_is_rgb (drawable))
{
g_message (_("Desaturate operates only on RGB color layers."));
return;
}
gimp_drawable_desaturate (drawable);
gimp_image_flush (gimage);
}
void
drawable_equalize_cmd_callback (GtkAction *action,
gpointer data)
{
GimpImage *gimage;
GimpDrawable *drawable;
return_if_no_drawable (gimage, drawable, data);
if (gimp_drawable_is_indexed (drawable))
{
g_message (_("Equalize does not operate on indexed layers."));
return;
}
gimp_drawable_equalize (drawable, TRUE);
gimp_image_flush (gimage);
}
void
drawable_invert_cmd_callback (GtkAction *action,
gpointer data)
{
GimpImage *gimage;
GimpDrawable *drawable;
return_if_no_drawable (gimage, drawable, data);
if (gimp_drawable_is_indexed (drawable))
{
g_message (_("Invert does not operate on indexed layers."));
return;
}
gimp_drawable_invert (drawable);
gimp_image_flush (gimage);
}
void
drawable_levels_stretch_cmd_callback (GtkAction *action,
gpointer data)
{
GimpImage *gimage;
GimpDrawable *drawable;
GimpContext *context;
return_if_no_drawable (gimage, drawable, data);
return_if_no_context (context, data);
if (! gimp_drawable_is_rgb (drawable))
{
g_message (_("White Balance operates only on RGB color layers."));
return;
}
gimp_drawable_levels_stretch (drawable, context);
gimp_image_flush (gimage);
}
void
drawable_offset_cmd_callback (GtkAction *action,
gpointer data)
{
GimpImage *gimage;
GimpDrawable *drawable;
GtkWidget *widget;
GtkWidget *dialog;
return_if_no_drawable (gimage, drawable, data);
return_if_no_widget (widget, data);
dialog = offset_dialog_new (drawable, widget);
gtk_widget_show (dialog);
}
void
drawable_linked_cmd_callback (GtkAction *action,
gpointer data)
{
GimpImage *gimage;
GimpDrawable *drawable;
gboolean linked;
return_if_no_drawable (gimage, drawable, data);
linked = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
if (GIMP_IS_LAYER_MASK (drawable))
drawable =
GIMP_DRAWABLE (gimp_layer_mask_get_layer (GIMP_LAYER_MASK (drawable)));
if (linked != gimp_item_get_linked (GIMP_ITEM (drawable)))
{
GimpUndo *undo;
gboolean push_undo = TRUE;
undo = gimp_image_undo_can_compress (gimage, GIMP_TYPE_ITEM_UNDO,
GIMP_UNDO_ITEM_LINKED);
if (undo && GIMP_ITEM_UNDO (undo)->item == GIMP_ITEM (drawable))
push_undo = FALSE;
gimp_item_set_linked (GIMP_ITEM (drawable), linked, push_undo);
gimp_image_flush (gimage);
}
}
void
drawable_visible_cmd_callback (GtkAction *action,
gpointer data)
{
GimpImage *gimage;
GimpDrawable *drawable;
gboolean visible;
return_if_no_drawable (gimage, drawable, data);
visible = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
if (GIMP_IS_LAYER_MASK (drawable))
drawable =
GIMP_DRAWABLE (gimp_layer_mask_get_layer (GIMP_LAYER_MASK (drawable)));
if (visible != gimp_item_get_visible (GIMP_ITEM (drawable)))
{
GimpUndo *undo;
gboolean push_undo = TRUE;
undo = gimp_image_undo_can_compress (gimage, GIMP_TYPE_ITEM_UNDO,
GIMP_UNDO_ITEM_VISIBILITY);
if (undo && GIMP_ITEM_UNDO (undo)->item == GIMP_ITEM (drawable))
push_undo = FALSE;
gimp_item_set_visible (GIMP_ITEM (drawable), visible, push_undo);
gimp_image_flush (gimage);
}
}
void
drawable_flip_cmd_callback (GtkAction *action,
gint value,
gpointer data)
{
GimpImage *gimage;
GimpDrawable *drawable;
GimpItem *item;
GimpContext *context;
gint off_x, off_y;
gdouble axis = 0.0;
return_if_no_drawable (gimage, drawable, data);
return_if_no_context (context, data);
item = GIMP_ITEM (drawable);
gimp_item_offsets (item, &off_x, &off_y);
switch ((GimpOrientationType) value)
{
case GIMP_ORIENTATION_HORIZONTAL:
axis = ((gdouble) off_x + (gdouble) gimp_item_width (item) / 2.0);
break;
case GIMP_ORIENTATION_VERTICAL:
axis = ((gdouble) off_y + (gdouble) gimp_item_height (item) / 2.0);
break;
default:
break;
}
if (gimp_item_get_linked (item))
gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_TRANSFORM,
GIMP_ITEM_GET_CLASS (item)->flip_desc);
gimp_item_flip (item, context, (GimpOrientationType) value, axis, FALSE);
if (gimp_item_get_linked (item))
{
gimp_item_linked_flip (item, context, (GimpOrientationType) action, axis,
FALSE);
gimp_image_undo_group_end (gimage);
}
gimp_image_flush (gimage);
}
void
drawable_rotate_cmd_callback (GtkAction *action,
gint value,
gpointer data)
{
GimpImage *gimage;
GimpDrawable *drawable;
GimpContext *context;
GimpItem *item;
gint off_x, off_y;
gdouble center_x, center_y;
gboolean clip_result = FALSE;
return_if_no_drawable (gimage, drawable, data);
return_if_no_context (context, data);
item = GIMP_ITEM (drawable);
gimp_item_offsets (item, &off_x, &off_y);
center_x = ((gdouble) off_x + (gdouble) gimp_item_width (item) / 2.0);
center_y = ((gdouble) off_y + (gdouble) gimp_item_height (item) / 2.0);
if (gimp_item_get_linked (item))
gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_TRANSFORM,
GIMP_ITEM_GET_CLASS (item)->rotate_desc);
if (GIMP_IS_CHANNEL (item))
clip_result = TRUE;
gimp_item_rotate (item, context, (GimpRotationType) value,
center_x, center_y, clip_result);
if (gimp_item_get_linked (item))
{
gimp_item_linked_rotate (item, context, (GimpRotationType) value,
center_x, center_y, FALSE);
gimp_image_undo_group_end (gimage);
}
gimp_image_flush (gimage);
}

View File

@ -0,0 +1,54 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __DRAWABLE_COMMANDS_H__
#define __DRAWABLE_COMMANDS_H__
void drawable_desaturate_cmd_callback (GtkAction *action,
gpointer data);
void drawable_equalize_cmd_callback (GtkAction *action,
gpointer data);
void drawable_invert_cmd_callback (GtkAction *action,
gpointer data);
void drawable_levels_stretch_cmd_callback (GtkAction *action,
gpointer data);
void drawable_offset_cmd_callback (GtkAction *action,
gpointer data);
void drawable_desaturate_cmd_callback (GtkAction *action,
gpointer data);
void drawable_equalize_cmd_callback (GtkAction *action,
gpointer data);
void drawable_invert_cmd_callback (GtkAction *action,
gpointer data);
void drawable_offset_cmd_callback (GtkAction *action,
gpointer data);
void drawable_linked_cmd_callback (GtkAction *action,
gpointer data);
void drawable_visible_cmd_callback (GtkAction *action,
gpointer data);
void drawable_flip_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void drawable_rotate_cmd_callback (GtkAction *action,
gint value,
gpointer data);
#endif /* __DRAWABLE_COMMANDS_H__ */

285
app/actions/edit-actions.c Normal file
View File

@ -0,0 +1,285 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"
#include "actions-types.h"
#include "core/gimp.h"
#include "core/gimpchannel.h"
#include "core/gimpcontext.h"
#include "core/gimpimage.h"
#include "core/gimplayer.h"
#include "core/gimplist.h"
#include "core/gimptoolinfo.h"
#include "core/gimpundostack.h"
#include "widgets/gimpactiongroup.h"
#include "widgets/gimphelp-ids.h"
#include "actions.h"
#include "edit-actions.h"
#include "edit-commands.h"
#include "gimp-intl.h"
/* local function prototypes */
static void edit_actions_foreground_changed (GimpContext *context,
const GimpRGB *color,
GimpActionGroup *group);
static void edit_actions_background_changed (GimpContext *context,
const GimpRGB *color,
GimpActionGroup *group);
static void edit_actions_pattern_changed (GimpContext *context,
GimpPattern *pattern,
GimpActionGroup *group);
static GimpActionEntry edit_actions[] =
{
{ "edit-menu", NULL, N_("_Edit") },
{ "edit-buffer-menu", NULL, N_("_Buffer") },
{ "edit-undo", GTK_STOCK_UNDO,
N_("_Undo"), "<control>Z",
N_("Undo"),
G_CALLBACK (edit_undo_cmd_callback),
GIMP_HELP_EDIT_UNDO },
{ "edit-redo", GTK_STOCK_REDO,
N_("_Redo"), "<control>Y",
N_("Redo"),
G_CALLBACK (edit_redo_cmd_callback),
GIMP_HELP_EDIT_REDO },
{ "edit-undo-clear", GTK_STOCK_CLEAR,
N_("_Clear Undo History"), "",
N_("Clear undo history..."),
G_CALLBACK (edit_undo_clear_cmd_callback),
GIMP_HELP_EDIT_UNDO_CLEAR },
{ "edit-cut", GTK_STOCK_CUT,
N_("Cu_t"), "<control>X", NULL,
G_CALLBACK (edit_cut_cmd_callback),
GIMP_HELP_EDIT_CUT },
{ "edit-copy", GTK_STOCK_COPY,
N_("_Copy"), "<control>C", NULL,
G_CALLBACK (edit_copy_cmd_callback),
GIMP_HELP_EDIT_COPY },
{ "edit-copy-visible", NULL, /* GIMP_STOCK_COPY_VISIBLE, */
N_("Copy _Visible"), "", NULL,
G_CALLBACK (edit_copy_visible_cmd_callback),
GIMP_HELP_EDIT_COPY_VISIBLE },
{ "edit-paste", GTK_STOCK_PASTE,
N_("_Paste"), "<control>V", NULL,
G_CALLBACK (edit_paste_cmd_callback),
GIMP_HELP_EDIT_PASTE },
{ "edit-paste-into", GIMP_STOCK_PASTE_INTO,
N_("Paste _Into"), NULL, NULL,
G_CALLBACK (edit_paste_into_cmd_callback),
GIMP_HELP_EDIT_PASTE_INTO },
{ "edit-paste-as-new", GIMP_STOCK_PASTE_AS_NEW,
N_("Paste as _New"), NULL, NULL,
G_CALLBACK (edit_paste_as_new_cmd_callback),
GIMP_HELP_EDIT_PASTE_AS_NEW },
{ "edit-named-cut", GTK_STOCK_CUT,
N_("Cu_t Named..."), "<control><shift>X",NULL,
G_CALLBACK (edit_named_cut_cmd_callback),
GIMP_HELP_BUFFER_CUT },
{ "edit-named-copy", GTK_STOCK_COPY,
N_("_Copy Named..."), "<control><shift>C", NULL,
G_CALLBACK (edit_named_copy_cmd_callback),
GIMP_HELP_BUFFER_COPY },
{ "edit-named-paste", GTK_STOCK_PASTE,
N_("_Paste Named..."), "<control><shift>V", NULL,
G_CALLBACK (edit_named_paste_cmd_callback),
GIMP_HELP_BUFFER_PASTE },
{ "edit-clear", GTK_STOCK_CLEAR,
N_("Cl_ear"), "<control>K", NULL,
G_CALLBACK (edit_clear_cmd_callback),
GIMP_HELP_EDIT_CLEAR }
};
static GimpEnumActionEntry edit_fill_actions[] =
{
{ "edit-fill-fg", GIMP_STOCK_TOOL_BUCKET_FILL,
N_("Fill with _FG Color"), "<control>comma", NULL,
GIMP_FOREGROUND_FILL, FALSE,
GIMP_HELP_EDIT_FILL_FG },
{ "edit-fill-bg", GIMP_STOCK_TOOL_BUCKET_FILL,
N_("Fill with B_G Color"), "<control>period", NULL,
GIMP_BACKGROUND_FILL, FALSE,
GIMP_HELP_EDIT_FILL_BG },
{ "edit-fill-pattern", GIMP_STOCK_TOOL_BUCKET_FILL,
N_("Fill with P_attern"), "<control>semicolon", NULL,
GIMP_PATTERN_FILL, FALSE,
GIMP_HELP_EDIT_FILL_PATTERN }
};
void
edit_actions_setup (GimpActionGroup *group)
{
GimpContext *context = gimp_get_user_context (group->gimp);
GimpRGB color;
GimpPattern *pattern;
gimp_action_group_add_actions (group,
edit_actions,
G_N_ELEMENTS (edit_actions));
gimp_action_group_add_enum_actions (group,
edit_fill_actions,
G_N_ELEMENTS (edit_fill_actions),
G_CALLBACK (edit_fill_cmd_callback));
g_signal_connect_object (context, "foreground_changed",
G_CALLBACK (edit_actions_foreground_changed),
group, 0);
g_signal_connect_object (context, "background_changed",
G_CALLBACK (edit_actions_background_changed),
group, 0);
g_signal_connect_object (context, "pattern_changed",
G_CALLBACK (edit_actions_pattern_changed),
group, 0);
gimp_context_get_foreground (context, &color);
edit_actions_foreground_changed (context, &color, group);
gimp_context_get_background (context, &color);
edit_actions_background_changed (context, &color, group);
pattern = gimp_context_get_pattern (context);
edit_actions_pattern_changed (context, pattern, group);
}
void
edit_actions_update (GimpActionGroup *group,
gpointer data)
{
GimpImage *gimage = action_data_get_image (data);
GimpDrawable *drawable = NULL;
gchar *undo_name = NULL;
gchar *redo_name = NULL;
gboolean undo_enabled = FALSE;
if (gimage)
{
GimpUndo *undo;
GimpUndo *redo;
drawable = gimp_image_active_drawable (gimage);
undo_enabled = gimp_image_undo_is_enabled (gimage);
if (undo_enabled)
{
undo = gimp_undo_stack_peek (gimage->undo_stack);
redo = gimp_undo_stack_peek (gimage->redo_stack);
if (undo)
undo_name =
g_strdup_printf (_("_Undo %s"),
gimp_object_get_name (GIMP_OBJECT (undo)));
if (redo)
redo_name =
g_strdup_printf (_("_Redo %s"),
gimp_object_get_name (GIMP_OBJECT (redo)));
}
}
#define SET_LABEL(action,label) \
gimp_action_group_set_action_label (group, action, (label))
#define SET_SENSITIVE(action,condition) \
gimp_action_group_set_action_sensitive (group, action, (condition) != 0)
SET_LABEL ("edit-undo", undo_name ? undo_name : _("_Undo"));
SET_LABEL ("edit-redo", redo_name ? redo_name : _("_Redo"));
SET_SENSITIVE ("edit-undo", undo_enabled && undo_name);
SET_SENSITIVE ("edit-redo", undo_enabled && redo_name);
SET_SENSITIVE ("edit-undo-clear", undo_enabled && (undo_name || redo_name));
g_free (undo_name);
g_free (redo_name);
SET_SENSITIVE ("edit-cut", drawable);
SET_SENSITIVE ("edit-copy", drawable);
SET_SENSITIVE ("edit-copy-visible", gimage);
SET_SENSITIVE ("edit-paste", gimage);
SET_SENSITIVE ("edit-paste-into", gimage);
SET_SENSITIVE ("edit-named-cut", drawable);
SET_SENSITIVE ("edit-named-copy", drawable);
SET_SENSITIVE ("edit-named-paste", gimage);
SET_SENSITIVE ("edit-clear", drawable);
SET_SENSITIVE ("edit-fill-fg", drawable);
SET_SENSITIVE ("edit-fill-bg", drawable);
SET_SENSITIVE ("edit-fill-pattern", drawable);
#undef SET_LABEL
#undef SET_SENSITIVE
}
/* private functions */
static void
edit_actions_foreground_changed (GimpContext *context,
const GimpRGB *color,
GimpActionGroup *group)
{
gimp_action_group_set_action_color (group, "edit-fill-fg", color, FALSE);
}
static void
edit_actions_background_changed (GimpContext *context,
const GimpRGB *color,
GimpActionGroup *group)
{
gimp_action_group_set_action_color (group, "edit-fill-bg", color, FALSE);
}
static void
edit_actions_pattern_changed (GimpContext *context,
GimpPattern *pattern,
GimpActionGroup *group)
{
gimp_action_group_set_action_viewable (group, "edit-fill-pattern",
GIMP_VIEWABLE (pattern));
}

View File

@ -0,0 +1,28 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __EDIT_ACTIONS_H__
#define __EDIT_ACTIONS_H__
void edit_actions_setup (GimpActionGroup *group);
void edit_actions_update (GimpActionGroup *group,
gpointer data);
#endif /* __EDIT_ACTIONS_H__ */

396
app/actions/edit-commands.c Normal file
View File

@ -0,0 +1,396 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <string.h>
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"
#include "actions-types.h"
#include "core/gimp.h"
#include "core/gimp-edit.h"
#include "core/gimpbuffer.h"
#include "core/gimpcontainer.h"
#include "core/gimpdrawable.h"
#include "core/gimpimage.h"
#include "core/gimpimage-undo.h"
#include "display/gimpdisplay.h"
#include "display/gimpdisplayshell.h"
#include "display/gimpdisplayshell-transform.h"
#include "widgets/gimpclipboard.h"
#include "widgets/gimphelp-ids.h"
#include "widgets/gimpdialogfactory.h"
#include "widgets/gimpmessagebox.h"
#include "widgets/gimpmessagedialog.h"
#include "dialogs/dialogs.h"
#include "actions.h"
#include "edit-commands.h"
#include "gimp-intl.h"
/* local function prototypes */
static void edit_paste (GimpDisplay *gdisp,
gboolean paste_into);
static void edit_undo_clear_response (GtkWidget *dialog,
gint response_id,
GimpImage *gimage);
static void cut_named_buffer_callback (GtkWidget *widget,
const gchar *name,
gpointer data);
static void copy_named_buffer_callback (GtkWidget *widget,
const gchar *name,
gpointer data);
/* public functions */
void
edit_undo_cmd_callback (GtkAction *action,
gpointer data)
{
GimpImage *gimage;
return_if_no_image (gimage, data);
if (gimp_image_undo (gimage))
gimp_image_flush (gimage);
}
void
edit_redo_cmd_callback (GtkAction *action,
gpointer data)
{
GimpImage *gimage;
return_if_no_image (gimage, data);
if (gimp_image_redo (gimage))
gimp_image_flush (gimage);
}
void
edit_undo_clear_cmd_callback (GtkAction *action,
gpointer data)
{
GimpImage *gimage;
GtkWidget *widget;
GtkWidget *dialog;
return_if_no_image (gimage, data);
return_if_no_widget (widget, data);
dialog = gimp_message_dialog_new (_("Clear Undo History"), GIMP_STOCK_WARNING,
widget, 0,
gimp_standard_help_func, NULL,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_CLEAR, GTK_RESPONSE_OK,
NULL);
g_signal_connect_object (gimage, "disconnect",
G_CALLBACK (gtk_widget_destroy),
dialog, G_CONNECT_SWAPPED);
g_signal_connect (dialog, "response",
G_CALLBACK (edit_undo_clear_response),
gimage);
gimp_message_box_set_primary_text (GIMP_MESSAGE_DIALOG (dialog)->box,
_("Really clear image's undo history?"));
gtk_widget_show (dialog);
}
void
edit_cut_cmd_callback (GtkAction *action,
gpointer data)
{
GimpImage *gimage;
GimpDrawable *drawable;
return_if_no_drawable (gimage, drawable, data);
if (gimp_edit_cut (gimage, drawable, action_data_get_context (data)))
gimp_image_flush (gimage);
}
void
edit_copy_cmd_callback (GtkAction *action,
gpointer data)
{
GimpImage *gimage;
GimpDrawable *drawable;
return_if_no_drawable (gimage, drawable, data);
if (gimp_edit_copy (gimage, drawable, action_data_get_context (data)))
gimp_image_flush (gimage);
}
void
edit_copy_visible_cmd_callback (GtkAction *action,
gpointer data)
{
GimpImage *gimage;
return_if_no_image (gimage, data);
if (gimp_edit_copy_visible (gimage, action_data_get_context (data)))
gimp_image_flush (gimage);
}
void
edit_paste_cmd_callback (GtkAction *action,
gpointer data)
{
GimpDisplay *gdisp;
return_if_no_display (gdisp, data);
edit_paste (gdisp, FALSE);
}
void
edit_paste_into_cmd_callback (GtkAction *action,
gpointer data)
{
GimpDisplay *gdisp;
return_if_no_display (gdisp, data);
edit_paste (gdisp, TRUE);
}
void
edit_paste_as_new_cmd_callback (GtkAction *action,
gpointer data)
{
Gimp *gimp;
GimpBuffer *buffer;
return_if_no_gimp (gimp, data);
buffer = gimp_clipboard_get_buffer (gimp);
if (buffer)
{
gimp_edit_paste_as_new (gimp, action_data_get_image (data), buffer);
g_object_unref (buffer);
}
}
void
edit_named_cut_cmd_callback (GtkAction *action,
gpointer data)
{
GimpImage *gimage;
GtkWidget *widget;
GtkWidget *dialog;
return_if_no_image (gimage, data);
return_if_no_widget (widget, data);
dialog = gimp_query_string_box (_("Cut Named"), widget,
gimp_standard_help_func,
GIMP_HELP_BUFFER_CUT,
_("Enter a name for this buffer"),
NULL,
G_OBJECT (gimage), "disconnect",
cut_named_buffer_callback, gimage);
gtk_widget_show (dialog);
}
void
edit_named_copy_cmd_callback (GtkAction *action,
gpointer data)
{
GimpImage *gimage;
GtkWidget *widget;
GtkWidget *dialog;
return_if_no_image (gimage, data);
return_if_no_widget (widget, data);
dialog = gimp_query_string_box (_("Copy Named"), widget,
gimp_standard_help_func,
GIMP_HELP_BUFFER_COPY,
_("Enter a name for this buffer"),
NULL,
G_OBJECT (gimage), "disconnect",
copy_named_buffer_callback, gimage);
gtk_widget_show (dialog);
}
void
edit_named_paste_cmd_callback (GtkAction *action,
gpointer data)
{
GtkWidget *widget;
return_if_no_widget (widget, data);
gimp_dialog_factory_dialog_raise (global_dock_factory,
gtk_widget_get_screen (widget),
"gimp-buffer-list|gimp-buffer-grid", -1);
}
void
edit_clear_cmd_callback (GtkAction *action,
gpointer data)
{
GimpImage *gimage;
GimpDrawable *drawable;
return_if_no_drawable (gimage, drawable, data);
gimp_edit_clear (gimage, drawable, action_data_get_context (data));
gimp_image_flush (gimage);
}
void
edit_fill_cmd_callback (GtkAction *action,
gint value,
gpointer data)
{
GimpImage *gimage;
GimpDrawable *drawable;
GimpFillType fill_type;
return_if_no_drawable (gimage, drawable, data);
fill_type = (GimpFillType) value;
gimp_edit_fill (gimage, drawable, action_data_get_context (data),
fill_type);
gimp_image_flush (gimage);
}
/* private functions */
static void
edit_paste (GimpDisplay *gdisp,
gboolean paste_into)
{
GimpBuffer *buffer = gimp_clipboard_get_buffer (gdisp->gimage->gimp);
if (buffer)
{
GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (gdisp->shell);
gint x, y;
gint width, height;
gimp_display_shell_untransform_viewport (shell, &x, &y, &width, &height);
if (gimp_edit_paste (gdisp->gimage,
gimp_image_active_drawable (gdisp->gimage),
buffer, paste_into, x, y, width, height))
{
gimp_image_flush (gdisp->gimage);
}
g_object_unref (buffer);
}
}
static void
edit_undo_clear_response (GtkWidget *dialog,
gint response_id,
GimpImage *gimage)
{
gtk_widget_destroy (dialog);
if (response_id == GTK_RESPONSE_OK)
{
gimp_image_undo_disable (gimage);
gimp_image_undo_enable (gimage);
gimp_image_flush (gimage);
}
}
static void
cut_named_buffer_callback (GtkWidget *widget,
const gchar *name,
gpointer data)
{
GimpImage *gimage = GIMP_IMAGE (data);
const GimpBuffer *cut_buffer;
GimpDrawable *drawable;
drawable = gimp_image_active_drawable (gimage);
if (! drawable)
{
g_message (_("There is no active layer or channel to cut from."));
return;
}
cut_buffer = gimp_edit_cut (gimage, drawable,
gimp_get_user_context (gimage->gimp));
if (cut_buffer)
{
GimpBuffer *new_buffer;
if (! (name && strlen (name)))
name = _("(Unnamed Buffer)");
new_buffer = gimp_buffer_new (cut_buffer->tiles, name, TRUE);
gimp_container_add (gimage->gimp->named_buffers,
GIMP_OBJECT (new_buffer));
g_object_unref (new_buffer);
gimp_image_flush (gimage);
}
}
static void
copy_named_buffer_callback (GtkWidget *widget,
const gchar *name,
gpointer data)
{
GimpImage *gimage = GIMP_IMAGE (data);
const GimpBuffer *copy_buffer;
GimpDrawable *drawable;
drawable = gimp_image_active_drawable (gimage);
if (! drawable)
{
g_message (_("There is no active layer or channel to copy from."));
return;
}
copy_buffer = gimp_edit_copy (gimage, drawable,
gimp_get_user_context (gimage->gimp));
if (copy_buffer)
{
GimpBuffer *new_buffer;
if (! (name && strlen (name)))
name = _("(Unnamed Buffer)");
new_buffer = gimp_buffer_new (copy_buffer->tiles, name, TRUE);
gimp_container_add (gimage->gimp->named_buffers,
GIMP_OBJECT (new_buffer));
g_object_unref (new_buffer);
gimp_image_flush (gimage);
}
}

View File

@ -0,0 +1,54 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __EDIT_COMMANDS_H__
#define __EDIT_COMMANDS_H__
void edit_undo_cmd_callback (GtkAction *action,
gpointer data);
void edit_redo_cmd_callback (GtkAction *action,
gpointer data);
void edit_undo_clear_cmd_callback (GtkAction *action,
gpointer data);
void edit_cut_cmd_callback (GtkAction *action,
gpointer data);
void edit_copy_cmd_callback (GtkAction *action,
gpointer data);
void edit_copy_visible_cmd_callback (GtkAction *action,
gpointer data);
void edit_paste_cmd_callback (GtkAction *action,
gpointer data);
void edit_paste_into_cmd_callback (GtkAction *action,
gpointer data);
void edit_paste_as_new_cmd_callback (GtkAction *action,
gpointer data);
void edit_named_cut_cmd_callback (GtkAction *action,
gpointer data);
void edit_named_copy_cmd_callback (GtkAction *action,
gpointer data);
void edit_named_paste_cmd_callback (GtkAction *action,
gpointer data);
void edit_clear_cmd_callback (GtkAction *action,
gpointer data);
void edit_fill_cmd_callback (GtkAction *action,
gint value,
gpointer data);
#endif /* __EDIT_COMMANDS_H__ */

View File

@ -0,0 +1,97 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"
#include "actions-types.h"
#include "widgets/gimpactiongroup.h"
#include "widgets/gimperrorconsole.h"
#include "widgets/gimphelp-ids.h"
#include "error-console-actions.h"
#include "error-console-commands.h"
#include "gimp-intl.h"
static GimpActionEntry error_console_actions[] =
{
{ "error-console-popup", GIMP_STOCK_WARNING,
N_("Error Console Menu"), NULL, NULL, NULL,
GIMP_HELP_ERRORS_DIALOG },
{ "error-console-clear", GTK_STOCK_CLEAR,
N_("_Clear Errors"), "",
N_("Clear errors"),
G_CALLBACK (error_console_clear_cmd_callback),
GIMP_HELP_ERRORS_CLEAR }
};
static GimpEnumActionEntry error_console_save_actions[] =
{
{ "error-console-save-all", GTK_STOCK_SAVE_AS,
N_("Save _All Errors to File..."), "",
N_("Save all errors"),
FALSE, FALSE,
GIMP_HELP_ERRORS_SAVE },
{ "error-console-save-selection", GTK_STOCK_SAVE_AS,
N_("Save _Selection to File..."), "",
N_("Save selection"),
TRUE, FALSE,
GIMP_HELP_ERRORS_SAVE }
};
void
error_console_actions_setup (GimpActionGroup *group)
{
gimp_action_group_add_actions (group,
error_console_actions,
G_N_ELEMENTS (error_console_actions));
gimp_action_group_add_enum_actions (group,
error_console_save_actions,
G_N_ELEMENTS (error_console_save_actions),
G_CALLBACK (error_console_save_cmd_callback));
}
void
error_console_actions_update (GimpActionGroup *group,
gpointer data)
{
GimpErrorConsole *console = GIMP_ERROR_CONSOLE (data);
gboolean selection;
selection = gtk_text_buffer_get_selection_bounds (console->text_buffer,
NULL, NULL);
#define SET_SENSITIVE(action,condition) \
gimp_action_group_set_action_sensitive (group, action, (condition) != 0)
SET_SENSITIVE ("error-console-clear", TRUE);
SET_SENSITIVE ("error-console-save-all", TRUE);
SET_SENSITIVE ("error-console-save-selection", selection);
#undef SET_SENSITIVE
}

View File

@ -0,0 +1,28 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __ERROR_CONSOLE_ACIONS_H__
#define __ERROR_CONSOLE_ACIONS_H__
void error_console_actions_setup (GimpActionGroup *group);
void error_console_actions_update (GimpActionGroup *group,
gpointer data);
#endif /* __ERROR_CONSOLE_ACTIONS_H__ */

View File

@ -0,0 +1,143 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <gtk/gtk.h>
#include "libgimpbase/gimpbase.h"
#include "libgimpwidgets/gimpwidgets.h"
#include "actions-types.h"
#include "widgets/gimperrorconsole.h"
#include "widgets/gimphelp-ids.h"
#include "widgets/gimpwidgets-utils.h"
#include "error-console-commands.h"
#include "gimp-intl.h"
/* local function prototypes */
static void error_console_save_response (GtkWidget *dialog,
gint response_id,
GimpErrorConsole *console);
/* public functions */
void
error_console_clear_cmd_callback (GtkAction *action,
gpointer data)
{
GimpErrorConsole *console = GIMP_ERROR_CONSOLE (data);
GtkTextIter start_iter;
GtkTextIter end_iter;
gtk_text_buffer_get_bounds (console->text_buffer, &start_iter, &end_iter);
gtk_text_buffer_delete (console->text_buffer, &start_iter, &end_iter);
}
void
error_console_save_cmd_callback (GtkAction *action,
gint value,
gpointer data)
{
GimpErrorConsole *console = GIMP_ERROR_CONSOLE (data);
GtkFileChooser *chooser;
if (value && ! gtk_text_buffer_get_selection_bounds (console->text_buffer,
NULL, NULL))
{
g_message (_("Cannot save. Nothing is selected."));
return;
}
if (console->file_dialog)
{
gtk_window_present (GTK_WINDOW (console->file_dialog));
return;
}
console->file_dialog =
gtk_file_chooser_dialog_new (_("Save Error Log to File"), NULL,
GTK_FILE_CHOOSER_ACTION_SAVE,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_SAVE, GTK_RESPONSE_OK,
NULL);
console->save_selection = value;
g_object_add_weak_pointer (G_OBJECT (console->file_dialog),
(gpointer *) &console->file_dialog);
chooser = GTK_FILE_CHOOSER (console->file_dialog);
gtk_window_set_screen (GTK_WINDOW (chooser),
gtk_widget_get_screen (GTK_WIDGET (console)));
gtk_window_set_position (GTK_WINDOW (chooser), GTK_WIN_POS_MOUSE);
gtk_window_set_role (GTK_WINDOW (chooser), "gimp-save-errors");
g_signal_connect (chooser, "response",
G_CALLBACK (error_console_save_response),
console);
g_signal_connect (chooser, "delete_event",
G_CALLBACK (gtk_true),
NULL);
gimp_help_connect (GTK_WIDGET (chooser), gimp_standard_help_func,
GIMP_HELP_ERRORS_DIALOG, NULL);
gtk_widget_show (GTK_WIDGET (chooser));
}
/* private functions */
static void
error_console_save_response (GtkWidget *dialog,
gint response_id,
GimpErrorConsole *console)
{
if (response_id == GTK_RESPONSE_OK)
{
GError *error = NULL;
gchar *filename;
filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog));
if (! gimp_text_buffer_save (console->text_buffer, filename,
console->save_selection, &error))
{
g_message (_("Error writing file '%s':\n%s"),
gimp_filename_to_utf8 (filename), error->message);
g_clear_error (&error);
g_free (filename);
return;
}
g_free (filename);
}
gtk_widget_destroy (dialog);
}

View File

@ -0,0 +1,30 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __ERROR_CONSOLE_COMMANDS_H__
#define __ERROR_CONSOLE_COMMANDS_H__
void error_console_clear_cmd_callback (GtkAction *action,
gpointer data);
void error_console_save_cmd_callback (GtkAction *action,
gint value,
gpointer data);
#endif /* __ERROR_CONSOLE_COMMANDS_H__ */

285
app/actions/file-actions.c Normal file
View File

@ -0,0 +1,285 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <gtk/gtk.h>
#include "libgimpbase/gimpbase.h"
#include "libgimpwidgets/gimpwidgets.h"
#include "actions-types.h"
#include "config/gimpguiconfig.h"
#include "core/gimp.h"
#include "core/gimpcontainer.h"
#include "core/gimpimage.h"
#include "core/gimpviewable.h"
#include "file/file-utils.h"
#include "widgets/gimpaction.h"
#include "widgets/gimpactiongroup.h"
#include "widgets/gimphelp-ids.h"
#include "actions.h"
#include "file-actions.h"
#include "file-commands.h"
#include "gimp-intl.h"
/* local function prototypes */
static void file_actions_last_opened_update (GimpContainer *container,
GimpImagefile *unused,
GimpActionGroup *group);
static void file_actions_last_opened_reorder (GimpContainer *container,
GimpImagefile *unused1,
gint unused2,
GimpActionGroup *group);
static GimpActionEntry file_actions[] =
{
{ "file-menu", NULL, N_("_File") },
{ "file-open-recent-menu", NULL, N_("Open _Recent") },
{ "file-acquire-menu", NULL, N_("_Acquire") },
{ "file-open", GTK_STOCK_OPEN,
N_("_Open..."), NULL, NULL,
G_CALLBACK (file_open_cmd_callback),
GIMP_HELP_FILE_OPEN },
{ "file-open-from-image", GTK_STOCK_OPEN,
N_("_Open..."), NULL, NULL,
G_CALLBACK (file_open_from_image_cmd_callback),
GIMP_HELP_FILE_OPEN },
{ "file-open-as-layer", GIMP_STOCK_LAYER,
N_("Op_en as Layer..."), "<control><alt>O", NULL,
G_CALLBACK (file_open_as_layer_cmd_callback),
GIMP_HELP_FILE_OPEN_AS_LAYER },
{ "file-open-location", GIMP_STOCK_WEB,
N_("Open _Location..."), NULL, NULL,
G_CALLBACK (file_open_location_cmd_callback),
GIMP_HELP_FILE_OPEN_LOCATION },
{ "file-save", GTK_STOCK_SAVE,
N_("_Save"), "<control>S", NULL,
G_CALLBACK (file_save_cmd_callback),
GIMP_HELP_FILE_SAVE },
{ "file-save-as", GTK_STOCK_SAVE_AS,
N_("Save _as..."), "<control><shift>S", NULL,
G_CALLBACK (file_save_as_cmd_callback),
GIMP_HELP_FILE_SAVE_AS },
{ "file-save-a-copy", NULL,
N_("Save a Cop_y..."), NULL, NULL,
G_CALLBACK (file_save_a_copy_cmd_callback),
GIMP_HELP_FILE_SAVE_A_COPY },
{ "file-save-as-template", NULL,
N_("Save as _Template..."), NULL, NULL,
G_CALLBACK (file_save_template_cmd_callback),
GIMP_HELP_FILE_SAVE_AS_TEMPLATE },
{ "file-revert", GTK_STOCK_REVERT_TO_SAVED,
N_("Re_vert..."), NULL, NULL,
G_CALLBACK (file_revert_cmd_callback),
GIMP_HELP_FILE_REVERT },
{ "file-quit", GTK_STOCK_QUIT,
N_("_Quit"), "<control>Q", NULL,
G_CALLBACK (file_quit_cmd_callback),
GIMP_HELP_FILE_QUIT }
};
void
file_actions_setup (GimpActionGroup *group)
{
GtkAction *action;
GimpEnumActionEntry *entries;
gint n_entries;
gint i;
gimp_action_group_add_actions (group,
file_actions,
G_N_ELEMENTS (file_actions));
action = gtk_action_group_get_action (GTK_ACTION_GROUP (group),
"file-open-from-image");
gtk_action_set_accel_path (action, "<Actions>/file/file-open");
#ifdef __GNUC__
#warning FIXME: remove accel_path hack
#endif
g_object_set_data (G_OBJECT (action), "gimp-accel-path",
"<Actions>/file/file-open");
n_entries = GIMP_GUI_CONFIG (group->gimp->config)->last_opened_size;
entries = g_new0 (GimpEnumActionEntry, n_entries);
for (i = 0; i < n_entries; i++)
{
entries[i].name = g_strdup_printf ("file-open-recent-%02d",
i + 1);
entries[i].stock_id = GTK_STOCK_OPEN;
entries[i].label = NULL;
entries[i].tooltip = NULL;
entries[i].value = i;
entries[i].value_variable = FALSE;
entries[i].help_id = GIMP_HELP_FILE_OPEN_RECENT;
if (i < 9)
entries[i].accelerator = g_strdup_printf ("<control>%d", i + 1);
else if (i == 9)
entries[i].accelerator = "<control>0";
else
entries[i].accelerator = "";
}
gimp_action_group_add_enum_actions (group, entries, n_entries,
G_CALLBACK (file_last_opened_cmd_callback));
for (i = 0; i < n_entries; i++)
{
gimp_action_group_set_action_visible (group, entries[i].name, FALSE);
g_free ((gchar *) entries[i].name);
if (i < 9)
g_free ((gchar *) entries[i].accelerator);
}
g_free (entries);
g_signal_connect_object (group->gimp->documents, "add",
G_CALLBACK (file_actions_last_opened_update),
group, 0);
g_signal_connect_object (group->gimp->documents, "remove",
G_CALLBACK (file_actions_last_opened_update),
group, 0);
g_signal_connect_object (group->gimp->documents, "reorder",
G_CALLBACK (file_actions_last_opened_reorder),
group, 0);
file_actions_last_opened_update (group->gimp->documents, NULL, group);
}
void
file_actions_update (GimpActionGroup *group,
gpointer data)
{
GimpImage *gimage = action_data_get_image (data);
GimpDrawable *drawable = NULL;
if (gimage)
drawable = gimp_image_active_drawable (gimage);
#define SET_SENSITIVE(action,condition) \
gimp_action_group_set_action_sensitive (group, action, (condition) != 0)
SET_SENSITIVE ("file-open-as-layer", gimage);
SET_SENSITIVE ("file-save", gimage && drawable);
SET_SENSITIVE ("file-save-as", gimage && drawable);
SET_SENSITIVE ("file-save-a-copy", gimage && drawable);
SET_SENSITIVE ("file-save-as-template", gimage);
SET_SENSITIVE ("file-revert", gimage && GIMP_OBJECT (gimage)->name);
#undef SET_SENSITIVE
}
/* private functions */
static void
file_actions_last_opened_update (GimpContainer *container,
GimpImagefile *unused,
GimpActionGroup *group)
{
gint num_documents;
gint i;
gint n = GIMP_GUI_CONFIG (group->gimp->config)->last_opened_size;
num_documents = gimp_container_num_children (container);
for (i = 0; i < n; i++)
{
GtkAction *action;
gchar *name = g_strdup_printf ("file-open-recent-%02d", i + 1);
action = gtk_action_group_get_action (GTK_ACTION_GROUP (group), name);
if (i < num_documents)
{
GimpImagefile *imagefile = (GimpImagefile *)
gimp_container_get_child_by_index (container, i);
if (GIMP_ACTION (action)->viewable != (GimpViewable *) imagefile)
{
const gchar *uri;
gchar *filename;
gchar *basename;
gchar *escaped;
uri = gimp_object_get_name (GIMP_OBJECT (imagefile));
filename = file_utils_uri_to_utf8_filename (uri);
basename = file_utils_uri_to_utf8_basename (uri);
escaped = gimp_escape_uline (basename);
g_free (basename);
g_object_set (action,
"label", escaped,
"tooltip", filename,
"visible", TRUE,
"viewable", imagefile,
NULL);
g_free (filename);
g_free (escaped);
}
}
else
{
g_object_set (action,
"visible", FALSE,
"viewable", NULL,
NULL);
}
g_free (name);
}
}
static void
file_actions_last_opened_reorder (GimpContainer *container,
GimpImagefile *unused1,
gint unused2,
GimpActionGroup *group)
{
file_actions_last_opened_update (container, unused1, group);
}

View File

@ -0,0 +1,28 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __FILE_ACTIONS_H__
#define __FILE_ACTIONS_H__
void file_actions_setup (GimpActionGroup *group);
void file_actions_update (GimpActionGroup *group,
gpointer data);
#endif /* __FILE_ACTIONS_H__ */

507
app/actions/file-commands.c Normal file
View File

@ -0,0 +1,507 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <string.h>
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"
#include "actions-types.h"
#include "config/gimpguiconfig.h"
#include "core/gimp.h"
#include "core/gimpcontainer.h"
#include "core/gimpimage.h"
#include "core/gimpprogress.h"
#include "core/gimptemplate.h"
#include "file/file-open.h"
#include "file/file-save.h"
#include "file/file-utils.h"
#include "widgets/gimpdialogfactory.h"
#include "widgets/gimpfiledialog.h"
#include "widgets/gimphelp-ids.h"
#include "widgets/gimpmessagebox.h"
#include "widgets/gimpmessagedialog.h"
#include "display/gimpdisplay.h"
#include "display/gimpdisplay-foreach.h"
#include "dialogs/dialogs.h"
#include "actions.h"
#include "file-commands.h"
#include "gimp-intl.h"
#define REVERT_DATA_KEY "revert-confirm-dialog"
/* local function prototypes */
static void file_open_dialog_show (GtkWidget *parent,
GimpImage *gimage,
const gchar *uri,
gboolean open_as_layer);
static void file_save_dialog_show (GimpImage *gimage,
GtkWidget *parent,
const gchar *title,
gboolean save_a_copy);
static void file_save_dialog_destroyed (GtkWidget *dialog,
GimpImage *gimage);
static void file_new_template_callback (GtkWidget *widget,
const gchar *name,
gpointer data);
static void file_revert_confirm_response (GtkWidget *dialog,
gint response_id,
GimpDisplay *gdisp);
/* public functions */
void
file_open_cmd_callback (GtkAction *action,
gpointer data)
{
GtkWidget *widget;
return_if_no_widget (widget, data);
file_open_dialog_show (widget, NULL, NULL, FALSE);
}
void
file_open_from_image_cmd_callback (GtkAction *action,
gpointer data)
{
GimpImage *image;
GtkWidget *widget;
const gchar *uri = NULL;
return_if_no_widget (widget, data);
image = action_data_get_image (data);
if (image)
uri = gimp_object_get_name (GIMP_OBJECT (image));
file_open_dialog_show (widget, NULL, uri, FALSE);
}
void
file_open_as_layer_cmd_callback (GtkAction *action,
gpointer data)
{
GimpDisplay *gdisp;
GtkWidget *widget;
return_if_no_display (gdisp, data);
return_if_no_widget (widget, data);
file_open_dialog_show (widget, gdisp->gimage, NULL, TRUE);
}
void
file_open_location_cmd_callback (GtkAction *action,
gpointer data)
{
GtkWidget *widget;
return_if_no_widget (widget, data);
gimp_dialog_factory_dialog_new (global_dialog_factory,
gtk_widget_get_screen (widget),
"gimp-file-open-location-dialog", -1, TRUE);
}
void
file_last_opened_cmd_callback (GtkAction *action,
gint value,
gpointer data)
{
Gimp *gimp;
GimpImagefile *imagefile;
gint num_entries;
return_if_no_gimp (gimp, data);
num_entries = gimp_container_num_children (gimp->documents);
if (value >= num_entries)
return;
imagefile = (GimpImagefile *)
gimp_container_get_child_by_index (gimp->documents, value);
if (imagefile)
{
GimpImage *gimage;
GimpPDBStatusType status;
GError *error = NULL;
gimage = file_open_with_display (gimp, action_data_get_context (data),
NULL,
GIMP_OBJECT (imagefile)->name,
&status, &error);
if (! gimage && status != GIMP_PDB_CANCEL)
{
gchar *filename;
filename =
file_utils_uri_to_utf8_filename (GIMP_OBJECT (imagefile)->name);
g_message (_("Opening '%s' failed:\n\n%s"),
filename, error->message);
g_clear_error (&error);
g_free (filename);
}
}
}
void
file_save_cmd_callback (GtkAction *action,
gpointer data)
{
GimpDisplay *gdisp;
return_if_no_display (gdisp, data);
if (! gimp_image_active_drawable (gdisp->gimage))
return;
/* Only save if the gimage has been modified */
if (gdisp->gimage->dirty ||
! GIMP_GUI_CONFIG (gdisp->gimage->gimp->config)->trust_dirty_flag)
{
const gchar *uri = gimp_object_get_name (GIMP_OBJECT (gdisp->gimage));
if (! uri)
{
file_save_as_cmd_callback (action, data);
}
else
{
GimpPDBStatusType status;
GError *error = NULL;
status = file_save (gdisp->gimage, action_data_get_context (data),
GIMP_PROGRESS (gdisp),
GIMP_RUN_WITH_LAST_VALS, &error);
if (status != GIMP_PDB_SUCCESS &&
status != GIMP_PDB_CANCEL)
{
gchar *filename;
filename = file_utils_uri_to_utf8_filename (uri);
g_message (_("Saving '%s' failed:\n\n%s"),
filename, error->message);
g_clear_error (&error);
g_free (filename);
}
}
}
}
void
file_save_as_cmd_callback (GtkAction *action,
gpointer data)
{
GimpDisplay *gdisp;
GtkWidget *widget;
return_if_no_display (gdisp, data);
return_if_no_widget (widget, data);
if (! gimp_image_active_drawable (gdisp->gimage))
return;
file_save_dialog_show (gdisp->gimage, widget,
_("Save Image"), FALSE);
}
void
file_save_a_copy_cmd_callback (GtkAction *action,
gpointer data)
{
GimpDisplay *gdisp;
GtkWidget *widget;
return_if_no_display (gdisp, data);
return_if_no_widget (widget, data);
if (! gimp_image_active_drawable (gdisp->gimage))
return;
file_save_dialog_show (gdisp->gimage, widget,
_("Save a Copy of the Image"), TRUE);
}
void
file_save_template_cmd_callback (GtkAction *action,
gpointer data)
{
GimpDisplay *gdisp;
GtkWidget *dialog;
return_if_no_display (gdisp, data);
dialog = gimp_query_string_box (_("Create New Template"),
gdisp->shell,
gimp_standard_help_func,
GIMP_HELP_FILE_SAVE_AS_TEMPLATE,
_("Enter a name for this template"),
NULL,
G_OBJECT (gdisp->gimage), "disconnect",
file_new_template_callback, gdisp->gimage);
gtk_widget_show (dialog);
}
void
file_revert_cmd_callback (GtkAction *action,
gpointer data)
{
GimpDisplay *gdisp;
GtkWidget *dialog;
const gchar *uri;
return_if_no_display (gdisp, data);
uri = gimp_object_get_name (GIMP_OBJECT (gdisp->gimage));
dialog = g_object_get_data (G_OBJECT (gdisp->gimage), REVERT_DATA_KEY);
if (! uri)
{
g_message (_("Revert failed. No file name associated with this image."));
}
else if (dialog)
{
gtk_window_present (GTK_WINDOW (dialog));
}
else
{
gchar *basename;
gchar *filename;
dialog =
gimp_message_dialog_new (_("Revert Image"), GIMP_STOCK_QUESTION,
gdisp->shell, 0,
gimp_standard_help_func, GIMP_HELP_FILE_REVERT,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_REVERT_TO_SAVED, GTK_RESPONSE_OK,
NULL);
g_signal_connect_object (gdisp, "disconnect",
G_CALLBACK (gtk_widget_destroy),
dialog, G_CONNECT_SWAPPED);
g_signal_connect (dialog, "response",
G_CALLBACK (file_revert_confirm_response),
gdisp);
basename = g_path_get_basename (uri);
filename = file_utils_uri_to_utf8_filename (uri);
gimp_message_box_set_primary_text (GIMP_MESSAGE_DIALOG (dialog)->box,
_("Revert '%s' to '%s'?"),
basename, filename);
g_free (filename);
g_free (basename);
gimp_message_box_set_text (GIMP_MESSAGE_DIALOG (dialog)->box,
_("By reverting the image to the state saved "
"on disk, you will lose all changes, "
"including all undo information."));
g_object_set_data (G_OBJECT (gdisp->gimage), REVERT_DATA_KEY, dialog);
gtk_widget_show (dialog);
}
}
void
file_quit_cmd_callback (GtkAction *action,
gpointer data)
{
Gimp *gimp;
return_if_no_gimp (gimp, data);
gimp_exit (gimp, FALSE);
}
void
file_file_open_dialog (Gimp *gimp,
const gchar *uri,
GtkWidget *parent)
{
file_open_dialog_show (parent, NULL, uri, FALSE);
}
/* private functions */
static void
file_open_dialog_show (GtkWidget *parent,
GimpImage *gimage,
const gchar *uri,
gboolean open_as_layer)
{
GtkWidget *dialog;
dialog = gimp_dialog_factory_dialog_new (global_dialog_factory,
gtk_widget_get_screen (parent),
"gimp-file-open-dialog", -1, FALSE);
if (dialog)
{
if (uri)
gtk_file_chooser_set_uri (GTK_FILE_CHOOSER (dialog), uri);
if (open_as_layer)
{
gtk_window_set_title (GTK_WINDOW (dialog), _("Open Image as Layer"));
GIMP_FILE_DIALOG (dialog)->gimage = gimage;
}
else
{
gtk_window_set_title (GTK_WINDOW (dialog), _("Open Image"));
GIMP_FILE_DIALOG (dialog)->gimage = NULL;
}
gtk_window_present (GTK_WINDOW (dialog));
}
}
static void
file_save_dialog_show (GimpImage *gimage,
GtkWidget *parent,
const gchar *title,
gboolean save_a_copy)
{
GtkWidget *dialog;
dialog = g_object_get_data (G_OBJECT (gimage), "gimp-file-save-dialog");
if (! dialog)
{
dialog = gimp_dialog_factory_dialog_new (global_dialog_factory,
gtk_widget_get_screen (parent),
"gimp-file-save-dialog",
-1, FALSE);
if (dialog)
{
g_object_set_data_full (G_OBJECT (gimage),
"gimp-file-save-dialog", dialog,
(GDestroyNotify) gtk_widget_destroy);
g_signal_connect (dialog, "destroy",
G_CALLBACK (file_save_dialog_destroyed),
gimage);
}
}
if (dialog)
{
gtk_window_set_title (GTK_WINDOW (dialog), title);
gimp_file_dialog_set_image (GIMP_FILE_DIALOG (dialog),
gimage, save_a_copy);
gtk_window_present (GTK_WINDOW (dialog));
}
}
static void
file_save_dialog_destroyed (GtkWidget *dialog,
GimpImage *gimage)
{
if (GIMP_FILE_DIALOG (dialog)->gimage == gimage)
g_object_set_data (G_OBJECT (gimage), "gimp-file-save-dialog", NULL);
}
static void
file_new_template_callback (GtkWidget *widget,
const gchar *name,
gpointer data)
{
GimpTemplate *template;
GimpImage *gimage;
gimage = (GimpImage *) data;
if (! (name && strlen (name)))
name = _("(Unnamed Template)");
template = gimp_template_new (name);
gimp_template_set_from_image (template, gimage);
gimp_container_add (gimage->gimp->templates, GIMP_OBJECT (template));
g_object_unref (template);
}
static void
file_revert_confirm_response (GtkWidget *dialog,
gint response_id,
GimpDisplay *gdisp)
{
GimpImage *old_gimage = gdisp->gimage;
gtk_widget_destroy (dialog);
g_object_set_data (G_OBJECT (old_gimage), REVERT_DATA_KEY, NULL);
if (response_id == GTK_RESPONSE_OK)
{
Gimp *gimp = old_gimage->gimp;
GimpImage *new_gimage;
const gchar *uri;
GimpPDBStatusType status;
GError *error = NULL;
uri = gimp_object_get_name (GIMP_OBJECT (old_gimage));
new_gimage = file_open_image (gimp, gimp_get_user_context (gimp),
GIMP_PROGRESS (gdisp),
uri, uri, NULL,
GIMP_RUN_INTERACTIVE,
&status, NULL, &error);
if (new_gimage)
{
gimp_displays_reconnect (gimp, old_gimage, new_gimage);
gimp_image_flush (new_gimage);
/* the displays own the image now */
g_object_unref (new_gimage);
}
else if (status != GIMP_PDB_CANCEL)
{
gchar *filename;
filename = file_utils_uri_to_utf8_filename (uri);
g_message (_("Reverting to '%s' failed:\n\n%s"),
filename, error->message);
g_clear_error (&error);
g_free (filename);
}
}
}

View File

@ -0,0 +1,54 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __FILE_COMMANDS_H__
#define __FILE_COMMANDS_H__
void file_open_cmd_callback (GtkAction *action,
gpointer data);
void file_open_from_image_cmd_callback (GtkAction *action,
gpointer data);
void file_open_as_layer_cmd_callback (GtkAction *action,
gpointer data);
void file_open_location_cmd_callback (GtkAction *action,
gpointer data);
void file_last_opened_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void file_save_cmd_callback (GtkAction *action,
gpointer data);
void file_save_as_cmd_callback (GtkAction *action,
gpointer data);
void file_save_a_copy_cmd_callback (GtkAction *action,
gpointer data);
void file_save_template_cmd_callback (GtkAction *action,
gpointer data);
void file_revert_cmd_callback (GtkAction *action,
gpointer data);
void file_quit_cmd_callback (GtkAction *action,
gpointer data);
void file_file_open_dialog (Gimp *gimp,
const gchar *uri,
GtkWidget *parent);
#endif /* __FILE_COMMANDS_H__ */

View File

@ -0,0 +1,79 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"
#include "actions-types.h"
#include "core/gimpcontext.h"
#include "text/gimpfont.h"
#include "widgets/gimpactiongroup.h"
#include "widgets/gimphelp-ids.h"
#include "actions.h"
#include "fonts-actions.h"
#include "fonts-commands.h"
#include "gimp-intl.h"
static GimpActionEntry fonts_actions[] =
{
{ "fonts-popup", GIMP_STOCK_FONT,
N_("Fonts Menu"), NULL, NULL, NULL,
GIMP_HELP_FONT_DIALOG },
{ "fonts-refresh", GTK_STOCK_REFRESH,
N_("_Rescan Font List"), "",
N_("Rescan font list"),
G_CALLBACK (fonts_refresh_cmd_callback),
GIMP_HELP_FONT_REFRESH }
};
void
fonts_actions_setup (GimpActionGroup *group)
{
gimp_action_group_add_actions (group,
fonts_actions,
G_N_ELEMENTS (fonts_actions));
}
void
fonts_actions_update (GimpActionGroup *group,
gpointer data)
{
GimpContext *context = action_data_get_context (data);
GimpFont *font = NULL;
if (context)
font = gimp_context_get_font (context);
#define SET_SENSITIVE(action,condition) \
gimp_action_group_set_action_sensitive (group, action, (condition) != 0)
SET_SENSITIVE ("fonts-refresh", TRUE);
#undef SET_SENSITIVE
}

View File

@ -0,0 +1,28 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __FONTS_ACTIONS_H__
#define __FONTS_ACTIONS_H__
void fonts_actions_setup (GimpActionGroup *group);
void fonts_actions_update (GimpActionGroup *group,
gpointer data);
#endif /* __FONTS_ACTIONS_H__ */

View File

@ -0,0 +1,47 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <gtk/gtk.h>
#include "actions-types.h"
#include "core/gimpcontext.h"
#include "text/gimp-fonts.h"
#include "widgets/gimpfontview.h"
#include "actions.h"
#include "fonts-commands.h"
#include "gimp-intl.h"
/* public functionss */
void
fonts_refresh_cmd_callback (GtkAction *action,
gpointer data)
{
GimpContext *context = action_data_get_context (data);
if (context)
gimp_fonts_load (context->gimp);
}

View File

@ -0,0 +1,27 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __FONTS_COMMANDS_H__
#define __FONTS_COMMANDS_H__
void fonts_refresh_cmd_callback (GtkAction *action,
gpointer data);
#endif /* __FONTS_COMMANDS_H__ */

View File

@ -0,0 +1,705 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"
#include "actions-types.h"
#include "core/gimp.h"
#include "core/gimpcontext.h"
#include "core/gimpdatafactory.h"
#include "core/gimpgradient.h"
#include "widgets/gimpactiongroup.h"
#include "widgets/gimpdataeditor.h"
#include "widgets/gimpgradienteditor.h"
#include "widgets/gimphelp-ids.h"
#include "gradient-editor-actions.h"
#include "gradient-editor-commands.h"
#include "gimp-intl.h"
static GimpActionEntry gradient_editor_actions[] =
{
{ "gradient-editor-popup", GIMP_STOCK_GRADIENT,
N_("Gradient Editor Menu"), NULL, NULL, NULL,
GIMP_HELP_GRADIENT_EDITOR_DIALOG },
{ "gradient-editor-load-left-color", GTK_STOCK_REVERT_TO_SAVED,
N_("_Load Left Color From") },
{ "gradient-editor-save-left-color", GTK_STOCK_SAVE,
N_("_Save Left Color To") },
{ "gradient-editor-load-right-color", GTK_STOCK_REVERT_TO_SAVED,
N_("Load Right Color Fr_om") },
{ "gradient-editor-save-right-color", GTK_STOCK_SAVE,
N_("Sa_ve Right Color To") },
{ "gradient-editor-blending-func", NULL, "blending-function" },
{ "gradient-editor-coloring-type", NULL, "coloring-type" },
{ "gradient-editor-left-color", NULL,
N_("L_eft Endpoint's Color..."), NULL, NULL,
G_CALLBACK (gradient_editor_left_color_cmd_callback),
GIMP_HELP_GRADIENT_EDITOR_LEFT_COLOR },
{ "gradient-editor-right-color", NULL,
N_("R_ight Endpoint's Color..."), NULL, NULL,
G_CALLBACK (gradient_editor_right_color_cmd_callback),
GIMP_HELP_GRADIENT_EDITOR_RIGHT_COLOR },
{ "gradient-editor-flip", GIMP_STOCK_FLIP_HORIZONTAL,
"flip", NULL, NULL,
G_CALLBACK (gradient_editor_flip_cmd_callback),
GIMP_HELP_GRADIENT_EDITOR_FLIP },
{ "gradient-editor-replicate", GIMP_STOCK_DUPLICATE,
"replicate", NULL, NULL,
G_CALLBACK (gradient_editor_replicate_cmd_callback),
GIMP_HELP_GRADIENT_EDITOR_FLIP },
{ "gradient-editor-split-midpoint", NULL,
"splitmidpoint", NULL, NULL,
G_CALLBACK (gradient_editor_split_midpoint_cmd_callback),
GIMP_HELP_GRADIENT_EDITOR_SPLIT_MIDPOINT },
{ "gradient-editor-split-uniform", NULL,
"splituniform", NULL, NULL,
G_CALLBACK (gradient_editor_split_uniformly_cmd_callback),
GIMP_HELP_GRADIENT_EDITOR_SPLIT_UNIFORM },
{ "gradient-editor-delete", GTK_STOCK_DELETE,
"delete", "", NULL,
G_CALLBACK (gradient_editor_delete_cmd_callback),
GIMP_HELP_GRADIENT_EDITOR_DELETE },
{ "gradient-editor-recenter", NULL,
"recenter", NULL, NULL,
G_CALLBACK (gradient_editor_recenter_cmd_callback),
GIMP_HELP_GRADIENT_EDITOR_RECENTER },
{ "gradient-editor-redistribute", NULL,
"redistribute", NULL, NULL,
G_CALLBACK (gradient_editor_redistribute_cmd_callback),
GIMP_HELP_GRADIENT_EDITOR_REDISTRIBUTE },
{ "gradient-editor-blend-color", NULL,
N_("Ble_nd Endpoints' Colors"), NULL, NULL,
G_CALLBACK (gradient_editor_blend_color_cmd_callback),
GIMP_HELP_GRADIENT_EDITOR_BLEND_COLOR },
{ "gradient-editor-blend-opacity", NULL,
N_("Blend Endpoints' Opacit_y"), NULL, NULL,
G_CALLBACK (gradient_editor_blend_opacity_cmd_callback),
GIMP_HELP_GRADIENT_EDITOR_BLEND_OPACITY }
};
#define LOAD_LEFT_FROM(num,magic) \
{ "gradient-editor-load-left-" num, NULL, \
num, NULL, NULL, \
(magic), FALSE, \
GIMP_HELP_GRADIENT_EDITOR_LEFT_LOAD }
#define SAVE_LEFT_TO(num,magic) \
{ "gradient-editor-save-left-" num, NULL, \
num, NULL, NULL, \
(magic), FALSE, \
GIMP_HELP_GRADIENT_EDITOR_LEFT_SAVE }
#define LOAD_RIGHT_FROM(num,magic) \
{ "gradient-editor-load-right-" num, NULL, \
num, NULL, NULL, \
(magic), FALSE, \
GIMP_HELP_GRADIENT_EDITOR_RIGHT_LOAD }
#define SAVE_RIGHT_TO(num,magic) \
{ "gradient-editor-save-right-" num, NULL, \
num, NULL, NULL, \
(magic), FALSE, \
GIMP_HELP_GRADIENT_EDITOR_RIGHT_SAVE }
static GimpEnumActionEntry gradient_editor_load_left_actions[] =
{
{ "gradient-editor-load-left-left-neighbor", NULL,
N_("_Left Neighbor's Right Endpoint"), NULL, NULL,
0, FALSE,
GIMP_HELP_GRADIENT_EDITOR_LEFT_LOAD },
{ "gradient-editor-load-left-right-endpoint", NULL,
N_("_Right Endpoint"), NULL, NULL,
1, FALSE,
GIMP_HELP_GRADIENT_EDITOR_LEFT_LOAD },
{ "gradient-editor-load-left-fg", NULL,
N_("_FG Color"), NULL, NULL,
2, FALSE,
GIMP_HELP_GRADIENT_EDITOR_LEFT_LOAD },
{ "gradient-editor-load-left-bg", NULL,
N_("_BG Color"), NULL, NULL,
3, FALSE,
GIMP_HELP_GRADIENT_EDITOR_LEFT_LOAD },
LOAD_LEFT_FROM ("01", 4),
LOAD_LEFT_FROM ("02", 5),
LOAD_LEFT_FROM ("03", 6),
LOAD_LEFT_FROM ("04", 7),
LOAD_LEFT_FROM ("05", 8),
LOAD_LEFT_FROM ("06", 9),
LOAD_LEFT_FROM ("07", 10),
LOAD_LEFT_FROM ("08", 11),
LOAD_LEFT_FROM ("09", 12),
LOAD_LEFT_FROM ("10", 13)
};
static GimpEnumActionEntry gradient_editor_save_left_actions[] =
{
SAVE_LEFT_TO ("01", 0),
SAVE_LEFT_TO ("02", 1),
SAVE_LEFT_TO ("03", 2),
SAVE_LEFT_TO ("04", 3),
SAVE_LEFT_TO ("05", 4),
SAVE_LEFT_TO ("06", 5),
SAVE_LEFT_TO ("07", 6),
SAVE_LEFT_TO ("08", 7),
SAVE_LEFT_TO ("09", 8),
SAVE_LEFT_TO ("10", 9)
};
static GimpEnumActionEntry gradient_editor_load_right_actions[] =
{
{ "gradient-editor-load-right-right-neighbor", NULL,
N_("_Right Neighbor's Left Endpoint"), NULL, NULL,
0, FALSE,
GIMP_HELP_GRADIENT_EDITOR_RIGHT_LOAD },
{ "gradient-editor-load-right-left-endpoint", NULL,
N_("_Left Endpoint"), NULL, NULL,
1, FALSE,
GIMP_HELP_GRADIENT_EDITOR_RIGHT_LOAD },
{ "gradient-editor-load-right-fg", NULL,
N_("_FG Color"), NULL, NULL,
2, FALSE,
GIMP_HELP_GRADIENT_EDITOR_RIGHT_LOAD },
{ "gradient-editor-load-right-bg", NULL,
N_("_BG Color"), NULL, NULL,
3, FALSE,
GIMP_HELP_GRADIENT_EDITOR_RIGHT_LOAD },
LOAD_RIGHT_FROM ("01", 4),
LOAD_RIGHT_FROM ("02", 5),
LOAD_RIGHT_FROM ("03", 6),
LOAD_RIGHT_FROM ("04", 7),
LOAD_RIGHT_FROM ("05", 8),
LOAD_RIGHT_FROM ("06", 9),
LOAD_RIGHT_FROM ("07", 10),
LOAD_RIGHT_FROM ("08", 11),
LOAD_RIGHT_FROM ("09", 12),
LOAD_RIGHT_FROM ("10", 13)
};
static GimpEnumActionEntry gradient_editor_save_right_actions[] =
{
SAVE_RIGHT_TO ("01", 0),
SAVE_RIGHT_TO ("02", 1),
SAVE_RIGHT_TO ("03", 2),
SAVE_RIGHT_TO ("04", 3),
SAVE_RIGHT_TO ("05", 4),
SAVE_RIGHT_TO ("06", 5),
SAVE_RIGHT_TO ("07", 6),
SAVE_RIGHT_TO ("08", 7),
SAVE_RIGHT_TO ("09", 8),
SAVE_RIGHT_TO ("10", 9)
};
#undef LOAD_LEFT_FROM
#undef SAVE_LEFT_TO
#undef LOAD_RIGHT_FROM
#undef SAVE_RIGHT_TO
static GimpRadioActionEntry gradient_editor_blending_actions[] =
{
{ "gradient-editor-blending-linear", NULL,
N_("_Linear"), NULL, NULL,
GIMP_GRADIENT_SEGMENT_LINEAR,
GIMP_HELP_GRADIENT_EDITOR_BLENDING },
{ "gradient-editor-blending-curved", NULL,
N_("_Curved"), NULL, NULL,
GIMP_GRADIENT_SEGMENT_CURVED,
GIMP_HELP_GRADIENT_EDITOR_BLENDING },
{ "gradient-editor-blending-sine", NULL,
N_("_Sinusoidal"), NULL, NULL,
GIMP_GRADIENT_SEGMENT_SINE,
GIMP_HELP_GRADIENT_EDITOR_BLENDING },
{ "gradient-editor-blending-sphere-increasing", NULL,
N_("Spherical (i_ncreasing)"), NULL, NULL,
GIMP_GRADIENT_SEGMENT_SPHERE_INCREASING,
GIMP_HELP_GRADIENT_EDITOR_BLENDING },
{ "gradient-editor-blending-sphere-decreasing", NULL,
N_("Spherical (_decreasing)"), NULL, NULL,
GIMP_GRADIENT_SEGMENT_SPHERE_DECREASING,
GIMP_HELP_GRADIENT_EDITOR_BLENDING },
{ "gradient-editor-blending-varies", NULL,
N_("(Varies)"), NULL, NULL,
-1,
GIMP_HELP_GRADIENT_EDITOR_BLENDING }
};
static GimpRadioActionEntry gradient_editor_coloring_actions[] =
{
{ "gradient-editor-coloring-rgb", NULL,
N_("_RGB"), NULL, NULL,
GIMP_GRADIENT_SEGMENT_RGB,
GIMP_HELP_GRADIENT_EDITOR_COLORING },
{ "gradient-editor-coloring-hsv-ccw", NULL,
N_("HSV (_counter-clockwise hue)"), NULL, NULL,
GIMP_GRADIENT_SEGMENT_HSV_CCW,
GIMP_HELP_GRADIENT_EDITOR_COLORING },
{ "gradient-editor-coloring-hsv-cw", NULL,
N_("HSV (clockwise _hue)"), NULL, NULL,
GIMP_GRADIENT_SEGMENT_HSV_CW,
GIMP_HELP_GRADIENT_EDITOR_COLORING },
{ "gradient-editor-coloring-varies", NULL,
N_("(Varies)"), NULL, NULL,
-1,
GIMP_HELP_GRADIENT_EDITOR_COLORING }
};
static GimpEnumActionEntry gradient_editor_zoom_actions[] =
{
{ "gradient-editor-zoom-in", GTK_STOCK_ZOOM_IN,
N_("Zoom In"), NULL,
N_("Zoom in"),
GIMP_ZOOM_IN, FALSE,
GIMP_HELP_GRADIENT_EDITOR_ZOOM_IN },
{ "gradient-editor-zoom-out", GTK_STOCK_ZOOM_OUT,
N_("Zoom Out"), NULL,
N_("Zoom out"),
GIMP_ZOOM_OUT, FALSE,
GIMP_HELP_GRADIENT_EDITOR_ZOOM_OUT },
{ "gradient-editor-zoom-all", GTK_STOCK_ZOOM_FIT,
N_("Zoom All"), NULL,
N_("Zoom all"),
GIMP_ZOOM_TO /* abused */, FALSE,
GIMP_HELP_GRADIENT_EDITOR_ZOOM_ALL }
};
void
gradient_editor_actions_setup (GimpActionGroup *group)
{
gimp_action_group_add_actions (group,
gradient_editor_actions,
G_N_ELEMENTS (gradient_editor_actions));
gimp_action_group_add_enum_actions (group,
gradient_editor_load_left_actions,
G_N_ELEMENTS (gradient_editor_load_left_actions),
G_CALLBACK (gradient_editor_load_left_cmd_callback));
gimp_action_group_add_enum_actions (group,
gradient_editor_save_left_actions,
G_N_ELEMENTS (gradient_editor_save_left_actions),
G_CALLBACK (gradient_editor_save_left_cmd_callback));
gimp_action_group_add_enum_actions (group,
gradient_editor_load_right_actions,
G_N_ELEMENTS (gradient_editor_load_right_actions),
G_CALLBACK (gradient_editor_load_right_cmd_callback));
gimp_action_group_add_enum_actions (group,
gradient_editor_save_right_actions,
G_N_ELEMENTS (gradient_editor_save_right_actions),
G_CALLBACK (gradient_editor_save_right_cmd_callback));
gimp_action_group_add_radio_actions (group,
gradient_editor_blending_actions,
G_N_ELEMENTS (gradient_editor_blending_actions),
0,
G_CALLBACK (gradient_editor_blending_func_cmd_callback));
gimp_action_group_add_radio_actions (group,
gradient_editor_coloring_actions,
G_N_ELEMENTS (gradient_editor_coloring_actions),
0,
G_CALLBACK (gradient_editor_coloring_type_cmd_callback));
gimp_action_group_add_enum_actions (group,
gradient_editor_zoom_actions,
G_N_ELEMENTS (gradient_editor_zoom_actions),
G_CALLBACK (gradient_editor_zoom_cmd_callback));
}
void
gradient_editor_actions_update (GimpActionGroup *group,
gpointer data)
{
GimpGradientEditor *editor = GIMP_GRADIENT_EDITOR (data);
GimpDataEditor *data_editor = GIMP_DATA_EDITOR (data);
GimpGradient *gradient;
GimpContext *context;
gboolean editable = FALSE;
GimpGradientSegment *left_seg = NULL;
GimpGradientSegment *right_seg = NULL;
GimpRGB fg;
GimpRGB bg;
gboolean blending_equal = TRUE;
gboolean coloring_equal = TRUE;
gboolean selection = FALSE;
gboolean delete = FALSE;
gradient = GIMP_GRADIENT (data_editor->data);
context = gimp_get_user_context (data_editor->data_factory->gimp);
if (gradient)
{
GimpGradientSegmentType type;
GimpGradientSegmentColor color;
GimpGradientSegment *seg, *aseg;
if (data_editor->data_editable)
editable = TRUE;
if (editor->control_sel_l->prev)
left_seg = editor->control_sel_l->prev;
else
left_seg = gimp_gradient_segment_get_last (editor->control_sel_l);
if (editor->control_sel_r->next)
right_seg = editor->control_sel_r->next;
else
right_seg = gimp_gradient_segment_get_first (editor->control_sel_r);
type = editor->control_sel_l->type;
color = editor->control_sel_l->color;
seg = editor->control_sel_l;
do
{
blending_equal = blending_equal && (seg->type == type);
coloring_equal = coloring_equal && (seg->color == color);
aseg = seg;
seg = seg->next;
}
while (aseg != editor->control_sel_r);
selection = (editor->control_sel_l != editor->control_sel_r);
delete = (editor->control_sel_l->prev || editor->control_sel_r->next);
}
if (context)
{
gimp_context_get_foreground (context, &fg);
gimp_context_get_background (context, &bg);
}
/* pretend the gradient not being editable while the dialog is
* insensitive. prevents the gradient from being modified while a
* dialog is running. bug #161411 --mitch
*/
if (! GTK_WIDGET_SENSITIVE (editor))
editable = FALSE;
#define SET_ACTIVE(action,condition) \
gimp_action_group_set_action_active (group, action, (condition) != 0)
#define SET_COLOR(action,color,set_label) \
gimp_action_group_set_action_color (group, action, (color), (set_label))
#define SET_LABEL(action,label) \
gimp_action_group_set_action_label (group, action, (label))
#define SET_SENSITIVE(action,condition) \
gimp_action_group_set_action_sensitive (group, action, (condition) != 0)
#define SET_VISIBLE(action,condition) \
gimp_action_group_set_action_visible (group, action, (condition) != 0)
SET_SENSITIVE ("gradient-editor-left-color", editable);
SET_SENSITIVE ("gradient-editor-load-left-left-neighbor", editable);
SET_SENSITIVE ("gradient-editor-load-left-right-endpoint", editable);
if (gradient)
{
SET_COLOR ("gradient-editor-left-color",
&editor->control_sel_l->left_color, FALSE);
SET_COLOR ("gradient-editor-load-left-left-neighbor",
&left_seg->right_color, FALSE);
SET_COLOR ("gradient-editor-load-left-right-endpoint",
&editor->control_sel_r->right_color, FALSE);
}
SET_SENSITIVE ("gradient-editor-load-left-fg", editable);
SET_SENSITIVE ("gradient-editor-load-left-bg", editable);
SET_COLOR ("gradient-editor-load-left-fg", context ? &fg : NULL, FALSE);
SET_COLOR ("gradient-editor-load-left-bg", context ? &bg : NULL, FALSE);
SET_SENSITIVE ("gradient-editor-load-left-01", editable);
SET_SENSITIVE ("gradient-editor-load-left-02", editable);
SET_SENSITIVE ("gradient-editor-load-left-03", editable);
SET_SENSITIVE ("gradient-editor-load-left-04", editable);
SET_SENSITIVE ("gradient-editor-load-left-05", editable);
SET_SENSITIVE ("gradient-editor-load-left-06", editable);
SET_SENSITIVE ("gradient-editor-load-left-07", editable);
SET_SENSITIVE ("gradient-editor-load-left-08", editable);
SET_SENSITIVE ("gradient-editor-load-left-09", editable);
SET_SENSITIVE ("gradient-editor-load-left-10", editable);
SET_COLOR ("gradient-editor-load-left-01", &editor->saved_colors[0], TRUE);
SET_COLOR ("gradient-editor-load-left-02", &editor->saved_colors[1], TRUE);
SET_COLOR ("gradient-editor-load-left-03", &editor->saved_colors[2], TRUE);
SET_COLOR ("gradient-editor-load-left-04", &editor->saved_colors[3], TRUE);
SET_COLOR ("gradient-editor-load-left-05", &editor->saved_colors[4], TRUE);
SET_COLOR ("gradient-editor-load-left-06", &editor->saved_colors[5], TRUE);
SET_COLOR ("gradient-editor-load-left-07", &editor->saved_colors[6], TRUE);
SET_COLOR ("gradient-editor-load-left-08", &editor->saved_colors[7], TRUE);
SET_COLOR ("gradient-editor-load-left-09", &editor->saved_colors[8], TRUE);
SET_COLOR ("gradient-editor-load-left-10", &editor->saved_colors[9], TRUE);
SET_SENSITIVE ("gradient-editor-save-left-01", gradient);
SET_SENSITIVE ("gradient-editor-save-left-02", gradient);
SET_SENSITIVE ("gradient-editor-save-left-03", gradient);
SET_SENSITIVE ("gradient-editor-save-left-04", gradient);
SET_SENSITIVE ("gradient-editor-save-left-05", gradient);
SET_SENSITIVE ("gradient-editor-save-left-06", gradient);
SET_SENSITIVE ("gradient-editor-save-left-07", gradient);
SET_SENSITIVE ("gradient-editor-save-left-08", gradient);
SET_SENSITIVE ("gradient-editor-save-left-09", gradient);
SET_SENSITIVE ("gradient-editor-save-left-10", gradient);
SET_COLOR ("gradient-editor-save-left-01", &editor->saved_colors[0], TRUE);
SET_COLOR ("gradient-editor-save-left-02", &editor->saved_colors[1], TRUE);
SET_COLOR ("gradient-editor-save-left-03", &editor->saved_colors[2], TRUE);
SET_COLOR ("gradient-editor-save-left-04", &editor->saved_colors[3], TRUE);
SET_COLOR ("gradient-editor-save-left-05", &editor->saved_colors[4], TRUE);
SET_COLOR ("gradient-editor-save-left-06", &editor->saved_colors[5], TRUE);
SET_COLOR ("gradient-editor-save-left-07", &editor->saved_colors[6], TRUE);
SET_COLOR ("gradient-editor-save-left-08", &editor->saved_colors[7], TRUE);
SET_COLOR ("gradient-editor-save-left-09", &editor->saved_colors[8], TRUE);
SET_COLOR ("gradient-editor-save-left-10", &editor->saved_colors[9], TRUE);
SET_SENSITIVE ("gradient-editor-right-color", editable);
SET_SENSITIVE ("gradient-editor-load-right-right-neighbor", editable);
SET_SENSITIVE ("gradient-editor-load-right-left-endpoint", editable);
if (gradient)
{
SET_COLOR ("gradient-editor-right-color",
&editor->control_sel_r->right_color, FALSE);
SET_COLOR ("gradient-editor-load-right-right-neighbor",
&right_seg->left_color, FALSE);
SET_COLOR ("gradient-editor-load-right-left-endpoint",
&editor->control_sel_l->left_color, FALSE);
}
SET_SENSITIVE ("gradient-editor-load-right-fg", editable);
SET_SENSITIVE ("gradient-editor-load-right-bg", editable);
SET_COLOR ("gradient-editor-load-right-fg", context ? &fg : NULL, FALSE);
SET_COLOR ("gradient-editor-load-right-bg", context ? &bg : NULL, FALSE);
SET_SENSITIVE ("gradient-editor-load-right-01", editable);
SET_SENSITIVE ("gradient-editor-load-right-02", editable);
SET_SENSITIVE ("gradient-editor-load-right-03", editable);
SET_SENSITIVE ("gradient-editor-load-right-04", editable);
SET_SENSITIVE ("gradient-editor-load-right-05", editable);
SET_SENSITIVE ("gradient-editor-load-right-06", editable);
SET_SENSITIVE ("gradient-editor-load-right-07", editable);
SET_SENSITIVE ("gradient-editor-load-right-08", editable);
SET_SENSITIVE ("gradient-editor-load-right-09", editable);
SET_SENSITIVE ("gradient-editor-load-right-10", editable);
SET_COLOR ("gradient-editor-load-right-01", &editor->saved_colors[0], TRUE);
SET_COLOR ("gradient-editor-load-right-02", &editor->saved_colors[1], TRUE);
SET_COLOR ("gradient-editor-load-right-03", &editor->saved_colors[2], TRUE);
SET_COLOR ("gradient-editor-load-right-04", &editor->saved_colors[3], TRUE);
SET_COLOR ("gradient-editor-load-right-05", &editor->saved_colors[4], TRUE);
SET_COLOR ("gradient-editor-load-right-06", &editor->saved_colors[5], TRUE);
SET_COLOR ("gradient-editor-load-right-07", &editor->saved_colors[6], TRUE);
SET_COLOR ("gradient-editor-load-right-08", &editor->saved_colors[7], TRUE);
SET_COLOR ("gradient-editor-load-right-09", &editor->saved_colors[8], TRUE);
SET_COLOR ("gradient-editor-load-right-10", &editor->saved_colors[9], TRUE);
SET_SENSITIVE ("gradient-editor-save-right-01", gradient);
SET_SENSITIVE ("gradient-editor-save-right-02", gradient);
SET_SENSITIVE ("gradient-editor-save-right-03", gradient);
SET_SENSITIVE ("gradient-editor-save-right-04", gradient);
SET_SENSITIVE ("gradient-editor-save-right-05", gradient);
SET_SENSITIVE ("gradient-editor-save-right-06", gradient);
SET_SENSITIVE ("gradient-editor-save-right-07", gradient);
SET_SENSITIVE ("gradient-editor-save-right-08", gradient);
SET_SENSITIVE ("gradient-editor-save-right-09", gradient);
SET_SENSITIVE ("gradient-editor-save-right-10", gradient);
SET_COLOR ("gradient-editor-save-right-01", &editor->saved_colors[0], TRUE);
SET_COLOR ("gradient-editor-save-right-02", &editor->saved_colors[1], TRUE);
SET_COLOR ("gradient-editor-save-right-03", &editor->saved_colors[2], TRUE);
SET_COLOR ("gradient-editor-save-right-04", &editor->saved_colors[3], TRUE);
SET_COLOR ("gradient-editor-save-right-05", &editor->saved_colors[4], TRUE);
SET_COLOR ("gradient-editor-save-right-06", &editor->saved_colors[5], TRUE);
SET_COLOR ("gradient-editor-save-right-07", &editor->saved_colors[6], TRUE);
SET_COLOR ("gradient-editor-save-right-08", &editor->saved_colors[7], TRUE);
SET_COLOR ("gradient-editor-save-right-09", &editor->saved_colors[8], TRUE);
SET_COLOR ("gradient-editor-save-right-10", &editor->saved_colors[9], TRUE);
SET_SENSITIVE ("gradient-editor-flip", editable);
SET_SENSITIVE ("gradient-editor-replicate", editable);
SET_SENSITIVE ("gradient-editor-split-midpoint", editable);
SET_SENSITIVE ("gradient-editor-split-uniform", editable);
SET_SENSITIVE ("gradient-editor-delete", editable && delete);
SET_SENSITIVE ("gradient-editor-recenter", editable);
SET_SENSITIVE ("gradient-editor-redistribute", editable);
if (! selection)
{
SET_LABEL ("gradient-editor-blending-func",
_("_Blending Function for Segment"));
SET_LABEL ("gradient-editor-coloring-type",
_("Coloring _Type for Segment"));
SET_LABEL ("gradient-editor-flip",
_("_Flip Segment"));
SET_LABEL ("gradient-editor-replicate",
_("_Replicate Segment..."));
SET_LABEL ("gradient-editor-split-midpoint",
_("Split Segment at _Midpoint"));
SET_LABEL ("gradient-editor-split-uniform",
_("Split Segment _Uniformly..."));
SET_LABEL ("gradient-editor-delete",
_("_Delete Segment"));
SET_LABEL ("gradient-editor-recenter",
_("Re-_center Segment's Midpoint"));
SET_LABEL ("gradient-editor-redistribute",
_("Re-distribute _Handles in Segment"));
}
else
{
SET_LABEL ("gradient-editor-blending-func",
_("_Blending Function for Selection"));
SET_LABEL ("gradient-editor-coloring-type",
_("Coloring _Type for Selection"));
SET_LABEL ("gradient-editor-flip",
_("_Flip Selection"));
SET_LABEL ("gradient-editor-replicate",
_("_Replicate Selection..."));
SET_LABEL ("gradient-editor-split-midpoint",
_("Split Segments at _Midpoints"));
SET_LABEL ("gradient-editor-split-uniform",
_("Split Segments _Uniformly..."));
SET_LABEL ("gradient-editor-delete",
_("_Delete Selection"));
SET_LABEL ("gradient-editor-recenter",
_("Re-_center Midpoints in Selection"));
SET_LABEL ("gradient-editor-redistribute",
_("Re-distribute _Handles in Selection"));
}
SET_SENSITIVE ("gradient-editor-blending-varies", FALSE);
SET_VISIBLE ("gradient-editor-blending-varies", ! blending_equal);
SET_SENSITIVE ("gradient-editor-blending-linear", editable);
SET_SENSITIVE ("gradient-editor-blending-curved", editable);
SET_SENSITIVE ("gradient-editor-blending-sine", editable);
SET_SENSITIVE ("gradient-editor-blending-sphere-increasing", editable);
SET_SENSITIVE ("gradient-editor-blending-sphere-decreasing", editable);
if (blending_equal && gradient)
{
switch (editor->control_sel_l->type)
{
case GIMP_GRADIENT_SEGMENT_LINEAR:
SET_ACTIVE ("gradient-editor-blending-linear", TRUE);
break;
case GIMP_GRADIENT_SEGMENT_CURVED:
SET_ACTIVE ("gradient-editor-blending-curved", TRUE);
break;
case GIMP_GRADIENT_SEGMENT_SINE:
SET_ACTIVE ("gradient-editor-blending-sine", TRUE);
break;
case GIMP_GRADIENT_SEGMENT_SPHERE_INCREASING:
SET_ACTIVE ("gradient-editor-blending-sphere-increasing", TRUE);
break;
case GIMP_GRADIENT_SEGMENT_SPHERE_DECREASING:
SET_ACTIVE ("gradient-editor-blending-sphere-decreasing", TRUE);
break;
}
}
else
{
SET_ACTIVE ("gradient-editor-blending-varies", TRUE);
}
SET_SENSITIVE ("gradient-editor-coloring-varies", FALSE);
SET_VISIBLE ("gradient-editor-coloring-varies", ! coloring_equal);
SET_SENSITIVE ("gradient-editor-coloring-rgb", editable);
SET_SENSITIVE ("gradient-editor-coloring-hsv-ccw", editable);
SET_SENSITIVE ("gradient-editor-coloring-hsv-cw", editable);
if (coloring_equal && gradient)
{
switch (editor->control_sel_l->color)
{
case GIMP_GRADIENT_SEGMENT_RGB:
SET_ACTIVE ("gradient-editor-coloring-rgb", TRUE);
break;
case GIMP_GRADIENT_SEGMENT_HSV_CCW:
SET_ACTIVE ("gradient-editor-coloring-hsv-ccw", TRUE);
break;
case GIMP_GRADIENT_SEGMENT_HSV_CW:
SET_ACTIVE ("gradient-editor-coloring-hsv-cw", TRUE);
break;
}
}
else
{
SET_ACTIVE ("gradient-editor-coloring-varies", TRUE);
}
SET_SENSITIVE ("gradient-editor-blend-color", editable && selection);
SET_SENSITIVE ("gradient-editor-blend-opacity", editable && selection);
SET_SENSITIVE ("gradient-editor-zoom-out", gradient);
SET_SENSITIVE ("gradient-editor-zoom-in", gradient);
SET_SENSITIVE ("gradient-editor-zoom-all", gradient);
#undef SET_ACTIVE
#undef SET_COLOR
#undef SET_LABEL
#undef SET_SENSITIVE
#undef SET_VISIBLE
}

View File

@ -0,0 +1,28 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __GRADIENT_EDITOR_ACTIONS_H__
#define __GRADIENT_EDITOR_ACTIONS_H__
void gradient_editor_actions_setup (GimpActionGroup *group);
void gradient_editor_actions_update (GimpActionGroup *group,
gpointer data);
#endif /* __GRADIENT_EDITOR_ACTIONS_H__ */

View File

@ -0,0 +1,821 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"
#include "actions-types.h"
#include "core/gimp.h"
#include "core/gimpcontext.h"
#include "core/gimpdatafactory.h"
#include "core/gimpgradient.h"
#include "widgets/gimpcolordialog.h"
#include "widgets/gimpgradienteditor.h"
#include "widgets/gimphelp-ids.h"
#include "widgets/gimpuimanager.h"
#include "widgets/gimpviewabledialog.h"
#include "dialogs/dialogs.h"
#include "gradient-editor-commands.h"
#include "gimp-intl.h"
/* local function prototypes */
static void gradient_editor_left_color_update (GimpColorDialog *dialog,
const GimpRGB *color,
GimpColorDialogState state,
GimpGradientEditor *editor);
static void gradient_editor_right_color_update (GimpColorDialog *dialog,
const GimpRGB *color,
GimpColorDialogState state,
GimpGradientEditor *editor);
static GimpGradientSegment *
gradient_editor_save_selection (GimpGradientEditor *editor);
static void gradient_editor_replace_selection (GimpGradientEditor *editor,
GimpGradientSegment *replace_seg);
static void gradient_editor_split_uniform_response (GtkWidget *widget,
gint response_id,
GimpGradientEditor *editor);
static void gradient_editor_replicate_response (GtkWidget *widget,
gint response_id,
GimpGradientEditor *editor);
/* public functionss */
void
gradient_editor_left_color_cmd_callback (GtkAction *action,
gpointer data)
{
GimpGradientEditor *editor = GIMP_GRADIENT_EDITOR (data);
GimpGradient *gradient;
gradient = GIMP_GRADIENT (GIMP_DATA_EDITOR (editor)->data);
editor->left_saved_dirty = GIMP_DATA (gradient)->dirty;
editor->left_saved_segments = gradient_editor_save_selection (editor);
editor->color_dialog =
gimp_color_dialog_new (GIMP_VIEWABLE (gradient),
_("Left Endpoint Color"),
GIMP_STOCK_GRADIENT,
_("Gradient Segment's Left Endpoint Color"),
GTK_WIDGET (editor),
global_dialog_factory,
"gimp-gradient-editor-color-dialog",
&editor->control_sel_l->left_color,
editor->instant_update, TRUE);
g_signal_connect (editor->color_dialog, "destroy",
G_CALLBACK (gtk_widget_destroyed),
&editor->color_dialog);
g_signal_connect (editor->color_dialog, "update",
G_CALLBACK (gradient_editor_left_color_update),
editor);
gtk_widget_set_sensitive (GTK_WIDGET (editor), FALSE);
gimp_ui_manager_update (GIMP_EDITOR (editor)->ui_manager,
GIMP_EDITOR (editor)->popup_data);
gtk_window_present (GTK_WINDOW (editor->color_dialog));
}
void
gradient_editor_load_left_cmd_callback (GtkAction *action,
gint value,
gpointer data)
{
GimpGradientEditor *editor = GIMP_GRADIENT_EDITOR (data);
GimpGradient *gradient;
GimpContext *context;
GimpGradientSegment *seg;
GimpRGB color;
gradient = GIMP_GRADIENT (GIMP_DATA_EDITOR (editor)->data);
context =
gimp_get_user_context (GIMP_DATA_EDITOR (editor)->data_factory->gimp);
switch (value)
{
case 0: /* Fetch from left neighbor's right endpoint */
if (editor->control_sel_l->prev != NULL)
seg = editor->control_sel_l->prev;
else
seg = gimp_gradient_segment_get_last (editor->control_sel_l);
color = seg->right_color;
break;
case 1: /* Fetch from right endpoint */
color = editor->control_sel_r->right_color;
break;
case 2: /* Fetch from FG color */
gimp_context_get_foreground (context, &color);
break;
case 3: /* Fetch from BG color */
gimp_context_get_background (context, &color);
break;
default: /* Load a color */
color = editor->saved_colors[value - 4];
break;
}
gimp_gradient_segment_range_blend (gradient,
editor->control_sel_l,
editor->control_sel_r,
&color,
&editor->control_sel_r->right_color,
TRUE, TRUE);
}
void
gradient_editor_save_left_cmd_callback (GtkAction *action,
gint value,
gpointer data)
{
GimpGradientEditor *editor = GIMP_GRADIENT_EDITOR (data);
GimpGradient *gradient;
gradient = GIMP_GRADIENT (GIMP_DATA_EDITOR (editor)->data);
gimp_gradient_segment_get_left_color (gradient, editor->control_sel_l,
&editor->saved_colors[value]);
}
void
gradient_editor_right_color_cmd_callback (GtkAction *action,
gpointer data)
{
GimpGradientEditor *editor = GIMP_GRADIENT_EDITOR (data);
GimpGradient *gradient;
gradient = GIMP_GRADIENT (GIMP_DATA_EDITOR (editor)->data);
editor->right_saved_dirty = GIMP_DATA (gradient)->dirty;
editor->right_saved_segments = gradient_editor_save_selection (editor);
editor->color_dialog =
gimp_color_dialog_new (GIMP_VIEWABLE (gradient),
_("Right Endpoint Color"),
GIMP_STOCK_GRADIENT,
_("Gradient Segment's Right Endpoint Color"),
GTK_WIDGET (editor),
global_dialog_factory,
"gimp-gradient-editor-color-dialog",
&editor->control_sel_l->right_color,
editor->instant_update, TRUE);
g_signal_connect (editor->color_dialog, "destroy",
G_CALLBACK (gtk_widget_destroyed),
&editor->color_dialog);
g_signal_connect (editor->color_dialog, "update",
G_CALLBACK (gradient_editor_right_color_update),
editor);
gtk_widget_set_sensitive (GTK_WIDGET (editor), FALSE);
gimp_ui_manager_update (GIMP_EDITOR (editor)->ui_manager,
GIMP_EDITOR (editor)->popup_data);
gtk_window_present (GTK_WINDOW (editor->color_dialog));
}
void
gradient_editor_load_right_cmd_callback (GtkAction *action,
gint value,
gpointer data)
{
GimpGradientEditor *editor = GIMP_GRADIENT_EDITOR (data);
GimpGradient *gradient;
GimpContext *context;
GimpGradientSegment *seg;
GimpRGB color;
gradient = GIMP_GRADIENT (GIMP_DATA_EDITOR (editor)->data);
context =
gimp_get_user_context (GIMP_DATA_EDITOR (editor)->data_factory->gimp);
switch (value)
{
case 0: /* Fetch from right neighbor's left endpoint */
if (editor->control_sel_r->next != NULL)
seg = editor->control_sel_r->next;
else
seg = gimp_gradient_segment_get_first (editor->control_sel_r);
color = seg->left_color;
break;
case 1: /* Fetch from left endpoint */
color = editor->control_sel_l->left_color;
break;
case 2: /* Fetch from FG color */
gimp_context_get_foreground (context, &color);
break;
case 3: /* Fetch from BG color */
gimp_context_get_background (context, &color);
break;
default: /* Load a color */
color = editor->saved_colors[value - 4];
break;
}
gimp_gradient_segment_range_blend (gradient,
editor->control_sel_l,
editor->control_sel_r,
&editor->control_sel_l->left_color,
&color,
TRUE, TRUE);
}
void
gradient_editor_save_right_cmd_callback (GtkAction *action,
gint value,
gpointer data)
{
GimpGradientEditor *editor = GIMP_GRADIENT_EDITOR (data);
GimpGradient *gradient;
gradient = GIMP_GRADIENT (GIMP_DATA_EDITOR (editor)->data);
gimp_gradient_segment_get_right_color (gradient, editor->control_sel_r,
&editor->saved_colors[value]);
}
void
gradient_editor_blending_func_cmd_callback (GtkAction *action,
GtkAction *current,
gpointer data)
{
GimpGradientEditor *editor = GIMP_GRADIENT_EDITOR (data);
GimpGradient *gradient;
gint value;
gradient = GIMP_GRADIENT (GIMP_DATA_EDITOR (editor)->data);
value = gtk_radio_action_get_current_value (GTK_RADIO_ACTION (action));
if (gradient && value >= 0)
{
GimpGradientSegmentType type = value;
gimp_gradient_segment_range_set_blending_function (gradient,
editor->control_sel_l,
editor->control_sel_r,
type);
}
}
void
gradient_editor_coloring_type_cmd_callback (GtkAction *action,
GtkAction *current,
gpointer data)
{
GimpGradientEditor *editor = GIMP_GRADIENT_EDITOR (data);
GimpGradient *gradient;
gint value;
gradient = GIMP_GRADIENT (GIMP_DATA_EDITOR (editor)->data);
value = gtk_radio_action_get_current_value (GTK_RADIO_ACTION (action));
if (gradient && value >= 0)
{
GimpGradientSegmentColor color = value;
gimp_gradient_segment_range_set_coloring_type (gradient,
editor->control_sel_l,
editor->control_sel_r,
color);
}
}
void
gradient_editor_flip_cmd_callback (GtkAction *action,
gpointer data)
{
GimpGradientEditor *editor = GIMP_GRADIENT_EDITOR (data);
GimpGradient *gradient;
gradient = GIMP_GRADIENT (GIMP_DATA_EDITOR (editor)->data);
gimp_gradient_segment_range_flip (gradient,
editor->control_sel_l,
editor->control_sel_r,
&editor->control_sel_l,
&editor->control_sel_r);
}
void
gradient_editor_replicate_cmd_callback (GtkAction *action,
gpointer data)
{
GimpGradientEditor *editor = GIMP_GRADIENT_EDITOR (data);
GtkWidget *dialog;
GtkWidget *vbox;
GtkWidget *label;
GtkWidget *scale;
GtkObject *scale_data;
const gchar *title;
const gchar *desc;
if (editor->control_sel_l == editor->control_sel_r)
{
title = _("Replicate Segment");
desc = _("Replicate Gradient Segment");
}
else
{
title = _("Replicate Selection");
desc = _("Replicate Gradient Selection");
}
dialog =
gimp_viewable_dialog_new (GIMP_VIEWABLE (GIMP_DATA_EDITOR (editor)->data),
title, "gimp-gradient-segment-replicate",
GIMP_STOCK_GRADIENT, desc,
GTK_WIDGET (editor),
gimp_standard_help_func,
GIMP_HELP_GRADIENT_EDITOR_REPLICATE,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
_("Replicate"), GTK_RESPONSE_OK,
NULL);
g_signal_connect (dialog, "response",
G_CALLBACK (gradient_editor_replicate_response),
editor);
vbox = gtk_vbox_new (FALSE, 12);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 12);
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), vbox);
gtk_widget_show (vbox);
/* Instructions */
if (editor->control_sel_l == editor->control_sel_r)
label = gtk_label_new (_("Select the number of times\n"
"to replicate the selected segment."));
else
label = gtk_label_new (_("Select the number of times\n"
"to replicate the selection."));
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
gtk_widget_show (label);
/* Scale */
editor->replicate_times = 2;
scale_data = gtk_adjustment_new (2.0, 2.0, 21.0, 1.0, 1.0, 1.0);
scale = gtk_hscale_new (GTK_ADJUSTMENT (scale_data));
gtk_scale_set_digits (GTK_SCALE (scale), 0);
gtk_scale_set_value_pos (GTK_SCALE (scale), GTK_POS_TOP);
gtk_box_pack_start (GTK_BOX (vbox), scale, FALSE, TRUE, 4);
gtk_widget_show (scale);
g_signal_connect (scale_data, "value_changed",
G_CALLBACK (gimp_int_adjustment_update),
&editor->replicate_times);
gtk_widget_set_sensitive (GTK_WIDGET (editor), FALSE);
gimp_ui_manager_update (GIMP_EDITOR (editor)->ui_manager,
GIMP_EDITOR (editor)->popup_data);
gtk_widget_show (dialog);
}
void
gradient_editor_split_midpoint_cmd_callback (GtkAction *action,
gpointer data)
{
GimpGradientEditor *editor = GIMP_GRADIENT_EDITOR (data);
GimpGradient *gradient;
gradient = GIMP_GRADIENT (GIMP_DATA_EDITOR (editor)->data);
gimp_gradient_segment_range_split_midpoint (gradient,
editor->control_sel_l,
editor->control_sel_r,
&editor->control_sel_l,
&editor->control_sel_r);
}
void
gradient_editor_split_uniformly_cmd_callback (GtkAction *action,
gpointer data)
{
GimpGradientEditor *editor = GIMP_GRADIENT_EDITOR (data);
GtkWidget *dialog;
GtkWidget *vbox;
GtkWidget *label;
GtkWidget *scale;
GtkObject *scale_data;
const gchar *title;
const gchar *desc;
if (editor->control_sel_l == editor->control_sel_r)
{
title = _("Split Segment Uniformly");
desc = _("Split Gradient Segment Uniformly");
}
else
{
title = _("Split Segments Uniformly");
desc = _("Split Gradient Segments Uniformly");
}
dialog =
gimp_viewable_dialog_new (GIMP_VIEWABLE (GIMP_DATA_EDITOR (editor)->data),
title, "gimp-gradient-segment-split-uniformly",
GIMP_STOCK_GRADIENT, desc,
GTK_WIDGET (editor),
gimp_standard_help_func,
GIMP_HELP_GRADIENT_EDITOR_SPLIT_UNIFORM,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
_("Split"), GTK_RESPONSE_OK,
NULL);
g_signal_connect (dialog, "response",
G_CALLBACK (gradient_editor_split_uniform_response),
editor);
/* The main vbox */
vbox = gtk_vbox_new (FALSE, 12);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 12);
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), vbox);
gtk_widget_show (vbox);
/* Instructions */
if (editor->control_sel_l == editor->control_sel_r)
label = gtk_label_new (_("Select the number of uniform parts\n"
"in which to split the selected segment."));
else
label = gtk_label_new (_("Select the number of uniform parts\n"
"in which to split the segments in the selection."));
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
gtk_widget_show (label);
/* Scale */
editor->split_parts = 2;
scale_data = gtk_adjustment_new (2.0, 2.0, 21.0, 1.0, 1.0, 1.0);
scale = gtk_hscale_new (GTK_ADJUSTMENT (scale_data));
gtk_scale_set_digits (GTK_SCALE (scale), 0);
gtk_scale_set_value_pos (GTK_SCALE (scale), GTK_POS_TOP);
gtk_box_pack_start (GTK_BOX (vbox), scale, FALSE, FALSE, 4);
gtk_widget_show (scale);
g_signal_connect (scale_data, "value_changed",
G_CALLBACK (gimp_int_adjustment_update),
&editor->split_parts);
gtk_widget_set_sensitive (GTK_WIDGET (editor), FALSE);
gimp_ui_manager_update (GIMP_EDITOR (editor)->ui_manager,
GIMP_EDITOR (editor)->popup_data);
gtk_widget_show (dialog);
}
void
gradient_editor_delete_cmd_callback (GtkAction *action,
gpointer data)
{
GimpGradientEditor *editor = GIMP_GRADIENT_EDITOR (data);
GimpGradient *gradient;
gradient = GIMP_GRADIENT (GIMP_DATA_EDITOR (editor)->data);
gimp_gradient_segment_range_delete (gradient,
editor->control_sel_l,
editor->control_sel_r,
&editor->control_sel_l,
&editor->control_sel_r);
}
void
gradient_editor_recenter_cmd_callback (GtkAction *action,
gpointer data)
{
GimpGradientEditor *editor = GIMP_GRADIENT_EDITOR (data);
GimpGradient *gradient;
gradient = GIMP_GRADIENT (GIMP_DATA_EDITOR (editor)->data);
gimp_gradient_segment_range_recenter_handles (gradient,
editor->control_sel_l,
editor->control_sel_r);
}
void
gradient_editor_redistribute_cmd_callback (GtkAction *action,
gpointer data)
{
GimpGradientEditor *editor = GIMP_GRADIENT_EDITOR (data);
GimpGradient *gradient;
gradient = GIMP_GRADIENT (GIMP_DATA_EDITOR (editor)->data);
gimp_gradient_segment_range_redistribute_handles (gradient,
editor->control_sel_l,
editor->control_sel_r);
}
void
gradient_editor_blend_color_cmd_callback (GtkAction *action,
gpointer data)
{
GimpGradientEditor *editor = GIMP_GRADIENT_EDITOR (data);
GimpGradient *gradient;
gradient = GIMP_GRADIENT (GIMP_DATA_EDITOR (editor)->data);
gimp_gradient_segment_range_blend (gradient,
editor->control_sel_l,
editor->control_sel_r,
&editor->control_sel_l->left_color,
&editor->control_sel_r->right_color,
TRUE, FALSE);
}
void
gradient_editor_blend_opacity_cmd_callback (GtkAction *action,
gpointer data)
{
GimpGradientEditor *editor = GIMP_GRADIENT_EDITOR (data);
GimpGradient *gradient;
gradient = GIMP_GRADIENT (GIMP_DATA_EDITOR (editor)->data);
gimp_gradient_segment_range_blend (gradient,
editor->control_sel_l,
editor->control_sel_r,
&editor->control_sel_l->left_color,
&editor->control_sel_r->right_color,
FALSE, TRUE);
}
void
gradient_editor_zoom_cmd_callback (GtkAction *action,
gint value,
gpointer data)
{
GimpGradientEditor *editor = GIMP_GRADIENT_EDITOR (data);
gimp_gradient_editor_zoom (editor, (GimpZoomType) value);
}
/* private functions */
static void
gradient_editor_left_color_update (GimpColorDialog *dialog,
const GimpRGB *color,
GimpColorDialogState state,
GimpGradientEditor *editor)
{
GimpGradient *gradient = GIMP_GRADIENT (GIMP_DATA_EDITOR (editor)->data);
switch (state)
{
case GIMP_COLOR_DIALOG_UPDATE:
gimp_gradient_segment_range_blend (gradient,
editor->control_sel_l,
editor->control_sel_r,
color,
&editor->control_sel_r->right_color,
TRUE, TRUE);
break;
case GIMP_COLOR_DIALOG_OK:
gimp_gradient_segment_range_blend (gradient,
editor->control_sel_l,
editor->control_sel_r,
color,
&editor->control_sel_r->right_color,
TRUE, TRUE);
gimp_gradient_segments_free (editor->left_saved_segments);
gtk_widget_destroy (editor->color_dialog);
editor->color_dialog = NULL;
gtk_widget_set_sensitive (GTK_WIDGET (editor), TRUE);
gimp_ui_manager_update (GIMP_EDITOR (editor)->ui_manager,
GIMP_EDITOR (editor)->popup_data);
break;
case GIMP_COLOR_DIALOG_CANCEL:
gradient_editor_replace_selection (editor, editor->left_saved_segments);
GIMP_DATA (gradient)->dirty = editor->left_saved_dirty;
gimp_viewable_invalidate_preview (GIMP_VIEWABLE (gradient));
gtk_widget_destroy (editor->color_dialog);
editor->color_dialog = NULL;
gtk_widget_set_sensitive (GTK_WIDGET (editor), TRUE);
gimp_ui_manager_update (GIMP_EDITOR (editor)->ui_manager,
GIMP_EDITOR (editor)->popup_data);
break;
}
}
static void
gradient_editor_right_color_update (GimpColorDialog *dialog,
const GimpRGB *color,
GimpColorDialogState state,
GimpGradientEditor *editor)
{
GimpGradient *gradient = GIMP_GRADIENT (GIMP_DATA_EDITOR (editor)->data);
switch (state)
{
case GIMP_COLOR_DIALOG_UPDATE:
gimp_gradient_segment_range_blend (gradient,
editor->control_sel_l,
editor->control_sel_r,
&editor->control_sel_r->left_color,
color,
TRUE, TRUE);
break;
case GIMP_COLOR_DIALOG_OK:
gimp_gradient_segment_range_blend (gradient,
editor->control_sel_l,
editor->control_sel_r,
&editor->control_sel_r->left_color,
color,
TRUE, TRUE);
gimp_gradient_segments_free (editor->right_saved_segments);
gtk_widget_destroy (editor->color_dialog);
editor->color_dialog = NULL;
gtk_widget_set_sensitive (GTK_WIDGET (editor), TRUE);
gimp_ui_manager_update (GIMP_EDITOR (editor)->ui_manager,
GIMP_EDITOR (editor)->popup_data);
break;
case GIMP_COLOR_DIALOG_CANCEL:
gradient_editor_replace_selection (editor, editor->right_saved_segments);
GIMP_DATA (gradient)->dirty = editor->right_saved_dirty;
gimp_viewable_invalidate_preview (GIMP_VIEWABLE (gradient));
gtk_widget_destroy (editor->color_dialog);
editor->color_dialog = NULL;
gtk_widget_set_sensitive (GTK_WIDGET (editor), TRUE);
gimp_ui_manager_update (GIMP_EDITOR (editor)->ui_manager,
GIMP_EDITOR (editor)->popup_data);
break;
}
}
static GimpGradientSegment *
gradient_editor_save_selection (GimpGradientEditor *editor)
{
GimpGradientSegment *seg, *prev, *tmp;
GimpGradientSegment *oseg, *oaseg;
prev = NULL;
oseg = editor->control_sel_l;
tmp = NULL;
do
{
seg = gimp_gradient_segment_new ();
*seg = *oseg; /* Copy everything */
if (prev == NULL)
tmp = seg; /* Remember first segment */
else
prev->next = seg;
seg->prev = prev;
seg->next = NULL;
prev = seg;
oaseg = oseg;
oseg = oseg->next;
}
while (oaseg != editor->control_sel_r);
return tmp;
}
static void
gradient_editor_replace_selection (GimpGradientEditor *editor,
GimpGradientSegment *replace_seg)
{
GimpGradient *gradient;
GimpGradientSegment *lseg, *rseg;
GimpGradientSegment *replace_last;
gradient = GIMP_GRADIENT (GIMP_DATA_EDITOR (editor)->data);
/* Remember left and right segments */
lseg = editor->control_sel_l->prev;
rseg = editor->control_sel_r->next;
replace_last = gimp_gradient_segment_get_last (replace_seg);
/* Free old selection */
editor->control_sel_r->next = NULL;
gimp_gradient_segments_free (editor->control_sel_l);
/* Link in new segments */
if (lseg)
lseg->next = replace_seg;
else
gradient->segments = replace_seg;
replace_seg->prev = lseg;
if (rseg)
rseg->prev = replace_last;
replace_last->next = rseg;
editor->control_sel_l = replace_seg;
editor->control_sel_r = replace_last;
gradient->last_visited = NULL; /* Force re-search */
}
static void
gradient_editor_split_uniform_response (GtkWidget *widget,
gint response_id,
GimpGradientEditor *editor)
{
gtk_widget_destroy (widget);
gtk_widget_set_sensitive (GTK_WIDGET (editor), TRUE);
gimp_ui_manager_update (GIMP_EDITOR (editor)->ui_manager,
GIMP_EDITOR (editor)->popup_data);
if (response_id == GTK_RESPONSE_OK)
{
GimpGradient *gradient = GIMP_GRADIENT (GIMP_DATA_EDITOR (editor)->data);
gimp_gradient_segment_range_split_uniform (gradient,
editor->control_sel_l,
editor->control_sel_r,
editor->split_parts,
&editor->control_sel_l,
&editor->control_sel_r);
}
}
static void
gradient_editor_replicate_response (GtkWidget *widget,
gint response_id,
GimpGradientEditor *editor)
{
gtk_widget_destroy (widget);
gtk_widget_set_sensitive (GTK_WIDGET (editor), TRUE);
gimp_ui_manager_update (GIMP_EDITOR (editor)->ui_manager,
GIMP_EDITOR (editor)->popup_data);
if (response_id == GTK_RESPONSE_OK)
{
GimpGradient *gradient = GIMP_GRADIENT (GIMP_DATA_EDITOR (editor)->data);
gimp_gradient_segment_range_replicate (gradient,
editor->control_sel_l,
editor->control_sel_r,
editor->replicate_times,
&editor->control_sel_l,
&editor->control_sel_r);
}
}

View File

@ -0,0 +1,73 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __GRADIENT_EDITOR_COMMANDS_H__
#define __GRADIENT_EDITOR_COMMANDS_H__
void gradient_editor_left_color_cmd_callback (GtkAction *action,
gpointer data);
void gradient_editor_load_left_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void gradient_editor_save_left_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void gradient_editor_right_color_cmd_callback (GtkAction *action,
gpointer data);
void gradient_editor_load_right_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void gradient_editor_save_right_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void gradient_editor_blending_func_cmd_callback (GtkAction *action,
GtkAction *current,
gpointer data);
void gradient_editor_coloring_type_cmd_callback (GtkAction *action,
GtkAction *current,
gpointer data);
void gradient_editor_flip_cmd_callback (GtkAction *action,
gpointer data);
void gradient_editor_replicate_cmd_callback (GtkAction *action,
gpointer data);
void gradient_editor_split_midpoint_cmd_callback (GtkAction *action,
gpointer data);
void gradient_editor_split_uniformly_cmd_callback (GtkAction *action,
gpointer data);
void gradient_editor_delete_cmd_callback (GtkAction *action,
gpointer data);
void gradient_editor_recenter_cmd_callback (GtkAction *action,
gpointer data);
void gradient_editor_redistribute_cmd_callback (GtkAction *action,
gpointer data);
void gradient_editor_blend_color_cmd_callback (GtkAction *action,
gpointer data);
void gradient_editor_blend_opacity_cmd_callback (GtkAction *action,
gpointer data);
void gradient_editor_zoom_cmd_callback (GtkAction *action,
gint value,
gpointer data);
#endif /* __GRADIENT_EDITOR_COMMANDS_H__ */

View File

@ -0,0 +1,126 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"
#include "actions-types.h"
#include "core/gimpcontext.h"
#include "core/gimpdata.h"
#include "widgets/gimpactiongroup.h"
#include "widgets/gimphelp-ids.h"
#include "actions.h"
#include "data-commands.h"
#include "gradients-actions.h"
#include "gradients-commands.h"
#include "gimp-intl.h"
static GimpActionEntry gradients_actions[] =
{
{ "gradients-popup", GIMP_STOCK_GRADIENT,
N_("Gradients Menu"), NULL, NULL, NULL,
GIMP_HELP_GRADIENT_DIALOG },
{ "gradients-new", GTK_STOCK_NEW,
N_("_New Gradient"), "",
N_("New gradient"),
G_CALLBACK (data_new_data_cmd_callback),
GIMP_HELP_GRADIENT_NEW },
{ "gradients-duplicate", GIMP_STOCK_DUPLICATE,
N_("D_uplicate Gradient"), NULL,
N_("Duplicate gradient"),
G_CALLBACK (data_duplicate_data_cmd_callback),
GIMP_HELP_GRADIENT_DUPLICATE },
{ "gradients-save-as-pov", GTK_STOCK_SAVE_AS,
N_("Save as _POV-Ray..."), "",
N_("Save gradient as POV-Ray"),
G_CALLBACK (gradients_save_as_pov_ray_cmd_callback),
GIMP_HELP_GRADIENT_SAVE_AS_POV },
{ "gradients-delete", GTK_STOCK_DELETE,
N_("_Delete Gradient..."), "",
N_("Delete gradient"),
G_CALLBACK (data_delete_data_cmd_callback),
GIMP_HELP_GRADIENT_DELETE },
{ "gradients-refresh", GTK_STOCK_REFRESH,
N_("_Refresh Gradients"), "",
N_("Refresh gradients"),
G_CALLBACK (data_refresh_data_cmd_callback),
GIMP_HELP_GRADIENT_REFRESH }
};
static GimpStringActionEntry gradients_edit_actions[] =
{
{ "gradients-edit", GIMP_STOCK_EDIT,
N_("_Edit Gradient..."), NULL,
N_("Edit gradient"),
"gimp-gradient-editor",
GIMP_HELP_GRADIENT_EDIT }
};
void
gradients_actions_setup (GimpActionGroup *group)
{
gimp_action_group_add_actions (group,
gradients_actions,
G_N_ELEMENTS (gradients_actions));
gimp_action_group_add_string_actions (group,
gradients_edit_actions,
G_N_ELEMENTS (gradients_edit_actions),
G_CALLBACK (data_edit_data_cmd_callback));
}
void
gradients_actions_update (GimpActionGroup *group,
gpointer user_data)
{
GimpContext *context = action_data_get_context (user_data);
GimpGradient *gradient = NULL;
GimpData *data = NULL;
if (context)
{
gradient = gimp_context_get_gradient (context);
if (gradient)
data = GIMP_DATA (gradient);
}
#define SET_SENSITIVE(action,condition) \
gimp_action_group_set_action_sensitive (group, action, (condition) != 0)
SET_SENSITIVE ("gradients-edit", gradient);
SET_SENSITIVE ("gradients-duplicate", gradient);
SET_SENSITIVE ("gradients-save-as-pov", gradient);
SET_SENSITIVE ("gradients-delete", gradient && data->deletable);
#undef SET_SENSITIVE
}

View File

@ -0,0 +1,28 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __GRADIENTS_ACTIONS_H__
#define __GRADIENTS_ACTIONS_H__
void gradients_actions_setup (GimpActionGroup *group);
void gradients_actions_update (GimpActionGroup *group,
gpointer user_data);
#endif /* __GRADIENT_ACTIONS_H__ */

View File

@ -0,0 +1,128 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"
#include "actions-types.h"
#include "core/gimpgradient-save.h"
#include "core/gimpcontext.h"
#include "widgets/gimpcontainereditor.h"
#include "widgets/gimpcontainerview.h"
#include "widgets/gimphelp-ids.h"
#include "gradients-commands.h"
#include "gimp-intl.h"
/* local function prototypes */
static void gradients_save_as_pov_ray_response (GtkWidget *dialog,
gint response_id,
GimpGradient *gradient);
/* public functions */
void
gradients_save_as_pov_ray_cmd_callback (GtkAction *action,
gpointer data)
{
GimpContainerEditor *editor = GIMP_CONTAINER_EDITOR (data);
GimpContext *context;
GimpGradient *gradient;
GtkFileChooser *chooser;
gchar *title;
context = gimp_container_view_get_context (editor->view);
gradient = gimp_context_get_gradient (context);
if (! gradient)
return;
title = g_strdup_printf (_("Save '%s' as POV-Ray"),
GIMP_OBJECT (gradient)->name);
chooser = GTK_FILE_CHOOSER
(gtk_file_chooser_dialog_new (title, NULL,
GTK_FILE_CHOOSER_ACTION_SAVE,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_SAVE, GTK_RESPONSE_OK,
NULL));
g_free (title);
gtk_window_set_screen (GTK_WINDOW (chooser),
gtk_widget_get_screen (GTK_WIDGET (editor)));
gtk_window_set_role (GTK_WINDOW (chooser), "gimp-gradient-save-pov");
gtk_window_set_position (GTK_WINDOW (chooser), GTK_WIN_POS_MOUSE);
g_signal_connect (chooser, "response",
G_CALLBACK (gradients_save_as_pov_ray_response),
gradient);
g_signal_connect (chooser, "delete_event",
G_CALLBACK (gtk_true),
NULL);
g_object_ref (gradient);
g_signal_connect_object (chooser, "destroy",
G_CALLBACK (g_object_unref),
gradient,
G_CONNECT_SWAPPED);
gimp_help_connect (GTK_WIDGET (chooser), gimp_standard_help_func,
GIMP_HELP_GRADIENT_SAVE_AS_POV, NULL);
gtk_widget_show (GTK_WIDGET (chooser));
}
/* private functions */
static void
gradients_save_as_pov_ray_response (GtkWidget *dialog,
gint response_id,
GimpGradient *gradient)
{
if (response_id == GTK_RESPONSE_OK)
{
const gchar *filename;
GError *error = NULL;
filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog));
if (! gimp_gradient_save_as_pov (gradient, filename, &error))
{
g_message (error->message);
g_clear_error (&error);
}
}
gtk_widget_destroy (dialog);
}

View File

@ -0,0 +1,27 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __GRADIENTS_COMMANDS_H__
#define __GRADIENTS_COMMANDS_H__
void gradients_save_as_pov_ray_cmd_callback (GtkAction *action,
gpointer data);
#endif /* __GRADIENTS_COMMANDS_H__ */

Some files were not shown because too many files have changed in this diff Show More