tinyscheme/CHANGES tinyscheme/scheme.c Updated to version 1.37 of

2006-05-18  Kevin Cozens  <kcozens@cvs.gnome.org>

	* tinyscheme/CHANGES
	* tinyscheme/scheme.c
	* tinyscheme/scheme.h: Updated to version 1.37 of TinyScheme. Adds
	'reserve_cells' to TinyScheme interface, moves the comment handling
	which fixes an obscure bug, and a patch for the allocator.
This commit is contained in:
Kevin Cozens 2006-05-18 23:05:12 +00:00 committed by Kevin Cozens
parent 0e2db63c8d
commit 7a94e33941
4260 changed files with 53 additions and 2508241 deletions

View File

@ -1,31 +0,0 @@
Makefile.in
Makefile
aclocal.m4
autom4te.cache
configure
config.cache
config.h
config.h.in
config.log
config.status
config.guess
config.sub
ltmain.sh
gimptool-2.0
gimptool-win32.c
gimp-2.0.pc
gimpthumb-2.0.pc
gimpui-2.0.pc
gimp-zip
intltool-extract
intltool-extract.in
intltool-merge
intltool-merge.in
intltool-modules
intltool-update
intltool-update.in
libtool
mkinstalldirs
stamp-h
stamp-h1
stamp-h.in

199
AUTHORS
View File

@ -1,199 +0,0 @@
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

339
COPYING
View File

@ -1,339 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
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.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
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
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) 19yy <name of author>
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 USA
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) 19yy name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.

7956
ChangeLog

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

159
HACKING
View File

@ -1,159 +0,0 @@
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.8 and 1.9 should work as well)
- 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-6)
* atk (gnome-2-6)
* pango (pango-1-8)
* gtk+ (gtk-2-6)
* 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.

356
INSTALL
View File

@ -1,356 +0,0 @@
Installation instructions for GIMP 2.3
--------------------------------------
There are some basic steps to building and installing The GIMP.
GIMP 2.3 replaces earlier GIMP 2.x versions. It is advised that you
uninstall them before installing GIMP 2.3. If you want to keep your
older GIMP 2.x installation in parallel to GIMP 2.3, you have to
choose a separate prefix which is not in your default library search
path.
GIMP 2.x 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.x.
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.6.0 or newer. Do not
try to use an older GTK+ version (1.2.x), it will not work.
GTK+ itself needs recent versions of GLib (>= 2.6.0),
Pango (>= 1.8.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.3.
By default there's also a link created so that you can type 'gimp'
to start gimp-2.3.
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.
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-2.3.x.tar.gz # unpack the sources
% cd gimp-2.3.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 several special options the GIMP `configure' script recognizes.
These are:
--enable-shared and --disable-shared. This option affects whether
shared libraries will be built or not. Shared libraries provide
for much smaller executables. The default is to enable shared
libraries. Disabling shared libraries is almost never a good idea.
--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.
--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.
--enable-gimpdir=DIR. This option changes the default directory
the gimp uses to search for its configuration files from ~/.gimp-2.3
(the directory .gimp-2.3 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.3 the default gimp installation. Otherwise a link called
gimp pointing to the gimp-2.3 executable will be installed.
--disable-gimp-console. Use this option if you don't want the
gimp-console binary to be built in addition to the standard binary.
gimp-console is useful for command-line batch mode or as a server.
The `make' command builds several things:
- 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.3' 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'.
When ./configure fails
======================
'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:
* 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 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.
* 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:
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
into the executable, by setting the LDFLAGS environment variable
before running configure. For example:
LDFLAGS="-R/home/joe/lib" ./configure
or
LDFLAGS="-Wl,-rpath -Wl,/home/joe/lib" ./configure
* 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.
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.
When ./configure fails on plug-ins
==================================
There are some GIMP plug-ins that need additional third-party libraries
installed on your system. For example to compile the plug-ins that load
and save JPEG, PNG or TIFF files you need the related libraries and header
files installed, otherwise you'll get a message that plugin xyz will not
be build.
If you are sure that those libraries are correctly installed, but configure
fails to detect them, the following might help:
Set your LDFLAGS environment variable to look for the library in a certain
place, e.g. if you are working in a bash shell you would say:
export LDFLAGS="-L<path_to_library> -L<path_to_another_one>"
before you run configure.
Set your CPPFLAGS environment variable to look for the header file in a
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.
* 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
==========================================================
To compile this package:
1. Configure the package for your system. In the directory that this
file is in, type `./configure'. If you're using `csh' on an old
version of System V, you might need to type `sh configure' instead to
prevent `csh' from trying to execute `configure' itself.
The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation, and
creates the Makefile(s) (one in each subdirectory of the source
directory). In some packages it creates a C header file containing
system-dependent definitions. It also creates a file `config.status'
that you can run in the future to recreate the current configuration.
Running `configure' takes a minute or two.
To compile the package in a different directory from the one
containing the source code, you must use GNU make. `cd' to the
directory where you want the object files and executables to go and
run `configure' with the option `--srcdir=DIR', where DIR is the
directory that contains the source code. Using this option is
actually unnecessary if the source code is in the parent directory of
the one in which you are compiling; `configure' automatically checks
for the source code in `..' if it does not find it in the current
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'.
You can specify separate installation prefixes for machine-specific
files and machine-independent files. If you give `configure' the
option `--exec-prefix=PATH', the package will use PATH as the prefix
for installing programs and libraries. Normally, all files are
installed using the same prefix.
`configure' ignores any other arguments that you give it.
If your system requires unusual options for compilation or linking
that `configure' doesn't know about, you can give `configure' initial
values for some variables by setting them in the environment. In
Bourne-compatible shells, you can do that on the command line like
this:
CC='gcc -traditional' DEFS=-D_POSIX_SOURCE ./configure
The `make' variables that you might want to override with environment
variables when running `configure' are:
(For these variables, any value given in the environment overrides the
value that `configure' would choose:)
CC C compiler program.
Default is `cc', or `gcc' if `gcc' is in your PATH.
INSTALL Program to use to install files.
Default is `install' if you have it, `cp' otherwise.
INCLUDEDIR Directory for `configure' to search for include files.
Default is /usr/include.
(For these variables, any value given in the environment is added to
the value that `configure' chooses:)
DEFS Configuration options, in the form '-Dfoo -Dbar ...'
LIBS Libraries to link with, in the form '-lfoo -lbar ...'
If you need to do unusual things to compile the package, we encourage
you to teach `configure' how to do them and mail the diffs to the
address given in the README so we can include them in the next
release.
2. Type `make' to compile the package.
3. Type `make install' to install programs, data files, and
documentation.
4. You can remove the program binaries and object files from the
source directory by typing `make clean'. To also remove the
Makefile(s), the header file containing system-dependent definitions
(if the package uses one), and `config.status' (all the files that
`configure' created), type `make distclean'.
The file `configure.in' is used as a template to create `configure' by
a program called `autoconf'. You will only need it if you want to
regenerate `configure' using a newer version of `autoconf'.

27
LICENSE
View File

@ -1,27 +0,0 @@
* 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,99 +0,0 @@
## Process this file with automake to produce Makefile.in
SUBDIRS = \
m4macros \
tools \
regexrepl \
cursors \
themes \
po \
po-libgimp \
po-plug-ins \
po-script-fu \
data \
menus \
tips \
libgimpbase \
libgimpcolor \
libgimpmath \
libgimpconfig \
libgimpmodule \
libgimpthumb \
libgimpwidgets \
libgimp \
app \
$(GIMP_MODULES) \
$(GIMP_PLUGINS) \
etc \
devel-docs \
docs
bin_SCRIPTS = gimptool-@GIMP_TOOL_VERSION@ @GIMPINSTALL@
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = \
gimp-@GIMP_PKGCONFIG_VERSION@.pc \
gimpthumb-@GIMP_PKGCONFIG_VERSION@.pc \
gimpui-@GIMP_PKGCONFIG_VERSION@.pc
AUTHORS: authors.xml
if HAVE_XSLTPROC
$(XSLTPROC) authors.xsl $< > $(@) || rm -f $(@)
endif
EXTRA_SCRIPTS = gimpinstall-@GIMP_TOOL_VERSION@
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
DISTCHECK_CONFIGURE_FLAGS = --enable-gimp-console
DISTCLEANFILES = \
intltool-extract \
intltool-merge \
intltool-update
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

93
NEWS
View File

@ -1,93 +0,0 @@
------------------------------
GNU Image Manipulation Program
Development Branch
------------------------------
This is the development branch of The GIMP. Here's where all the shiny
new stuff is being done that will one day be released as GIMP 2.4.
Changes in CVS (not released yet)
=================================
- allow to copy and paste SVG between GIMP and other applications
- added a utility for testing and debugging clipboard operations
- more work on the new vectors PDB API
- made screen edges active in the image display in fullscreen mode
- made file and color selection dialogs transient to their parent windows
- moved browser widget from Procedure Browser plug-in to libgimpwidgets
- allow more search types in the Procedure Browser
- reduced size of the Colors dockable by moving the hex entry down
- added object properties to GimpColorArea and GimpColorButton
- changed default for RGB->Indexed conversion to not to any dithering
- allow to paste a new image using Ctrl-V on the toolbox
- show previews of dash presets in Stroke Options dialog
- Escape key cancels the window selection in the Screenshot plug-in
- bug fixes and code cleanup
Changes in GIMP 2.3.0
=====================
- added Recompose plug-in
- added rectangle tool in GFig plug-in
- improved palette editor color DND
- improved EXIF handling in JPEG plug-in
- smoother autoscrolling in image display
- added Snap to Canvas Border and Snap to Path (yet unimplemented)
- added previews to Mosaic, Pixelize and Sparkle plug-ins
- added Lanczos interpolation method
- added Open as Image menu entries to brushes and patterns dialogs
- improved drag-n-drop of drawables within GIMP
- added a prototype of a new rectangular select tool
- moved a bunch of enums from core into libgimpbase
- moved GimpConfig functionality from core into libgimpconfig
- moved GimpEnumStore and GimpEnumComboBox to libgimpwidgets
- moved convenience constructors for property views to libgimpwidgets
- ported ImageMap plug-in to action based menus.
- first steps towards color management
- use GOptionContext for command-line parsing
- added a gnome-vfs backend for the uri plug-in (former url plug-in)
- prepared code for accessing remote files in the file-chooser
- let all dialogs obey the gtk-alternative-button-order setting
- extended GimpProgress PDB API
- improved file type handling in file save dialog
- resurrected threaded pixel processor and enable it by default
- parallelized a few more internal functions
- speed up gradient dithering
- improved PSD save plug-in
- improved Python bindings
- allow to resize layers with the image
- allow to control letter spacing in the text tool
- added path-on-path functionality, use it to implement Text on Path
- improved gradient editor
- allow to import paths from a string
- ported all code to gstdio wrappers
- added infrastructure for color sample points
- added first draft of a metadata editor plug-in
- speed up burn compositing function
- added Altivec versions of some compositing functions
- added PDB API to control the number of columns in a palette
- allow to control hue overlap in Hue-Saturation tool
- added a PDB API to register menu branches
- added missing mnemonics
- improved Screenshot plug-in
- allow to drag brushes/patterns/gradients... to the selectors in Script-Fu
- allow to save images by dragging them to a filemanager that supports the
XDS protocol
- optimizations in the Color Deficiency display filter
- transfer the clipboard content to a clipboard manager on exit
- moved cursor info out of the Info window into a dockable
- moved remaining bits of the Info Window to a new Image Properties dialog
- build and install gimp-console by default
- allow to drag and drop image data into GIMP
- use the statusbar more to display hints and info about the tool state
- resurrected --no-data functionality
- zoom to the cursor position instead of the display center
- some improvements to the Helpbrowser plug-in
- load PS brushes in the .abr format
- allow to choose between different algorithms for Desaturate
- added thumbnail loader to Winicon plug-in
- improved configuration of input controllers
- added an option to make the dock windows transient to the active image display
- lots of code cleanup and bug-fixes

View File

@ -1,807 +0,0 @@
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.

View File

@ -1,578 +0,0 @@
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...

115
README
View File

@ -1,115 +0,0 @@
The GNU Image Manipulation Program Version 2.3
----------------------------------------------
This is an unstable development version of GIMP. Please realize that
this is in no way a final product. A lot of new features are
incomplete and some things may even be completely broken. If you need
to get work done, please use the stable version, GIMP 2.2.
GIMP 2.3 replaces earlier GIMP 2.x versions. It is advised that you
uninstall them before installing GIMP 2.3. If you want to keep your
older GIMP 2.x installation in parallel to GIMP 2.3, you have to
choose a separate prefix which is not in your default library search
path. Otherwise your GIMP 2.2 or GIMP 2.0 installation will start to
use the new libraries. You have been warned.
If you think you found a bug in this version, please make sure that it
hasn't been reported earlier and that it is not just new stuff that is
still being worked on and obviously not quite finished yet.
If you want to hack on The GIMP, please read the file HACKING. For
detailed installation instructions, see the file INSTALL.
1. Web Resources
================
The GIMP's home page is at:
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:
http://registry.gimp.org/
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. There is more info at
https://lists.xcf.berkeley.edu/mailman/listinfo/<listname>
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.
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.
There is also a mailing list, "gimpwin-users", dedicated to users of the
Win32 port. To subscribe, send an empty message to
gimpwin-users-subscribe@egroups.com
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 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.us.gimp.org:6667
irc.eu.gimp.org:6667
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.
Have fun,
Spencer Kimball
Peter Mattis
Federico Mena
Manish Singh
Sven Neumann
Michael Natterer
Dave Neary

View File

@ -1,238 +0,0 @@
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

View File

@ -1,21 +0,0 @@
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,418 +0,0 @@
## 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")
])

View File

@ -1,7 +0,0 @@
Makefile
Makefile.in
makefile.mingw
.deps
.libs
gimp-2.3
gimp-console-2.3

View File

@ -1,218 +0,0 @@
## Process this file with automake to produce Makefile.in
libgimpbase = $(top_builddir)/libgimpbase/libgimpbase-$(GIMP_API_VERSION).la
libgimpconfig = $(top_builddir)/libgimpconfig/libgimpconfig-$(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 =
if ENABLE_GIMP_CONSOLE
bin_PROGRAMS = gimp-2.3 gimp-console-2.3
else
bin_PROGRAMS = gimp-2.3
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_3_SOURCES = $(app_sources)
EXTRA_DIST = \
makefile.msc \
gimp.rc \
fileicon.ico \
wilber.ico
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 \
@GTHREAD_CFLAGS@
INCLUDES = \
-I$(top_srcdir) \
$(GTK_CFLAGS) \
$(PANGOFT2_CFLAGS) \
-I$(includedir)
gimp_2_3_LDFLAGS = $(mwindows)
gimp_2_3_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) \
$(libgimpconfig) \
$(libgimpbase) \
$(REGEXREPL) \
$(GTK_LIBS) \
$(LIBART_LIBS) \
$(PANGOFT2_LIBS) \
$(FONTCONFIG_LIBS) \
$(FREETYPE_LIBS) \
$(GTHREAD_LIBS) \
$(RT_LIBS) \
$(INTLLIBS) \
$(GIMPICONRC)
if ENABLE_GIMP_CONSOLE
gimp_console_2_3_SOURCES = $(app_sources)
gimp_console_2_3_CPPFLAGS = \
$(AM_CPPFLAGS) \
-DGIMP_CONSOLE_COMPILATION
gimp_console_2_3_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) \
$(libgimpconfig) \
$(libgimpbase) \
$(REGEXREPL) \
$(GDK_PIXBUF_LIBS) \
$(LIBART_LIBS) \
$(PANGOFT2_LIBS) \
$(FONTCONFIG_LIBS) \
$(FREETYPE_LIBS) \
$(GTHREAD_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

View File

@ -1,6 +0,0 @@
Makefile
Makefile.in
.deps
.libs
*.lo
libappactions.la

View File

@ -1,157 +0,0 @@
## 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 \
dock-actions.c \
dock-actions.h \
dock-commands.c \
dock-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 \
window-actions.c \
window-actions.h
EXTRA_DIST = \
makefile.msc
AM_CPPFLAGS = \
-DG_LOG_DOMAIN=\"Gimp-Actions\" \
@GTHREAD_CFLAGS@
INCLUDES = \
-I$(top_builddir) \
-I$(top_srcdir) \
-I$(top_builddir)/app \
-I$(top_srcdir)/app \
$(GTK_CFLAGS) \
-I$(includedir)

View File

@ -1,38 +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 __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__ */

View File

@ -1,502 +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 "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/gimpactiongroup.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 "dock-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 },
{ "dock", N_("Dock"), NULL,
dock_actions_setup,
dock_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)
{
GimpDisplay *display = NULL;
if (! data)
return NULL;
if (GIMP_IS_DISPLAY (data))
display = data;
else if (GIMP_IS_GIMP (data))
display = gimp_context_get_display (gimp_get_user_context (data));
else if (GTK_IS_WIDGET (data))
return data;
if (display)
return display->shell;
return dialogs_get_toolbox ();
}
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 ((gint) select_type >= 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;
}
void
action_select_property (GimpActionSelectType select_type,
GObject *object,
const gchar *property_name,
gdouble inc,
gdouble skip_inc,
gboolean wrap)
{
GParamSpec *pspec;
gdouble value;
g_return_if_fail (G_IS_OBJECT (object));
g_return_if_fail (property_name != NULL);
pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (object),
property_name);
g_return_if_fail (G_IS_PARAM_SPEC_DOUBLE (pspec));
g_object_get (object, property_name, &value, NULL);
value = action_select_value (select_type,
value,
G_PARAM_SPEC_DOUBLE (pspec)->minimum,
G_PARAM_SPEC_DOUBLE (pspec)->maximum,
inc, skip_inc, wrap);
g_object_set (object, property_name, value, NULL);
}
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:
if ((gint) select_type >= 0)
select_index = (gint) select_type;
else
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);
}

View File

@ -1,104 +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 __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);
void action_select_property (GimpActionSelectType select_type,
GObject *object,
const gchar *property_name,
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

@ -1,125 +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 "config.h"
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"
#include "actions-types.h"
#include "core/gimpbrushgenerated.h"
#include "core/gimpcontext.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-open-as-image", GTK_STOCK_OPEN,
N_("_Open Brush as Image"), "",
N_("Open brush as image"),
G_CALLBACK (data_open_as_image_cmd_callback),
GIMP_HELP_BRUSH_OPEN_AS_IMAGE },
{ "brushes-new", GTK_STOCK_NEW,
N_("_New Brush"), "",
N_("New brush"),
G_CALLBACK (data_new_cmd_callback),
GIMP_HELP_BRUSH_NEW },
{ "brushes-duplicate", GIMP_STOCK_DUPLICATE,
N_("D_uplicate Brush"), NULL,
N_("Duplicate brush"),
G_CALLBACK (data_duplicate_cmd_callback),
GIMP_HELP_BRUSH_DUPLICATE },
{ "brushes-delete", GTK_STOCK_DELETE,
N_("_Delete Brush"), "",
N_("Delete brush"),
G_CALLBACK (data_delete_cmd_callback),
GIMP_HELP_BRUSH_DELETE },
{ "brushes-refresh", GTK_STOCK_REFRESH,
N_("_Refresh Brushes"), "",
N_("Refresh brushes"),
G_CALLBACK (data_refresh_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_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-open-as-image", brush && data->filename && ! GIMP_IS_BRUSH_GENERATED (brush));
SET_SENSITIVE ("brushes-duplicate", brush && GIMP_DATA_GET_CLASS (data)->duplicate);
SET_SENSITIVE ("brushes-delete", brush && data->deletable);
#undef SET_SENSITIVE
}

View File

@ -1,28 +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 __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

@ -1,98 +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 "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_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_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_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_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

@ -1,28 +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 __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

@ -1,155 +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 "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_cmd_callback (GtkAction *action,
gpointer data)
{
buffers_paste (GIMP_BUFFER_VIEW (data), FALSE);
}
void
buffers_paste_into_cmd_callback (GtkAction *action,
gpointer data)
{
buffers_paste (GIMP_BUFFER_VIEW (data), TRUE);
}
void
buffers_paste_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_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

@ -1,33 +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 __BUFFERS_COMMANDS_H__
#define __BUFFERS_COMMANDS_H__
void buffers_paste_cmd_callback (GtkAction *action,
gpointer data);
void buffers_paste_into_cmd_callback (GtkAction *action,
gpointer data);
void buffers_paste_as_new_cmd_callback (GtkAction *action,
gpointer data);
void buffers_delete_cmd_callback (GtkAction *action,
gpointer data);
#endif /* __BUFFERS_COMMANDS_H__ */

View File

@ -1,203 +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 "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

@ -1,28 +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 __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

@ -1,413 +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 "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:"),
FALSE);
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:"),
TRUE);
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))
{
GimpChannelType component;
const gchar *desc;
gchar *name;
return_if_no_image (gimage, data);
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, NULL);
/* 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);
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (options->save_sel_checkbutton)))
{
GimpChannel *selection = gimp_image_get_mask (options->gimage);
new_channel =
GIMP_CHANNEL (gimp_item_duplicate (GIMP_ITEM (selection),
GIMP_TYPE_CHANNEL,
FALSE));
gimp_object_set_name (GIMP_OBJECT (new_channel), channel_name);
gimp_channel_set_color (new_channel, &channel_color, FALSE);
}
else
{
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

@ -1,48 +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 __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

@ -1,122 +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 "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

@ -1,28 +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 __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

@ -1,156 +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 "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

@ -1,30 +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 __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

@ -1,122 +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 "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

@ -1,28 +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 __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

@ -1,156 +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 "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

@ -1,30 +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 __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__ */

File diff suppressed because it is too large Load Diff

View File

@ -1,28 +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 __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

@ -1,610 +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 "config.h"
#include <string.h>
#include <gtk/gtk.h>
#include "libgimpcolor/gimpcolor.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_foreground_hue_cmd_callback (GtkAction *action,
gint value,
gpointer data)
{
GimpContext *context;
GimpRGB color;
GimpHSV hsv;
return_if_no_context (context, data);
gimp_context_get_foreground (context, &color);
gimp_rgb_to_hsv (&color, &hsv);
hsv.h = action_select_value ((GimpActionSelectType) value,
hsv.h,
0.0, 1.0,
0.01, 0.1, FALSE);
gimp_hsv_to_rgb (&hsv, &color);
gimp_context_set_foreground (context, &color);
}
void
context_foreground_saturation_cmd_callback (GtkAction *action,
gint value,
gpointer data)
{
GimpContext *context;
GimpRGB color;
GimpHSV hsv;
return_if_no_context (context, data);
gimp_context_get_foreground (context, &color);
gimp_rgb_to_hsv (&color, &hsv);
hsv.s = action_select_value ((GimpActionSelectType) value,
hsv.s,
0.0, 1.0,
0.01, 0.1, FALSE);
gimp_hsv_to_rgb (&hsv, &color);
gimp_context_set_foreground (context, &color);
}
void
context_foreground_value_cmd_callback (GtkAction *action,
gint value,
gpointer data)
{
GimpContext *context;
GimpRGB color;
GimpHSV hsv;
return_if_no_context (context, data);
gimp_context_get_foreground (context, &color);
gimp_rgb_to_hsv (&color, &hsv);
hsv.v = action_select_value ((GimpActionSelectType) value,
hsv.v,
0.0, 1.0,
0.01, 0.1, FALSE);
gimp_hsv_to_rgb (&hsv, &color);
gimp_context_set_foreground (context, &color);
}
void
context_background_hue_cmd_callback (GtkAction *action,
gint value,
gpointer data)
{
GimpContext *context;
GimpRGB color;
GimpHSV hsv;
return_if_no_context (context, data);
gimp_context_get_background (context, &color);
gimp_rgb_to_hsv (&color, &hsv);
hsv.h = action_select_value ((GimpActionSelectType) value,
hsv.h,
0.0, 1.0,
0.01, 0.1, FALSE);
gimp_hsv_to_rgb (&hsv, &color);
gimp_context_set_background (context, &color);
}
void
context_background_saturation_cmd_callback (GtkAction *action,
gint value,
gpointer data)
{
GimpContext *context;
GimpRGB color;
GimpHSV hsv;
return_if_no_context (context, data);
gimp_context_get_background (context, &color);
gimp_rgb_to_hsv (&color, &hsv);
hsv.s = action_select_value ((GimpActionSelectType) value,
hsv.s,
0.0, 1.0,
0.01, 0.1, FALSE);
gimp_hsv_to_rgb (&hsv, &color);
gimp_context_set_background (context, &color);
}
void
context_background_value_cmd_callback (GtkAction *action,
gint value,
gpointer data)
{
GimpContext *context;
GimpRGB color;
GimpHSV hsv;
return_if_no_context (context, data);
gimp_context_get_background (context, &color);
gimp_rgb_to_hsv (&color, &hsv);
hsv.v = action_select_value ((GimpActionSelectType) value,
hsv.v,
0.0, 1.0,
0.01, 0.1, FALSE);
gimp_hsv_to_rgb (&hsv, &color);
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

@ -1,114 +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 __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_foreground_hue_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void context_foreground_saturation_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void context_foreground_value_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void context_background_hue_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void context_background_saturation_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void context_background_value_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__ */

View File

@ -1,288 +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 "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 "file/file-open.h"
#include "file/file-utils.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_open_as_image_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->filename)
{
gchar *uri = g_filename_to_uri (data->filename, NULL, NULL);
if (uri)
{
GimpImage *image;
GimpPDBStatusType status;
GError *error = NULL;
image = file_open_with_display (context->gimp, context, NULL, uri,
&status, &error);
if (! image && 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);
}
g_free (uri);
}
}
}
void
data_new_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_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_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);
gtk_dialog_set_alternative_button_order (GTK_DIALOG (dialog),
GTK_RESPONSE_OK,
GTK_RESPONSE_CANCEL,
-1);
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_cmd_callback (GtkAction *action,
gpointer user_data)
{
GimpDataFactoryView *view = GIMP_DATA_FACTORY_VIEW (user_data);
gimp_data_factory_data_refresh (view->factory);
}
void
data_edit_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

@ -1,38 +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 __DATA_COMMANDS_H__
#define __DATA_COMMANDS_H__
void data_open_as_image_cmd_callback (GtkAction *action,
gpointer data);
void data_new_cmd_callback (GtkAction *action,
gpointer data);
void data_duplicate_cmd_callback (GtkAction *action,
gpointer data);
void data_delete_cmd_callback (GtkAction *action,
gpointer data);
void data_refresh_cmd_callback (GtkAction *action,
gpointer data);
void data_edit_cmd_callback (GtkAction *action,
const gchar *value,
gpointer data);
#endif /* __DATA_COMMANDS_H__ */

View File

@ -1,70 +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 "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

@ -1,28 +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 __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

@ -1,177 +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 "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

@ -1,40 +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 __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

@ -1,233 +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 "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"), "<control>B", 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-cursor", GIMP_STOCK_CURSOR,
N_("_Cursor"), NULL, NULL,
"gimp-cursor-view",
GIMP_HELP_CURSOR_DIALOG },
{ "dialogs-sample-points", GIMP_STOCK_SAMPLE_POINT,
N_("_Sample Points"), NULL, NULL,
"gimp-sample-point-editor",
GIMP_HELP_SAMPLE_POINT_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

@ -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 __DIALOGS_ACTIONS_H__
#define __DIALOGS_ACTIONS_H__
/* this check is needed for the extern declaration below to be correct */
#ifndef __GIMP_ACTION_GROUP_H__
#error "widgets/gimpactiongroup.h must be included prior to dialog-actions.h"
#endif
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

@ -1,196 +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 "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/gimpmenudock.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_menu_dock_set_show_image_menu (GIMP_MENU_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

@ -1,42 +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 __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

@ -1,118 +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 "config.h"
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"
#include "actions-types.h"
#include "widgets/gimpactiongroup.h"
#include "widgets/gimphelp-ids.h"
#include "widgets/gimpmenudock.h"
#include "actions.h"
#include "dock-actions.h"
#include "dock-commands.h"
#include "window-actions.h"
#include "gimp-intl.h"
static GimpActionEntry dock_actions[] =
{
{ "dock-move-to-screen-menu", GIMP_STOCK_MOVE_TO_SCREEN,
N_("M_ove to Screen"), NULL, NULL, NULL,
GIMP_HELP_DOCK_CHANGE_SCREEN },
{ "dock-close", GTK_STOCK_CLOSE,
N_("Close Dock"), "<control>W", NULL,
G_CALLBACK (dock_close_cmd_callback),
GIMP_HELP_DOCK_CLOSE }
};
static GimpToggleActionEntry dock_toggle_actions[] =
{
{ "dock-show-image-menu", NULL,
N_("_Show Image Selection"), NULL, NULL,
G_CALLBACK (dock_toggle_image_menu_cmd_callback),
TRUE,
GIMP_HELP_DOCK_IMAGE_MENU },
{ "dock-auto-follow-active", NULL,
N_("Auto _Follow Active Image"), NULL, NULL,
G_CALLBACK (dock_toggle_auto_cmd_callback),
TRUE,
GIMP_HELP_DOCK_AUTO_BUTTON }
};
void
dock_actions_setup (GimpActionGroup *group)
{
gimp_action_group_add_actions (group,
dock_actions,
G_N_ELEMENTS (dock_actions));
gimp_action_group_add_toggle_actions (group,
dock_toggle_actions,
G_N_ELEMENTS (dock_toggle_actions));
window_actions_setup (group,
GIMP_HELP_DOCK_CHANGE_SCREEN,
G_CALLBACK (dock_move_to_screen_cmd_callback));
}
void
dock_actions_update (GimpActionGroup *group,
gpointer data)
{
GtkWidget *widget = action_data_get_widget (data);
GtkWidget *toplevel = NULL;
if (widget)
toplevel = gtk_widget_get_toplevel (widget);
#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)
if (GIMP_IS_MENU_DOCK (toplevel))
{
GimpMenuDock *menu_dock = GIMP_MENU_DOCK (toplevel);
SET_VISIBLE ("dock-show-image-menu", TRUE);
SET_VISIBLE ("dock-auto-follow-active", TRUE);
SET_ACTIVE ("dock-show-image-menu", menu_dock->show_image_menu);
SET_ACTIVE ("dock-auto-follow-active", menu_dock->auto_follow_active);
}
else
{
SET_VISIBLE ("dock-show-image-menu", FALSE);
SET_VISIBLE ("dock-auto-follow-active", FALSE);
}
window_actions_update (group, toplevel);
#undef SET_ACTIVE
#undef SET_VISIBLE
}

View File

@ -1,28 +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 __DOCK_ACTIONS_H__
#define __DOCK_ACTIONS_H__
void dock_actions_setup (GimpActionGroup *group);
void dock_actions_update (GimpActionGroup *group,
gpointer data);
#endif /* __DOCK_ACTIONS_H__ */

View File

@ -1,116 +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 "config.h"
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"
#include "actions-types.h"
#include "widgets/gimpmenudock.h"
#include "actions.h"
#include "dock-commands.h"
/* public functions */
void
dock_close_cmd_callback (GtkAction *action,
gpointer data)
{
GtkWidget *widget;
return_if_no_widget (widget, data);
if (! GTK_WIDGET_TOPLEVEL (widget))
widget = gtk_widget_get_toplevel (widget);
if (widget && widget->window)
{
GdkEvent *event = gdk_event_new (GDK_DELETE);
event->any.window = g_object_ref (widget->window);
event->any.send_event = TRUE;
gtk_main_do_event (event);
gdk_event_free (event);
}
}
void
dock_move_to_screen_cmd_callback (GtkAction *action,
GtkAction *current,
gpointer data)
{
GtkWidget *widget;
gint value;
return_if_no_widget (widget, data);
if (! GTK_WIDGET_TOPLEVEL (widget))
widget = gtk_widget_get_toplevel (widget);
value = gtk_radio_action_get_current_value (GTK_RADIO_ACTION (action));
if (value != gdk_screen_get_number (gtk_widget_get_screen (widget)))
{
GdkDisplay *display;
GdkScreen *screen;
display = gtk_widget_get_display (widget);
screen = gdk_display_get_screen (display, value);
if (screen)
gtk_window_set_screen (GTK_WINDOW (widget), screen);
}
}
void
dock_toggle_image_menu_cmd_callback (GtkAction *action,
gpointer data)
{
GtkWidget *widget;
gboolean active;
return_if_no_widget (widget, data);
if (! GTK_WIDGET_TOPLEVEL (widget))
widget = gtk_widget_get_toplevel (widget);
active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
if (GIMP_IS_MENU_DOCK (widget))
gimp_menu_dock_set_show_image_menu (GIMP_MENU_DOCK (widget), active);
}
void
dock_toggle_auto_cmd_callback (GtkAction *action,
gpointer data)
{
GtkWidget *widget;
gboolean active;
return_if_no_widget (widget, data);
if (! GTK_WIDGET_TOPLEVEL (widget))
widget = gtk_widget_get_toplevel (widget);
active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
if (GIMP_IS_MENU_DOCK (widget))
gimp_menu_dock_set_auto_follow_active (GIMP_MENU_DOCK (widget), active);
}

View File

@ -1,35 +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 __DOCK_COMMANDS_H__
#define __DOCK_COMMANDS_H__
void dock_close_cmd_callback (GtkAction *action,
gpointer data);
void dock_move_to_screen_cmd_callback (GtkAction *action,
GtkAction *current,
gpointer data);
void dock_toggle_image_menu_cmd_callback (GtkAction *action,
gpointer data);
void dock_toggle_auto_cmd_callback (GtkAction *action,
gpointer data);
#endif /* __DOCK_COMMANDS_H__ */

View File

@ -1,315 +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 "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/gimpdock.h"
#include "widgets/gimpdockable.h"
#include "widgets/gimpdockbook.h"
#include "widgets/gimpdocked.h"
#include "widgets/gimphelp-ids.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 }
};
#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_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;
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);
}
#undef SET_ACTIVE
#undef SET_VISIBLE
#undef SET_SENSITIVE
}

View File

@ -1,28 +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 __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

@ -1,268 +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 "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/gimpdock.h"
#include "widgets/gimpdockable.h"
#include "widgets/gimpdockbook.h"
#include "widgets/gimpsessioninfo.h"
#include "dialogs/dialogs.h"
#include "dockable-commands.h"
/* 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);
}
}

View File

@ -1,42 +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 __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);
#endif /* __DOCKABLE_COMMANDS_H__ */

View File

@ -1,121 +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 "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_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_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_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_remove_dangling_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

@ -1,28 +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 __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

@ -1,274 +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 "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_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_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_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_remove_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_remove_dangling_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_remove_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

@ -1,39 +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 __DOCUMENTS_COMMANDS_H__
#define __DOCUMENTS_COMMANDS_H__
void documents_open_cmd_callback (GtkAction *action,
gpointer data);
void documents_raise_or_open_cmd_callback (GtkAction *action,
gpointer data);
void documents_file_open_dialog_cmd_callback (GtkAction *action,
gpointer data);
void documents_remove_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_remove_dangling_cmd_callback (GtkAction *action,
gpointer data);
#endif /* __DOCUMENTS_COMMANDS_H__ */

View File

@ -1,202 +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 "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

@ -1,28 +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 __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

@ -1,333 +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 "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/desaturate-dialog.h"
#include "dialogs/offset-dialog.h"
#include "actions.h"
#include "drawable-commands.h"
#include "gimp-intl.h"
/* local function prototypes */
static void desaturate_response (GtkWidget *widget,
gint response_id,
DesaturateDialog *dialog);
/* private variables */
static GimpDesaturateMode desaturate_mode = GIMP_DESATURATE_LIGHTNESS;
/* public functions */
void
drawable_desaturate_cmd_callback (GtkAction *action,
gpointer data)
{
DesaturateDialog *dialog;
GimpImage *gimage;
GimpDrawable *drawable;
GtkWidget *widget;
return_if_no_drawable (gimage, drawable, data);
return_if_no_widget (widget, data);
if (! gimp_drawable_is_rgb (drawable))
{
g_message (_("Desaturate operates only on RGB color layers."));
return;
}
dialog = desaturate_dialog_new (drawable, widget, desaturate_mode);
g_signal_connect (dialog->dialog, "response",
G_CALLBACK (desaturate_response),
dialog);
gtk_widget_show (dialog->dialog);
}
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);
}
/* private functions */
static void
desaturate_response (GtkWidget *widget,
gint response_id,
DesaturateDialog *dialog)
{
if (response_id == GTK_RESPONSE_OK)
{
GimpDrawable *drawable = dialog->drawable;
GimpImage *gimage = gimp_item_get_image (GIMP_ITEM (drawable));
/* remember for next invocation of the dialog */
desaturate_mode = dialog->mode;
gimp_drawable_desaturate (drawable, desaturate_mode);
gimp_image_flush (gimage);
}
gtk_widget_destroy (dialog->dialog);
}

View File

@ -1,46 +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 __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_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__ */

View File

@ -1,285 +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 "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);
/* "edit-paste" is always enabled */
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

@ -1,28 +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 __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__ */

View File

@ -1,445 +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 "config.h"
#include <string.h>
#include <gtk/gtk.h>
#include "libgimpbase/gimpbase.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 "vectors/gimpvectors-import.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;
gchar *size;
guint64 memsize;
guint64 guisize;
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,
GIMP_HELP_EDIT_UNDO_CLEAR,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_CLEAR, GTK_RESPONSE_OK,
NULL);
gtk_dialog_set_alternative_button_order (GTK_DIALOG (dialog),
GTK_RESPONSE_OK,
GTK_RESPONSE_CANCEL,
-1);
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?"));
memsize = gimp_object_get_memsize (GIMP_OBJECT (gimage->undo_stack),
&guisize);
memsize += guisize;
memsize += gimp_object_get_memsize (GIMP_OBJECT (gimage->redo_stack),
&guisize);
memsize += guisize;
size = gimp_memsize_to_string (memsize);
gimp_message_box_set_text (GIMP_MESSAGE_DIALOG (dialog)->box,
_("Clearing the undo history of this "
"image will gain %s of memory."), size);
g_free (size);
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 = action_data_get_display (data);
if (gdisp)
edit_paste (gdisp, FALSE);
else
edit_paste_as_new_cmd_callback (action, data);
}
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)
{
guchar *svg;
gsize svg_size;
svg = gimp_clipboard_get_svg (gdisp->gimage->gimp, &svg_size);
if (svg)
{
if (gimp_vectors_import_buffer (gdisp->gimage, svg, svg_size,
TRUE, TRUE, -1, NULL))
{
gimp_image_flush (gdisp->gimage);
}
g_free (svg);
}
else
{
GimpBuffer *buffer;
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

@ -1,54 +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 __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

@ -1,97 +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 "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

@ -1,28 +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 __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

@ -1,148 +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 "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);
gtk_dialog_set_alternative_button_order (GTK_DIALOG (console->file_dialog),
GTK_RESPONSE_OK,
GTK_RESPONSE_CANCEL,
-1);
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

@ -1,30 +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 __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__ */

View File

@ -1,279 +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 "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");
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

@ -1,28 +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 __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__ */

View File

@ -1,533 +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 "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;
GimpImage *image;
const gchar *uri;
return_if_no_display (gdisp, data);
return_if_no_widget (widget, data);
image = gdisp->gimage;
uri = gimp_object_get_name (GIMP_OBJECT (image));
file_open_dialog_show (widget, image, uri, 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;
GimpImage *gimage;
return_if_no_display (gdisp, data);
gimage = gdisp->gimage;
if (! gimp_image_active_drawable (gimage))
return;
/* Only save if the gimage has been modified */
if (gimage->dirty ||
! GIMP_GUI_CONFIG (gimage->gimp->config)->trust_dirty_flag)
{
const gchar *uri;
PlugInProcDef *save_proc = NULL;
uri = gimp_object_get_name (GIMP_OBJECT (gimage));
save_proc = gimp_image_get_save_proc (gimage);
if (uri && ! save_proc)
save_proc = file_utils_find_proc (gimage->gimp->save_procs, uri);
if (! (uri && save_proc))
{
file_save_as_cmd_callback (action, data);
}
else
{
GimpPDBStatusType status;
GError *error = NULL;
status = file_save (gimage, action_data_get_context (data),
GIMP_PROGRESS (gdisp),
uri, save_proc,
GIMP_RUN_WITH_LAST_VALS, FALSE, &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);
gtk_dialog_set_alternative_button_order (GTK_DIALOG (dialog),
GTK_RESPONSE_OK,
GTK_RESPONSE_CANCEL,
-1);
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_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (parent));
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)
{
gtk_window_set_transient_for (GTK_WINDOW (dialog),
GTK_WINDOW (parent));
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

@ -1,54 +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 __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

@ -1,79 +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 "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

@ -1,28 +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 __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

@ -1,47 +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 "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

@ -1,27 +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 __FONTS_COMMANDS_H__
#define __FONTS_COMMANDS_H__
void fonts_refresh_cmd_callback (GtkAction *action,
gpointer data);
#endif /* __FONTS_COMMANDS_H__ */

View File

@ -1,704 +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 "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/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,
GRADIENT_EDITOR_COLOR_NEIGHBOR_ENDPOINT, FALSE,
GIMP_HELP_GRADIENT_EDITOR_LEFT_LOAD },
{ "gradient-editor-load-left-right-endpoint", NULL,
N_("_Right Endpoint"), NULL, NULL,
GRADIENT_EDITOR_COLOR_OTHER_ENDPOINT, FALSE,
GIMP_HELP_GRADIENT_EDITOR_LEFT_LOAD },
{ "gradient-editor-load-left-fg", NULL,
N_("_FG Color"), NULL, NULL,
GRADIENT_EDITOR_COLOR_FOREGROUND, FALSE,
GIMP_HELP_GRADIENT_EDITOR_LEFT_LOAD },
{ "gradient-editor-load-left-bg", NULL,
N_("_BG Color"), NULL, NULL,
GRADIENT_EDITOR_COLOR_BACKGROUND, FALSE,
GIMP_HELP_GRADIENT_EDITOR_LEFT_LOAD },
LOAD_LEFT_FROM ("01", GRADIENT_EDITOR_COLOR_FIRST_CUSTOM + 0),
LOAD_LEFT_FROM ("02", GRADIENT_EDITOR_COLOR_FIRST_CUSTOM + 1),
LOAD_LEFT_FROM ("03", GRADIENT_EDITOR_COLOR_FIRST_CUSTOM + 2),
LOAD_LEFT_FROM ("04", GRADIENT_EDITOR_COLOR_FIRST_CUSTOM + 3),
LOAD_LEFT_FROM ("05", GRADIENT_EDITOR_COLOR_FIRST_CUSTOM + 4),
LOAD_LEFT_FROM ("06", GRADIENT_EDITOR_COLOR_FIRST_CUSTOM + 5),
LOAD_LEFT_FROM ("07", GRADIENT_EDITOR_COLOR_FIRST_CUSTOM + 6),
LOAD_LEFT_FROM ("08", GRADIENT_EDITOR_COLOR_FIRST_CUSTOM + 7),
LOAD_LEFT_FROM ("09", GRADIENT_EDITOR_COLOR_FIRST_CUSTOM + 8),
LOAD_LEFT_FROM ("10", GRADIENT_EDITOR_COLOR_FIRST_CUSTOM + 9)
};
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,
GRADIENT_EDITOR_COLOR_NEIGHBOR_ENDPOINT, FALSE,
GIMP_HELP_GRADIENT_EDITOR_RIGHT_LOAD },
{ "gradient-editor-load-right-left-endpoint", NULL,
N_("_Left Endpoint"), NULL, NULL,
GRADIENT_EDITOR_COLOR_OTHER_ENDPOINT, FALSE,
GIMP_HELP_GRADIENT_EDITOR_RIGHT_LOAD },
{ "gradient-editor-load-right-fg", NULL,
N_("_FG Color"), NULL, NULL,
GRADIENT_EDITOR_COLOR_FOREGROUND, FALSE,
GIMP_HELP_GRADIENT_EDITOR_RIGHT_LOAD },
{ "gradient-editor-load-right-bg", NULL,
N_("_BG Color"), NULL, NULL,
GRADIENT_EDITOR_COLOR_BACKGROUND, FALSE,
GIMP_HELP_GRADIENT_EDITOR_RIGHT_LOAD },
LOAD_RIGHT_FROM ("01", GRADIENT_EDITOR_COLOR_FIRST_CUSTOM + 0),
LOAD_RIGHT_FROM ("02", GRADIENT_EDITOR_COLOR_FIRST_CUSTOM + 1),
LOAD_RIGHT_FROM ("03", GRADIENT_EDITOR_COLOR_FIRST_CUSTOM + 2),
LOAD_RIGHT_FROM ("04", GRADIENT_EDITOR_COLOR_FIRST_CUSTOM + 3),
LOAD_RIGHT_FROM ("05", GRADIENT_EDITOR_COLOR_FIRST_CUSTOM + 4),
LOAD_RIGHT_FROM ("06", GRADIENT_EDITOR_COLOR_FIRST_CUSTOM + 5),
LOAD_RIGHT_FROM ("07", GRADIENT_EDITOR_COLOR_FIRST_CUSTOM + 6),
LOAD_RIGHT_FROM ("08", GRADIENT_EDITOR_COLOR_FIRST_CUSTOM + 7),
LOAD_RIGHT_FROM ("09", GRADIENT_EDITOR_COLOR_FIRST_CUSTOM + 8),
LOAD_RIGHT_FROM ("10", GRADIENT_EDITOR_COLOR_FIRST_CUSTOM + 9)
};
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

@ -1,28 +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 __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

@ -1,824 +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 "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 GRADIENT_EDITOR_COLOR_NEIGHBOR_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 GRADIENT_EDITOR_COLOR_OTHER_ENDPOINT:
color = editor->control_sel_r->right_color;
break;
case GRADIENT_EDITOR_COLOR_FOREGROUND:
gimp_context_get_foreground (context, &color);
break;
case GRADIENT_EDITOR_COLOR_BACKGROUND:
gimp_context_get_background (context, &color);
break;
default: /* Load a color */
color = editor->saved_colors[value - GRADIENT_EDITOR_COLOR_FIRST_CUSTOM];
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 GRADIENT_EDITOR_COLOR_NEIGHBOR_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 GRADIENT_EDITOR_COLOR_OTHER_ENDPOINT:
color = editor->control_sel_l->left_color;
break;
case GRADIENT_EDITOR_COLOR_FOREGROUND:
gimp_context_get_foreground (context, &color);
break;
case GRADIENT_EDITOR_COLOR_BACKGROUND:
gimp_context_get_background (context, &color);
break;
default: /* Load a color */
color = editor->saved_colors[value - GRADIENT_EDITOR_COLOR_FIRST_CUSTOM];
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);
gtk_dialog_set_alternative_button_order (GTK_DIALOG (dialog),
GTK_RESPONSE_OK,
GTK_RESPONSE_CANCEL,
-1);
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;
}
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

@ -1,83 +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 __GRADIENT_EDITOR_COMMANDS_H__
#define __GRADIENT_EDITOR_COMMANDS_H__
enum
{
GRADIENT_EDITOR_COLOR_NEIGHBOR_ENDPOINT,
GRADIENT_EDITOR_COLOR_OTHER_ENDPOINT,
GRADIENT_EDITOR_COLOR_FOREGROUND,
GRADIENT_EDITOR_COLOR_BACKGROUND,
GRADIENT_EDITOR_COLOR_FIRST_CUSTOM
};
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

@ -1,126 +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 "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_cmd_callback),
GIMP_HELP_GRADIENT_NEW },
{ "gradients-duplicate", GIMP_STOCK_DUPLICATE,
N_("D_uplicate Gradient"), NULL,
N_("Duplicate gradient"),
G_CALLBACK (data_duplicate_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_cmd_callback),
GIMP_HELP_GRADIENT_DELETE },
{ "gradients-refresh", GTK_STOCK_REFRESH,
N_("_Refresh Gradients"), "",
N_("Refresh gradients"),
G_CALLBACK (data_refresh_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_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

@ -1,28 +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 __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

@ -1,133 +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 "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));
gtk_dialog_set_alternative_button_order (GTK_DIALOG (chooser),
GTK_RESPONSE_OK,
GTK_RESPONSE_CANCEL,
-1);
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

@ -1,27 +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 __GRADIENTS_COMMANDS_H__
#define __GRADIENTS_COMMANDS_H__
void gradients_save_as_pov_ray_cmd_callback (GtkAction *action,
gpointer data);
#endif /* __GRADIENTS_COMMANDS_H__ */

View File

@ -1,64 +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 "config.h"
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"
#include "actions-types.h"
#include "widgets/gimpactiongroup.h"
#include "widgets/gimphelp-ids.h"
#include "help-actions.h"
#include "help-commands.h"
#include "gimp-intl.h"
static GimpActionEntry help_actions[] =
{
{ "help-menu", NULL, N_("_Help") },
{ "help-help", GTK_STOCK_HELP,
N_("_Help"), "F1", NULL,
G_CALLBACK (help_help_cmd_callback),
GIMP_HELP_HELP },
{ "help-context-help", GTK_STOCK_HELP,
N_("_Context Help"), "<shift>F1", NULL,
G_CALLBACK (help_context_help_cmd_callback),
GIMP_HELP_HELP_CONTEXT }
};
void
help_actions_setup (GimpActionGroup *group)
{
gimp_action_group_add_actions (group,
help_actions,
G_N_ELEMENTS (help_actions));
}
void
help_actions_update (GimpActionGroup *group,
gpointer data)
{
}

View File

@ -1,28 +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 __HELP_ACTIONS_H__
#define __HELP_ACTIONS_H__
void help_actions_setup (GimpActionGroup *group);
void help_actions_update (GimpActionGroup *group,
gpointer data);
#endif /* __HELP_ACTIONS_H__ */

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