1
1
mirror of https://gitlab.gnome.org/GNOME/gimp.git synced 2025-10-06 01:12:40 +02:00

Compare commits

...

316 Commits

Author SHA1 Message Date
Sven Neumann
a947208bac Made 2.0.6 release.
2004-11-02  Sven Neumann  <sven@gimp.org>

        * Made 2.0.6 release.
2004-11-02 21:15:26 +00:00
Sven Neumann
087aa171ac updated NEWS for 2.0.6 2004-11-02 18:26:59 +00:00
Sven Neumann
c43a6f2610 applied patch by Robert Ögren that fixes the workaround for bug #143542
2004-11-02  Sven Neumann  <sven@gimp.org>

	* app/text/gimptextlayout.c: applied patch by Robert Ögren that
	fixes the workaround for bug #143542 for Pango 1.2. Fixes bug #154144.
2004-11-02 13:17:02 +00:00
Sven Neumann
e5374c8132 applied patch by Joao S. O. Bueno that implements the opacity parameters
2004-10-30  Sven Neumann  <sven@gimp.org>

	* plug-ins/common/grid.c (run): applied patch by Joao S. O. Bueno
	that implements the opacity parameters the way it is documented.
	Fixes bug #156750; merged from HEAD branch.
2004-10-29 23:55:19 +00:00
Sven Neumann
41baf30cdd fixed ChangeLog entry 2004-10-29 15:22:11 +00:00
Sven Neumann
fcc5ff95ed pass the name to filesystem encoding to gimp_image_set_filename(). Fixes
2004-10-29  Sven Neumann  <sven@gimp.org>

	* plug-ins/common/jpeg.c: pass the name to filesystem encoding to
	gimp_image_set_filename(). Fixes bug #153751 for the JPEG plug-in.
2004-10-29 15:19:50 +00:00
Sven Neumann
d6633b85bf merged workaround for bug #153751 from HEAD branch.
2004-10-29  Sven Neumann  <sven@gimp.org>

	* app/file/file-utils.c (file_utils_uri_to_utf8_filename): merged
	workaround for bug #153751 from HEAD branch.
2004-10-29 13:06:51 +00:00
Sven Neumann
38b74148ea merged minor bugfix from HEAD branch.
2004-10-28  Sven Neumann  <sven@gimp.org>

	* plug-ins/common/grid.c: merged minor bugfix from HEAD branch.
2004-10-28 21:21:07 +00:00
Sven Neumann
9bd3bd3b9c merged fix for bug #138275 from HEAD branch.
2004-10-28  Sven Neumann  <sven@gimp.org>

	* plug-ins/helpbrowser/dialog.c: merged fix for bug #138275 from
	HEAD branch.
2004-10-28 18:25:04 +00:00
Sven Neumann
67eb70f598 changelog formatting 2004-10-21 21:32:44 +00:00
Laszlo Dvornik
df2d6361c8 Hungarian translation updated by Arpad Biro.
2004-10-19  Laszlo Dvornik  <dvornik@gnome.hu>

	* hu.po: Hungarian translation updated by Arpad Biro.
2004-10-19 14:57:28 +00:00
Manish Singh
159e26b100 Make sure we have a bpp value we can handle, and fail gracefully if not.
2004-10-14  Manish Singh  <yosh@gimp.org>

        * plug-ins/common/bmpread.c: Make sure we have a bpp value we can
        handle, and fail gracefully if not. Fixes bug #155401.
2004-10-14 17:17:15 +00:00
Vincent van Adrighem
8432f1ca57 Translation updated.
2004-10-13  Vincent van Adrighem  <adrighem@gnome.org>

	* nl.po: Translation updated.
2004-10-13 13:08:44 +00:00
Manish Singh
dbe739e224 Should not be in this branch 2004-10-11 21:18:45 +00:00
Nikos Charonitakis
6ae330d755 Updated Greek translation 2004-10-10 15:39:08 +00:00
Jan Morén
3bb363bff3 Updated Swedish translation.
2004-10-08  Jan Morén  <jan.moren@lucs.lu.se>

         * sv.po: Updated Swedish translation.
2004-10-08 08:20:47 +00:00
Nikos Charonitakis
e1b591ba46 Updated Greek translation and bug fix [Bug 154234] - Broken GIMP translation (Greek) 2004-10-08 00:10:02 +00:00
Manish Singh
a93c093291 Should not be in this branch 2004-10-07 16:35:23 +00:00
Michael Natterer
d7ff3d35a5 Merged from HEAD branch:
2004-10-06  Michael Natterer  <mitch@gimp.org>

	Merged from HEAD branch:

	* app/tools/gimp-tools.c (gimp_tools_restore): reset the tool
	options before deserializing so they have the correct default
	values. Fixes bug #120832.

	* app/tools/gimpbucketfilloptions.c
	* app/tools/gimpmagnifyoptions.c
	* app/tools/gimpselectionoptions.c
	* app/tools/gimptransformoptions.c: removed all set_defaults()
	utility functions and moved their code to reset(). The change
	above calls them automatically so there is no need to call them
	from the GUI constructors any more.
2004-10-06 17:26:55 +00:00
Michael Natterer
e2deafe6a0 Merged from HEAD branch:
2004-10-06  Michael Natterer  <mitch@gimp.org>

	Merged from HEAD branch:

	* app/gui/file-commands.c (file_revert_confirm_callback):
	removed the code which sets the new image on all contexts where
	the old image was set...

	* app/display/gimpdisplay-foreach.c (gimp_displays_reconnect):
	...and added it here so it happens for all calls of this function,
	also from the PDB. Fixes bug #154638.
2004-10-06 10:15:15 +00:00
David Lodge
0aea86ddd2 Updated British English translation.
2004-10-05  David Lodge <dave@cirt.net>

        * en_GB.po: Updated British English translation.
2004-10-05 22:40:42 +00:00
Adam Weinberger
2b7e1126cc Updated Canadian English translation.
* en_CA.po: Updated Canadian English translation.
2004-10-03 00:01:18 +00:00
Manish Singh
1382afcd0c These don't belong in this branch 2004-09-29 22:20:36 +00:00
Kwok-Koon Cheung
7cf3d946ee Updated traditional Chinese translation from GNOME HK Team
* zh_TW.po: Updated traditional Chinese translation from GNOME HK Team
2004-09-29 10:38:51 +00:00
Sven Neumann
230615c72a bumped version to 2.0.6, interface_age 6, binary_age 6.
2004-09-27  Sven Neumann  <sven@gimp.org>

	* configure.in: bumped version to 2.0.6, interface_age 6,
	binary_age 6.

	Merged from HEAD:

	* tools/pdbgen/pdb/fileops.pdb (file_load_thumbnail_invoker): use
	the GIMP_CHECK_SIZE_SM define, not the enum value
	GIMP_CHECK_SIZE_SMALL_CHECKS which is 0 (eeek!).

	* app/pdb/fileops_cmds.c: regenerated.
2004-09-26 23:28:13 +00:00
Pablo Gonzalo del Campo
df8c2edb2b Updated Spanish translation by Franscisco Vila
2004-09-26  Pablo Gonzalo del Campo  <pablodc@bigfoot.com>

        * es.po: Updated Spanish translation by Franscisco Vila <francisco.vila@hispalinux.es>
2004-09-26 21:39:50 +00:00
Miloslav Trmac
f824b014b7 Updated Czech translation.
2004-09-25  Miloslav Trmac  <mitr@volny.cz>

	* cs.po: Updated Czech translation.
2004-09-25 12:51:23 +00:00
Sven Neumann
f437163003 Made 2.0.5 release.
2004-09-25  Sven Neumann  <sven@gimp.org>

        * Made 2.0.5 release.
2004-09-25 00:33:56 +00:00
Sven Neumann
3dbb6f2433 shut up CVS 2004-09-24 20:42:30 +00:00
Michael Natterer
aaa656bd72 Merged from HEAD branch:
2004-09-24  Michael Natterer  <mitch@gimp.org>

	Merged from HEAD branch:

	* app/core/gimpimage-undo-push.c (undo_pop_fs_to_layer): factored
	common code out of the UNDO amd REDO cases. Use gimp_drawable_update()
	instead of gimp_viewable_invalidate_preview() so the projection
	gets updated correctly. Fixes bug #149558.
2004-09-24 18:10:33 +00:00
Sven Neumann
f59e96db48 fixed typos 2004-09-24 16:02:13 +00:00
Sven Neumann
00457601f3 NEWS update 2004-09-24 15:59:52 +00:00
Sven Neumann
558f4ffd06 Merged from HEAD branch:
2004-09-24  Sven Neumann  <sven@gimp.org>

	Merged from HEAD branch:

	* app/base/curves.[ch]
	* app/tools/gimpcurvestool.c: defined CURVES_NUM_POINTS and use it.

	* tools/pdbgen/pdb/color.pdb (curves_spline_invoker): unset the
	last control point which got initialized to (255,255) by
	curves_init(). Fixes bug #153635.

	* app/pdb/color_cmds.c: regenerated.
2004-09-24 13:41:31 +00:00
Michael Natterer
b4fed8bf53 Merged from HEAD:
2004-09-23  Michael Natterer  <mitch@gimp.org>

	Merged from HEAD:

	* app/tools/gimpairbrushtool.c (gimp_airbrush_tool_register)
	* app/tools/gimppenciltool.c (gimp_pencil_tool_register):
	add GIMP_CONTEXT_GRADIENT_MASK to the tools' context_props because
	these tools use the current gradient. Fixes bug #153584.
2004-09-23 21:39:19 +00:00
Adam Weinberger
d865e317bc Updated Canadian English translation.
* en_CA.po: Updated Canadian English translation.
2004-09-23 16:47:23 +00:00
Sven Neumann
580c889844 mark menu label as translatable (bug #153456).
2004-09-22  Sven Neumann  <sven@gimp.org>

	* app/gui/image-menu.c (image_menu_entries): mark menu label as
	translatable (bug #153456).
2004-09-22 17:51:24 +00:00
Sven Neumann
ecaa670108 workaround Pango bug #143542 (PangoFT2Fontmap leak, see also bug #148997).
2004-09-22  Sven Neumann  <sven@gimp.org>

	* app/text/gimptextlayout.c (gimp_text_get_pango_context):
	workaround Pango bug #143542 (PangoFT2Fontmap leak, see also bug
	#148997). Based on a patch by Robert gren.
2004-09-21 22:40:51 +00:00
Dave Neary
fbd3ce81ea Correctly set overlay, hard light and soft light modes from .psd files.
2004-09-21  Dave Neary  <bolsh@gimp.org>

	* plug-ins/common/psd.c: Correctly set overlay, hard light and
	soft light modes from .psd files. Fixes bug #153229.
2004-09-21 09:01:45 +00:00
Sven Neumann
8593617e43 set to 90dpi as a workaround for bug #143300.
2004-09-21  Sven Neumann  <sven@gimp.org>

	* plug-ins/common/svg.c (SVG_DEFAULT_RESOLUTION): set to 90dpi as
	a workaround for bug #143300.
2004-09-20 23:34:17 +00:00
Sven Neumann
61d62e8242 Merged fix for bug #153035 from HEAD branch:
2004-09-19  Sven Neumann  <sven@gimp.org>

	Merged fix for bug #153035 from HEAD branch:

	* app/base/tile-manager.[ch] (tile_manager_get_memsize): added a
	"gboolean sparse" parameter to get more accurate results for
	sparse tile-managers.

	* app/core/gimpbuffer.c
	* app/core/gimpdrawable.c
	* app/core/gimpimage-scale.c
	* app/core/gimpimage-undo-push.c
	* app/core/gimpimage.c
	* app/core/gimplayer.c: changed accordingly.
2004-09-19 22:00:59 +00:00
Sven Neumann
a177b6c9a3 applied a patch by Peter Kirchgessner that solves a problem with the
2004-09-19  Sven Neumann  <sven@gimp.org>

	* plug-ins/common/postscript.c (ps_open): applied a patch by Peter
	Kirchgessner that solves a problem with the recognition of the
	bounding box. Fixes bug #152829.
2004-09-19 10:55:55 +00:00
Sven Neumann
4087163bbc Fixed bug #152937.
2004-09-17  Sven Neumann  <sven@gimp.org>

	* app/gui/qmask-commands.c (qmask_query_response): Fixed bug #152937.
2004-09-17 19:45:00 +00:00
Dave Neary
bf27372150 merged patch from Kevin Cozens which reinstates corona. Fixes bug #142282.
2004-09-16  Dave Neary  <bolsh@gimp.org>

	* plug-ins/script-fu/scripts/burn-in-anim.scm: merged patch from
	Kevin Cozens which reinstates corona. Fixes bug #142282.
2004-09-16 14:51:17 +00:00
Sven Neumann
d106727394 Merged from HEAD:
2004-09-15  Sven Neumann  <sven@gimp.org>

	Merged from HEAD:

	* app/widgets/gimpcontainertreeview.c
	(gimp_container_tree_view_menu_position): improved the fix for bug
	#152662 and removed trailing whitespace.
2004-09-15 09:37:08 +00:00
Nathan Summers
a22754d861 Merged from HEAD:
2004-09-15  Nathan Summers  <rock@gimp.org>

        Merged from HEAD:

        * app/widgets/gimpcontainertreeview.c
        (gimp_container_tree_view_menu_position): clamp the popup
        menu's Y position to the visible area of the GtkTreeView.
        Fixes #152662.
2004-09-15 06:29:02 +00:00
Sven Neumann
ff131ad02e removed files that moved in the HEAD branch 2004-09-13 14:48:01 +00:00
Sven Neumann
b03b296d11 Merged from HEAD:
2004-09-13  Sven Neumann  <sven@gimp.org>

	Merged from HEAD:

	* app/widgets/gimphelp.c: simulate the behaviour of GNU gettext and
	look at the LANGUAGE environment variable if the locale is not "C".
2004-09-13 12:26:33 +00:00
Sven Neumann
7a76bbb2c8 updated 2004-09-10 17:08:51 +00:00
Helvetix Victorinox
c8e371e7dc Missed commit of ChangeLog 2004-09-10 16:50:09 +00:00
Sven Neumann
386f5413d0 added nb.po.
2004-09-10  Sven Neumann  <sven@gimp.org>

	* Makefile.am (tips_POFILES): added nb.po.
2004-09-10 15:51:20 +00:00
Adam Weinberger
71f454e0c5 Updated Canadian English translation.
* en_CA.po: Updated Canadian English translation.
2004-09-06 16:27:46 +00:00
Laurent Dhima
c1cadf1c9e Updated Albanian translation.
2004-09-03  Laurent Dhima  <laurenti@alblinux.net>

	* sq.po: Updated Albanian translation.
2004-09-03 16:21:10 +00:00
Kjartan Maraas
3e2d4fc429 Add «nb» to ALL_LINGUAS.
2004-09-02  Kjartan Maraas  <kmaraas@gnome.org>

	* configure.in: Add «nb» to ALL_LINGUAS.
2004-09-02 20:08:44 +00:00
Kjartan Maraas
b0d40cad62 Add here too.
2004-09-02  Kjartan Maraas  <kmaraas@gnome.org>

	* nb.po: Add here too.
2004-09-02 20:07:23 +00:00
Kjartan Maraas
b65778d182 Add this.
2004-09-02  Kjartan Maraas  <kmaraas@gnome.org>

	* nb.po: Add this.
2004-09-02 20:06:41 +00:00
Helvetix Victorinox
24bb1021b5 app/composite/gimp-composite-*.[ch] backported changes to composite code
* Merged from HEAD:
* app/composite/gimp-composite-*.[ch]
* app/composite/make-installer.py: backported changes to composite
	code from HEAD branch. Fixes bug #149429 and works around problems
	with the Intel compiler (bug #147013).
2004-09-01 15:35:38 +00:00
Manish Singh
aeaabf0036 Doesn't belong on this branch 2004-08-31 17:33:52 +00:00
Michael Natterer
07a742c28f Merged from HEAD:
2004-08-31  Michael Natterer  <mitch@gimp.org>

	Merged from HEAD:

	* app/paint/gimppaintoptions.[ch]: added "GimpPaintInfo *paint_info"
	member and construct property. Changed gimp_paint_options_new()
	to take only a GimpPaintInfo parameter.

	* app/core/gimpitem.c (gimp_item_stroke)
	* app/core/gimppaintinfo.c (gimp_paint_info_new): changed accordingly.

	* app/core/gimpchannel.c (gimp_channel_stroke)
	* app/vectors/gimpvectors.c (gimp_vectors_stroke): use
	paint_options->paint_info->paint_type directly instead of casting
	to GimpToolOptions and using
	tool_options->tool_info->paint_info->paint_type (eek). Fixes crash
	when stroking via the PDB because newly created GimpToolOptions
	instances have no "tool_info" pointer yet.

	* tools/pdbgen/pdb/paint_tools.pdb: changed all paint PDB wrappers
	accordingly.

	* app/pdb/paint_tools_cmds.c: regenerated.
2004-08-31 14:10:17 +00:00
Michael Natterer
55e2a38527 Merged from HEAD:
2004-08-31  Michael Natterer  <mitch@gimp.org>

	Merged from HEAD:

	* app/config/gimpconfig.c (gimp_config_iface_duplicate): set
	construct_param->foo, not construct_param*s*->foo, so we don't set
	the first construct param again and crash.
2004-08-31 13:17:53 +00:00
Miloslav Trmac
01e5860cd2 Updated Czech translation.
2004-08-31  Miloslav Trmac  <mitr@volny.cz>

	* cs.po: Updated Czech translation.
2004-08-30 23:00:53 +00:00
Sven Neumann
781bfeff9d Merged from HEAD:
2004-08-29  Sven Neumann  <sven@gimp.org>

	Merged from HEAD:

	* app/config/gimpconfigwriter.c: don't emit critical warnings
        about a messed up state of GimpConfigWriter if the writer is
        disabled because of a write error that occured earlier.
2004-08-29 12:18:33 +00:00
Sven Neumann
88c7cbc814 fixed wrong translations.
2004-08-27  Sven Neumann  <sven@gimp.org>

        * de.po: fixed wrong translations.
2004-08-28 21:31:27 +00:00
Sven Neumann
b0f3ab8d6d Merged from HEAD:
2004-08-28  Sven Neumann  <sven@gimp.org>

	Merged from HEAD:

	* plug-ins/common/vpropagate.c (run): fixed confusion about which
	mode to use when being run with last values (bug #151308).
2004-08-28 21:16:19 +00:00
Sven Neumann
37af5df3f0 updated 2004-08-28 11:59:16 +00:00
Sven Neumann
66a34010df Merged from HEAD:
2004-08-28  Sven Neumann  <sven@gimp.org>

	Merged from HEAD:

	* app/core/gimpimage-contiguous-region.c
	(find_contiguous_region_helper): applied a patch from Eric Cheung
	that changes the function to use a GQueue to implement recursion
	instead of recursive function calls. Fixes bug #151124.
2004-08-28 11:49:47 +00:00
Sven Neumann
bf9fcfdaaa fixed wrong translations.
2004-08-27  Sven Neumann  <sven@gimp.org>

	* de.po: fixed wrong translations.
2004-08-27 20:46:15 +00:00
Manish Singh
b6d436c4fc These files don't belong in this branch 2004-08-27 00:38:08 +00:00
Michael Natterer
666c3294f6 Merged from HEAD:
2004-08-26  Michael Natterer  <mitch@gimp.org>

	Merged from HEAD:

	* app/core/gimpitem.c (gimp_item_stroke): implement the whole
	paint_options fiddling here instead of in each subclass and pass
	either GimpStrokeOptions or GimpPaintOptions (instead of
	GimpStrokeOptions or GimpPaintInfo) to GimpItem::stroke().

	Also copied code from the tool_manager which makes sure we really
	use the global brush, pattern etc. if these options are checked in
	prefs. Fixes bug #150716.

	* app/core/gimpchannel.c (gimp_channel_stroke)
	* app/vectors/gimpvectors.c (gimp_vectors_stroke): removed the
	duplicated code mentioned above and simply use the paint_options
	passed.

	* app/core/gimpitem.[ch]: removed "gboolean use_default_values"
	from GimpItem::stroke().

	* app/core/gimpchannel.c
	* app/core/gimpselection.c
	* app/vectors/gimpvectors.c: changed accordingly.
2004-08-26 18:17:44 +00:00
Manish Singh
93d4f742cf These files don't belong on this branch 2004-08-26 14:13:06 +00:00
Sven Neumann
ee58e2a982 try to convert the result of gimp_directory() to UTF-8 and bail out with a
2004-08-26  Sven Neumann  <sven@gimp.org>

	* app/sanity.c (sanity_check_filename_encoding): try to convert
	the result of gimp_directory() to UTF-8 and bail out with a
	moderately helpful error message if this conversion fails. Works
	around bug #150917.
2004-08-26 09:45:34 +00:00
Manish Singh
0394948e71 Guard against bogus logical screen dimensions. Fixes bug #151053.
2004-08-25  Manish Singh  <yosh@gimp.org>

        * plug-ins/common/gifload.c: Guard against bogus logical screen
        dimensions. Fixes bug #151053.
2004-08-25 22:34:23 +00:00
Manish Singh
497ce2f767 These don't belong in this branch 2004-08-25 22:33:32 +00:00
Manish Singh
7545d5535e These don't belong in this branch 2004-08-25 15:56:02 +00:00
Manish Singh
75de158f46 These shouldn't exist on this branch 2004-08-24 17:09:32 +00:00
Amanpreet Singh Alam
29e047b2bb check 2004-08-24 11:31:26 +00:00
Sven Neumann
b3d37b02c0 merged fixes from HEAD branch.
2004-08-22  Sven Neumann  <sven@gimp.org>

	* app/vectors/gimpvectors-import.c (parse_svg_transform): merged
	fixes from HEAD branch.
2004-08-22 10:53:17 +00:00
Francisco Javier F. Serrador
597bc4ec3a Updated Spanish translation.
2004-08-21  Francisco Javier F. Serrador  <serrador@cvs.gnome.org>

	* es.po: Updated Spanish translation.
2004-08-21 15:31:58 +00:00
Sven Neumann
915f8a14bb declared global const variable as static. Fixes compiler warnings seen
2004-08-20  Sven Neumann  <sven@gimp.org>

	* plug-ins/common/gif.c: declared global const variable as static.
	Fixes compiler warnings seen with gcc 3.4.1. Merged from HEAD.
2004-08-20 20:05:03 +00:00
Laurent Dhima
2f836304cc Added Albanian translation.
2004-08-20  Laurent Dhima  <laurenti@alblinux.net>

	* sq.po: Added Albanian translation.
2004-08-20 18:19:58 +00:00
Laurent Dhima
028980f50c Added sq to ALL_LINGUAS.
2004-08-20  Laurent Dhima  <laurenti@alblinux.net>

	* configure.in: Added sq to ALL_LINGUAS.
2004-08-20 17:52:51 +00:00
Vincent van Adrighem
f206985510 Translation updated by Tino Meinen.
2004-08-18  Vincent van Adrighem  <adrighem@gnome.org>

	* nl.po: Translation updated by Tino Meinen.
2004-08-18 01:05:02 +00:00
Sven Neumann
edeb957ec8 fixed labels in CMYK mode. Fixes bug #150213.
2004-08-16  Sven Neumann  <sven@gimp.org>

	* app/widgets/gimpcolorframe.c (gimp_color_frame_update): fixed
	labels in CMYK mode. Fixes bug #150213.
2004-08-16 07:24:19 +00:00
Sven Neumann
b60c08b1d7 removed non-functional button labelled "Configure input devices". Fixes
2004-08-15  Sven Neumann  <sven@gimp.org>

	* app/widgets/gimpdevicestatus.c: removed non-functional button
	labelled "Configure input devices". Fixes bug #150177 for the
	stable branch.
2004-08-15 14:07:23 +00:00
Michael Natterer
daf96b92eb Merged from HEAD:
2004-08-09  Michael Natterer  <mitch@gimp.org>

	Merged from HEAD:

	* app/tools/gimpsheartool.[ch]: applied (modified) patch from Ari
	Pollak which enables controlling the shear direction from the
	dialog and changing the shear direction without hitting "Reset".
	Fixes bug #149467.
2004-08-09 11:13:14 +00:00
Sven Neumann
a705ed1e5e use the basename as Title, not the full filename. Fixes bug #149669;
2004-08-09  Sven Neumann  <sven@gimp.org>

	* plug-ins/common/postscript.c (save_ps_header): use the basename
	as Title, not the full filename. Fixes bug #149669; merged from HEAD.
2004-08-08 22:28:43 +00:00
Pablo Saratxaga
3e7db9a5ba fixed various po files 2004-08-08 17:48:02 +00:00
Danilo Šegan
69c383a414 Updated Serbian translation (base gimp). 2004-08-08 12:48:26 +00:00
Danilo Šegan
105b29c415 Updated Serbian translation (po-libgimp). 2004-08-08 12:28:23 +00:00
Danilo Šegan
28d29629e7 Updated Serbian translation (po-script-fu). 2004-08-08 12:27:29 +00:00
Danilo Šegan
e5435c0b82 Updated Serbian translation. 2004-08-08 12:23:26 +00:00
Sven Neumann
a7413a5846 bumped version number to 2.0.5, interface_age 5, binary_age 5.
2004-08-07  Sven Neumann  <sven@gimp.org>

	* configure.in: bumped version number to 2.0.5, interface_age 5,
	binary_age 5.

	* app/sanity.c: abort if the configured filename encoding can't be
	converted to UTF-8. Fix for bug #149464, merged from HEAD branch.
2004-08-07 19:06:50 +00:00
Sven Neumann
4b953eb74f Made 2.0.4, the 'GIMP Tipsy' release.
2004-08-05  Sven Neumann  <sven@gimp.org>

        * Made 2.0.4, the 'GIMP Tipsy' release.
2004-08-05 21:23:44 +00:00
Sven Neumann
e6e18f666e updated 2004-08-05 19:54:20 +00:00
Sven Neumann
8e5115c99f app/app_procs.c app/base/base.[ch] app/composite/Makefile.am
2004-08-05  Sven Neumann  <sven@gimp.org>

	* app/app_procs.c
	* app/base/base.[ch]
	* app/composite/Makefile.am
	* app/composite/gimp-composite-3dnow-test.c
	* app/composite/gimp-composite-3dnow.[ch]
	* app/composite/gimp-composite-altivec-test.c
	* app/composite/gimp-composite-altivec.[ch]
	* app/composite/gimp-composite-mmx-installer.c
	* app/composite/gimp-composite-mmx-test.c
	* app/composite/gimp-composite-mmx.[ch]
	* app/composite/gimp-composite-sse-installer.c
	* app/composite/gimp-composite-sse-test.c
	* app/composite/gimp-composite-sse.[ch]
	* app/composite/gimp-composite-sse2-installer.c
	* app/composite/gimp-composite-sse2-test.c
	* app/composite/gimp-composite-sse2.[ch]
	* app/composite/gimp-composite-vis-test.c
	* app/composite/gimp-composite-vis.[ch]
	* app/composite/gimp-composite-x86.h
	* app/composite/gimp-composite.[ch]
	* app/composite/make-installer.py: backported changes to composite
	code from HEAD branch. Fixes bug #149429 and works around problems
	with the Intel compiler (bug #147013).
2004-08-05 19:49:02 +00:00
Michael Natterer
921660a352 Merged from HEAD:
2004-08-05  Michael Natterer  <mitch@gimp.org>

	Merged from HEAD:

	* app/tools/gimpiscissorstool.c: increased the handle size from 8
	to 9 pixels (which is the same as in the path tool) as suggested
	in bug #134250.
2004-08-05 15:47:07 +00:00
Sven Neumann
9f711ded12 updated NEWS for 2.0.4 release 2004-08-05 12:38:39 +00:00
Adam Weinberger
17db6c7c39 Updated Canadian English translation.
* en_CA.po: Updated Canadian English translation.
2004-08-05 00:35:49 +00:00
Michael Natterer
6ec3c5acf2 Merged from HEAD:
2004-08-04  Michael Natterer  <mitch@gimp.org>

	Merged from HEAD:

	Allow URI drops from apps linked against GLib < 2.4.4 to GIMP
	linked against GLib >= 2.4.5. Fixes bug #148140.

	* app/core/gimp-utils.[ch]: added gimp_check_glib_version().

	* app/widgets/gimpdnd.c: added runtime check for GLib versions
	that encode file:// URIs correctly (>= 2.4.5). For older
	(broken) GLibs, leave the code path as is, for newer (fixed) ones,
	perform an additional check if the dropped URI is in the (broken)
	escaped-UTF-8 format and convert it to local filename encoding.

	* app/gui/gui.c: warn the user that non-ASCII filenames can't
	be used when linked against GLib 2.4.4.
2004-08-04 17:12:50 +00:00
Adam Weinberger
3079a1b32c Updated Canadian English translation.
* en_CA.po: Updated Canadian English translation.
2004-08-04 02:16:20 +00:00
Michael Natterer
23f4570e49 Merged from HEAD:
2004-08-03  Michael Natterer  <mitch@gimp.org>

	Merged from HEAD:

	* app/widgets/gimpcontainergridview.c
	(gimp_container_grid_view_item_context): ref/unref the view around
	the calls to gimp_container_view_item_selected() and _item_context()
	because the former may destroy the view which leads to a crash
	when trying the latter. Fixes bug #148955.
2004-08-03 14:57:12 +00:00
Michael Natterer
377424f281 app/tools/gimpeditselectiontool.c app/tools/gimptexttool.c
2004-08-03  Michael Natterer  <mitch@gimp.org>

	* app/tools/gimpeditselectiontool.c
	* app/tools/gimptexttool.c
	* app/widgets/gimpitemtreeview.c
	* app/widgets/gimplayertreeview.c: don't compress undos if the
	image is clean. Fixes bug #148853.
2004-08-03 14:33:17 +00:00
Francisco Javier F. Serrador
9363f125b6 Updated Spanish translation.
2004-08-01  Francisco Javier F. Serrador  <serrador@cvs.gnome.org>

	* es.po:  Updated Spanish translation.
2004-08-01 12:58:16 +00:00
Sven Neumann
634a47d42d Applied a bunch of small changes contributed by Tim Mooney to fix stack
2004-07-30  Sven Neumann  <sven@gimp.org>

	Applied a bunch of small changes contributed by Tim Mooney to fix
	stack corruption on Tru64 and Aix (bug #129867).

	* app/Makefile.am
	* plug-ins/script-fu/Makefile.am: changed the dependency order so
	that $(REGEXREPL) is linked earlier.

	* regexrepl/regex.[ch]: fixed check for __STDC__, merged upstream
	fix for re_max_failures value.
2004-07-30 20:58:07 +00:00
Sven Neumann
c9099848c5 always do the check for perl and use the substituted perl executable name
2004-07-30  Sven Neumann  <sven@gimp.org>

	* configure.in: always do the check for perl and use the
	substituted perl executable name in the call for gimp-mkenums.
	Fixes the build on platforms where perl is not available as
	/usr/bin/perl. Closes bug #148813.
2004-07-30 20:44:16 +00:00
SHIRASAKI Yasuhiro
74a3db884f Updated Japanese translation.
-- yasuhiro
2004-07-30 13:44:44 +00:00
Sven Neumann
e0bd905a96 completed last entry 2004-07-30 01:14:16 +00:00
Sven Neumann
74a4c91b4a Applied a bunch of AIX portability fixes (bug #148813):
2004-07-30  Sven Neumann  <sven@gimp.org>

	Applied a bunch of AIX portability fixes (bug #148813):

	* configure.in: when testing for Xmu library, link with -lXt -lX11.

	* app/gui/tips-parser.c
	* app/gui/user-install-dialog.c
	* app/tools/tools-enums.h
	* app/widgets/gimpdasheditor.c
	* app/widgets/widgets-enums.h
	* libgimpthumb/gimpthumb-error.h
	* libgimpwidgets/gimpcolorbutton.c
	* plug-ins/common/edge.c: removed trailing commas from enums.

	* plug-ins/common/snoise.c

	* plug-ins/imagemap/imap_cmd_move.c: no C++ style comments.

	* app/paint-funcs/paint-funcs-generic.h
	* app/paint-funcs/paint-funcs.c: use integers for bit fields.
2004-07-30 00:58:53 +00:00
Dave Neary
a866a4d356 Stop signed ints overflowing while getting the mean by replacing (a + b) /
2004-07-29  Dave Neary  <bolsh@gimp.org>

	* app/core/gimpdrawable-transform.c: Stop signed ints overflowing
	while getting the mean by replacing (a + b) / 2 with a / 2 + b / 2.
	Fixes bug #128594 for drawables less than 32K wide.
2004-07-29 11:31:16 +00:00
Sven Neumann
557b0908a8 applied patch by Kevin Cozens that moves a g_free() to the right place
2004-07-29  Sven Neumann  <sven@gimp.org>

	* plug-ins/script-fu/script-fu-scripts.c (script_fu_free_script):
	applied patch by Kevin Cozens that moves a g_free() to the right
	place (bug #148729, merged from HEAD).
2004-07-28 22:39:20 +00:00
David Lodge
541b4c0ab7 Updated British translation.
2004-07-28  David Lodge <dave@cirt.net>

        * en_GB.po: Updated British translation.
2004-07-28 21:35:59 +00:00
Sven Neumann
856bfb2254 fixed bug number in ChangeLog entry 2004-07-28 10:37:30 +00:00
William Skaggs
1d3cd13fbf Bill Skaggs <weskaggs@primate.ucdavis.edu>
* plug-ins/common/jpeg.c: changed "exif-data" back to
	"jpeg-exif-data" to fix bug #148632.
2004-07-28 01:21:49 +00:00
Michael Natterer
bfec4c3701 Merged from HEAD (fixes bug #120034, patch from Pedro Gimeno):
2004-07-28  Michael Natterer  <mitch@gimp.org>

	Merged from HEAD (fixes bug #120034, patch from Pedro Gimeno):

	* app/core/gimpimage.c (gimp_image_finalize): remove the image
	from the image hash table and set its "gimp" pointer to NULL
	*after* all layers, channels, vectors and the selection are
	finalized; otherwise these items have no chance of removing
	themselves from the item hash table (because image->gimp is
	already NULL).
2004-07-27 23:19:21 +00:00
Sven Neumann
6bc9a1825b print the help-id and help-domain to stdout if gimp was started with the
2004-07-27  Sven Neumann  <sven@gimp.org>

	* app/widgets/gimphelp.c (gimp_help): print the help-id and
	help-domain to stdout if gimp was started with the --verbose
	command-line option.
2004-07-27 11:19:11 +00:00
Sven Neumann
a49286c7f3 removed files moved in the HEAD branch 2004-07-26 21:12:46 +00:00
Sven Neumann
68dc3814e2 plug-ins/bmp/bmp.h merged patch by Brion Vibber from HEAD branch. Fixes
2004-07-26  Sven Neumann  <sven@gimp.org>

	* plug-ins/bmp/bmp.h
	* plug-ins/bmp/bmpread.c: merged patch by Brion Vibber from HEAD
	branch. Fixes extra data overflow, nonstandard 16bpp field
	arrangement and unrecognized compression (bug #143682).
2004-07-26 00:51:05 +00:00
Pedro Gimeno
45ac31a243 Fix ChangeLog (forgot bug number for previous commit):
2004-07-24  Pedro Gimeno  <pggimeno@wanadoo.es>

	* app/gui/gradient-editor-menu.c (gradient_editor_menu_update):
	Fix typo which caused warnings when Sinusoidal blending mode was
	selected for a segment. Fixes bug #148300.
2004-07-24 18:11:56 +00:00
Pedro Gimeno
c7280db1d0 Fix typo which caused warnings when Sinusoidal blending mode was selected
2004-07-24  Pedro Gimeno  <pggimeno@wanadoo.es>

	* app/gui/gradient-editor-menu.c (gradient_editor_menu_update):
	Fix typo which caused warnings when Sinusoidal blending mode was
	selected for a segment.
2004-07-24 18:02:54 +00:00
Michael Natterer
4deb81a3b0 Merged from HEAD:
2004-07-22  Michael Natterer  <mitch@gimp.org>

	Merged from HEAD:

	* tools/gimp-remote.c (main): correctly convert relative paths to
	URIs. Append the resulting URI only if it's not NULL.
2004-07-22 11:42:25 +00:00
Jan Morén
082134e591 fixed zoom text errors in Swedish translation as reported by Robert
2004-07-21  Jan Morén  <jan.moren@lucs.lu.se>

        * sv.po: fixed zoom text errors in Swedish translation as
	 reported by Robert Ögren.
2004-07-21 02:10:54 +00:00
Miloslav Trmac
d98248e30a Updated Czech translation.
2004-07-20  Miloslav Trmac  <mitr@volny.cz>

	* cs.po: Updated Czech translation.
2004-07-20 16:04:40 +00:00
Christophe Merlet
1beb952ebe Updated French translation. 2004-07-20 00:09:03 +00:00
Sven Neumann
a185bb121e bumped version number to 2.0.4, interface_age 4, binary_age 4.
2004-07-19  Sven Neumann  <sven@gimp.org>

	* configure.in: bumped version number to 2.0.4, interface_age 4,
	binary_age 4.
2004-07-19 18:45:15 +00:00
Sven Neumann
68708e7e88 backported improvements to the anti-aliasing for elliptical selections
2004-07-19  Sven Neumann  <sven@gimp.org>

	* app/core/gimpdrawable-combine.c (gimp_channel_combine_ellipse):
	backported improvements to the anti-aliasing for
        elliptical selections from HEAD branch (bug #147836).
2004-07-19 18:40:33 +00:00
Philip Lafleur
fd0206a4d2 Fixed filename in my last entry. 2004-07-18 10:01:36 +00:00
Philip Lafleur
89d89519b4 Check if the array index is legal before using it, not the other way
2004-07-18  Philip Lafleur  <plafleur@cvs.gnome.org>

	* app/paint/gimpink-blob.c (blob_make_convex): Check if the
	array index is legal before using it, not the other way around.
	Fixes bug #144856, merged from HEAD.
2004-07-18 09:33:33 +00:00
Philip Lafleur
3524e9d1f5 Fixed a write to unallocated memory that was causing crashes in various
2004-07-17  Philip Lafleur  <plafleur@cvs.gnome.org>

	* plug-ins/common/polar.c (dialog_update_preview): Fixed a
	write to unallocated memory that was causing crashes in various
	spots. Merged from HEAD.
2004-07-18 01:48:54 +00:00
Philip Lafleur
3d5359b010 moved array initialization out of variable declaration. Fixes bug #147799,
2004-07-17  Philip Lafleur  <plafleur@cvs.gnome.org>

	* plug-ins/common/polar.c (polarize_func): moved array
	initialization out of variable declaration. Fixes bug #147799,
	merged from HEAD.
2004-07-18 00:32:27 +00:00
Sven Neumann
5d8f2edfc5 Made 2.0.3 release.
2004-07-17  Sven Neumann  <sven@gimp.org>

        * Made 2.0.3 release.
2004-07-17 15:31:54 +00:00
Philip Lafleur
3ceacb2f62 Applied a patch from Brion Vibber that fixes corruption when saving
2004-07-17  Philip Lafleur  <plafleur@cvs.gnome.org>

	* plug-ins/bmp/bmpwrite.c (WriteImage): Applied a patch from
	Brion Vibber that fixes corruption when saving RLE-encoded
	BMPs on big endian hosts. Fixes bug #147759, merged from HEAD.
2004-07-17 11:38:39 +00:00
Sven Neumann
b6eaa7485e updated for 2.0.3 release.
2004-07-17  Sven Neumann  <sven@gimp.org>

	* NEWS: updated for 2.0.3 release.
2004-07-17 11:35:04 +00:00
Žygimantas Beručka
51f875ae31 Updated Lithuanian translation by Giedrius Naudžiūnas.
2004-07-17  Žygimantas Beručka  <uid0@akl.lt>

	* lt.po: Updated Lithuanian translation by Giedrius Naudžiūnas.
2004-07-17 08:24:18 +00:00
Laszlo Dvornik
187e70a294 Updated Hungarian translation by Arpad Biro.
2004-07-17  Laszlo Dvornik  <dvornik@gnome.hu>

	* hu.po: Updated Hungarian translation by Arpad Biro.
2004-07-17 08:12:18 +00:00
Dmitry Mastrukov
a8e65adcd1 ru.po: Updated Russian transaltion from Russian team <gnome-cyr@gnome.org>. 2004-07-17 07:06:46 +00:00
Sven Neumann
6614bf2ab2 changed an overly string in the selection tool options.
2004-07-17  Sven Neumann  <sven@gimp.org>

	* de.po: changed an overly string in the selection tool options.
2004-07-17 00:36:48 +00:00
Laszlo Dvornik
8de5f88f7b Updated Hungarian translation by Arpad Biro.
2004-07-15  Laszlo Dvornik  <dvornik@gnome.hu>

	* hu.po: Updated Hungarian translation by Arpad Biro.
2004-07-15 18:38:09 +00:00
Dmitry Mastrukov
3e943cdb06 ru.po: Updated Russian translation from Russian team <gnome-cyr@gnome.org>. 2004-07-15 05:04:04 +00:00
Philip Lafleur
76382c43f8 Fixed erroneously reported warning message when saving indexed layers with
2004-07-14  Philip Lafleur  <plafleur@cvs.gnome.org>

	* plug-ins/common/png.c:
	* plug-ins/common/mng.c: Fixed erroneously reported warning
	message when saving indexed layers with an alpha channel but
	no transparent pixels. Merged from HEAD.
2004-07-14 22:49:49 +00:00
Gustavo Maciel Dias Vieira
645ce7bcd6 Updated Brazilian Portuguese translation done by João S. O. Bueno
2004-07-14  Gustavo Maciel Dias Vieira  <gustavo@sagui.org>

        * pt_BR.po: Updated Brazilian Portuguese translation done by João
        S. O. Bueno <gwidion@mpc.com.br>.
2004-07-14 21:38:44 +00:00
Sven Neumann
0c1d27fbc5 plug-ins/script-fu/script-fu-console.[ch] plug-ins/script-fu/script-fu.c
2004-07-14  Sven Neumann  <sven@gimp.org>

	* plug-ins/script-fu/script-fu-console.[ch]
	* plug-ins/script-fu/script-fu.c
	* plug-ins/script-fu/siod-wrapper.[ch]
	* plug-ins/script-fu/siod/slib.c: merged fix for bug #139200
	(script-fu console freezes on long output from SIOD interpreter).
2004-07-14 16:05:24 +00:00
Philip Lafleur
005f592723 Properly check the return value of find_unused_ia_color(). The plugin will
2004-07-14  Philip Lafleur  <plafleur@cvs.gnome.org>

	* plug-ins/common/mng.c (respin_cmap): Properly check the return
	value of find_unused_ia_color(). The plugin will now save indexed
	MNGs correctly; fixes bug #139947. Also converted tabs to spaces.
2004-07-14 11:56:37 +00:00
Jan Morén
fa33e99e2f Updated Swedish translation.
2004-07-14  Jan Morén  <jan.moren@lucs.lu.se>

        * sv.po: Updated Swedish translation.
2004-07-14 11:40:24 +00:00
Sven Neumann
53fabe2f43 merged fix for bug #147328 from HEAD branch. Fixes loading of CMYK TIFF
2004-07-14  Sven Neumann  <sven@gimp.org>

	* plug-ins/common/tiff.c: merged fix for bug #147328 from HEAD
	branch. Fixes loading of CMYK TIFF images on big-endian hardware.
2004-07-14 10:56:21 +00:00
Manish Singh
a6c2fb3bf6 Removed copied files that only belong in HEAD 2004-07-13 20:56:22 +00:00
Sven Neumann
adb719833e merged some code from the HEAD branch that improves the computation of the
2004-07-13  Sven Neumann  <sven@gimp.org>

	* app/text/gimptextundo.c (gimp_text_undo_get_memsize): merged
	some code from the HEAD branch that improves the computation of
	the memory requirements for a text undo step.
2004-07-13 12:00:05 +00:00
Sven Neumann
d8e251eea4 merged fix for bug #145212 (JPEG plug-in crashes on corrupt EXIF data)
2004-07-13  Sven Neumann  <sven@gimp.org>

	* plug-ins/common/jpeg.c: merged fix for bug #145212 (JPEG plug-in
	crashes on corrupt EXIF data) from HEAD branch.
2004-07-13 11:20:51 +00:00
Sven Neumann
05c32fb5e0 plugged a tiny memory leak.
2004-07-13  Sven Neumann  <sven@gimp.org>

	* app/tools/gimptexttool.c (gimp_text_tool_create_layer): plugged
	a tiny memory leak.
2004-07-13 08:57:10 +00:00
Vincent van Adrighem
759187e16f Translation updated by Tino Meinen.
2004-07-12  Vincent van Adrighem  <adrighem@gnome.org>

	* nl.po: Translation updated by Tino Meinen.
2004-07-12 21:16:56 +00:00
Sven Neumann
650412c26c Backported the missing gimp-path-get-point-at-dist PDB function from the
2004-07-12  Sven Neumann  <sven@gimp.org>

	Backported the missing gimp-path-get-point-at-dist PDB function
	from the HEAD branch (bug #138754):

	* app/vectors/gimpstroke.[ch]: added gimp_stroke_get_point_at_dist().

	* tools/pdbgen/pdb/paths.pdb: use the API to implement
	gimp-path-get-point-at-dist.

	* app/pdb/paths_cmds.c: regenerated.
2004-07-12 16:28:38 +00:00
Michael Natterer
3696979d75 Merged from HEAD:
2004-07-12  Michael Natterer  <mitch@gimp.org>

	Merged from HEAD:

	* plug-ins/script-fu/scripts/round-corners.scm: applied patch from
	Dave Neary that changes the behavior from undo disable/enable to
	using an undo group if the script doesn't work on a copy of the
	image. Fixes bug #146344.
2004-07-12 16:16:11 +00:00
Sven Neumann
beee5710bf updated NEWS for 2.0.3 2004-07-12 12:10:12 +00:00
Sven Neumann
f7b7907767 applied a patch from Brion Vibber that sets the 'Save color values from
2004-07-12  Sven Neumann  <sven@gimp.org>

	* plug-ins/common/tiff.c: applied a patch from Brion Vibber that
	sets the 'Save color values from transparent pixels' insensitive
	when there's no alpha channel. Merged from HEAD branch.
2004-07-12 07:41:57 +00:00
Philip Lafleur
5a06a4dfa4 Fixed typo. 2004-07-11 03:27:03 +00:00
Philip Lafleur
306b29a2d7 Applied a patch from Robert Robert Ögren, moved here from
2004-07-11  Philip Lafleur  <plafleur@cvs.gnome.org>

	* app/widgets/gimpdevices.c (gimp_devices_check_change):
	Applied a patch from Robert Robert Ögren, moved here from
	toolbox_check_device() - Only change devices if the event came from
	a widget that accepts extension events.
	Fixes bug #115774, merged from HEAD.
2004-07-11 03:22:21 +00:00
Vincent van Adrighem
d60c156eb4 Translation updated by Tino Meinen.
2004-07-10  Vincent van Adrighem  <adrighem@gnome.org>

	* nl.po: Translation updated by Tino Meinen.
2004-07-10 14:59:43 +00:00
Artur Flinta
ef36480919 Updated Polish translation by GNOME PL Team.
2004-07-09  Artur Flinta  <aflinta@cvs.gnome.org>

	* pl.po: Updated Polish translation by GNOME PL Team.
2004-07-09 18:46:18 +00:00
Sigurd Gartmann
9e8991b0cb Updated Norwegian Bokmål translation.
2004-07-08  Sigurd Gartmann  <sigurd-translate@brogar.org>

	* no.po: Updated Norwegian Bokmål translation.
2004-07-08 16:38:05 +00:00
Sigurd Gartmann
985568cf07 Bugfix update of Norwegian Bokmål translation.
2004-07-08  Sigurd Gartmann  <sigurd-translate@brogar.org>

	* no.po: Bugfix update of Norwegian Bokmål translation.
2004-07-08 16:18:17 +00:00
Sigurd Gartmann
7f41fb21f3 Updated Norwegian Bokmål translation.
2004-07-08  Sigurd Gartmann  <sigurd-translate@brogar.org>

	* no.po: Updated Norwegian Bokmål translation.
2004-07-08 16:08:36 +00:00
Sven Neumann
f66e5073c9 some minor updates to the german translation.
2004-07-08  Sven Neumann  <sven@gimp.org>

	* de.po: some minor updates to the german translation.
2004-07-08 15:45:46 +00:00
Jan Morén
d054e6321c Updated Swedish translation.
2004-07-08  Jan Morén  <jan.moren@lucs.lu.se>

        * sv.po: Updated Swedish translation.
2004-07-08 04:09:21 +00:00
Jan Morén
1a4904f97c Updated Swedish translation.
2004-07-07  Jan Morén  <jan.moren@lucs.lu.se>

        * sv.po: Updated Swedish translation.
2004-07-08 03:07:46 +00:00
Michael Natterer
5249edb004 Merged from HEAD:
2004-07-07  Michael Natterer  <mitch@gimp.org>

	Merged from HEAD:

	Made the undo system robust against the currently pushed undo
	being too large according to prefs settings. Fixes bug #145379.

	* app/core/gimpimage-undo.[ch] (gimp_image_undo_push_undo)
	(gimp_image_undo_group_end): emit "undo-event" *before* calling
	gimp_image_undo_free_space() so the undo history doesn't try to
	remove an item that has never been added.

	(gimp_image_undo_push_undo): added boolean return value indicating
	if the undo could be pushed (FALSE means the undo was to large
	and was discarded right away).

	(gimp_image_undo_push_item): return NULL if the above returned
	FALSE.

	* app/core/gimpimage-undo-push.c (gimp_image_undo_push_text_layer):
	changed accordingly.
2004-07-07 14:03:58 +00:00
Laszlo Dvornik
019641f530 Updated Hungarian translation by Arpad Biro.
2004-07-07  Laszlo Dvornik  <ldvornik@cvs.gnome.org>

	* hu.po: Updated Hungarian translation by Arpad Biro.
2004-07-07 12:07:22 +00:00
Francisco Javier F. Serrador
0cf0a0e840 Updated Spanish translation.
2004-07-05  Francisco Javier F. Serrador  <serrador@cvs.gnome.org>

	* es.po: Updated Spanish translation.
2004-07-05 21:27:01 +00:00
Sven Neumann
40fec6e22a fixed my last ChangeLog entry 2004-07-05 19:06:30 +00:00
Sven Neumann
da596775cb include missing gimppaths.xml and gimppatterns.xml.
2004-07-05  Sven Neumann  <sven@gimp.org>

	* libgimp/libgimp-docs.sgml: include missing gimppaths.xml and
	gimppatterns.xml.
2004-07-05 19:03:27 +00:00
Sven Neumann
6e4a57cc1c include gimpenums.xml and gimppaths.xml.
2004-07-05  Sven Neumann  <sven@gimp.org>

	* libgimp/libgimp-docs.sgml:  include gimpenums.xml and gimppaths.xml.
2004-07-05 18:47:30 +00:00
Michael Natterer
a5344b8fd2 Merged from HEAD:
2004-07-05  Michael Natterer  <mitch@gimp.org>

	Merged from HEAD:

	* app/tools/gimpcolorizetool.c (gimp_colorize_tool_initialize):
	return TRUE if initialization was successful. Makes the
	tool->drawable pointer being set correctly by the calling code and
	fixes bugs where colorize was leaving the drawable in a modified
	but non-undoable state when cancelling or changing images.
2004-07-05 12:56:04 +00:00
Michael Natterer
da81090f2c disabled code that was accidentially enabled and broke persistence of many
2004-07-05  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpcontext.c (gimp_context_serialize_property):
	disabled code that was accidentially enabled and broke persistence
	of many tool options settings and of the context part of devicerc.
2004-07-05 11:53:18 +00:00
Miloslav Trmac
b8e3f199dd Updated Czech translation.
2004-07-05  Miloslav Trmac  <mitr@volny.cz>

	* cs.po: Updated Czech translation.
2004-07-05 10:28:48 +00:00
Roman Joost
4091bdd8c2 Updated german translation, fixed misspelled translations spotted by
2004-07-04  Roman Joost <roman@bromeco.de>

        * de.po: Updated german translation, fixed misspelled translations
          spotted by Michael Schumacher
2004-07-04 15:43:33 +00:00
Sven Neumann
7739c9a2bd don't attempt to store a pointer to the last used filename in the plug-in
2004-07-04  Sven Neumann  <sven@gimp.org>

	* plug-ins/common/channel_mixer.c: don't attempt to store a
	pointer to the last used filename in the plug-in parameter
	struct. Fixes bug #145380; merged from HEAD branch.
2004-07-04 13:40:55 +00:00
Žygimantas Beručka
264b2365c2 Updated Lithuanian translation by Giedrius Naudžiūnas.
2004-07-02  Žygimantas Beručka  <uid0@akl.lt>

	* lt.po: Updated Lithuanian translation by Giedrius Naudžiūnas.
2004-07-02 18:04:09 +00:00
Roman Joost
0201e18ab4 Updated german translation
2004-07-01  Roman Joost <roman@bromeco.de>

        * de.po: Updated german translation
2004-07-01 21:13:47 +00:00
Michael Schumacher
396877344a there seems to be no reason why this plug-in should not work on INDEXED*
2004-07-01  Michael Schumacher  <schumaml@cvs.gnome.org>

	* plug-ins/common/align_layers.c: there seems to be no reason why
	this plug-in should not work on INDEXED* images, added it to the
	registered image types
2004-07-01 20:26:13 +00:00
Sven Neumann
40e157cd3c fixed a wrong translation.
2004-07-01  Sven Neumann  <sven@gimp.org>

	* de.po: fixed a wrong translation.
2004-07-01 19:30:23 +00:00
Sven Neumann
b9d9e6b536 bumped version number to 2.0.3, interface_age 3, binary_age 3.
2004-06-28  Sven Neumann  <sven@gimp.org>

	* configure.in: bumped version number to 2.0.3, interface_age 3,
	binary_age 3.
2004-06-28 14:50:22 +00:00
Michael Natterer
b42996f657 Merged from HEAD:
2004-06-28  Michael Natterer  <mitch@gimp.org>

	Merged from HEAD:

	Fixed bug #141930 while keeping bug #132322 fixed:

	* app/base/curves.c (curves_lut_func)
	* app/base/levels.c (levels_lut_func): changed meaning of channel
	slots for GRAYA images: just as for GRAY images, expect the value
	channel in slot 0 and the alpha channel in slot 1, so it matches
	the meaning of slots of GimpHistogram (before this change, only
	GRAY images had their value in slot 0 and GRAYA images had it in
	slot 1, whereas the histogram had the value channel in slot 0,
	which was breaking auto levels for GRAYA images).

	* app/tools/gimpcurvestool.c
	* app/tools/gimplevelstool.c
	* tools/pdbgen/pdb/color.pdb: adjusted channel fiddling for GRAY
	and GRAYA images accordingly.

	* app/tools/gimpcurvestool.c (curves_update)
	* app/tools/gimplevelstool.c (levels_update): call
	gimp_color_bar_set_buffers() with the right buffers.
2004-06-28 14:40:14 +00:00
Funda Wang
928235712e Updated Simplified Chinese translation 2004-06-26 10:11:18 +00:00
Sven Neumann
651a9a55f4 define timersub() macro in case it's undefined. Patch by Tim Mooney, fixes
2004-06-22  Sven Neumann  <sven@gimp.org>

	* app/composite/gimp-composite-regression.c: define timersub()
	macro in case it's undefined. Patch by Tim Mooney, fixes 'make
	check' on Tru64 (bug #144780). Merged from HEAD branch.
2004-06-22 18:12:01 +00:00
Sven Neumann
07b1f8f34b use gimp_rgb_distance() for flat color areas. Fixes bug #144786; merged
2004-06-22  Sven Neumann  <sven@gimp.org>

	* libgimpwidgets/gimpcolorarea.c (gimp_color_area_set_color): use
	gimp_rgb_distance() for flat color areas. Fixes bug #144786;
	merged from HEAD.
2004-06-22 09:30:20 +00:00
Andras Timar
0cdeabe94c Updated Hungarian translation.
2004-06-20  Andras Timar  <timar@gnome.hu>

	* hu.po: Updated Hungarian translation.
2004-06-20 18:48:17 +00:00
Pedro Gimeno
4c183e1f58 Fix typos and improve documentation. Merged from HEAD. Addresses bug
2004-06-19  Pedro Gimeno  <pggimeno@wanadoo.es>

	* tools/pdbgen/pdb/paths.pdb: Fix typos and improve documentation.
	Merged from HEAD. Addresses bug #144267.

	* app/pdb/paths_cmds.c
	* libgimp/gimppaths_pdb.c: regenerated.
2004-06-19 16:18:47 +00:00
Sven Neumann
d68136c63b moved array initialization out of variable declaration (bug #144632).
2004-06-19  Sven Neumann  <sven@gimp.org>

	* app/vectors/gimpbezierstroke.c (arcto_ellipsesegment): moved
	array initialization out of variable declaration (bug #144632).
2004-06-19 10:45:45 +00:00
Sven Neumann
4d995532e5 use G_SQRT2 to make circlemagic a constant value so we can initialize the
2004-06-19  Sven Neumann  <sven@gimp.org>

	* app/vectors/gimpbezierstroke.c (arcto_ellipsesegment): use
	G_SQRT2 to make circlemagic a constant value so we can initialize
	the array on declaration. Fixes bug #144632; merged from HEAD.
2004-06-19 09:22:05 +00:00
Philip Lafleur
74fadffc58 reverted my previous change.
2004-06-18  Philip Lafleur  <plafleur@cvs.gnome.org>

	* app/tools/gimptransformtool.c: reverted my previous change.
2004-06-18 10:51:34 +00:00
Philip Lafleur
647f48646f If transforming a path, use the path bounds rather than the mask bounds.
2004-06-18  Philip Lafleur  <plafleur@cvs.gnome.org>

	* app/tools/gimptransformtool.c (gimp_transform_tool_bounds):
	If transforming a path, use the path bounds rather than the mask
	bounds. Fixes bug #144570. Merged from HEAD.
2004-06-18 06:13:11 +00:00
Dmitry Mastrukov
b3a2df5d84 ru.po: Updated Russian translation from Russian team <gnome-cyr@gnome.org>. 2004-06-17 05:06:17 +00:00
Dmitry Mastrukov
114f96ebd8 ru.po: Update Russian translation from Russian team <gnome-cyr@gnome.org>. 2004-06-17 05:00:24 +00:00
Andras Timar
2f26dfa441 Updated Hungarian translation.
2004-06-15  Andras Timar  <timar@gnome.hu>

	* hu.po: Updated Hungarian translation.
2004-06-16 13:47:06 +00:00
Pablo G. del Campo
f2a1476a9f Updated Spanish translation by Francisco Vila
2004-06-15  Pablo G. del Campo <pablodc@bigfoot.com>

        * es.po: Updated Spanish translation by
        Francisco Vila <francisco.vila@hispalinux.es>.
2004-06-16 01:15:39 +00:00
Sven Neumann
ea1716b5c3 Made 2.0.2 release.
2004-06-15  Sven Neumann  <sven@gimp.org>

        * Made 2.0.2 release.
2004-06-15 12:19:49 +00:00
Philip Lafleur
e10f48a25f Don't round texture coordinates when not using interpolation. Fixes bug
2004-06-15  Philip Lafleur  <plafleur@cvs.gnome.org>

	* app/core/gimpdrawable-transform.c (gimp_drawable_transform_tiles_affine):
	Don't round texture coordinates when not using interpolation. Fixes
	bug #144352 for the nearest neighbor case only. Merged from HEAD.
2004-06-15 11:30:09 +00:00
Sven Neumann
7f90720b9f applied the fix for empty colormaps (bug #143009) here as well. Merged
2004-06-15  Sven Neumann  <sven@gimp.org>

	* plug-ins/common/mng.c (respin_cmap): applied the fix for empty
	colormaps (bug #143009) here as well. Merged from HEAD branch.
2004-06-15 11:23:14 +00:00
Sven Neumann
545ad59164 regenerated (using a newer version of gtk-doc) 2004-06-15 11:10:59 +00:00
Sven Neumann
567186464c bumped version number to 2.0.2, interface_age 2, binary_age 2.
2004-06-15  Sven Neumann  <sven@gimp.org>

	* configure.in: bumped version number to 2.0.2, interface_age 2,
	binary_age 2.
2004-06-15 11:09:09 +00:00
Henrik Brix Andersen
0310333ffe let extensions run synchronously when called via PDB. Fixes bug #140112.
2004-06-14 Henrik Brix Andersen <brix@gimp.org>

* app/plug-in/plug-in-run.c: let extensions run synchronously when
called via PDB. Fixes bug #140112. Merged from HEAD.
2004-06-14 11:59:15 +00:00
Manish Singh
96fee5b9a2 Make sure PangoFT2 is using a recent enough fontconfig since many people
2004-06-13  Manish Singh  <yosh@gimp.org>

        * configure.in: Make sure PangoFT2 is using a recent enough fontconfig
        since many people have broken and confused setups.
2004-06-14 02:37:16 +00:00
Manish Singh
561ef38181 Reorged, to address bug #142907 and bug #143069. Accel implementations
2004-06-13  Manish Singh  <yosh@gimp.org>

        * app/base/cpu-accel.c: Reorged, to address bug #142907 and
        bug #143069. Accel implementations #define HAVE_ACCEL, and cpu_accel()
        keys on that. Both PPC and X86 implementations check for __GNUC__.
        X86 stuff is only used with USE_MMX is defined. The SSE OS check
        is now checked in arch_accel(), not cpu_accel(). Finally, the
        arch x86_64 checks now are EM64T aware (which didn't matter in
        practice).
2004-06-14 00:53:30 +00:00
Sven Neumann
1b5f136e47 ChangeLog formatting 2004-06-09 11:14:14 +00:00
Sven Neumann
dd4db1fe4f added ca.po (Catalan).
2004-06-09  Sven Neumann  <sven@gimp.org>

	* Makefile.am (tips_POFILES): added ca.po (Catalan).
2004-06-09 11:10:50 +00:00
Jordi Mallach
4da269cbe5 Added Catalan translation by Xavier Beà <xbea@pie.xtec.es>. 2004-06-08 10:39:51 +00:00
Jordi Mallach
62f099449d Updated Catalan translation by Xavier Beà <xbea@pie.xtec.es>. 2004-06-08 10:26:10 +00:00
Jordi Mallach
d78fdbdee4 Updated Catalan translation by Xavier Conde Rueda <xaviconde@eresmas.com>. 2004-06-08 10:23:08 +00:00
Jordi Mallach
8d3b43c579 Updated Catalan translation by Xavier Beà <xbea@pie.xtec.es>. 2004-06-08 08:47:05 +00:00
Pablo G. del Campo
0b573cb5c4 Updated Spanish translation by Francisco Vila
2004-06-07 Pablo G. del Campo <pablodc@bigfoot.com>

        * es.po: Updated Spanish translation by
                 Francisco Vila <francisco.vila@hispalinux.es>.
2004-06-08 01:27:13 +00:00
Sven Neumann
201f8bcce4 Updated Brazilian Portuguese translation from Joao S. O. Bueno
2004-06-07  Sven Neumann  <sven@gimp.org>

	* pt_br.po: Updated Brazilian Portuguese translation
	from Joao S. O. Bueno <gwidion@mpc.com.br>.
2004-06-07 22:04:15 +00:00
Sven Neumann
21c2817d84 Updated Brazilian Portuguese translation from Joao S. O. Bueno
2004-06-07  Sven Neumann  <sven@gimp.org>

	* pt_br.po: Updated Brazilian Portuguese translation
	from Joao S. O. Bueno <gwidion@mpc.com.br>.
2004-06-07 18:49:15 +00:00
Michael Natterer
766c2e84f1 Merged from HEAD:
2004-06-07  Michael Natterer  <mitch@gimp.org>

	Merged from HEAD:

	* app/core/gimplayer.c (gimp_layer_set_tiles): don't set
	layer->mask's offsets. It is wrong because GimpDrawable::set_tiles()
	is a lowlevel function which is used by stuff like scale and
	resize which keep the mask in sync explicitely and don't expect it
	to be moved in the middle of chaining up. Fixes bug #143860.
2004-06-07 15:14:45 +00:00
Miloslav Trmac
9286c8f9b8 Updated Czech translation.
2004-06-07  Miloslav Trmac  <mitr@volny.cz>

	* cs.po: Updated Czech translation.
2004-06-07 09:16:55 +00:00
Sven Neumann
399303f963 fixed typo that caused corruption of first row. Spotted by William Skaggs,
2004-06-07  Sven Neumann  <sven@gimp.org>

	* plug-ins/common/blur.c: fixed typo that caused corruption of
	first row. Spotted by William Skaggs, bug #142318.
2004-06-07 09:06:41 +00:00
Sven Neumann
c67ee1e116 applied a patch from Henrik Brix Andersen that tells the user that Curve
2004-06-05  Sven Neumann  <sven@gimp.org>

	* plug-ins/common/curve_bend.c: applied a patch from Henrik Brix
	Andersen that tells the user that Curve Bend cannot operate on
	layers with masks instead of silently applying the mask
	(bug #134748).
2004-06-05 19:21:14 +00:00
Sven Neumann
94b85f6773 merged a patch from Philip Lafleur that makes the plug-in handle images
2004-06-05  Sven Neumann  <sven@gimp.org>

	* plug-ins/sgi/sgi.c: merged a patch from Philip Lafleur that
	makes the plug-in handle images with more than 4 channels. At the
	moment the extra information is discarded (bug #143673).
2004-06-05 18:45:16 +00:00
Sven Neumann
0b65037ad4 save the proper value for type of alpha channel. Fixes bug #143522; patch
2004-06-05  Sven Neumann  <sven@gimp.org>

	* plug-ins/common/tiff.c: save the proper value for type of alpha
	channel. Fixes bug #143522; patch by Philip Lafleur merged from
	HEAD branch.
2004-06-05 10:28:21 +00:00
Sven Neumann
b67ccf9ce0 removed a redundant transformation (merged from HEAD branch).
2004-06-05  Sven Neumann  <sven@gimp.org>

	* app/text/gimptext-bitmap.c (gimp_text_render_bitmap): removed a
	redundant transformation (merged from HEAD branch).
2004-06-04 23:46:10 +00:00
Sven Neumann
39e1e6ee66 set the focus on the text area (merged from HEAD branch).
2004-06-04  Sven Neumann  <sven@gimp.org>

	* app/widgets/gimptexteditor.c (gimp_text_editor_new): set the
	focus on the text area (merged from HEAD branch).
2004-06-04 18:19:03 +00:00
Sven Neumann
c0327acc92 allow to move a text layer using the cursor keys (merged from HEAD
2004-06-04  Sven Neumann  <sven@gimp.org>

	* app/tools/gimptexttool.c (gimp_text_tool_class_init): allow to
	move a text layer using the cursor keys (merged from HEAD branch).
2004-06-04 17:53:51 +00:00
Sven Neumann
8d627bdfaf applied a patch by Philip Lafleur that changes the default to FALSE. Fixes
2004-06-04  Sven Neumann  <sven@gimp.org>

	* app/paint/gimppaintoptions.c (DEFAULT_PRESSURE_PRESSURE):
	applied a patch by Philip Lafleur that changes the default to
	FALSE. Fixes bug #143626; merged from HEAD branch.
2004-06-04 09:46:52 +00:00
Sven Neumann
eee0e57b5a suggest to use gimp-print 4.2.7-pre1 in case of problems (see bug
2004-06-02  Sven Neumann  <sven@gimp.org>

	* INSTALL: suggest to use gimp-print 4.2.7-pre1 in case of problems
	(see bug #138273).
2004-06-02 11:05:29 +00:00
Sven Neumann
68599dbc7e don't call gtk_entry_set_text() with a NULL text. Merged from HEAD branch.
2004-06-01  Sven Neumann  <sven@gimp.org>

	* plug-ins/common/tiff.c: don't call gtk_entry_set_text() with a
	NULL text. Merged from HEAD branch.
2004-06-01 17:15:42 +00:00
Funda Wang
18d8c970f5 Updated Simplified Chinese translation 2004-06-01 12:05:47 +00:00
Adam Weinberger
4f6b93c803 Updated Canadian English translation.
* po/en_CA.po
	  po-plug-ins/en_CA.po:

	  Updated Canadian English translation.
2004-05-30 21:33:10 +00:00
Andras Timar
ec80c3a04a Updated Hungarian translation.
2004-05-29  Andras Timar  <timar@gnome.hu>

	* hu.po: Updated Hungarian translation.
2004-05-29 17:21:47 +00:00
Sven Neumann
664e4f05af reset the file type menu to "By Extension". Based on a patch from Philip
2004-05-29  Sven Neumann  <sven@gimp.org>

        * app/widgets/gimpfiledialog.[ch]: reset the file type menu to "By
        Extension". Based on a patch from Philip Lafleur (bug #141535).
2004-05-29 12:32:28 +00:00
Sven Neumann
5f902811e6 tools/pdbgen/pdb/layer.pdb app/pdb/layer_cmds.c fixed documentation for
2004-05-29  Sven Neumann  <sven@gimp.org>

	* tools/pdbgen/pdb/layer.pdb
	* app/pdb/layer_cmds.c
	* libgimp/gimplayer_pdb.c: fixed documentation for gimp_resize_layer.
	Patch provided by Philip Lafleur (bug #142618, merged from HEAD).
2004-05-29 11:31:39 +00:00
Andras Timar
8a048d8e2b added hu.po (Hungarian). Added Hungarian translation
2004-05-28  Andras Timar  <timar@gnome.hu>

	* Makefile.am (tips_POFILES): added hu.po (Hungarian).
	* hu.po: Added Hungarian translation
2004-05-28 20:34:09 +00:00
Andras Timar
ba858645c1 Updated Hungarian translation.
2004-05-28  Andras Timar  <timar@gnome.hu>

	* hu.po: Updated Hungarian translation.
2004-05-28 20:29:26 +00:00
Sven Neumann
104334e02a handle an empty colormap. Fixes bug #143009, merged from HEAD branch.
2004-05-27  Sven Neumann  <sven@gimp.org>

	* plug-ins/common/png.c (respin_cmap): handle an empty colormap.
	Fixes bug #143009, merged from HEAD branch.
2004-05-27 15:24:52 +00:00
Sven Neumann
60776ef93f applied patch from Philip Lafleur that fixes color picking for XInput
2004-05-27  Sven Neumann  <sven@gimp.org>

	* libgimpwidgets/gimppickbutton.c: applied patch from Philip
	Lafleur that fixes color picking for XInput devices (bug #143166).
2004-05-27 15:13:53 +00:00
Sven Neumann
a37780d572 fixed handling of grid offsets in the grid drawing routine. Merged from
2004-05-27  Sven Neumann  <sven@gimp.org>

	* app/display/gimpdisplayshell-draw.c
	(gimp_display_shell_draw_grid): fixed handling of grid offsets in
	the grid drawing routine. Merged from HEAD.
2004-05-27 14:55:43 +00:00
Miloslav Trmac
68a6b2ed3f Updated Czech translation.
2004-05-27  Miloslav Trmac  <mitr@volny.cz>

	* cs.po: Updated Czech translation.
2004-05-27 12:12:19 +00:00
Gareth Owen
5c9b2d2b9a Updated British English translation 2004-05-26 23:03:43 +00:00
Sven Neumann
4c1728e2cc do not install test-sphere.scm in the stable branch.
2004-05-26  Sven Neumann  <sven@gimp.org>

	* plug-ins/script-fu/scripts/Makefile.am: do not install
	test-sphere.scm in the stable branch.
2004-05-26 17:59:39 +00:00
Sven Neumann
2554608019 removed moved files from stable branch 2004-05-26 15:32:17 +00:00
Gareth Owen
f235e64621 Updated British English translation 2004-05-26 00:01:20 +00:00
Sven Neumann
7319c3b6af removed moved files from stable branch 2004-05-24 16:38:15 +00:00
Sven Neumann
08bcc1a40f fixed range check of blur type parameter (bug #142965).
2004-05-24  Sven Neumann  <sven@gimp.org>

	* plug-ins/common/mblur.c: fixed range check of blur type
	parameter (bug #142965).
2004-05-24 13:50:54 +00:00
Sven Neumann
4df9d2856f added lt.po (Lithuanian).
2004-05-24  Sven Neumann  <sven@gimp.org>

        * Makefile.am (tips_POFILES): added lt.po (Lithuanian).
2004-05-24 13:05:21 +00:00
Sven Neumann
7e9b407fff Applied a patch from Philip Lafleur (bug #142808):
2004-05-24  Sven Neumann  <sven@gimp.org>

	Applied a patch from Philip Lafleur (bug #142808):

	* app/paint/gimppaintcore.h: define PRESSURE_SCALE to 1.5

	* app/paint/gimpairbrush.c
	* app/paint/gimpclone.c
	* app/paint/gimpconvolve.c
	* app/paint/gimpdodgeburn.c
	* app/paint/gimperaser.c
	* app/paint/gimppaintbrush.c
	* app/paint/gimpsmudge.c: use the PRESSURE_SCALE constant.
2004-05-24 13:01:16 +00:00
Zygimantas Berucka
35c9058ef9 Updated Lithuanian translation.
2004-05-24  Zygimantas Berucka  <uid0@akl.lt>

	* lt.po: Updated Lithuanian translation.
2004-05-24 12:24:13 +00:00
Sven Neumann
39adf33de4 added "lt" (Lithuanian) to ALL_LINGUAS.
2004-05-24  Sven Neumann  <sven@gimp.org>

	* configure.in: added "lt" (Lithuanian) to ALL_LINGUAS.
2004-05-24 06:49:16 +00:00
Zygimantas Berucka
0e8e9434de Updated Lithuanian translation.
2004-05-24  Zygimantas Berucka  <uid0@akl.lt>

	* lt.po: Updated Lithuanian translation.
2004-05-24 06:29:28 +00:00
Zygimantas Berucka
791eb8e03d Updated Lithuanian translation.
2004-05-24  Zygimantas Berucka  <uid0@akl.lt>

	* lt.po: Updated Lithuanian translation.
2004-05-24 05:20:23 +00:00
Sven Neumann
4624b2875e More fixes for bug #142996, merged from HEAD branch:
2004-05-23  Sven Neumann  <sven@gimp.org>

	More fixes for bug #142996, merged from HEAD branch:

	* plug-ins/common/postscript.c
	* plug-ins/common/sparkle.c
	* plug-ins/common/sunras.c
	* plug-ins/common/uniteditor.c
	* plug-ins/fits/fits.c: fixed typos.
2004-05-23 21:13:46 +00:00
Sven Neumann
613ff5f97d Fixes for bug #142996, merged from HEAD branch:
2004-05-23  Sven Neumann  <sven@gimp.org>

	Fixes for bug #142996, merged from HEAD branch:

	* app/gui/preferences-dialog.c: added missing gettext call.

	* app/config/gimprc-blurbs.h
	* app/core/gimptemplate.c
	* app/gui/gradient-editor-menu.c: fixed typos.
2004-05-23 21:03:18 +00:00
Andras Timar
50cfa04608 Updated Hungarian translation.
2004-05-23  Andras Timar  <timar@gnome.hu>

	* hu.po: Updated Hungarian translation.
2004-05-23 15:55:17 +00:00
Henrik Brix Andersen
0733f8f318 added plug-ins/MapObject/mapobject_apply.c and plug-ins/maze/maze.h. Fixes
2004-05-23 Henrik Brix Andersen <brix@gimp.org>

* po-plugins/POTFILES.in: added plug-ins/MapObject/mapobject_apply.c
and plug-ins/maze/maze.h. Fixes part of bug #142996, merged from HEAD
branch

* app/config/gimprc-blurbs.h
* plug-ins/gfig/gfig-spiral.c (spiral_button_press)
* plug-ins/gimpressionist/orientation.c (create_orientationpage)
* plug-ins/common/diffraction.c (diffraction_dialog)
* plug-ins/common/bumpmap.c (bumpmap_dialog)
* plug-ins/maze/maze.h
* plug-ins/MapObject/mapobject_apply.c (compute_image)
* app/tools/gimpmeasuretool.c (gimp_measure_tool_dialog_update)
* plug-ins/print/gimp_main_window.c (create_scaling_frame): marked
strings for translation, corrected small typos. Fixes part of bug
#142996, merged from HEAD branch
2004-05-23 12:46:26 +00:00
Sven Neumann
d2f6d4a00d better fix for bug #123811, merged from HEAD branch.
2004-05-21  Sven Neumann  <sven@gimp.org>

	* app/paint/gimppaintcore.c (gimp_paint_core_interpolate): better
	fix for bug #123811, merged from HEAD branch.
2004-05-21 15:24:42 +00:00
Michael Natterer
b81f01bb1c delete the data only if "OK" was pressed.
2004-05-21  Michael Natterer  <mitch@gimp.org>

	* app/widgets/gimpdatafactoryview.c
	(gimp_data_factory_view_delete_callback): delete the data
	only if "OK" was pressed.
2004-05-20 22:38:13 +00:00
Andras Timar
a0c4eeba91 Updated Hungarian translation.
2004-05-20  Andras Timar  <timar@gnome.hu>

	* hu.po: Updated Hungarian translation.
2004-05-20 12:32:45 +00:00
Manish Singh
d32465a9ee vte sucks 2004-05-20 02:35:45 +00:00
Manish Singh
625285b3f3 Actually return values from the run function. Fixes #141338.
2004-05-19  Manish Singh  <yosh@gimp.org>

        * plug-ins/pygimp/gimpfu.py: Actually return values from the run
        function. Fixes #141338.
2004-05-20 02:29:10 +00:00
Sven Neumann
672446e942 make sure that pressure never becomes negative. Fix for bug #123811,
2004-05-19  Sven Neumann  <sven@gimp.org>

	* app/paint/gimppaintcore.c (gimp_paint_core_interpolate): make
	sure that pressure never becomes negative. Fix for bug #123811,
	merged from HEAD branch.
2004-05-19 10:33:25 +00:00
Sven Neumann
045ed12dd7 fixed wrong use of layer ID; bug #142326, merged from HEAD.
2004-05-16  Sven Neumann  <sven@gimp.org>

	* plug-ins/script-fu/scripts/old-photo.scm: fixed wrong use of
	layer ID; bug #142326, merged from HEAD.
2004-05-16 12:05:27 +00:00
Sven Neumann
a47a313ab9 fixed position of vertical line indicating the picked color. Patch from
2004-05-15  Sven Neumann  <sven@gimp.org>

	* app/tools/gimpcurvestool.c: fixed position of vertical line
	indicating the picked color. Patch from William Skaggs and
	Søren Wedel Nielsen, merged from HEAD branch. Fixes bug #142506.
2004-05-15 13:11:24 +00:00
Sven Neumann
7521daf101 merged fix for bug #142400 from HEAD branch.
2004-05-13  Sven Neumann  <sven@gimp.org>

	* de.po: merged fix for bug #142400 from HEAD branch.
2004-05-13 10:50:46 +00:00
Francisco Javier F. Serrador
4a76803b9f Updated Spanish translation.
2004-05-13  Francisco Javier F. Serrador  <serrador@cvs.gnome.org>

	* es.po: Updated Spanish translation.
2004-05-12 23:16:55 +00:00
Andras Timar
99da037ae1 Updated Hungarian translation.
2004-05-12  Andras Timar  <timar@gnome.hu>

	* hu.po: Updated Hungarian translation.
2004-05-12 05:40:31 +00:00
Karl Eichwalder
0f83882af0 update 2004-05-11 19:42:49 +00:00
Karl Eichwalder
05da001ea9 Update. 2004-05-11 18:33:26 +00:00
Karl Eichwalder
b42a1a166f fix spelling 2004-05-11 18:09:54 +00:00
Sven Neumann
714d766264 fixed spelling, merge from HEAD.
2004-05-11  Sven Neumann  <sven@gimp.org>

	* docs/gimptool.1.in: fixed spelling, merge from HEAD.
2004-05-11 15:05:56 +00:00
Samel Jn Gunnarsson
bfd6f1a3b8 Updated Icelandic translation by ki G. Karlsson <aki@akademia.is>
2004-05-10  Samel Jn Gunnarsson  <sammi@techattack.nu>

	* is.po: Updated Icelandic translation by
	ki G. Karlsson  <aki@akademia.is>
2004-05-10 22:24:04 +00:00
Andras Timar
f79b87130d Updated Hungarian translation.
2004-05-10  Andras Timar  <timar@gnome.hu>

	* hu.po: Updated Hungarian translation.
2004-05-10 19:45:31 +00:00
Sven Neumann
71eb1b5fe1 fixed size of colormap property. Fixes bug #142149; merged from HEAD
2004-05-10  Sven Neumann  <sven@gimp.org>

	* app/xcf/xcf-save.c (xcf_save_prop): fixed size of colormap
	property. Fixes bug #142149; merged from HEAD branch.
2004-05-10 18:45:20 +00:00
Sven Neumann
508e6a58a2 don't call gtk_widget_set_direction() on a non-existant widget. Fix for
2004-05-10  Sven Neumann  <sven@gimp.org>

	* app/widgets/gimptexteditor.c (gimp_text_editor_set_direction):
	don't call gtk_widget_set_direction() on a non-existant widget.
	Fix for bug #141792, merged from HEAD branch.
2004-05-10 18:11:39 +00:00
Hans Breuer
ab60a34e23 $(FONTCONFIG_CFLAGS) app/composite/makefile.msc : don't build dll
2004-05-09  Hans Breuer  <hans@breuer.org>

	* app/makefile.msc : $(FONTCONFIG_CFLAGS)
	  app/composite/makefile.msc : don't build dll
	  app/modules/makefile.msc : ../app/gimp.lib is gone
	  plug-ins/makefile.msc : somehow the script-fu icon got lost
	  themes/default/images/makefile.msc : removed a bunch
	of stock images which are not used anymore.
	In general : make the whole build process work more out
	of the box ;-)

	* plug-ins/common/winclipboard.c : support gray images;
	fixes bug #141382

	* plug-ins/common/winprint.c : dito; fixes bug #141145
2004-05-09 21:49:58 +00:00
Manish Singh
dadc8e90ff Regenerated 2004-05-06 23:29:29 +00:00
Manish Singh
f6efb17480 Fix silly "Dodgebure" typo.
2004-05-06  Manish Singh  <yosh@gimp.org>

        * tools/pdbgen/pdb/paint_tools.pdb: Fix silly "Dodgebure" typo.
2004-05-06 23:23:01 +00:00
Sven Neumann
4fabadb473 Merged from HEAD branch:
2004-05-06  Sven Neumann  <sven@gimp.org>

	Merged from HEAD branch:

	* app/core/gimpdrawable-preview.c
	* app/core/gimpimage-projection.c: added sanity so we don't just
	plain crash when an indexed image doesn't have a colormap.

	* plug-ins/common/png.c: keep at least one entry in the colormap.
	Fixes bug #142029.
2004-05-06 20:20:02 +00:00
Sven Neumann
6e52ed12da fixed the fix 2004-05-06 14:33:23 +00:00
Sven Neumann
9b98d3c72d center the about dialog on the monitor, not on the screen. Fix for
2004-05-06  Sven Neumann  <sven@gimp.org>

	* app/gui/about-dialog.c: center the about dialog on the monitor,
	not on the screen. Fix for xinerama setups merged from HEAD branch.
2004-05-06 14:31:24 +00:00
Sven Neumann
293e291c5d removed copied files from stable branch 2004-05-05 17:10:10 +00:00
Michael Natterer
296e6d6f10 Fix bug #141719 (merged from HEAD):
2004-05-04  Michael Natterer  <mitch@gimp.org>

	Fix bug #141719 (merged from HEAD):

	* app/tools/gimpmovetool.c (gimp_move_tool_motion): use RINT()
	instead of ROUND() to round double coords to guide positions.

	* app/display/gimpdisplayshell-callbacks.c
	(gimp_display_shell_canvas_tool_events): pass RINT()-rounded
	coords to gimp_display_shell_update_cursor() instead of implicitly
	truncating by casting to int.
2004-05-04 13:14:19 +00:00
Francisco Javier F. Serrador
0b6ee206e2 Updated Spanish translation.
2004-05-04  Francisco Javier F. Serrador  <serrador@cvs.gnome.org>

	* es.po: Updated Spanish translation.
2004-05-04 12:10:00 +00:00
Miloslav Trmac
99bd9146db Updated Czech translation.
2004-05-04  Miloslav Trmac  <mitr@volny.cz>

	* cs.po: Updated Czech translation.
2004-05-04 10:31:21 +00:00
Gareth Owen
9d89216dae Updated British English translation 2004-05-04 01:34:56 +00:00
Andras Timar
b8c901720e Updated Hungarian translation.
2004-05-03  Andras Timar  <timar@gnome.hu>

	* hu.po: Updated Hungarian translation.
2004-05-03 12:11:16 +00:00
Sven Neumann
c655deecd3 added missing file.
2004-05-03  Sven Neumann  <sven@gimp.org>

        * POTFILES.in: added missing file.

        * de.po: minor update.
2004-05-03 10:27:16 +00:00
Sigurd Gartmann
821ea3b629 Updated Norwegian Bokmål translation
2004-05-03  Sigurd Gartmann  <sigurd-translate@brogar.org>

	* no.po: Updated Norwegian Bokmål translation
2004-05-03 09:18:21 +00:00
Gareth Owen
e7f0f1f152 Updated British English translation 2004-05-02 20:21:04 +00:00
Pedro Gimeno
4d2926583e Cleanups. (gimp_rect_select_tool_coords_to_integer): Undo my bogus fix for
2004-04-30  Pedro Gimeno  <pggimeno@wanadoo.es>

	* app/tools/gimprectselecttool.c: Cleanups.
	(gimp_rect_select_tool_coords_to_integer): Undo my bogus fix for
	bug #138103, which led to bug #140649.

	* app/pdb/procedural_db.c (procedural_db_init_procs): Add missing
	compat procs: gimp_channel_ops_duplicate, gimp_channel_ops_offset.
2004-04-30 19:07:28 +00:00
Manish Singh
a3a0f02d62 Quick fix to make uppercase tags work properly.
2004-04-29  Manish Singh  <yosh@gimp.org>

        * plug-ins/pygimp/plug-ins/py-slice.py: Quick fix to make uppercase
        tags work properly.
2004-04-29 16:10:55 +00:00
Andras Timar
fe82ee534a Updated Hungarian translation.
2004-04-29  Andras Timar  <timar@gnome.hu>

	* hu.po: Updated Hungarian translation.
2004-04-29 15:16:12 +00:00
Andras Timar
03267b6bf7 Updated Hungarian translation.
2004-04-27  Andras Timar  <timar@gnome.hu>

	* hu.po: Updated Hungarian translation.
2004-04-27 15:16:50 +00:00
Artur Flinta
ea3de9ec90 Updated Polish translation by GNOME PL Team.
2004-04-26  Artur Flinta  <aflinta@cvs.gnome.org>

	* pl.po: Updated Polish translation by GNOME PL Team.
2004-04-26 10:29:24 +00:00
Adam Weinberger
59aee53c95 Updated Canadian English translation.
* en_CA.po: Updated Canadian English translation.
2004-04-26 04:15:27 +00:00
Christophe Merlet
d22bdef154 Updated French translation. 2004-04-24 18:16:13 +00:00
Adam Weinberger
4ccfc53f18 Updated Canadian English translation.
* po/en_CA.po
	  po-script-fu/en_CA.po:

	  Updated Canadian English translation.
2004-04-22 16:18:10 +00:00
Sigurd Gartmann
b700e1df7e Updatet Norwegian Bokmål translation (Work by Runar Ingebrigtsen)
2004-04-22  Sigurd Gartmann  <sigurd-translate@brogar.org>

	    * no.po: Updatet Norwegian Bokmål translation (Work by Runar Ingebrigtsen)
2004-04-22 08:54:20 +00:00
Sven Neumann
55cffe4cc2 removed color cast.
2004-04-20  Sven Neumann  <sven@gimp.org>

	* tools/pdbgen/pdb/fileops.pdb (file_load_thumbnail): removed
	color cast.

	* app/pdb/fileops_cmds.c: regenerated.
2004-04-20 22:02:04 +00:00
Sven Neumann
886736908c removed moved files from stable branch 2004-04-20 21:59:39 +00:00
Miloslav Trmac
d1a7457ce4 Updated Czech translation.
2004-04-20  Miloslav Trmac  <mitr@volny.cz>

	* cs.po: Updated Czech translation.
2004-04-20 18:42:07 +00:00
Updated ja.po. T.Aihana
c08be65eba 2004-04-21 Updated ja.po. T.Aihana <aihana@gnome.gr.jp> 2004-04-20 14:59:04 +00:00
Sven Neumann
a8ed12422f check tile != NULL before unrefing it. Fixes bug #140554.
2004-04-20  Sven Neumann  <sven@gimp.org>

	* plug-ins/common/iwarp.c (iwarp_get_pixel): check tile != NULL
	before unrefing it. Fixes bug #140554.
2004-04-20 10:16:57 +00:00
Sven Neumann
3f62397fe5 ignore gimp-intl.h. app-docs.sgml updated.
2004-04-19  Sven Neumann  <sven@gimp.org>

	* Makefile.am: ignore gimp-intl.h.
	* app-docs.sgml
	* app-sections.txt: updated.
2004-04-19 16:34:41 +00:00
Henrik Brix Andersen
03d37bb56c removed double linebreak from my last commit 2004-04-19 09:11:23 +00:00
Henrik Brix Andersen
524ac4c735 plug-ins/script-fu/scripts/gimp-headers.scm applied a patch from William
2004-04-19 Henrik Brix Andersen <brix@gimp.org>

* plug-ins/script-fu/scripts/gimp-headers.scm
* plug-ins/script-fu/scripts/gimp-labels.scm: applied a patch from
William Skaggs which changes the sub menu title for the gimp web
theme to classic.gimp.org. Fixes bug #137036.
2004-04-19 08:59:57 +00:00
Henrik Brix Andersen
337e390cc1 use g_signal_connect_object() instead of g_signal_connect(). Fixes bug
2004-04-18 Henrik Brix Andersen <brix@gimp.org>

* app/widgets/gimptemplateeditor.c
(gimp_template_editor_constructor): use g_signal_connect_object()
instead of g_signal_connect(). Fixes bug #140315.
2004-04-18 20:44:15 +00:00
Artur Flinta
2d3efafc3d Updated Polish translation by GNOME PL Team.
2004-04-18  Artur Flinta  <aflinta@cvs.gnome.org>

	* pl.po: Updated Polish translation by GNOME PL Team.
2004-04-18 20:20:25 +00:00
Pedro Gimeno
a7e0791d49 Fix a condition which was preventing GRAYA images from loading.
2004-04-18  Pedro Gimeno  <pggimeno@wanadoo.es>

	* plug-ins/common/tga.c (load_image): Fix a condition which was
	preventing GRAYA images from loading.
2004-04-18 18:55:48 +00:00
Sven Neumann
d0d8a8eec4 replaced wrong use of gimp_option_menu with gimp_int_option_menu; merged
2004-04-18  Sven Neumann  <sven@gimp.org>

	* plug-ins/print/gimp_main_window.c: replaced wrong use of
	gimp_option_menu with gimp_int_option_menu; merged from HEAD.
2004-04-17 23:35:09 +00:00
Miloslav Trmac
65c516230a Updated Czech translation.
2004-04-17  Miloslav Trmac  <mitr@volny.cz>

	* cs.po: Updated Czech translation.
2004-04-17 15:18:08 +00:00
Henrik Brix Andersen
1560d22da1 resolved conflicting mnemonic. Fixes bug #139868.
2004-04-17 Henrik Brix Andersen <brix@gimp.org>

* app/tools/gimphuesaturationtool.c
(gimp_hue_saturation_tool_dialog): resolved conflicting
mnemonic. Fixes bug #139868.
2004-04-17 02:06:40 +00:00
Adam Weinberger
4239bfc441 po-plug-ins/en_CA.po: tips/en_CA.po:
* po/en_CA.po:
	  po-plug-ins/en_CA.po:
	  tips/en_CA.po:

	  Updated Canadian English translation.
2004-04-17 00:58:48 +00:00
Henrik Brix Andersen
851d1a9520 live preview doesn't modify the undo history of the image anymore, label
2004-04-17 Henrik Brix Andersen <brix@gimp.org>

* plug-ins/common/jpeg.c (save_dialog): live preview doesn't
modify the undo history of the image anymore, label changed
accordingly. Fixes bug #140296.
2004-04-17 00:14:53 +00:00
Pedro Gimeno
0fa3ff9d4c changed a call to gimp_image_undo_enable to _undo_disable which was
2004-04-16  Pedro Gimeno  <pggimeno@wanadoo.es>

	* plug-ins/common/tile.c (tile): changed a call to
	gimp_image_undo_enable to _undo_disable which was obviously the
	intention of the author. Added a call to gimp_drawable_update to
	get the previews refreshed.
2004-04-16 17:51:34 +00:00
Maxim Dziumanenko
2124a4fbf0 Updated Ukrainian translation.
2004-04-16  Maxim Dziumanenko <mvd@mylinux.com.ua>

	* Updated Ukrainian translation.
2004-04-16 17:23:23 +00:00
Sven Neumann
225412d37a app/tools/gimpcolorpickertool.c don't use gtk_window_present() to raise
2004-04-16  Sven Neumann  <sven@gimp.org>

	* app/tools/gimpcolorpickertool.c
	* app/tools/gimpmeasuretool.c: don't use gtk_window_present() to
	raise the tool dialog since it also moves the focus away from the
	image window. Fixes the problem described in bug #139349.
2004-04-16 13:53:51 +00:00
Sven Neumann
e3fe4cebe1 present the help browser window (merged from HEAD).
2004-04-16  Sven Neumann  <sven@gimp.org>

	* plug-ins/helpbrowser/dialog.c (browser_dialog_load): present the
	help browser window (merged from HEAD).
2004-04-16 13:21:53 +00:00
Tor Lillqvist
7887463a89 app/plug-in/plug-in-message.c (plug_in_handle_proc_install)
2004-04-15  Tor Lillqvist  <tml@iki.fi>

	* app/plug-in/plug-in-message.c (plug_in_handle_proc_install)
	* app/plug-in/plug-in-proc.h (struct _PlugInProcDef)
	* app/plug-in/plug-in-rc.c (plug_in_rc_write)
	* app/plug-in/plug-ins.c (plug_ins_init): Make PDB procedures
	(including their menu entries) installed during a plug-ins init()
	phase show up. Add a flag to PlugInProcDef that tells whether the
	proc was installed during the init() phase. Such procs aren't
	saved to the pluginrc. Move the code that initializes plug-ins
	that need initialization earlier, before the procs are added to
	the PDB and menus are built. Fixes bug #139969.
2004-04-15 22:05:51 +00:00
Tor Lillqvist
389a2bcae4 For Win32, Install gimpthumb.def, like the .def files of the other
2004-04-15  Tor Lillqvist  <tml@iki.fi>

	* libgimpthumb/Makefile.am: For Win32, Install gimpthumb.def, like
	the .def files of the other libgimp* libs.

	* app/Makefile.am (INCLUDES): Add PANGOFT2_CFLAGS.

	* gimp-zip.in: Put also libgimpthumb in the developer package.
2004-04-15 21:02:16 +00:00
Miloslav Trmac
1f1d7138f8 Updated Czech translation.
2004-04-15  Miloslav Trmac  <mitr@volny.cz>

	* cs.po: Updated Czech translation.
2004-04-15 14:27:20 +00:00
Sven Neumann
1e924e17b3 fixed declaration of initial_region() (bug #140115).
2004-04-15  Sven Neumann  <sven@gimp.org>

	* app/paint-funcs/paint-funcs.h: fixed declaration of
	initial_region() (bug #140115).
2004-04-15 12:42:07 +00:00
Sven Neumann
28f45f97ec fixed typo (bug #140039).
2004-04-14  Sven Neumann  <sven@gimp.org>

	* plug-ins/common/film.c: fixed typo (bug #140039).
2004-04-14 15:11:34 +00:00
680 changed files with 127505 additions and 117964 deletions

View File

@@ -26,6 +26,7 @@ intltool-modules
intltool-update
intltool-update.in
libtool
mkinstalldirs
stamp-h
stamp-h1
stamp-h.in

1149
ChangeLog

File diff suppressed because it is too large Load Diff

View File

@@ -26338,7 +26338,7 @@
* themes/Default/images/stock-eye-12.png: sharp icons
2003-03-21 Manish Singh <yosh@gimp.org>
* plug-ins/common/ps.c: always quote the filename, since system/popen
uses the shell. Also, never quote the filename if we are reading from
a parameter file (only in the win32 case). Fixes #108648.
@@ -26346,7 +26346,7 @@
* plug-ins/dbbrowser/dbbrowser_utils.c: double click on a list item
files Apply, if applicable. Remove the existing model in the treeview
(which will deallocate it) instead of clearing it.
2003-03-22 Sven Neumann <sven@gimp.org>
* themes/Default/images/stock-channel-16.png
@@ -29666,7 +29666,7 @@
This byte --> <-- is the millionth in this file!
2003-02-05 Manish Singh <yosh@gimp.org>
* plug-ins/common/jpeg.c (run): if the quality level is close to zero
in non-interactive mode, use default settings. This is hack until
the PDB gets default arguments, so gimp-file-save works sanely with
@@ -30295,7 +30295,7 @@
inspired by GimpDrawTool. Not actually used by anything yet.
2003-01-29 Manish Singh <yosh@gimp.org>
* plug-ins/common/jpeg.c (load_image): don't divide by zero if
we get all zero resolution info when we load the jpeg.

View File

@@ -236,6 +236,10 @@ 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-pre1 at the time of this writing).
Generic Instructions for Building Auto-Configured Packages

105
NEWS
View File

@@ -5,6 +5,111 @@ This is the stable branch of GIMP 2.0. Only bug-fixes are applied
here. New features are being added in the HEAD branch that is supposed
to be released as GIMP version 2.2 in a not too distant future.
Bugs fixed in GIMP 2.0.6
========================
- fixed gimp_file_load_thumbnail()
- fixed gimp_displays_reconnect() (#154638)
- initialize tool options with default values before deserializiation (#120832)
- let the BMP loader deal better with broken BMP files (#15540)
- fixed help-browser crashes on missing images (#138275)
- fixed opacity handling in grid plug-in (#156750)
- fixed text tool crashes with Pango 1.2 (#154144)
Bugs fixed in GIMP 2.0.5
========================
- added sanity checks for misconfigured filesystem encodings (#149464,
#150917)
- don't expose unnecessary information in Postscript files we generate
(#149669)
- improved behaviour of Shear tool (#149467)
- fixed labels in CMYK color-picker (#150213)
- removed non-functional button from Device Status dialog (#150177)
- fixed parsing of SVG transform attributes
- guard against bogus logical screen dimensions in GIF images (#151053)
- fixed use of global context for stroke operations (#150716)
- avoid stack overflows when bucket-filling complex regions (#151124)
- fixes to the composite code (#149429, #147013)
- fixed run-with-last-vals mode for vpropagate plug-in (#151308)
- respect the global-brush setting when stroking
- fixed popup menu positioning (#152662)
- fixed handling of QuickMask color (#152937)
- fixed bounding box problems when opening Postscript files (#152829)
- fixed undo memory calculation for paint operations (#153035)
- work around file-descriptor leak in Pango (#143542, #148997)
- made menu entry translatable (#153456)
- use the global gradient for the airbrush and pencil tools (#153584)
- fixed PDB call gimp-curves-spline (#153635)
- fixed projection when undoing floating_sel_to_layer (#149558)
Bugs fixed in GIMP 2.0.4
========================
- several build fixes (#147799, #148813, #147013)
- fixed bug in Polarize plug-in (#147799)
- fixed out-of-bounds access in Ink tool code (#144856)
- improved antialiasing of elliptical selections (#147836)
- fixed typo in gradient editor (#148300)
- really remove all associated items from the ID hash table when an
image is being closed (#148614)
- work around integer overflows when transforming large drawables (#128594)
- fixed wrong EXIF handling in JPEG plug-in, a bug that has been
introduced in 2.0.3 (#148632)
- fixed bug in Script-Fu extension (bug #148729)
- fixed crash in container grid views (bug #148955)
- handle changes to URI handling in newer glib releases (bug #148140)
Bugs fixed in GIMP 2.0.3
========================
- several build fixes (#144632, #144780)
- documentation fixes (#144267)
- avoid use of uninitialized values in GimpColorArea widget (#144786)
- fixed Levels tool on grayscale images with alpha channel (#141930)
- fixed Save/Load functionality in channel-mixer plug-in (#145380)
- fixed brokeness in GimpContext that caused tool options and device
settings to be saved incorrectly
- fixed bug in Colorize tool
- fixed undo stack corruption that occured with some undo settings (#145379)
- fixed long-standing bug that caused the tablet pointer to change
inadvertently (#115774)
- allow to undo script 'Round Corners' (#146344)
- implemented gimp-path-get-point-at-dist PDB function (#138754)
- don't crash while loading JPEG files with corrupt EXIF data (#145212)
- fixed loading of CMYK TIFF images on big-endian hosts (#147328)
- fixed palette handling in MNG plug-in (#139947)
- fixed bug in Script-Fu console (#139200)
- fixed corruption when saving RLE-encoded BMPs on big-endian hosts (#147759)
Bugs fixed in GIMP 2.0.2
========================
- several build fixes (#140115, #142907, #143069)
- allow plug-ins to register menu entries from within init() (#139969)
- fixed focus issues with tool dialogs (#139349)
- allow to load grayscale TGA files
- a couple of string and i18n fixes (#140296, #140039, #137036, #142996)
- fixed crash in template editor (#140315)
- fixed crash in IWarp plug-in (#140554)
- fixed snap to guides (#140649)
- made the PNG plug-in handle empty colormaps (#142029)
- fixed bug in text editor dialog (#141792)
- fixed Old Photo script-fu (#142326)
- fixed glitch in the Curves tool dialog (#142506)
- don't allow tablet pressure to become negative (#123811)
- improved range of tablet pressure values (#142808)
- better defaults for tablet pressure (#143626)
- fixed use of screen color picker with XInput devices (#143166)
- actually return values from the run function of Python scripts (#141338)
- documentation fixes (#142618)
- fixed bug in the save routine of the TIFF plug-in (#143522)
- don't let Curve Bend silently apply the layer mask (#134748)
- fixed bug in Blur plug-in (#142318)
- fixed mask offsets after crop operations (#143860)
- let extensions run synchronously when called via PDB (#140112)
- updated (and some new) translations
Bugs fixed in GIMP 2.0.1
========================

View File

@@ -161,7 +161,7 @@ this one may not necessarily fit.
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/gimp20.pot -- 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

View File

@@ -71,6 +71,7 @@ AM_CPPFLAGS = \
INCLUDES = \
-I$(top_srcdir) \
$(GTK_CFLAGS) \
$(PANGOFT2_CFLAGS) \
-I$(includedir)
gimp_2_0_LDFLAGS = \
@@ -102,6 +103,7 @@ gimp_2_0_LDADD = \
$(libgimpthumb) \
$(libgimpmath) \
$(libgimpbase) \
$(REGEXREPL) \
$(GTK_LIBS) \
$(LIBART_LIBS) \
$(PANGOFT2_LIBS) \
@@ -110,8 +112,7 @@ gimp_2_0_LDADD = \
$(GIMP_THREAD_LIBS) \
$(GIMP_MP_LIBS) \
$(RT_LIBS) \
$(INTLLIBS) \
$(REGEXREPL)
$(INTLLIBS)
if ENABLE_GIMP_CONSOLE
gimp_console_2_0_SOURCES = $(gimp_2_0_SOURCES)
@@ -135,6 +136,7 @@ gimp_console_2_0_LDADD = \
$(libgimpthumb) \
$(libgimpmath) \
$(libgimpbase) \
$(REGEXREPL) \
$(GDK_PIXBUF_LIBS) \
$(LIBART_LIBS) \
$(PANGOFT2_LIBS) \
@@ -143,8 +145,7 @@ gimp_console_2_0_LDADD = \
$(GIMP_THREAD_LIBS) \
$(GIMP_MP_LIBS) \
$(RT_LIBS) \
$(INTLLIBS) \
$(REGEXREPL)
$(INTLLIBS)
endif
install-exec-hook:

View File

@@ -1,68 +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 "gui-types.h"
#include "widgets/gimpbufferview.h"
#include "buffers-commands.h"
#include "gimp-intl.h"
/* public functionss */
void
buffers_paste_buffer_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpBufferView *view = GIMP_BUFFER_VIEW (data);
gtk_button_clicked (GTK_BUTTON (view->paste_button));
}
void
buffers_paste_buffer_into_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpBufferView *view = GIMP_BUFFER_VIEW (data);
gtk_button_clicked (GTK_BUTTON (view->paste_into_button));
}
void
buffers_paste_buffer_as_new_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpBufferView *view = GIMP_BUFFER_VIEW (data);
gtk_button_clicked (GTK_BUTTON (view->paste_as_new_button));
}
void
buffers_delete_buffer_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpBufferView *view = GIMP_BUFFER_VIEW (data);
gtk_button_clicked (GTK_BUTTON (view->delete_button));
}

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_buffer_cmd_callback (GtkWidget *widget,
gpointer data);
void buffers_paste_buffer_into_cmd_callback (GtkWidget *widget,
gpointer data);
void buffers_paste_buffer_as_new_cmd_callback (GtkWidget *widget,
gpointer data);
void buffers_delete_buffer_cmd_callback (GtkWidget *widget,
gpointer data);
#endif /* __BUFFERS_COMMANDS_H__ */

View File

@@ -1,606 +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 "gui-types.h"
#include "core/gimp.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/gimpcolorpanel.h"
#include "widgets/gimpcomponenteditor.h"
#include "widgets/gimpdock.h"
#include "widgets/gimphelp-ids.h"
#include "widgets/gimpitemtreeview.h"
#include "widgets/gimpviewabledialog.h"
#include "display/gimpdisplay.h"
#include "channels-commands.h"
#include "gimp-intl.h"
/* local function prototypes */
static void channels_opacity_update (GtkAdjustment *adjustment,
gpointer data);
static void channels_color_changed (GimpColorButton *button,
gpointer data);
#define return_if_no_image(gimage,data) \
if (GIMP_IS_DISPLAY (data)) \
gimage = ((GimpDisplay *) data)->gimage; \
else if (GIMP_IS_GIMP (data)) \
gimage = gimp_context_get_image (gimp_get_user_context (GIMP (data))); \
else if (GIMP_IS_DOCK (data)) \
gimage = gimp_context_get_image (((GimpDock *) data)->context); \
else if (GIMP_IS_COMPONENT_EDITOR (data)) \
gimage = ((GimpImageEditor *) data)->gimage; \
else if (GIMP_IS_ITEM_TREE_VIEW (data)) \
gimage = ((GimpItemTreeView *) data)->gimage; \
else \
gimage = NULL; \
\
if (! gimage) \
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
/* public functions */
void
channels_new_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpImage *gimage;
return_if_no_image (gimage, data);
channels_new_channel_query (gimage, NULL, TRUE, widget);
}
void
channels_raise_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpImage *gimage;
GimpChannel *active_channel;
return_if_no_channel (gimage, active_channel, data);
gimp_image_raise_channel (gimage, active_channel);
gimp_image_flush (gimage);
}
void
channels_lower_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpImage *gimage;
GimpChannel *active_channel;
return_if_no_channel (gimage, active_channel, data);
gimp_image_lower_channel (gimage, active_channel);
gimp_image_flush (gimage);
}
void
channels_duplicate_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpImage *gimage;
GimpChannel *new_channel;
if (GIMP_IS_COMPONENT_EDITOR (data))
{
GimpRGB color;
GimpChannelType component;
GEnumClass *enum_class;
GEnumValue *enum_value;
gchar *name;
return_if_no_image (gimage, data);
gimp_rgba_set (&color, 0, 0, 0, 0.5);
component = GIMP_COMPONENT_EDITOR (data)->clicked_component;
enum_class = g_type_class_ref (GIMP_TYPE_CHANNEL_TYPE);
enum_value = g_enum_get_value (enum_class, component);
g_type_class_unref (enum_class);
name = g_strdup_printf (_("%s Channel Copy"),
gettext (enum_value->value_name));
new_channel = gimp_channel_new_from_component (gimage, component,
name, &color);
/* copied components are invisible by default so subsequent copies
* of components don't affect each other
*/
gimp_item_set_visible (GIMP_ITEM (new_channel), FALSE, FALSE);
g_free (name);
}
else
{
GimpChannel *active_channel;
return_if_no_channel (gimage, active_channel, data);
new_channel =
GIMP_CHANNEL (gimp_item_duplicate (GIMP_ITEM (active_channel),
G_TYPE_FROM_INSTANCE (active_channel),
TRUE));
}
gimp_image_add_channel (gimage, new_channel, -1);
gimp_image_flush (gimage);
}
void
channels_delete_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpImage *gimage;
GimpChannel *active_channel;
return_if_no_channel (gimage, active_channel, data);
gimp_image_remove_channel (gimage, active_channel);
gimp_image_flush (gimage);
}
void
channels_to_selection_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
GimpChannelOps op;
GimpImage *gimage;
op = (GimpChannelOps) action;
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);
}
void
channels_edit_attributes_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpImage *gimage;
GimpChannel *active_channel;
return_if_no_channel (gimage, active_channel, data);
channels_edit_channel_query (active_channel, widget);
}
/**********************************/
/* The new channel query dialog */
/**********************************/
typedef struct _NewChannelOptions NewChannelOptions;
struct _NewChannelOptions
{
GtkWidget *query_box;
GtkWidget *name_entry;
GtkWidget *color_panel;
GimpImage *gimage;
};
static gchar *channel_name = NULL;
static GimpRGB channel_color = { 0.0, 0.0, 0.0, 0.5 };
static void
new_channel_query_response (GtkWidget *widget,
gint response_id,
NewChannelOptions *options)
{
if (response_id == GTK_RESPONSE_OK)
{
GimpChannel *new_channel;
GimpImage *gimage;
if (channel_name)
g_free (channel_name);
channel_name =
g_strdup (gtk_entry_get_text (GTK_ENTRY (options->name_entry)));
if ((gimage = options->gimage))
{
gimp_color_button_get_color (GIMP_COLOR_BUTTON (options->color_panel),
&channel_color);
new_channel = gimp_channel_new (gimage, gimage->width, gimage->height,
channel_name,
&channel_color);
gimp_drawable_fill_by_type (GIMP_DRAWABLE (new_channel),
gimp_get_user_context (gimage->gimp),
GIMP_TRANSPARENT_FILL);
gimp_image_add_channel (gimage, new_channel, -1);
gimp_image_flush (gimage);
}
}
gtk_widget_destroy (options->query_box);
}
void
channels_new_channel_query (GimpImage *gimage,
GimpChannel *template,
gboolean interactive,
GtkWidget *parent)
{
NewChannelOptions *options;
GtkWidget *hbox;
GtkWidget *vbox;
GtkWidget *table;
GtkObject *opacity_scale_data;
g_return_if_fail (GIMP_IS_IMAGE (gimage));
g_return_if_fail (! template || GIMP_IS_CHANNEL (template));
if (template || ! interactive)
{
GimpChannel *new_channel;
gint width, height;
GimpRGB color;
if (template)
{
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);
gimp_rgba_set (&color, 0.0, 0.0, 0.0, 0.5);
}
gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_EDIT_PASTE,
_("New Channel"));
new_channel = gimp_channel_new (gimage,
width, height,
_("Empty Channel"),
&color);
gimp_drawable_fill_by_type (GIMP_DRAWABLE (new_channel),
gimp_get_user_context (gimage->gimp),
GIMP_TRANSPARENT_FILL);
gimp_image_add_channel (gimage, new_channel, -1);
gimp_image_undo_group_end (gimage);
return;
}
/* the new options structure */
options = g_new (NewChannelOptions, 1);
options->gimage = gimage;
options->color_panel = gimp_color_panel_new (_("New Channel Color"),
&channel_color,
GIMP_COLOR_AREA_LARGE_CHECKS,
48, 64);
gimp_color_panel_set_context (GIMP_COLOR_PANEL (options->color_panel),
gimp_get_user_context (gimage->gimp));
/* The dialog */
options->query_box =
gimp_viewable_dialog_new (GIMP_VIEWABLE (gimage),
_("New Channel"), "gimp-channel-new",
GIMP_STOCK_CHANNEL,
_("New Channel Options"),
parent,
gimp_standard_help_func,
GIMP_HELP_CHANNEL_NEW,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OK, GTK_RESPONSE_OK,
NULL);
g_object_weak_ref (G_OBJECT (options->query_box),
(GWeakNotify) g_free,
options);
g_signal_connect (options->query_box, "response",
G_CALLBACK (new_channel_query_response),
options);
/* The main hbox */
hbox = gtk_hbox_new (FALSE, 4);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 6);
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (options->query_box)->vbox),
hbox);
/* The vbox */
vbox = gtk_vbox_new (FALSE, 2);
gtk_box_pack_start (GTK_BOX (hbox), vbox, TRUE, TRUE, 0);
/* The table */
table = gtk_table_new (2, 3, FALSE);
gtk_table_set_col_spacings (GTK_TABLE (table), 2);
gtk_table_set_row_spacings (GTK_TABLE (table), 2);
gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0);
/* The name entry */
options->name_entry = gtk_entry_new ();
gtk_entry_set_text (GTK_ENTRY (options->name_entry),
(channel_name ? channel_name : _("New Channel")));
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
_("Channel Name:"), 1.0, 0.5,
options->name_entry, 2, FALSE);
/* The opacity scale */
opacity_scale_data = gimp_scale_entry_new (GTK_TABLE (table), 0, 1,
_("Fill Opacity:"), 100, -1,
channel_color.a * 100.0,
0.0, 100.0, 1.0, 10.0, 1,
TRUE, 0.0, 0.0,
NULL, NULL);
g_signal_connect (opacity_scale_data, "value_changed",
G_CALLBACK (channels_opacity_update),
options->color_panel);
/* The color panel */
gtk_box_pack_start (GTK_BOX (hbox), options->color_panel,
TRUE, TRUE, 0);
gtk_widget_show (options->color_panel);
g_signal_connect (options->color_panel, "color_changed",
G_CALLBACK (channels_color_changed),
opacity_scale_data);
gtk_widget_show (table);
gtk_widget_show (vbox);
gtk_widget_show (hbox);
gtk_widget_show (options->query_box);
}
/****************************************/
/* The edit channel attributes dialog */
/****************************************/
typedef struct _EditChannelOptions EditChannelOptions;
struct _EditChannelOptions
{
GtkWidget *query_box;
GtkWidget *name_entry;
GtkWidget *color_panel;
GimpChannel *channel;
GimpImage *gimage;
};
static void
edit_channel_query_response (GtkWidget *widget,
gint response_id,
EditChannelOptions *options)
{
if (response_id == GTK_RESPONSE_OK)
{
GimpChannel *channel = options->channel;
if (options->gimage)
{
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->query_box);
}
void
channels_edit_channel_query (GimpChannel *channel,
GtkWidget *parent)
{
EditChannelOptions *options;
GtkWidget *hbox;
GtkWidget *vbox;
GtkWidget *table;
GtkObject *opacity_scale_data;
options = g_new0 (EditChannelOptions, 1);
options->channel = channel;
options->gimage = gimp_item_get_image (GIMP_ITEM (channel));
channel_color = channel->color;
options->color_panel = gimp_color_panel_new (_("Edit Channel Color"),
&channel_color,
GIMP_COLOR_AREA_LARGE_CHECKS,
48, 64);
gimp_color_panel_set_context (GIMP_COLOR_PANEL (options->color_panel),
gimp_get_user_context (options->gimage->gimp));
/* The dialog */
options->query_box =
gimp_viewable_dialog_new (GIMP_VIEWABLE (channel),
_("Channel Attributes"), "gimp-channel-edit",
GIMP_STOCK_EDIT,
_("Edit Channel Attributes"),
parent,
gimp_standard_help_func,
GIMP_HELP_CHANNEL_EDIT,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OK, GTK_RESPONSE_OK,
NULL);
g_object_weak_ref (G_OBJECT (options->query_box),
(GWeakNotify) g_free,
options);
g_signal_connect (options->query_box, "response",
G_CALLBACK (edit_channel_query_response),
options);
/* The main hbox */
hbox = gtk_hbox_new (FALSE, 4);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 6);
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (options->query_box)->vbox),
hbox);
/* The vbox */
vbox = gtk_vbox_new (FALSE, 2);
gtk_box_pack_start (GTK_BOX (hbox), vbox, TRUE, TRUE, 0);
/* The table */
table = gtk_table_new (2, 3, FALSE);
gtk_table_set_col_spacings (GTK_TABLE (table), 2);
gtk_table_set_row_spacings (GTK_TABLE (table), 2);
gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0);
/* The name entry */
options->name_entry = gtk_entry_new ();
gtk_entry_set_text (GTK_ENTRY (options->name_entry),
gimp_object_get_name (GIMP_OBJECT (channel)));
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
_("Channel Name:"), 1.0, 0.5,
options->name_entry, 2, FALSE);
/* The opacity scale */
opacity_scale_data = gimp_scale_entry_new (GTK_TABLE (table), 0, 1,
_("Fill Opacity:"), 100, -1,
channel_color.a * 100.0,
0.0, 100.0, 1.0, 10.0, 1,
TRUE, 0.0, 0.0,
NULL, NULL);
g_signal_connect (opacity_scale_data, "value_changed",
G_CALLBACK (channels_opacity_update),
options->color_panel);
/* The color panel */
gtk_box_pack_start (GTK_BOX (hbox), options->color_panel,
TRUE, TRUE, 0);
gtk_widget_show (options->color_panel);
g_signal_connect (options->color_panel, "color_changed",
G_CALLBACK (channels_color_changed),
opacity_scale_data);
gtk_widget_show (table);
gtk_widget_show (vbox);
gtk_widget_show (hbox);
gtk_widget_show (options->query_box);
}
/* private functions */
static void
channels_opacity_update (GtkAdjustment *adjustment,
gpointer data)
{
GimpRGB color;
gimp_color_button_get_color (GIMP_COLOR_BUTTON (data), &color);
gimp_rgb_set_alpha (&color, adjustment->value / 100.0);
gimp_color_button_set_color (GIMP_COLOR_BUTTON (data), &color);
}
static void
channels_color_changed (GimpColorButton *button,
gpointer data)
{
GtkAdjustment *adj = GTK_ADJUSTMENT (data);
GimpRGB color;
gimp_color_button_get_color (button, &color);
gtk_adjustment_set_value (adj, color.a * 100.0);
}

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.
*/
#ifndef __CHANNELS_COMMANDS_H__
#define __CHANNELS_COMMANDS_H__
void channels_new_cmd_callback (GtkWidget *widget,
gpointer data);
void channels_raise_cmd_callback (GtkWidget *widget,
gpointer data);
void channels_lower_cmd_callback (GtkWidget *widget,
gpointer data);
void channels_duplicate_cmd_callback (GtkWidget *widget,
gpointer data);
void channels_delete_cmd_callback (GtkWidget *widget,
gpointer data);
void channels_to_selection_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void channels_edit_attributes_cmd_callback (GtkWidget *widget,
gpointer data);
void channels_new_channel_query (GimpImage *gimage,
GimpChannel *template,
gboolean interactive,
GtkWidget *parent);
void channels_edit_channel_query (GimpChannel *channel,
GtkWidget *parent);
#endif /* __CHANNELS_COMMANDS_H__ */

View File

@@ -1,55 +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 "gui-types.h"
#include "widgets/gimpcolormapeditor.h"
#include "colormap-editor-commands.h"
/* public functions */
void
colormap_editor_edit_color_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
GimpColormapEditor *editor = GIMP_COLORMAP_EDITOR (data);
if (GTK_WIDGET_SENSITIVE (editor->edit_button))
gtk_button_clicked (GTK_BUTTON (editor->edit_button));
}
void
colormap_editor_add_color_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
GimpColormapEditor *editor = GIMP_COLORMAP_EDITOR (data);
if (GTK_WIDGET_SENSITIVE (editor->add_button))
gimp_button_extended_clicked (GIMP_BUTTON (editor->add_button),
action ? GDK_CONTROL_MASK : 0);
}

View File

@@ -1,31 +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 (GtkWidget *widget,
gpointer data,
guint action);
void colormap_editor_add_color_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
#endif /* __COLORMAP_EDITOR_COMMANDS_H__ */

View File

@@ -1,55 +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 "gui-types.h"
#include "widgets/gimpcolormapeditor.h"
#include "colormap-editor-commands.h"
/* public functions */
void
colormap_editor_edit_color_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
GimpColormapEditor *editor = GIMP_COLORMAP_EDITOR (data);
if (GTK_WIDGET_SENSITIVE (editor->edit_button))
gtk_button_clicked (GTK_BUTTON (editor->edit_button));
}
void
colormap_editor_add_color_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
GimpColormapEditor *editor = GIMP_COLORMAP_EDITOR (data);
if (GTK_WIDGET_SENSITIVE (editor->add_button))
gimp_button_extended_clicked (GIMP_BUTTON (editor->add_button),
action ? GDK_CONTROL_MASK : 0);
}

View File

@@ -1,31 +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 (GtkWidget *widget,
gpointer data,
guint action);
void colormap_editor_add_color_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
#endif /* __COLORMAP_EDITOR_COMMANDS_H__ */

View File

@@ -1,80 +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 "gui-types.h"
#include "widgets/gimpdatafactoryview.h"
#include "data-commands.h"
#include "gimp-intl.h"
void
data_new_data_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpDataFactoryView *view = GIMP_DATA_FACTORY_VIEW (data);
if (GTK_WIDGET_SENSITIVE (view->new_button))
gtk_button_clicked (GTK_BUTTON (view->new_button));
}
void
data_duplicate_data_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpDataFactoryView *view = GIMP_DATA_FACTORY_VIEW (data);
if (GTK_WIDGET_SENSITIVE (view->duplicate_button))
gtk_button_clicked (GTK_BUTTON (view->duplicate_button));
}
void
data_edit_data_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpDataFactoryView *view = GIMP_DATA_FACTORY_VIEW (data);
if (GTK_WIDGET_SENSITIVE (view->edit_button))
gtk_button_clicked (GTK_BUTTON (view->edit_button));
}
void
data_delete_data_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpDataFactoryView *view = GIMP_DATA_FACTORY_VIEW (data);
if (GTK_WIDGET_SENSITIVE (view->delete_button))
gtk_button_clicked (GTK_BUTTON (view->delete_button));
}
void
data_refresh_data_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpDataFactoryView *view = GIMP_DATA_FACTORY_VIEW (data);
if (GTK_WIDGET_SENSITIVE (view->refresh_button))
gtk_button_clicked (GTK_BUTTON (view->refresh_button));
}

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 __DATA_COMMANDS_H__
#define __DATA_COMMANDS_H__
void data_new_data_cmd_callback (GtkWidget *widget,
gpointer data);
void data_duplicate_data_cmd_callback (GtkWidget *widget,
gpointer data);
void data_edit_data_cmd_callback (GtkWidget *widget,
gpointer data);
void data_delete_data_cmd_callback (GtkWidget *widget,
gpointer data);
void data_refresh_data_cmd_callback (GtkWidget *widget,
gpointer data);
#endif /* __DATA_COMMANDS_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 <string.h>
#include <gtk/gtk.h>
#include "libgimpbase/gimpbase.h"
#include "gui-types.h"
#include "core/gimpobject.h"
#include "widgets/gimpitemfactory.h"
#include "widgets/gimpmenufactory.h"
#include "debug-commands.h"
#include "menus.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_dump_menus_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
GList *list;
for (list = global_menu_factory->registered_menus;
list;
list = g_list_next (list))
{
GimpMenuFactoryEntry *entry;
GimpItemFactory *item_factory;
entry = list->data;
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");
}
}
}
void
debug_mem_profile_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
extern gboolean gimp_debug_memsize;
gimp_debug_memsize = TRUE;
gimp_object_get_memsize (GIMP_OBJECT (data), NULL);
gimp_debug_memsize = FALSE;
}
/* private functions */
static void
debug_dump_menus_recurse_menu (GtkWidget *menu,
gint depth,
gchar *path)
{
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 /* ENABLE_DEBUG_MENU */

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 __DEBUG_COMMANDS_H__
#define __DEBUG_COMMANDS_H__
#ifdef GIMP_UNSTABLE
#define ENABLE_DEBUG_MENU 1
#endif
#ifdef ENABLE_DEBUG_MENU
void debug_dump_menus_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void debug_mem_profile_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
#endif /* ENABLE_DEBUG_MENU */
#endif /* __DEBUG_COMMANDS_H__ */

View File

@@ -1,522 +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 "gui-types.h"
#include "widgets/gimpcontainerview.h"
#include "widgets/gimpcontainerview-utils.h"
#include "widgets/gimpdialogfactory.h"
#include "widgets/gimpdockable.h"
#include "widgets/gimpdockbook.h"
#include "widgets/gimpimagedock.h"
#include "widgets/gimpsessioninfo.h"
#include "dialogs.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 (GtkWidget *widget,
gpointer data,
guint action)
{
dialogs_show_toolbox ();
}
void
dialogs_create_toplevel_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
if (action)
{
const gchar *identifier = g_quark_to_string ((GQuark) action);
if (identifier)
gimp_dialog_factory_dialog_new (global_dialog_factory,
gtk_widget_get_screen (widget),
identifier, -1);
}
}
void
dialogs_create_dockable_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
if (action)
{
const gchar *identifier = g_quark_to_string ((GQuark) action);
if (!identifier)
return;
gimp_dialog_factory_dialog_raise (global_dock_factory,
gtk_widget_get_screen (widget),
identifier, -1);
}
}
void
dialogs_add_tab_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
GimpDockbook *dockbook = GIMP_DOCKBOOK (data);
if (action)
{
GtkWidget *dockable;
const gchar *identifier;
identifier = g_quark_to_string ((GQuark) action);
if (identifier)
{
dockable =
gimp_dialog_factory_dockable_new (dockbook->dock->dialog_factory,
dockbook->dock,
identifier,
-1);
/* 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
dialogs_close_tab_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
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
dialogs_detach_tab_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
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
dialogs_toggle_view_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
GimpDockbook *dockbook = GIMP_DOCKBOOK (data);
GimpDockable *dockable;
GimpViewType view_type;
gint page_num;
if (! GTK_CHECK_MENU_ITEM (widget)->active)
return;
view_type = (GimpViewType) 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 = old_view->preview_size;
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
dialogs_preview_size_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
GimpDockbook *dockbook = GIMP_DOCKBOOK (data);
GimpDockable *dockable;
gint preview_size;
gint page_num;
if (! GTK_CHECK_MENU_ITEM (widget)->active)
return;
preview_size = (gint) 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;
view = gimp_container_view_get_by_dockable (dockable);
if (view && view->preview_size != preview_size)
gimp_container_view_set_preview_size (view, preview_size,
view->preview_border_width);
}
}
void
dialogs_tab_style_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
GimpDockbook *dockbook = GIMP_DOCKBOOK (data);
GimpDockable *dockable;
GimpTabStyle tab_style;
gint page_num;
if (! GTK_CHECK_MENU_ITEM (widget)->active)
return;
tab_style = (gint) 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;
dockable->tab_style = tab_style;
tab_widget = gimp_dockbook_get_tab_widget (dockbook, dockable);
gtk_notebook_set_tab_label (GTK_NOTEBOOK (dockbook),
GTK_WIDGET (dockable),
tab_widget);
}
}
void
dialogs_toggle_image_menu_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
GimpDockbook *dockbook = GIMP_DOCKBOOK (data);
if (GIMP_IS_IMAGE_DOCK (dockbook->dock))
gimp_image_dock_set_show_image_menu (GIMP_IMAGE_DOCK (dockbook->dock),
GTK_CHECK_MENU_ITEM (widget)->active);
}
void
dialogs_toggle_auto_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
GimpDockbook *dockbook = GIMP_DOCKBOOK (data);
if (GIMP_IS_IMAGE_DOCK (dockbook->dock))
gimp_image_dock_set_auto_follow_active (GIMP_IMAGE_DOCK (dockbook->dock),
GTK_CHECK_MENU_ITEM (widget)->active);
}
static void
dialogs_change_screen_confirm_callback (GtkWidget *query_box,
gint value,
gpointer data)
{
GdkScreen *screen;
screen = gdk_display_get_screen (gtk_widget_get_display (GTK_WIDGET (data)),
value);
if (screen)
gtk_window_set_screen (GTK_WINDOW (data), screen);
}
static void
dialogs_change_screen_destroy_callback (GtkWidget *query_box,
GtkWidget *dock)
{
g_object_set_data (G_OBJECT (dock), "gimp-change-screen-dialog", NULL);
}
void
dialogs_change_screen_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
GimpDockbook *dockbook = GIMP_DOCKBOOK (data);
GtkWidget *dock;
GdkScreen *screen;
GdkDisplay *display;
gint cur_screen;
gint num_screens;
GtkWidget *qbox;
dock = GTK_WIDGET (dockbook->dock);
qbox = g_object_get_data (G_OBJECT (dock), "gimp-change-screen-dialog");
if (qbox)
{
gtk_window_present (GTK_WINDOW (qbox));
return;
}
screen = gtk_widget_get_screen (dock);
display = gtk_widget_get_display (dock);
cur_screen = gdk_screen_get_number (screen);
num_screens = gdk_display_get_n_screens (display);
qbox = gimp_query_int_box ("Move Dock to Screen",
dock,
NULL, 0,
"Enter destination screen",
cur_screen, 0, num_screens - 1,
G_OBJECT (dock), "destroy",
dialogs_change_screen_confirm_callback,
dock);
g_object_set_data (G_OBJECT (dock), "gimp-change-screen-dialog", qbox);
g_signal_connect (qbox, "destroy",
G_CALLBACK (dialogs_change_screen_destroy_callback),
dock);
gtk_widget_show (qbox);
}
void
dialogs_create_lc_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
static const gchar *tabs[] =
{
"gimp-layer-list",
"gimp-channel-list",
"gimp-vectors-list",
"gimp-undo-history"
};
dialogs_create_dock (gtk_widget_get_screen (widget), TRUE,
tabs, G_N_ELEMENTS (tabs));
}
void
dialogs_create_data_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
static const gchar *tabs[] =
{
"gimp-brush-grid",
"gimp-pattern-grid",
"gimp-gradient-list",
"gimp-palette-list",
"gimp-font-list"
};
dialogs_create_dock (gtk_widget_get_screen (widget), FALSE,
tabs, G_N_ELEMENTS (tabs));
}
void
dialogs_create_stuff_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
static const gchar *tabs[] =
{
"gimp-buffer-list",
"gimp-image-list",
"gimp-document-list",
"gimp-template-list"
};
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
{
GList *list;
for (list = global_toolbox_factory->open_dialogs;
list;
list = g_list_next (list))
{
if (GTK_WIDGET_TOPLEVEL (list->data))
{
gtk_window_present (GTK_WINDOW (list->data));
break;
}
}
}
}
/* private functions */
static void
dialogs_create_dock (GdkScreen *screen,
gboolean show_image_menu,
const gchar *tabs[],
gint n_tabs)
{
GtkWidget *dock;
GtkWidget *dockbook;
GtkWidget *dockable;
gint i;
dock = gimp_dialog_factory_dock_new (global_dock_factory, screen);
gimp_image_dock_set_show_image_menu (GIMP_IMAGE_DOCK (dock), show_image_menu);
dockbook = gimp_dockbook_new (global_dock_factory->menu_factory);
gimp_dock_add_book (GIMP_DOCK (dock), GIMP_DOCKBOOK (dockbook), 0);
for (i = 0; i < n_tabs; i++)
{
dockable = gimp_dialog_factory_dialog_new (global_dock_factory,
screen,
tabs[i], -1);
if (dockable && ! GIMP_DOCKABLE (dockable)->dockbook)
gimp_dock_add (GIMP_DOCK (dock), GIMP_DOCKABLE (dockable), -1, -1);
}
gtk_widget_show (dock);
}

View File

@@ -1,76 +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 (GtkWidget *widget,
gpointer data,
guint action);
void dialogs_create_toplevel_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void dialogs_create_dockable_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void dialogs_add_tab_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void dialogs_close_tab_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void dialogs_detach_tab_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void dialogs_toggle_view_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void dialogs_preview_size_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void dialogs_tab_style_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void dialogs_toggle_image_menu_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void dialogs_toggle_auto_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void dialogs_change_screen_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void dialogs_create_lc_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void dialogs_create_data_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void dialogs_create_stuff_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void dialogs_show_toolbox (void);
#endif /* __DIALOGS_COMMANDS_H__ */

View File

@@ -1,100 +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 "gui-types.h"
#include "widgets/gimpdocumentview.h"
#include "documents-commands.h"
/* public functions */
void
documents_open_document_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpDocumentView *view = GIMP_DOCUMENT_VIEW (data);
gtk_button_clicked (GTK_BUTTON (view->open_button));
}
void
documents_raise_or_open_document_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpDocumentView *view = GIMP_DOCUMENT_VIEW (data);
gimp_button_extended_clicked (GIMP_BUTTON (view->open_button),
GDK_SHIFT_MASK);
}
void
documents_file_open_dialog_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpDocumentView *view = GIMP_DOCUMENT_VIEW (data);
gimp_button_extended_clicked (GIMP_BUTTON (view->open_button),
GDK_CONTROL_MASK);
}
void
documents_remove_document_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpDocumentView *view = GIMP_DOCUMENT_VIEW (data);
gtk_button_clicked (GTK_BUTTON (view->remove_button));
}
void
documents_recreate_preview_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpDocumentView *view = GIMP_DOCUMENT_VIEW (data);
gtk_button_clicked (GTK_BUTTON (view->refresh_button));
}
void
documents_reload_previews_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpDocumentView *view = GIMP_DOCUMENT_VIEW (data);
gimp_button_extended_clicked (GIMP_BUTTON (view->refresh_button),
GDK_SHIFT_MASK);
}
void
documents_delete_dangling_documents_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpDocumentView *view = GIMP_DOCUMENT_VIEW (data);
gimp_button_extended_clicked (GIMP_BUTTON (view->refresh_button),
GDK_CONTROL_MASK);
}

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_document_cmd_callback (GtkWidget *widget,
gpointer data);
void documents_raise_or_open_document_cmd_callback (GtkWidget *widget,
gpointer data);
void documents_file_open_dialog_cmd_callback (GtkWidget *widget,
gpointer data);
void documents_remove_document_cmd_callback (GtkWidget *widget,
gpointer data);
void documents_recreate_preview_cmd_callback (GtkWidget *widget,
gpointer data);
void documents_reload_previews_cmd_callback (GtkWidget *widget,
gpointer data);
void documents_delete_dangling_documents_cmd_callback (GtkWidget *widget,
gpointer data);
#endif /* __DOCUMENTS_COMMANDS_H__ */

View File

@@ -1,217 +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 "gui-types.h"
#include "core/gimp.h"
#include "core/gimpcontext.h"
#include "core/gimpdrawable.h"
#include "core/gimpdrawable-desaturate.h"
#include "core/gimpdrawable-equalize.h"
#include "core/gimpdrawable-invert.h"
#include "core/gimpimage.h"
#include "core/gimpimage-undo.h"
#include "core/gimpitem-linked.h"
#include "widgets/gimpdock.h"
#include "widgets/gimpitemtreeview.h"
#include "display/gimpdisplay.h"
#include "drawable-commands.h"
#include "offset-dialog.h"
#include "gimp-intl.h"
#define return_if_no_image(gimage,data) \
if (GIMP_IS_DISPLAY (data)) \
gimage = ((GimpDisplay *) data)->gimage; \
else if (GIMP_IS_GIMP (data)) \
gimage = gimp_context_get_image (gimp_get_user_context (GIMP (data))); \
else if (GIMP_IS_DOCK (data)) \
gimage = gimp_context_get_image (((GimpDock *) data)->context); \
else if (GIMP_IS_ITEM_TREE_VIEW (data)) \
gimage = ((GimpItemTreeView *) data)->gimage; \
else \
gimage = NULL; \
\
if (! gimage) \
return
#define return_if_no_drawable(gimage,drawable,data) \
return_if_no_image (gimage,data); \
drawable = gimp_image_active_drawable (gimage); \
if (! drawable) \
return
/* public functions */
void
drawable_desaturate_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpImage *gimage;
GimpDrawable *active_drawable;
return_if_no_drawable (gimage, active_drawable, data);
if (! gimp_drawable_is_rgb (active_drawable))
{
g_message (_("Desaturate operates only on RGB color layers."));
return;
}
gimp_drawable_desaturate (active_drawable);
gimp_image_flush (gimage);
}
void
drawable_invert_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpImage *gimage;
GimpDrawable *active_drawable;
return_if_no_drawable (gimage, active_drawable, data);
if (gimp_drawable_is_indexed (active_drawable))
{
g_message (_("Invert does not operate on indexed layers."));
return;
}
gimp_drawable_invert (active_drawable);
gimp_image_flush (gimage);
}
void
drawable_equalize_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpImage *gimage;
GimpDrawable *active_drawable;
return_if_no_drawable (gimage, active_drawable, data);
if (gimp_drawable_is_indexed (active_drawable))
{
g_message (_("Equalize does not operate on indexed layers."));
return;
}
gimp_drawable_equalize (active_drawable, TRUE);
gimp_image_flush (gimage);
}
void
drawable_flip_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
GimpImage *gimage;
GimpDrawable *active_drawable;
GimpItem *item;
gint off_x, off_y;
gdouble axis = 0.0;
return_if_no_drawable (gimage, active_drawable, data);
item = GIMP_ITEM (active_drawable);
gimp_item_offsets (item, &off_x, &off_y);
switch ((GimpOrientationType) action)
{
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,
_("Flip Layer"));
gimp_item_flip (item, (GimpOrientationType) action, axis, FALSE);
if (gimp_item_get_linked (item))
{
gimp_item_linked_flip (item, (GimpOrientationType) action, axis, FALSE);
gimp_image_undo_group_end (gimage);
}
gimp_image_flush (gimage);
}
void
drawable_rotate_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
GimpImage *gimage;
GimpDrawable *active_drawable;
GimpItem *item;
gint off_x, off_y;
gdouble center_x, center_y;
return_if_no_drawable (gimage, active_drawable, data);
item = GIMP_ITEM (active_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,
_("Rotate Layer"));
gimp_item_rotate (item, (GimpRotationType) action, center_x, center_y, FALSE);
if (gimp_item_get_linked (item))
{
gimp_item_linked_rotate (item, (GimpRotationType) action,
center_x, center_y, FALSE);
gimp_image_undo_group_end (gimage);
}
gimp_image_flush (gimage);
}
void
drawable_offset_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpImage *gimage;
GimpDrawable *active_drawable;
return_if_no_drawable (gimage, active_drawable, data);
offset_dialog_create (active_drawable, widget);
}

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 __DRAWABLE_COMMANDS_H__
#define __DRAWABLE_COMMANDS_H__
void drawable_desaturate_cmd_callback (GtkWidget *widget,
gpointer data);
void drawable_invert_cmd_callback (GtkWidget *widget,
gpointer data);
void drawable_equalize_cmd_callback (GtkWidget *widget,
gpointer data);
void drawable_flip_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void drawable_rotate_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void drawable_offset_cmd_callback (GtkWidget *widget,
gpointer data);
#endif /* __DRAWABLE_COMMANDS_H__ */

View File

@@ -1,373 +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 "gui-types.h"
#include "core/gimp.h"
#include "core/gimp-edit.h"
#include "core/gimpbuffer.h"
#include "core/gimpcontainer.h"
#include "core/gimpcontext.h"
#include "core/gimpdrawable.h"
#include "core/gimpimage.h"
#include "core/gimpimage-undo.h"
#include "core/gimptoolinfo.h"
#include "display/gimpdisplay.h"
#include "display/gimpdisplayshell.h"
#include "display/gimpdisplayshell-transform.h"
#include "widgets/gimpdock.h"
#include "widgets/gimphelp-ids.h"
#include "widgets/gimpdialogfactory.h"
#include "dialogs.h"
#include "edit-commands.h"
#include "stroke-dialog.h"
#include "gimp-intl.h"
#define return_if_no_display(gdisp,data) \
if (GIMP_IS_DISPLAY (data)) \
gdisp = data; \
else if (GIMP_IS_GIMP (data)) \
gdisp = gimp_context_get_display (gimp_get_user_context (GIMP (data))); \
else if (GIMP_IS_DOCK (data)) \
gdisp = gimp_context_get_display (((GimpDock *) data)->context); \
else \
gdisp = NULL; \
if (! gdisp) \
return
#define return_if_no_image(gimage,data) \
if (GIMP_IS_DISPLAY (data)) \
gimage = ((GimpDisplay *) data)->gimage; \
else if (GIMP_IS_GIMP (data)) \
gimage = gimp_context_get_image (gimp_get_user_context (GIMP (data))); \
else if (GIMP_IS_DOCK (data)) \
gimage = gimp_context_get_image (((GimpDock *) data)->context); \
else \
gimage = NULL; \
if (! gimage) \
return
#define return_if_no_drawable(gimage,drawable,data) \
return_if_no_image (gimage, data); \
drawable = gimp_image_active_drawable (gimage); \
if (! drawable) \
return;
/* local function prototypes */
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 (GtkWidget *widget,
gpointer data)
{
GimpImage *gimage;
return_if_no_image (gimage, data);
if (gimp_image_undo (gimage))
gimp_image_flush (gimage);
}
void
edit_redo_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpImage *gimage;
return_if_no_image (gimage, data);
if (gimp_image_redo (gimage))
gimp_image_flush (gimage);
}
void
edit_cut_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpImage *gimage;
GimpDrawable *drawable;
return_if_no_drawable (gimage, drawable, data);
if (gimp_edit_cut (gimage, drawable))
gimp_image_flush (gimage);
}
void
edit_copy_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpImage *gimage;
GimpDrawable *drawable;
return_if_no_drawable (gimage, drawable, data);
if (gimp_edit_copy (gimage, drawable))
gimp_image_flush (gimage);
}
void
edit_paste_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
GimpDisplay *gdisp;
gboolean paste_into;
return_if_no_display (gdisp, data);
paste_into = (gboolean) action;
if (gdisp->gimage->gimp->global_buffer)
{
GimpDisplayShell *shell;
gint x, y, width, height;
shell = GIMP_DISPLAY_SHELL (gdisp->shell);
gimp_display_shell_untransform_viewport (shell, &x, &y, &width, &height);
if (gimp_edit_paste (gdisp->gimage,
gimp_image_active_drawable (gdisp->gimage),
gdisp->gimage->gimp->global_buffer,
paste_into, x, y, width, height))
{
gimp_image_flush (gdisp->gimage);
}
}
}
void
edit_paste_as_new_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpDisplay *gdisp;
return_if_no_display (gdisp, data);
if (gdisp->gimage->gimp->global_buffer)
{
gimp_edit_paste_as_new (gdisp->gimage->gimp,
gdisp->gimage,
gdisp->gimage->gimp->global_buffer);
}
}
void
edit_named_cut_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpDisplay *gdisp;
GtkWidget *qbox;
return_if_no_display (gdisp, data);
qbox = gimp_query_string_box (_("Cut Named"),
gdisp->shell,
gimp_standard_help_func,
GIMP_HELP_BUFFER_CUT,
_("Enter a name for this buffer"),
NULL,
G_OBJECT (gdisp->gimage), "disconnect",
cut_named_buffer_callback, gdisp->gimage);
gtk_widget_show (qbox);
}
void
edit_named_copy_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpDisplay *gdisp;
GtkWidget *qbox;
return_if_no_display (gdisp, data);
qbox = gimp_query_string_box (_("Copy Named"),
gdisp->shell,
gimp_standard_help_func,
GIMP_HELP_BUFFER_COPY,
_("Enter a name for this buffer"),
NULL,
G_OBJECT (gdisp->gimage), "disconnect",
copy_named_buffer_callback, gdisp->gimage);
gtk_widget_show (qbox);
}
void
edit_named_paste_cmd_callback (GtkWidget *widget,
gpointer 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 (GtkWidget *widget,
gpointer data)
{
GimpImage *gimage;
GimpDrawable *drawable;
return_if_no_drawable (gimage, drawable, data);
gimp_edit_clear (gimage, drawable);
gimp_image_flush (gimage);
}
void
edit_fill_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
GimpImage *gimage;
GimpDrawable *drawable;
GimpFillType fill_type;
return_if_no_drawable (gimage, drawable, data);
fill_type = (GimpFillType) action;
gimp_edit_fill (gimage, drawable, fill_type);
gimp_image_flush (gimage);
}
void
edit_stroke_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpImage *gimage;
GimpDrawable *drawable;
return_if_no_drawable (gimage, drawable, data);
edit_stroke_selection (GIMP_ITEM (gimp_image_get_mask (gimage)), widget);
}
void
edit_stroke_selection (GimpItem *item,
GtkWidget *parent)
{
GimpImage *gimage;
GimpDrawable *active_drawable;
GtkWidget *dialog;
g_return_if_fail (GIMP_IS_ITEM (item));
gimage = gimp_item_get_image (item);
active_drawable = gimp_image_active_drawable (gimage);
if (! active_drawable)
{
g_message (_("There is no active layer or channel to stroke to."));
return;
}
dialog = stroke_dialog_new (item, GIMP_STOCK_SELECTION_STROKE,
GIMP_HELP_SELECTION_STROKE,
parent);
gtk_widget_show (dialog);
}
/* private functions */
static void
cut_named_buffer_callback (GtkWidget *widget,
const gchar *name,
gpointer data)
{
GimpImage *gimage = GIMP_IMAGE (data);
const GimpBuffer *cut_buffer;
GimpDrawable *active_drawable;
active_drawable = gimp_image_active_drawable (gimage);
if (! active_drawable)
{
g_message (_("There is no active layer or channel to cut from."));
return;
}
cut_buffer = gimp_edit_cut (gimage, active_drawable);
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 *active_drawable;
active_drawable = gimp_image_active_drawable (gimage);
if (! active_drawable)
{
g_message (_("There is no active layer or channel to copy from."));
return;
}
copy_buffer = gimp_edit_copy (gimage, active_drawable);
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 (GtkWidget *widget,
gpointer data);
void edit_redo_cmd_callback (GtkWidget *widget,
gpointer data);
void edit_cut_cmd_callback (GtkWidget *widget,
gpointer data);
void edit_copy_cmd_callback (GtkWidget *widget,
gpointer data);
void edit_paste_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void edit_paste_as_new_cmd_callback (GtkWidget *widget,
gpointer data);
void edit_named_cut_cmd_callback (GtkWidget *widget,
gpointer data);
void edit_named_copy_cmd_callback (GtkWidget *widget,
gpointer data);
void edit_named_paste_cmd_callback (GtkWidget *widget,
gpointer data);
void edit_clear_cmd_callback (GtkWidget *widget,
gpointer data);
void edit_fill_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void edit_stroke_cmd_callback (GtkWidget *widget,
gpointer data);
void edit_stroke_selection (GimpItem *item,
GtkWidget *parent);
#endif /* __EDIT_COMMANDS_H__ */

View File

@@ -1,66 +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 "gui-types.h"
#include "widgets/gimperrorconsole.h"
#include "error-console-commands.h"
/* public functions */
void
error_console_clear_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
GimpErrorConsole *console = GIMP_ERROR_CONSOLE (data);
if (GTK_WIDGET_IS_SENSITIVE (console->clear_button))
gtk_button_clicked (GTK_BUTTON (console->clear_button));
}
void
error_console_save_all_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
GimpErrorConsole *console = GIMP_ERROR_CONSOLE (data);
if (GTK_WIDGET_IS_SENSITIVE (console->save_button))
gtk_button_clicked (GTK_BUTTON (console->save_button));
}
void
error_console_save_selection_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
GimpErrorConsole *console = GIMP_ERROR_CONSOLE (data);
if (GTK_WIDGET_IS_SENSITIVE (console->save_button))
gimp_button_extended_clicked (GIMP_BUTTON (console->save_button),
GDK_SHIFT_MASK);
}

View File

@@ -1,34 +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 (GtkWidget *widget,
gpointer data,
guint action);
void error_console_save_all_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void error_console_save_selection_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
#endif /* __ERROR_CONSOLE_COMMANDS_H__ */

View File

@@ -1,469 +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 "gui-types.h"
#include "config/gimpguiconfig.h"
#include "core/gimp.h"
#include "core/gimpcontainer.h"
#include "core/gimpcontext.h"
#include "core/gimplist.h"
#include "core/gimpimage.h"
#include "core/gimptemplate.h"
#include "file/file-open.h"
#include "file/file-save.h"
#include "file/file-utils.h"
#include "widgets/gimpdock.h"
#include "widgets/gimphelp-ids.h"
#include "widgets/gimpdialogfactory.h"
#include "widgets/gimpfiledialog.h"
#include "display/gimpdisplay.h"
#include "display/gimpdisplay-foreach.h"
#include "display/gimpdisplayshell.h"
#include "dialogs.h"
#include "file-commands.h"
#include "file-new-dialog.h"
#include "file-open-dialog.h"
#include "file-save-dialog.h"
#include "menus.h"
#include "gimp-intl.h"
#define REVERT_DATA_KEY "revert-confirm-dialog"
#define return_if_no_gimp(gimp,data) \
if (GIMP_IS_DISPLAY (data)) \
gimp = ((GimpDisplay *) data)->gimage->gimp; \
else if (GIMP_IS_GIMP (data)) \
gimp = data; \
else if (GIMP_IS_DOCK (data)) \
gimp = ((GimpDock *) data)->context->gimp; \
else \
gimp = NULL; \
if (! gimp) \
return
#define return_if_no_display(gdisp,data) \
if (GIMP_IS_DISPLAY (data)) \
gdisp = data; \
else if (GIMP_IS_GIMP (data)) \
gdisp = gimp_context_get_display (gimp_get_user_context (GIMP (data))); \
else if (GIMP_IS_DOCK (data)) \
gdisp = gimp_context_get_display (((GimpDock *) data)->context); \
else \
gdisp = NULL; \
if (! gdisp) \
return
/* local function prototypes */
static void file_new_template_callback (GtkWidget *widget,
const gchar *name,
gpointer data);
static void file_revert_confirm_callback (GtkWidget *widget,
gboolean revert,
gpointer data);
/* public functions */
void
file_new_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
Gimp *gimp;
GimpImage *gimage;
GtkWidget *dialog;
return_if_no_gimp (gimp, data);
/* if called from the image menu */
if (action)
gimage = gimp_context_get_image (gimp_get_user_context (gimp));
else
gimage = NULL;
dialog = gimp_dialog_factory_dialog_new (global_dialog_factory,
gtk_widget_get_screen (widget),
"gimp-file-new-dialog", -1);
if (dialog)
file_new_dialog_set (dialog, gimage, NULL);
}
void
file_type_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
gimp_file_dialog_set_file_proc (GIMP_FILE_DIALOG (data),
g_object_get_data (G_OBJECT (widget),
"file-proc"));
}
void
file_open_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
Gimp *gimp;
GimpImage *gimage;
return_if_no_gimp (gimp, data);
/* if called from the image menu */
if (action)
gimage = gimp_context_get_image (gimp_get_user_context (gimp));
else
gimage = NULL;
file_open_dialog_show (gimp, gimage, NULL, global_menu_factory, widget);
}
void
file_last_opened_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
Gimp *gimp;
GimpImagefile *imagefile;
guint num_entries;
return_if_no_gimp (gimp, data);
num_entries = gimp_container_num_children (gimp->documents);
if (action >= num_entries)
return;
imagefile = (GimpImagefile *)
gimp_container_get_child_by_index (gimp->documents, action);
if (imagefile)
{
GimpImage *gimage;
GimpPDBStatusType status;
GError *error = NULL;
gimage = file_open_with_display (gimp, 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 (GtkWidget *widget,
gpointer data,
guint action)
{
GimpDisplay *gdisp;
return_if_no_display (gdisp, data);
g_return_if_fail (gimp_image_active_drawable (gdisp->gimage));
/* Only save if the gimage has been modified */
if (gdisp->gimage->dirty ||
! GIMP_GUI_CONFIG (gdisp->gimage->gimp->config)->trust_dirty_flag)
{
const gchar *uri;
uri = gimp_object_get_name (GIMP_OBJECT (gdisp->gimage));
if (! uri)
{
file_save_as_cmd_callback (widget, data, action);
}
else
{
GimpPDBStatusType status;
GError *error = NULL;
status = file_save (gdisp->gimage, GIMP_RUN_WITH_LAST_VALS, &error);
if (status != GIMP_PDB_SUCCESS &&
status != GIMP_PDB_CANCEL)
{
gchar *filename;
filename = file_utils_uri_to_utf8_filename (uri);
g_message (_("Saving '%s' failed:\n\n%s"),
filename, error->message);
g_clear_error (&error);
g_free (filename);
}
}
}
}
void
file_save_as_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
GimpDisplay *gdisp;
return_if_no_display (gdisp, data);
file_save_dialog_show (gdisp->gimage, global_menu_factory, widget);
}
void
file_save_a_copy_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
GimpDisplay *gdisp;
return_if_no_display (gdisp, data);
file_save_a_copy_dialog_show (gdisp->gimage, global_menu_factory, widget);
}
void
file_save_template_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
GimpDisplay *gdisp;
GtkWidget *qbox;
return_if_no_display (gdisp, data);
qbox = 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 (qbox);
}
void
file_revert_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
GimpDisplay *gdisp;
GtkWidget *query_box;
const gchar *uri;
return_if_no_display (gdisp, data);
uri = gimp_object_get_name (GIMP_OBJECT (gdisp->gimage));
query_box = 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 (query_box)
{
gtk_window_present (GTK_WINDOW (query_box->window));
}
else
{
gchar *basename;
gchar *text;
basename = g_path_get_basename (uri);
text = g_strdup_printf (_("Revert '%s' to\n"
"'%s'?\n\n"
"You will lose all your changes, "
"including all undo information."),
basename, uri);
g_free (basename);
query_box = gimp_query_boolean_box (_("Revert Image"),
gdisp->shell,
gimp_standard_help_func,
GIMP_HELP_FILE_REVERT,
GIMP_STOCK_QUESTION,
text,
GTK_STOCK_YES, GTK_STOCK_NO,
G_OBJECT (gdisp->gimage),
"disconnect",
file_revert_confirm_callback,
gdisp->gimage);
g_free (text);
g_object_set_data (G_OBJECT (gdisp->gimage), REVERT_DATA_KEY,
query_box);
gtk_window_set_transient_for (GTK_WINDOW (query_box),
GTK_WINDOW (gdisp->shell));
gtk_widget_show (query_box);
}
}
void
file_close_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
GimpDisplay *gdisp;
return_if_no_display (gdisp, data);
gimp_display_shell_close (GIMP_DISPLAY_SHELL (gdisp->shell), FALSE);
}
void
file_quit_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
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 (gimp, NULL, uri, global_menu_factory, parent);
}
/* private functions */
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_list_uniquefy_name (GIMP_LIST (gimage->gimp->templates),
GIMP_OBJECT (template), TRUE);
gimp_container_add (gimage->gimp->templates,
GIMP_OBJECT (template));
g_object_unref (template);
}
static void
file_revert_confirm_callback (GtkWidget *widget,
gboolean revert,
gpointer data)
{
GimpImage *old_gimage;
old_gimage = (GimpImage *) data;
g_object_set_data (G_OBJECT (old_gimage), REVERT_DATA_KEY, NULL);
if (revert)
{
Gimp *gimp;
GimpImage *new_gimage;
const gchar *uri;
GimpPDBStatusType status;
GError *error = NULL;
gimp = old_gimage->gimp;
uri = gimp_object_get_name (GIMP_OBJECT (old_gimage));
new_gimage = file_open_image (gimp, uri, uri, NULL,
GIMP_RUN_INTERACTIVE,
&status, &error);
if (new_gimage)
{
GList *contexts = NULL;
GList *list;
/* remember which contexts refer to old_gimage */
for (list = gimp->context_list; list; list = g_list_next (list))
{
GimpContext *context = list->data;
if (gimp_context_get_image (context) == old_gimage)
contexts = g_list_prepend (contexts, list->data);
}
gimp_displays_reconnect (gimp, old_gimage, new_gimage);
gimp_image_flush (new_gimage);
/* set the new_gimage on the remembered contexts (in reverse
* order, since older contexts are usually the parents of
* newer ones)
*/
g_list_foreach (contexts, (GFunc) gimp_context_set_image, new_gimage);
g_list_free (contexts);
/* 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,69 +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_new_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void file_type_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void file_open_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void file_last_opened_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void file_save_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void file_save_as_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void file_save_a_copy_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void file_save_template_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void file_revert_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void file_pref_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void file_close_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void file_quit_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void file_file_open_dialog (Gimp *gimp,
const gchar *uri,
GtkWidget *parent);
#endif /* __FILE_COMMANDS_H__ */

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.
*/
#include "config.h"
#include <gtk/gtk.h>
#include "gui-types.h"
#include "widgets/gimpfontview.h"
#include "fonts-commands.h"
#include "gimp-intl.h"
/* public functionss */
void
fonts_refresh_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpFontView *view = GIMP_FONT_VIEW (data);
if (GTK_WIDGET_SENSITIVE (view->refresh_button))
gtk_button_clicked (GTK_BUTTON (view->refresh_button));
}

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 (GtkWidget *widget,
gpointer data);
#endif /* __FONTS_COMMANDS_H__ */

File diff suppressed because it is too large Load Diff

View File

@@ -1,80 +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__
void gradient_editor_left_color_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void gradient_editor_load_left_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void gradient_editor_save_left_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void gradient_editor_right_color_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void gradient_editor_load_right_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void gradient_editor_save_right_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void gradient_editor_blending_func_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void gradient_editor_coloring_type_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void gradient_editor_flip_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void gradient_editor_replicate_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void gradient_editor_split_midpoint_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void gradient_editor_split_uniformly_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void gradient_editor_delete_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void gradient_editor_recenter_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void gradient_editor_redistribute_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void gradient_editor_blend_color_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void gradient_editor_blend_opacity_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
#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 "gui-types.h"
#include "core/gimpgradient.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_query (GimpContainerEditor *editor);
static void gradients_save_as_pov_response (GtkWidget *dialog,
gint response_id,
GimpGradient *gradient);
/* public functions */
void
gradients_save_as_pov_ray_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpContainerEditor *editor = GIMP_CONTAINER_EDITOR (data);
gradients_save_as_pov_query (editor);
}
/* private functions */
static void
gradients_save_as_pov_query (GimpContainerEditor *editor)
{
GimpGradient *gradient;
GtkFileSelection *filesel;
gchar *title;
gradient = gimp_context_get_gradient (editor->view->context);
if (! gradient)
return;
title = g_strdup_printf (_("Save '%s' as POV-Ray"),
GIMP_OBJECT (gradient)->name);
filesel = GTK_FILE_SELECTION (gtk_file_selection_new (title));
g_free (title);
gtk_window_set_screen (GTK_WINDOW (filesel),
gtk_widget_get_screen (GTK_WIDGET (editor)));
gtk_window_set_role (GTK_WINDOW (filesel), "gimp-gradient-save-pov");
gtk_window_set_position (GTK_WINDOW (filesel), GTK_WIN_POS_MOUSE);
gtk_container_set_border_width (GTK_CONTAINER (filesel), 6);
gtk_container_set_border_width (GTK_CONTAINER (filesel->button_area), 4);
g_signal_connect (filesel, "response",
G_CALLBACK (gradients_save_as_pov_response),
gradient);
g_object_ref (gradient);
g_signal_connect_object (filesel, "destroy",
G_CALLBACK (g_object_unref),
gradient,
G_CONNECT_SWAPPED);
gimp_help_connect (GTK_WIDGET (filesel), gimp_standard_help_func,
GIMP_HELP_GRADIENT_SAVE_AS_POV, NULL);
gtk_widget_show (GTK_WIDGET (filesel));
}
static void
gradients_save_as_pov_response (GtkWidget *dialog,
gint response_id,
GimpGradient *gradient)
{
if (response_id == GTK_RESPONSE_OK)
{
const gchar *filename;
GError *error = NULL;
filename = gtk_file_selection_get_filename (GTK_FILE_SELECTION (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 (GtkWidget *widget,
gpointer data);
#endif /* __GRADIENTS_COMMANDS_H__ */

View File

@@ -1,44 +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 "gui-types.h"
#include "help-commands.h"
void
help_help_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
gimp_standard_help_func (NULL, NULL);
}
void
help_context_help_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
gimp_context_help (widget);
}

View File

@@ -1,31 +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_COMMANDS_H__
#define __HELP_COMMANDS_H__
void help_help_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void help_context_help_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
#endif /* __HELP_COMMANDS_H__ */

View File

@@ -1,655 +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/gimputils.h"
#include "libgimpwidgets/gimpwidgets.h"
#include "gui-types.h"
#include "config/gimpguiconfig.h"
#include "core/core-enums.h"
#include "core/gimp.h"
#include "core/gimpchannel.h"
#include "core/gimpcontext.h"
#include "core/gimpimage.h"
#include "core/gimpimage-crop.h"
#include "core/gimpimage-duplicate.h"
#include "core/gimpimage-flip.h"
#include "core/gimpimage-merge.h"
#include "core/gimpimage-resize.h"
#include "core/gimpimage-rotate.h"
#include "core/gimpimage-scale.h"
#include "core/gimpimage-undo.h"
#include "widgets/gimpdock.h"
#include "widgets/gimphelp-ids.h"
#include "widgets/gimpviewabledialog.h"
#include "display/gimpdisplay.h"
#include "display/gimpdisplayshell.h"
#include "display/gimpprogress.h"
#include "convert-dialog.h"
#include "image-commands.h"
#include "grid-dialog.h"
#include "resize-dialog.h"
#include "gimp-intl.h"
typedef struct
{
Resize *resize;
GimpDisplay *gdisp;
GimpImage *gimage;
} ImageResize;
#define return_if_no_display(gdisp,data) \
if (GIMP_IS_DISPLAY (data)) \
gdisp = data; \
else if (GIMP_IS_GIMP (data)) \
gdisp = gimp_context_get_display (gimp_get_user_context (GIMP (data))); \
else if (GIMP_IS_DOCK (data)) \
gdisp = gimp_context_get_display (((GimpDock *) data)->context); \
else \
gdisp = NULL; \
if (! gdisp) \
return
#define return_if_no_image(gimage,data) \
if (GIMP_IS_DISPLAY (data)) \
gimage = ((GimpDisplay *) data)->gimage; \
else if (GIMP_IS_GIMP (data)) \
gimage = gimp_context_get_image (gimp_get_user_context (GIMP (data))); \
else if (GIMP_IS_DOCK (data)) \
gimage = gimp_context_get_image (((GimpDock *) data)->context); \
else \
gimage = NULL; \
if (! gimage) \
return
/* local functions */
static void image_resize_callback (GtkWidget *widget,
gpointer data);
static void image_scale_callback (GtkWidget *widget,
gpointer data);
static void image_scale_warn (ImageResize *image_scale,
const gchar *warning_title,
const gchar *warning_message);
static void image_scale_warn_callback (GtkWidget *widget,
gboolean do_scale,
gpointer data);
static void image_scale_implement (ImageResize *image_scale);
/* public functions */
void
image_convert_rgb_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpImage *gimage;
return_if_no_image (gimage, data);
convert_to_rgb (gimage);
}
void
image_convert_grayscale_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpImage *gimage;
return_if_no_image (gimage, data);
convert_to_grayscale (gimage);
}
void
image_convert_indexed_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpImage *gimage;
return_if_no_image (gimage, data);
convert_to_indexed (gimage, widget);
}
void
image_resize_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpDisplay *gdisp;
GimpImage *gimage;
ImageResize *image_resize;
return_if_no_display (gdisp, data);
gimage = gdisp->gimage;
image_resize = g_new0 (ImageResize, 1);
image_resize->gdisp = gdisp;
image_resize->gimage = gimage;
image_resize->resize =
resize_widget_new (GIMP_VIEWABLE (gimage), gdisp->shell,
ResizeWidget,
gimage->width,
gimage->height,
gimage->xresolution,
gimage->yresolution,
gimage->unit,
GIMP_DISPLAY_SHELL (gdisp->shell)->dot_for_dot,
G_CALLBACK (image_resize_callback),
image_resize);
g_signal_connect_object (gdisp, "disconnect",
G_CALLBACK (gtk_widget_destroy),
image_resize->resize->resize_shell,
G_CONNECT_SWAPPED);
g_object_weak_ref (G_OBJECT (image_resize->resize->resize_shell),
(GWeakNotify) g_free,
image_resize);
gtk_widget_show (image_resize->resize->resize_shell);
}
void
image_scale_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpDisplay *gdisp;
GimpImage *gimage;
ImageResize *image_scale;
return_if_no_display (gdisp, data);
gimage = gdisp->gimage;
image_scale = g_new0 (ImageResize, 1);
image_scale->gdisp = gdisp;
image_scale->gimage = gimage;
image_scale->resize =
resize_widget_new (GIMP_VIEWABLE (gimage), gdisp->shell,
ScaleWidget,
gimage->width,
gimage->height,
gimage->xresolution,
gimage->yresolution,
gimage->unit,
GIMP_DISPLAY_SHELL (gdisp->shell)->dot_for_dot,
G_CALLBACK (image_scale_callback),
image_scale);
g_signal_connect_object (gdisp, "disconnect",
G_CALLBACK (gtk_widget_destroy),
image_scale->resize->resize_shell,
G_CONNECT_SWAPPED);
g_object_weak_ref (G_OBJECT (image_scale->resize->resize_shell),
(GWeakNotify) g_free,
image_scale);
gtk_widget_show (image_scale->resize->resize_shell);
}
void
image_flip_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
GimpDisplay *gdisp;
GimpProgress *progress;
return_if_no_display (gdisp, data);
progress = gimp_progress_start (gdisp, _("Flipping..."), TRUE, NULL, NULL);
gimp_image_flip (gdisp->gimage, (GimpOrientationType) action,
gimp_progress_update_and_flush, progress);
gimp_progress_end (progress);
gimp_image_flush (gdisp->gimage);
}
void
image_rotate_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
GimpDisplay *gdisp;
GimpProgress *progress;
return_if_no_display (gdisp, data);
progress = gimp_progress_start (gdisp, _("Rotating..."), TRUE, NULL, NULL);
gimp_image_rotate (gdisp->gimage, (GimpRotationType) action,
gimp_progress_update_and_flush, progress);
gimp_progress_end (progress);
gimp_image_flush (gdisp->gimage);
}
void
image_crop_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpDisplay *gdisp;
gint x1, y1, x2, y2;
return_if_no_display (gdisp, data);
if (! gimp_channel_bounds (gimp_image_get_mask (gdisp->gimage),
&x1, &y1, &x2, &y2))
{
g_message (_("Cannot crop because the current selection is empty."));
return;
}
gimp_image_crop (gdisp->gimage, x1, y1, x2, y2, FALSE, TRUE);
gimp_image_flush (gdisp->gimage);
}
void
image_duplicate_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpImage *gimage;
GimpImage *new_gimage;
return_if_no_image (gimage, data);
new_gimage = gimp_image_duplicate (gimage);
gimp_create_display (new_gimage->gimp, new_gimage, 1.0);
g_object_unref (new_gimage);
}
void
image_merge_layers_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpImage *gimage;
return_if_no_image (gimage, data);
image_layers_merge_query (gimage, TRUE, widget);
}
void
image_flatten_image_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpImage *gimage;
return_if_no_image (gimage, data);
gimp_image_flatten (gimage);
gimp_image_flush (gimage);
}
void
image_configure_grid_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpDisplay *gdisp;
GimpDisplayShell *shell;
GimpImage *gimage;
return_if_no_display (gdisp, data);
shell = GIMP_DISPLAY_SHELL (gdisp->shell);
gimage = GIMP_IMAGE (gdisp->gimage);
if (! shell->grid_dialog)
{
shell->grid_dialog = grid_dialog_new (GIMP_IMAGE (gimage), widget);
gtk_window_set_transient_for (GTK_WINDOW (shell->grid_dialog),
GTK_WINDOW (shell));
gtk_window_set_destroy_with_parent (GTK_WINDOW (shell->grid_dialog),
TRUE);
g_object_add_weak_pointer (G_OBJECT (shell->grid_dialog),
(gpointer *) &shell->grid_dialog);
}
gtk_window_present (GTK_WINDOW (shell->grid_dialog));
}
/****************************/
/* The layer merge dialog */
/****************************/
typedef struct _LayerMergeOptions LayerMergeOptions;
struct _LayerMergeOptions
{
GtkWidget *query_box;
GimpImage *gimage;
gboolean merge_visible;
GimpMergeType merge_type;
};
static void
image_layers_merge_query_response (GtkWidget *widget,
gint response_id,
LayerMergeOptions *options)
{
GimpImage *gimage = options->gimage;
if (! gimage)
return;
if (response_id == GTK_RESPONSE_OK)
{
if (options->merge_visible)
gimp_image_merge_visible_layers (gimage, options->merge_type);
gimp_image_flush (gimage);
}
gtk_widget_destroy (options->query_box);
}
void
image_layers_merge_query (GimpImage *gimage,
/* if FALSE, anchor active layer */
gboolean merge_visible,
GtkWidget *parent)
{
LayerMergeOptions *options;
GtkWidget *vbox;
GtkWidget *frame;
/* The new options structure */
options = g_new (LayerMergeOptions, 1);
options->gimage = gimage;
options->merge_visible = merge_visible;
options->merge_type = GIMP_EXPAND_AS_NECESSARY;
/* The dialog */
options->query_box =
gimp_viewable_dialog_new (GIMP_VIEWABLE (gimage),
_("Merge Layers"), "gimp-image-merge-layers",
GIMP_STOCK_MERGE_DOWN,
_("Layers Merge Options"),
parent,
gimp_standard_help_func,
GIMP_HELP_IMAGE_MERGE_LAYERS,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OK, GTK_RESPONSE_OK,
NULL);
g_signal_connect (options->query_box, "response",
G_CALLBACK (image_layers_merge_query_response),
options);
g_object_weak_ref (G_OBJECT (options->query_box),
(GWeakNotify) g_free,
options);
/* The main vbox */
vbox = gtk_vbox_new (FALSE, 4);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 6);
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (options->query_box)->vbox),
vbox);
frame =
gimp_int_radio_group_new (TRUE,
merge_visible ?
_("Final, Merged Layer should be:") :
_("Final, Anchored Layer should be:"),
G_CALLBACK (gimp_radio_button_update),
&options->merge_type, options->merge_type,
_("Expanded as necessary"),
GIMP_EXPAND_AS_NECESSARY, NULL,
_("Clipped to image"),
GIMP_CLIP_TO_IMAGE, NULL,
_("Clipped to bottom layer"),
GIMP_CLIP_TO_BOTTOM_LAYER, NULL,
NULL);
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
gtk_widget_show (frame);
gtk_widget_show (vbox);
gtk_widget_show (options->query_box);
}
/* private functions */
static void
image_resize_callback (GtkWidget *widget,
gpointer data)
{
ImageResize *image_resize;
image_resize = (ImageResize *) data;
g_assert (image_resize != NULL);
g_assert (image_resize->gimage != NULL);
gtk_widget_set_sensitive (image_resize->resize->resize_shell, FALSE);
if (image_resize->resize->width > 0 &&
image_resize->resize->height > 0)
{
GimpProgress *progress;
progress = gimp_progress_start (image_resize->gdisp,
_("Resizing..."),
TRUE, NULL, NULL);
gimp_image_resize (image_resize->gimage,
image_resize->resize->width,
image_resize->resize->height,
image_resize->resize->offset_x,
image_resize->resize->offset_y,
gimp_progress_update_and_flush, progress);
gimp_progress_end (progress);
gimp_image_flush (image_resize->gimage);
}
else
{
g_message (_("Resize Error: Both width and height must be "
"greater than zero."));
}
gtk_widget_destroy (image_resize->resize->resize_shell);
}
static void
image_scale_callback (GtkWidget *widget,
gpointer data)
{
ImageResize *image_scale = data;
GimpImageScaleCheckType scale_check;
gint64 new_memsize;
gchar *warning_message;
g_assert (image_scale != NULL);
g_assert (image_scale->gimage != NULL);
gtk_widget_set_sensitive (image_scale->resize->resize_shell, FALSE);
scale_check = gimp_image_scale_check (image_scale->gimage,
image_scale->resize->width,
image_scale->resize->height,
&new_memsize);
switch (scale_check)
{
case GIMP_IMAGE_SCALE_TOO_BIG:
{
gchar *size_str;
gchar *max_size_str;
size_str = gimp_memsize_to_string (new_memsize);
max_size_str = gimp_memsize_to_string
(GIMP_GUI_CONFIG (image_scale->gimage->gimp->config)->max_new_image_size);
warning_message = g_strdup_printf
(_("You are trying to create an image with a size of %s.\n\n"
"Choose OK to create this image anyway.\n"
"Choose Cancel if you did not intend to create such a "
"large image.\n\n"
"To prevent this dialog from appearing, increase the "
"\"Maximum Image Size\" setting (currently %s) in the "
"Preferences dialog."),
size_str, max_size_str);
g_free (size_str);
g_free (max_size_str);
image_scale_warn (image_scale, _("Image exceeds maximum image size"),
warning_message);
g_free (warning_message);
}
break;
case GIMP_IMAGE_SCALE_TOO_SMALL:
warning_message = _("The chosen image size will shrink "
"some layers completely away. "
"Is this what you want?");
image_scale_warn (image_scale, _("Layer Too Small"),
warning_message);
break;
case GIMP_IMAGE_SCALE_OK:
/* If all is well, return directly after scaling image. */
image_scale_implement (image_scale);
gtk_widget_destroy (image_scale->resize->resize_shell);
break;
}
}
static void
image_scale_warn (ImageResize *image_scale,
const gchar *warning_title,
const gchar *warning_message)
{
GtkWidget *dialog;
dialog = gimp_query_boolean_box (warning_title,
image_scale->resize->resize_shell,
gimp_standard_help_func,
GIMP_HELP_IMAGE_SCALE_WARNING,
GTK_STOCK_DIALOG_QUESTION,
warning_message,
GTK_STOCK_OK, GTK_STOCK_CANCEL,
G_OBJECT (image_scale->resize->resize_shell),
"destroy",
image_scale_warn_callback,
image_scale);
gtk_widget_show (dialog);
}
static void
image_scale_warn_callback (GtkWidget *widget,
gboolean do_scale,
gpointer data)
{
ImageResize *image_scale = data;
if (do_scale) /* User doesn't mind losing layers or
* creating huge image... */
{
image_scale_implement (image_scale);
gtk_widget_destroy (image_scale->resize->resize_shell);
}
else
{
gtk_widget_set_sensitive (image_scale->resize->resize_shell, TRUE);
}
}
static void
image_scale_implement (ImageResize *image_scale)
{
GimpImage *gimage;
g_assert (image_scale != NULL);
g_assert (image_scale->gimage != NULL);
gimage = image_scale->gimage;
if (image_scale->resize->resolution_x == gimage->xresolution &&
image_scale->resize->resolution_y == gimage->yresolution &&
image_scale->resize->unit == gimage->unit &&
image_scale->resize->width == gimage->width &&
image_scale->resize->height == gimage->height)
return;
gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_IMAGE_SCALE,
_("Scale Image"));
gimp_image_set_resolution (gimage,
image_scale->resize->resolution_x,
image_scale->resize->resolution_y);
gimp_image_set_unit (gimage, image_scale->resize->unit);
if (image_scale->resize->width != gimage->width ||
image_scale->resize->height != gimage->height)
{
if (image_scale->resize->width > 0 &&
image_scale->resize->height > 0)
{
GimpProgress *progress;
progress = gimp_progress_start (image_scale->gdisp,
_("Scaling..."),
TRUE, NULL, NULL);
gimp_image_scale (gimage,
image_scale->resize->width,
image_scale->resize->height,
image_scale->resize->interpolation,
gimp_progress_update_and_flush, progress);
gimp_progress_end (progress);
}
else
{
g_message (_("Scale Error: Both width and height must be "
"greater than zero."));
return;
}
}
gimp_image_undo_group_end (gimage);
gimp_image_flush (gimage);
}

View File

@@ -1,58 +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 __IMAGE_COMMANDS_H__
#define __IMAGE_COMMANDS_H__
void image_convert_rgb_cmd_callback (GtkWidget *widget,
gpointer data);
void image_convert_grayscale_cmd_callback (GtkWidget *widget,
gpointer data);
void image_convert_indexed_cmd_callback (GtkWidget *widget,
gpointer data);
void image_resize_cmd_callback (GtkWidget *widget,
gpointer data);
void image_scale_cmd_callback (GtkWidget *widget,
gpointer data);
void image_flip_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void image_rotate_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void image_crop_cmd_callback (GtkWidget *widget,
gpointer data);
void image_duplicate_cmd_callback (GtkWidget *widget,
gpointer data);
void image_merge_layers_cmd_callback (GtkWidget *widet,
gpointer data);
void image_flatten_image_cmd_callback (GtkWidget *widet,
gpointer data);
void image_layers_merge_query (GimpImage *gimage,
gboolean merge_visible,
GtkWidget *parent);
void image_configure_grid_cmd_callback (GtkWidget *widget,
gpointer data);
#endif /* __IMAGE_COMMANDS_H__ */

View File

@@ -1,84 +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 "gui-types.h"
#include "core/gimp.h"
#include "core/gimpimage.h"
#include "core/gimplist.h"
#include "widgets/gimpimageview.h"
#include "display/gimpdisplay.h"
#include "images-commands.h"
/* public functionss */
void
images_raise_views_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpImageView *view = GIMP_IMAGE_VIEW (data);
if (GTK_WIDGET_SENSITIVE (view->raise_button))
gtk_button_clicked (GTK_BUTTON (view->raise_button));
}
void
images_new_view_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpImageView *view = GIMP_IMAGE_VIEW (data);
if (GTK_WIDGET_SENSITIVE (view->new_button))
gtk_button_clicked (GTK_BUTTON (view->new_button));
}
void
images_delete_image_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpImageView *view = GIMP_IMAGE_VIEW (data);
if (GTK_WIDGET_SENSITIVE (view->delete_button))
gtk_button_clicked (GTK_BUTTON (view->delete_button));
}
void
images_raise_views (GimpImage *gimage)
{
GList *list;
g_return_if_fail (GIMP_IS_IMAGE (gimage));
for (list = GIMP_LIST (gimage->gimp->displays)->list;
list;
list = g_list_next (list))
{
GimpDisplay *display = list->data;
if (display->gimage == gimage)
gtk_window_present (GTK_WINDOW (display->shell));
}
}

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 __IMAGES_COMMANDS_H__
#define __IMAGES_COMMANDS_H__
void images_raise_views_cmd_callback (GtkWidget *widget,
gpointer data);
void images_new_view_cmd_callback (GtkWidget *widget,
gpointer data);
void images_delete_image_cmd_callback (GtkWidget *widget,
gpointer data);
void images_raise_views (GimpImage *gimage);
#endif /* __IMAGES_COMMANDS_H__ */

File diff suppressed because it is too large Load Diff

View File

@@ -1,99 +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 __LAYERS_COMMANDS_H__
#define __LAYERS_COMMANDS_H__
void layers_select_previous_cmd_callback (GtkWidget *widet,
gpointer data);
void layers_select_next_cmd_callback (GtkWidget *widet,
gpointer data);
void layers_select_top_cmd_callback (GtkWidget *widet,
gpointer data);
void layers_select_bottom_cmd_callback (GtkWidget *widet,
gpointer data);
void layers_raise_cmd_callback (GtkWidget *widet,
gpointer data);
void layers_lower_cmd_callback (GtkWidget *widet,
gpointer data);
void layers_raise_to_top_cmd_callback (GtkWidget *widet,
gpointer data);
void layers_lower_to_bottom_cmd_callback (GtkWidget *widet,
gpointer data);
void layers_new_cmd_callback (GtkWidget *widet,
gpointer data);
void layers_duplicate_cmd_callback (GtkWidget *widet,
gpointer data);
void layers_anchor_cmd_callback (GtkWidget *widet,
gpointer data);
void layers_merge_down_cmd_callback (GtkWidget *widet,
gpointer data);
void layers_delete_cmd_callback (GtkWidget *widet,
gpointer data);
void layers_text_discard_cmd_callback (GtkWidget *widet,
gpointer data);
void layers_resize_cmd_callback (GtkWidget *widet,
gpointer data);
void layers_resize_to_image_cmd_callback (GtkWidget *widet,
gpointer data);
void layers_scale_cmd_callback (GtkWidget *widet,
gpointer data);
void layers_crop_cmd_callback (GtkWidget *widet,
gpointer data);
void layers_mask_add_cmd_callback (GtkWidget *widet,
gpointer data);
void layers_mask_apply_cmd_callback (GtkWidget *widet,
gpointer data);
void layers_mask_delete_cmd_callback (GtkWidget *widet,
gpointer data);
void layers_mask_to_selection_cmd_callback (GtkWidget *widet,
gpointer data,
guint action);
void layers_alpha_add_cmd_callback (GtkWidget *widet,
gpointer data);
void layers_alpha_to_selection_cmd_callback (GtkWidget *widet,
gpointer data,
guint action);
void layers_merge_layers_cmd_callback (GtkWidget *widget,
gpointer data);
void layers_flatten_image_cmd_callback (GtkWidget *widget,
gpointer data);
void layers_text_tool_cmd_callback (GtkWidget *widet,
gpointer data);
void layers_edit_attributes_cmd_callback (GtkWidget *widet,
gpointer data);
void layers_text_tool (GimpLayer *layer,
GtkWidget *parent);
void layers_new_layer_query (GimpImage *gimage,
GimpLayer *template,
gboolean interactive,
GtkWidget *parent);
void layers_edit_layer_query (GimpLayer *layer,
GtkWidget *parent);
#endif /* __LAYERS_COMMANDS_H__ */

View File

@@ -1,99 +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 "gui-types.h"
#include "widgets/gimppaletteeditor.h"
#include "palette-editor-commands.h"
/* public functions */
void
palette_editor_edit_color_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
GimpPaletteEditor *editor = GIMP_PALETTE_EDITOR (data);
if (GTK_WIDGET_SENSITIVE (editor->edit_button))
gtk_button_clicked (GTK_BUTTON (editor->edit_button));
}
void
palette_editor_new_color_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
GimpPaletteEditor *editor = GIMP_PALETTE_EDITOR (data);
if (GTK_WIDGET_SENSITIVE (editor->new_button))
gimp_button_extended_clicked (GIMP_BUTTON (editor->new_button),
action ? GDK_CONTROL_MASK : 0);
}
void
palette_editor_delete_color_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
GimpPaletteEditor *editor = GIMP_PALETTE_EDITOR (data);
if (GTK_WIDGET_SENSITIVE (editor->delete_button))
gtk_button_clicked (GTK_BUTTON (editor->delete_button));
}
void
palette_editor_zoom_in_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
GimpPaletteEditor *editor = GIMP_PALETTE_EDITOR (data);
if (GTK_WIDGET_SENSITIVE (editor->zoom_in_button))
gtk_button_clicked (GTK_BUTTON (editor->zoom_in_button));
}
void
palette_editor_zoom_out_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
GimpPaletteEditor *editor = GIMP_PALETTE_EDITOR (data);
if (GTK_WIDGET_SENSITIVE (editor->zoom_out_button))
gtk_button_clicked (GTK_BUTTON (editor->zoom_out_button));
}
void
palette_editor_zoom_all_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
GimpPaletteEditor *editor = GIMP_PALETTE_EDITOR (data);
if (GTK_WIDGET_SENSITIVE (editor->zoom_all_button))
gtk_button_clicked (GTK_BUTTON (editor->zoom_all_button));
}

View File

@@ -1,44 +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 __PALETTE_EDITOR_COMMANDS_H__
#define __PALETTE_EDITOR_COMMANDS_H__
void palette_editor_edit_color_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void palette_editor_new_color_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void palette_editor_delete_color_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void palette_editor_zoom_in_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void palette_editor_zoom_out_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void palette_editor_zoom_all_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
#endif /* __PALETTE_EDITOR_COMMANDS_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 "libgimpwidgets/gimpwidgets.h"
#include "gui-types.h"
#include "core/gimppalette.h"
#include "core/gimpcontainer.h"
#include "core/gimpcontext.h"
#include "widgets/gimpcontainertreeview.h"
#include "widgets/gimpdatafactoryview.h"
#include "widgets/gimphelp-ids.h"
#include "widgets/gimppreview.h"
#include "palette-import-dialog.h"
#include "palettes-commands.h"
#include "gimp-intl.h"
/* local function prototypes */
static void palettes_merge_palettes_query (GimpContainerEditor *editor);
static void palettes_merge_palettes_callback (GtkWidget *widget,
const gchar *palette_name,
gpointer data);
/* public functionss */
void
palettes_import_palette_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpContainerEditor *editor;
editor = GIMP_CONTAINER_EDITOR (data);
palette_import_dialog_show (editor->view->context->gimp);
}
void
palettes_merge_palettes_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpContainerEditor *editor;
editor = GIMP_CONTAINER_EDITOR (data);
palettes_merge_palettes_query (editor);
}
/* private functions */
static void
palettes_merge_palettes_query (GimpContainerEditor *editor)
{
GtkWidget *qbox;
qbox = gimp_query_string_box (_("Merge Palette"),
GTK_WIDGET (editor),
gimp_standard_help_func,
GIMP_HELP_PALETTE_MERGE,
_("Enter a name for the merged palette"),
NULL,
G_OBJECT (editor), "destroy",
palettes_merge_palettes_callback,
editor);
gtk_widget_show (qbox);
}
static void
palettes_merge_palettes_callback (GtkWidget *widget,
const gchar *palette_name,
gpointer data)
{
#ifdef __GNUC__
#warning FIXME: reimplement palettes_merge_palettes_callback()
#endif
#if 0
GimpContainerEditor *editor;
GimpPalette *palette;
GimpPalette *new_palette;
GimpPaletteEntry *entry;
GList *sel_list;
editor = (GimpContainerEditor *) data;
sel_list = GTK_LIST (GIMP_CONTAINER_LIST_VIEW (editor->view)->gtk_list)->selection;
if (! sel_list)
{
g_message ("Can't merge palettes because there are no palettes selected.");
return;
}
new_palette = GIMP_PALETTE (gimp_palette_new (palette_name, FALSE));
while (sel_list)
{
GimpListItem *list_item;
GList *cols;
list_item = GIMP_LIST_ITEM (sel_list->data);
palette = (GimpPalette *) GIMP_PREVIEW (list_item->preview)->viewable;
if (palette)
{
for (cols = palette->colors; cols; cols = g_list_next (cols))
{
entry = (GimpPaletteEntry *) cols->data;
gimp_palette_add_entry (new_palette,
entry->name,
&entry->color);
}
}
sel_list = sel_list->next;
}
gimp_container_add (editor->view->container,
GIMP_OBJECT (new_palette));
#endif
}

View File

@@ -1,29 +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 __PALETTES_COMMANDS_H__
#define __PALETTES_COMMANDS_H__
void palettes_import_palette_cmd_callback (GtkWidget *widget,
gpointer data);
void palettes_merge_palettes_cmd_callback (GtkWidget *widget,
gpointer data);
#endif /* __PALETTES_COMMANDS_H__ */

View File

@@ -1,180 +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 "gui-types.h"
#include "core/gimp.h"
#include "core/gimpcontext.h"
#include "core/gimpdrawable.h"
#include "core/gimpimage.h"
#include "core/gimpitem.h"
#include "plug-in/plug-in-run.h"
#include "plug-in/plug-in-proc.h"
#include "widgets/gimpdock.h"
#include "widgets/gimpitemfactory.h"
#include "display/gimpdisplay.h"
#include "plug-in-commands.h"
#include "plug-in-menus.h"
#define return_if_no_display(gdisp,data) \
if (GIMP_IS_DISPLAY (data)) \
gdisp = data; \
else if (GIMP_IS_GIMP (data)) \
gdisp = gimp_context_get_display (gimp_get_user_context (GIMP (data))); \
else if (GIMP_IS_DOCK (data)) \
gdisp = gimp_context_get_display (((GimpDock *) data)->context); \
else \
gdisp = NULL; \
if (! gdisp) \
return
void
plug_in_run_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
GtkItemFactory *item_factory;
Gimp *gimp;
ProcRecord *proc_rec;
Argument *args;
gint gdisp_ID = -1;
gint i;
gint argc;
GimpImageType drawable_type = GIMP_RGB_IMAGE;
item_factory = gtk_item_factory_from_widget (widget);
gimp = GIMP_ITEM_FACTORY (item_factory)->gimp;
proc_rec = (ProcRecord *) data;
/* construct the procedures arguments */
args = g_new0 (Argument, proc_rec->num_args);
/* initialize the argument types */
for (i = 0; i < proc_rec->num_args; i++)
args[i].arg_type = proc_rec->args[i].arg_type;
/* initialize the first argument */
args[0].value.pdb_int = GIMP_RUN_INTERACTIVE;
argc = 1;
switch (proc_rec->proc_type)
{
case GIMP_EXTENSION:
break;
case GIMP_PLUGIN:
case GIMP_TEMPORARY:
if (proc_rec->num_args >= 2 &&
proc_rec->args[1].arg_type == GIMP_PDB_IMAGE)
{
GimpDisplay *gdisplay;
gdisplay = gimp_context_get_display (gimp_get_user_context (gimp));
if (gdisplay)
{
gdisp_ID = gimp_display_get_ID (gdisplay);
args[1].value.pdb_int = gimp_image_get_ID (gdisplay->gimage);
argc++;
if (proc_rec->num_args >= 2 &&
proc_rec->args[2].arg_type == GIMP_PDB_DRAWABLE)
{
GimpDrawable *drawable;
drawable = gimp_image_active_drawable (gdisplay->gimage);
if (drawable)
{
drawable_type = gimp_drawable_type (drawable);
args[2].value.pdb_int =
gimp_item_get_ID (GIMP_ITEM (drawable));
argc++;
}
else
{
g_warning ("Uh-oh, no active drawable for the plug-in!");
g_free (args);
return;
}
}
}
}
break;
default:
g_error ("Unknown procedure type.");
g_free (args);
return;
}
/* run the plug-in procedure */
plug_in_run (gimp, proc_rec, args, argc, FALSE, TRUE, gdisp_ID);
/* remember only "standard" plug-ins */
if (proc_rec->proc_type == GIMP_PLUGIN &&
proc_rec->num_args >= 2 &&
proc_rec->args[1].arg_type == GIMP_PDB_IMAGE &&
proc_rec->args[2].arg_type == GIMP_PDB_DRAWABLE)
{
gimp->last_plug_in = proc_rec;
plug_in_menus_update (GIMP_ITEM_FACTORY (item_factory), drawable_type);
}
g_free (args);
}
void
plug_in_repeat_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
GimpDisplay *gdisp;
GimpDrawable *drawable;
gboolean interactive;
return_if_no_display (gdisp, data);
drawable = gimp_image_active_drawable (gdisp->gimage);
if (! drawable)
return;
interactive = action ? TRUE : FALSE;
plug_in_repeat (gdisp->gimage->gimp,
gimp_display_get_ID (gdisp),
gimp_image_get_ID (gdisp->gimage),
gimp_item_get_ID (GIMP_ITEM (drawable)),
interactive);
}

View File

@@ -1,31 +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 __PLUG_IN_COMMANDS_H__
#define __PLUG_IN_COMMANDS_H__
void plug_in_run_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void plug_in_repeat_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
#endif /* __PLUG_IN_COMMANDS_H__ */

View File

@@ -1,259 +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 "gui-types.h"
#include "core/gimp.h"
#include "core/gimpchannel.h"
#include "core/gimpimage.h"
#include "core/gimpimage-qmask.h"
#include "widgets/gimpcolorpanel.h"
#include "widgets/gimphelp-ids.h"
#include "widgets/gimpviewabledialog.h"
#include "display/gimpdisplay.h"
#include "display/gimpdisplayshell.h"
#include "qmask-commands.h"
#include "gimp-intl.h"
typedef struct _EditQmaskOptions EditQmaskOptions;
struct _EditQmaskOptions
{
GtkWidget *query_box;
GtkWidget *name_entry;
GtkWidget *color_panel;
GimpImage *gimage;
};
/* local function prototypes */
static void qmask_channel_query (GimpDisplayShell *shell);
static void qmask_query_response (GtkWidget *widget,
gint response_id,
EditQmaskOptions *options);
static void qmask_query_scale_update (GtkAdjustment *adjustment,
gpointer data);
static void qmask_query_color_changed (GimpColorButton *button,
gpointer data);
/* public functionss */
void
qmask_toggle_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (data);
if (GTK_CHECK_MENU_ITEM (widget)->active !=
gimp_image_get_qmask_state (shell->gdisp->gimage))
{
gimp_image_set_qmask_state (shell->gdisp->gimage,
GTK_CHECK_MENU_ITEM (widget)->active);
gimp_image_flush (shell->gdisp->gimage);
}
}
void
qmask_invert_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (data);
if (GTK_CHECK_MENU_ITEM (widget)->active)
{
if (action != shell->gdisp->gimage->qmask_inverted)
{
gimp_image_qmask_invert (shell->gdisp->gimage);
if (gimp_image_get_qmask_state (shell->gdisp->gimage))
gimp_image_flush (shell->gdisp->gimage);
}
}
}
void
qmask_configure_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (data);
qmask_channel_query (shell);
}
/* private functions */
static void
qmask_channel_query (GimpDisplayShell *shell)
{
EditQmaskOptions *options;
GtkWidget *hbox;
GtkWidget *vbox;
GtkWidget *table;
GtkWidget *opacity_scale;
GtkObject *opacity_scale_data;
/* the new options structure */
options = g_new0 (EditQmaskOptions, 1);
options->gimage = shell->gdisp->gimage;
options->color_panel = gimp_color_panel_new (_("Edit Qmask Color"),
&options->gimage->qmask_color,
GIMP_COLOR_AREA_LARGE_CHECKS,
48, 64);
gimp_color_panel_set_context (GIMP_COLOR_PANEL (options->color_panel),
gimp_get_user_context (options->gimage->gimp));
/* The dialog */
options->query_box =
gimp_viewable_dialog_new (GIMP_VIEWABLE (shell->gdisp->gimage),
_("Qmask Attributes"), "gimp-qmask-edit",
GIMP_STOCK_QMASK_ON,
_("Edit QuickMask Attributes"),
GTK_WIDGET (shell),
gimp_standard_help_func,
GIMP_HELP_QMASK_EDIT,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OK, GTK_RESPONSE_OK,
NULL);
g_signal_connect (options->query_box, "response",
G_CALLBACK (qmask_query_response),
options);
g_object_weak_ref (G_OBJECT (options->query_box),
(GWeakNotify) g_free, options);
/* The main hbox */
hbox = gtk_hbox_new (FALSE, 4);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 6);
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (options->query_box)->vbox),
hbox);
gtk_widget_show (hbox);
/* The vbox */
vbox = gtk_vbox_new (FALSE, 2);
gtk_box_pack_start (GTK_BOX (hbox), vbox, TRUE, TRUE, 0);
gtk_widget_show (vbox);
/* The table */
table = gtk_table_new (1, 2, FALSE);
gtk_table_set_col_spacings (GTK_TABLE (table), 4);
gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0);
gtk_widget_show (table);
/* The opacity scale */
opacity_scale_data =
gtk_adjustment_new (options->gimage->qmask_color.a * 100.0,
0.0, 100.0, 1.0, 1.0, 0.0);
opacity_scale = gtk_hscale_new (GTK_ADJUSTMENT (opacity_scale_data));
gtk_widget_set_size_request (opacity_scale, 100, -1);
gtk_scale_set_value_pos (GTK_SCALE (opacity_scale), GTK_POS_TOP);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
_("Mask Opacity:"), 1.0, 1.0,
opacity_scale, 1, FALSE);
g_signal_connect (opacity_scale_data, "value_changed",
G_CALLBACK (qmask_query_scale_update),
options->color_panel);
/* The color panel */
gtk_box_pack_start (GTK_BOX (hbox), options->color_panel,
TRUE, TRUE, 0);
gtk_widget_show (options->color_panel);
g_signal_connect (options->color_panel, "color_changed",
G_CALLBACK (qmask_query_color_changed),
opacity_scale_data);
gtk_widget_show (options->query_box);
}
static void
qmask_query_response (GtkWidget *widget,
gint response_id,
EditQmaskOptions *options)
{
if (response_id == GTK_RESPONSE_OK)
{
GimpChannel *channel = gimp_image_get_qmask (options->gimage);
GimpRGB color;
if (options->gimage && channel)
{
gimp_color_button_get_color (GIMP_COLOR_BUTTON (options->color_panel),
&color);
if (gimp_rgba_distance (&color, &channel->color) > 0.0001)
{
gimp_channel_set_color (channel, &color, TRUE);
gimp_image_flush (options->gimage);
}
}
/* update the qmask color no matter what */
options->gimage->qmask_color = color;
}
gtk_widget_destroy (options->query_box);
}
static void
qmask_query_scale_update (GtkAdjustment *adjustment,
gpointer data)
{
GimpRGB color;
gimp_color_button_get_color (GIMP_COLOR_BUTTON (data), &color);
gimp_rgb_set_alpha (&color, adjustment->value / 100.0);
gimp_color_button_set_color (GIMP_COLOR_BUTTON (data), &color);
}
static void
qmask_query_color_changed (GimpColorButton *button,
gpointer data)
{
GtkAdjustment *adj = GTK_ADJUSTMENT (data);
GimpRGB color;
gimp_color_button_get_color (button, &color);
gtk_adjustment_set_value (adj, color.a * 100.0);
}

View File

@@ -1,34 +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 __QMASK_COMMANDS_H__
#define __QMASK_COMMANDS_H__
void qmask_toggle_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void qmask_invert_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void qmask_configure_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
#endif /* __QMASK_COMMANDS_H__ */

View File

@@ -1,259 +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 "gui-types.h"
#include "core/gimp.h"
#include "core/gimpchannel.h"
#include "core/gimpimage.h"
#include "core/gimpimage-qmask.h"
#include "widgets/gimpcolorpanel.h"
#include "widgets/gimphelp-ids.h"
#include "widgets/gimpviewabledialog.h"
#include "display/gimpdisplay.h"
#include "display/gimpdisplayshell.h"
#include "qmask-commands.h"
#include "gimp-intl.h"
typedef struct _EditQmaskOptions EditQmaskOptions;
struct _EditQmaskOptions
{
GtkWidget *query_box;
GtkWidget *name_entry;
GtkWidget *color_panel;
GimpImage *gimage;
};
/* local function prototypes */
static void qmask_channel_query (GimpDisplayShell *shell);
static void qmask_query_response (GtkWidget *widget,
gint response_id,
EditQmaskOptions *options);
static void qmask_query_scale_update (GtkAdjustment *adjustment,
gpointer data);
static void qmask_query_color_changed (GimpColorButton *button,
gpointer data);
/* public functionss */
void
qmask_toggle_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (data);
if (GTK_CHECK_MENU_ITEM (widget)->active !=
gimp_image_get_qmask_state (shell->gdisp->gimage))
{
gimp_image_set_qmask_state (shell->gdisp->gimage,
GTK_CHECK_MENU_ITEM (widget)->active);
gimp_image_flush (shell->gdisp->gimage);
}
}
void
qmask_invert_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (data);
if (GTK_CHECK_MENU_ITEM (widget)->active)
{
if (action != shell->gdisp->gimage->qmask_inverted)
{
gimp_image_qmask_invert (shell->gdisp->gimage);
if (gimp_image_get_qmask_state (shell->gdisp->gimage))
gimp_image_flush (shell->gdisp->gimage);
}
}
}
void
qmask_configure_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (data);
qmask_channel_query (shell);
}
/* private functions */
static void
qmask_channel_query (GimpDisplayShell *shell)
{
EditQmaskOptions *options;
GtkWidget *hbox;
GtkWidget *vbox;
GtkWidget *table;
GtkWidget *opacity_scale;
GtkObject *opacity_scale_data;
/* the new options structure */
options = g_new0 (EditQmaskOptions, 1);
options->gimage = shell->gdisp->gimage;
options->color_panel = gimp_color_panel_new (_("Edit Qmask Color"),
&options->gimage->qmask_color,
GIMP_COLOR_AREA_LARGE_CHECKS,
48, 64);
gimp_color_panel_set_context (GIMP_COLOR_PANEL (options->color_panel),
gimp_get_user_context (options->gimage->gimp));
/* The dialog */
options->query_box =
gimp_viewable_dialog_new (GIMP_VIEWABLE (shell->gdisp->gimage),
_("Qmask Attributes"), "gimp-qmask-edit",
GIMP_STOCK_QMASK_ON,
_("Edit QuickMask Attributes"),
GTK_WIDGET (shell),
gimp_standard_help_func,
GIMP_HELP_QMASK_EDIT,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OK, GTK_RESPONSE_OK,
NULL);
g_signal_connect (options->query_box, "response",
G_CALLBACK (qmask_query_response),
options);
g_object_weak_ref (G_OBJECT (options->query_box),
(GWeakNotify) g_free, options);
/* The main hbox */
hbox = gtk_hbox_new (FALSE, 4);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 6);
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (options->query_box)->vbox),
hbox);
gtk_widget_show (hbox);
/* The vbox */
vbox = gtk_vbox_new (FALSE, 2);
gtk_box_pack_start (GTK_BOX (hbox), vbox, TRUE, TRUE, 0);
gtk_widget_show (vbox);
/* The table */
table = gtk_table_new (1, 2, FALSE);
gtk_table_set_col_spacings (GTK_TABLE (table), 4);
gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0);
gtk_widget_show (table);
/* The opacity scale */
opacity_scale_data =
gtk_adjustment_new (options->gimage->qmask_color.a * 100.0,
0.0, 100.0, 1.0, 1.0, 0.0);
opacity_scale = gtk_hscale_new (GTK_ADJUSTMENT (opacity_scale_data));
gtk_widget_set_size_request (opacity_scale, 100, -1);
gtk_scale_set_value_pos (GTK_SCALE (opacity_scale), GTK_POS_TOP);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
_("Mask Opacity:"), 1.0, 1.0,
opacity_scale, 1, FALSE);
g_signal_connect (opacity_scale_data, "value_changed",
G_CALLBACK (qmask_query_scale_update),
options->color_panel);
/* The color panel */
gtk_box_pack_start (GTK_BOX (hbox), options->color_panel,
TRUE, TRUE, 0);
gtk_widget_show (options->color_panel);
g_signal_connect (options->color_panel, "color_changed",
G_CALLBACK (qmask_query_color_changed),
opacity_scale_data);
gtk_widget_show (options->query_box);
}
static void
qmask_query_response (GtkWidget *widget,
gint response_id,
EditQmaskOptions *options)
{
if (response_id == GTK_RESPONSE_OK)
{
GimpChannel *channel = gimp_image_get_qmask (options->gimage);
GimpRGB color;
if (options->gimage && channel)
{
gimp_color_button_get_color (GIMP_COLOR_BUTTON (options->color_panel),
&color);
if (gimp_rgba_distance (&color, &channel->color) > 0.0001)
{
gimp_channel_set_color (channel, &color, TRUE);
gimp_image_flush (options->gimage);
}
}
/* update the qmask color no matter what */
options->gimage->qmask_color = color;
}
gtk_widget_destroy (options->query_box);
}
static void
qmask_query_scale_update (GtkAdjustment *adjustment,
gpointer data)
{
GimpRGB color;
gimp_color_button_get_color (GIMP_COLOR_BUTTON (data), &color);
gimp_rgb_set_alpha (&color, adjustment->value / 100.0);
gimp_color_button_set_color (GIMP_COLOR_BUTTON (data), &color);
}
static void
qmask_query_color_changed (GimpColorButton *button,
gpointer data)
{
GtkAdjustment *adj = GTK_ADJUSTMENT (data);
GimpRGB color;
gimp_color_button_get_color (button, &color);
gtk_adjustment_set_value (adj, color.a * 100.0);
}

View File

@@ -1,34 +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 __QMASK_COMMANDS_H__
#define __QMASK_COMMANDS_H__
void qmask_toggle_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void qmask_invert_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void qmask_configure_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
#endif /* __QMASK_COMMANDS_H__ */

View File

@@ -1,449 +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 "libgimpmath/gimpmath.h"
#include "libgimpwidgets/gimpwidgets.h"
#include "gui-types.h"
#include "core/gimp.h"
#include "core/gimpchannel.h"
#include "core/gimpchannel-select.h"
#include "core/gimpcontext.h"
#include "core/gimpimage.h"
#include "core/gimpimage-qmask.h"
#include "core/gimpselection.h"
#include "widgets/gimpdock.h"
#include "widgets/gimphelp-ids.h"
#include "widgets/gimpdialogfactory.h"
#include "display/gimpdisplay.h"
#include "display/gimpdisplayshell.h"
#include "dialogs.h"
#include "select-commands.h"
#include "gimp-intl.h"
#define return_if_no_display(gdisp,data) \
if (GIMP_IS_DISPLAY (data)) \
gdisp = data; \
else if (GIMP_IS_GIMP (data)) \
gdisp = gimp_context_get_display (gimp_get_user_context (GIMP (data))); \
else if (GIMP_IS_DOCK (data)) \
gdisp = gimp_context_get_display (((GimpDock *) data)->context); \
else \
gdisp = NULL; \
if (! gdisp) \
return
#define return_if_no_image(gimage,data) \
if (GIMP_IS_DISPLAY (data)) \
gimage = ((GimpDisplay *) data)->gimage; \
else if (GIMP_IS_GIMP (data)) \
gimage = gimp_context_get_image (gimp_get_user_context (GIMP (data))); \
else if (GIMP_IS_DOCK (data)) \
gimage = gimp_context_get_image (((GimpDock *) data)->context); \
else \
gimage = NULL; \
if (! gimage) \
return
/* local functions */
static void gimp_image_mask_feather_callback (GtkWidget *widget,
gdouble size,
GimpUnit unit,
gpointer data);
static void gimp_image_mask_border_callback (GtkWidget *widget,
gdouble size,
GimpUnit unit,
gpointer data);
static void gimp_image_mask_grow_callback (GtkWidget *widget,
gdouble size,
GimpUnit unit,
gpointer data);
static void gimp_image_mask_shrink_callback (GtkWidget *widget,
gdouble size,
GimpUnit unit,
gpointer data);
/* local variables */
static gdouble selection_feather_radius = 5.0;
static gint selection_border_radius = 5;
static gint selection_grow_pixels = 1;
static gint selection_shrink_pixels = 1;
static gboolean selection_shrink_edge_lock = FALSE;
void
select_invert_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpImage *gimage;
return_if_no_image (gimage, data);
gimp_channel_invert (gimp_image_get_mask (gimage), TRUE);
gimp_image_flush (gimage);
}
void
select_all_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpImage *gimage;
return_if_no_image (gimage, data);
gimp_channel_all (gimp_image_get_mask (gimage), TRUE);
gimp_image_flush (gimage);
}
void
select_none_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpImage *gimage;
return_if_no_image (gimage, data);
gimp_channel_clear (gimp_image_get_mask (gimage), NULL, TRUE);
gimp_image_flush (gimage);
}
void
select_from_vectors_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpImage *gimage;
GimpVectors *vectors;
return_if_no_image (gimage, data);
vectors = gimp_image_get_active_vectors (gimage);
if (!vectors)
return;
gimp_channel_select_vectors (gimp_image_get_mask (gimage),
_("Path to Selection"),
vectors,
GIMP_CHANNEL_OP_REPLACE,
TRUE, FALSE, 0, 0);
gimp_image_flush (gimage);
}
void
select_float_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpImage *gimage;
return_if_no_image (gimage, data);
gimp_selection_float (gimp_image_get_mask (gimage),
gimp_image_active_drawable (gimage),
TRUE, 0, 0);
gimp_image_flush (gimage);
}
void
select_feather_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpDisplay *gdisp;
GtkWidget *qbox;
return_if_no_display (gdisp, data);
qbox = gimp_query_size_box (_("Feather Selection"),
gdisp->shell,
gimp_standard_help_func,
GIMP_HELP_SELECTION_FEATHER,
_("Feather selection by"),
selection_feather_radius, 0, 32767, 3,
gdisp->gimage->unit,
MIN (gdisp->gimage->xresolution,
gdisp->gimage->yresolution),
GIMP_DISPLAY_SHELL (gdisp->shell)->dot_for_dot,
G_OBJECT (gdisp->gimage), "disconnect",
gimp_image_mask_feather_callback, gdisp->gimage);
gtk_widget_show (qbox);
}
void
select_sharpen_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpImage *gimage;
return_if_no_image (gimage, data);
gimp_channel_sharpen (gimp_image_get_mask (gimage), TRUE);
gimp_image_flush (gimage);
}
void
select_shrink_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpDisplay *gdisp;
GtkWidget *shrink_dialog;
GtkWidget *edge_lock;
return_if_no_display (gdisp, data);
shrink_dialog =
gimp_query_size_box (_("Shrink Selection"),
gdisp->shell,
gimp_standard_help_func,
GIMP_HELP_SELECTION_SHRINK,
_("Shrink selection by"),
selection_shrink_pixels, 1, 32767, 0,
gdisp->gimage->unit,
MIN (gdisp->gimage->xresolution,
gdisp->gimage->yresolution),
GIMP_DISPLAY_SHELL (gdisp->shell)->dot_for_dot,
G_OBJECT (gdisp->gimage), "disconnect",
gimp_image_mask_shrink_callback, gdisp->gimage);
edge_lock = gtk_check_button_new_with_label (_("Shrink from image border"));
gtk_box_pack_start (GTK_BOX (GIMP_QUERY_BOX_VBOX (shrink_dialog)), edge_lock,
FALSE, FALSE, 0);
g_object_set_data (G_OBJECT (shrink_dialog), "edge_lock_toggle", edge_lock);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (edge_lock),
! selection_shrink_edge_lock);
gtk_widget_show (edge_lock);
gtk_widget_show (shrink_dialog);
}
void
select_grow_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpDisplay *gdisp;
GtkWidget *qbox;
return_if_no_display (gdisp, data);
qbox = gimp_query_size_box (_("Grow Selection"),
gdisp->shell,
gimp_standard_help_func,
GIMP_HELP_SELECTION_GROW,
_("Grow selection by"),
selection_grow_pixels, 1, 32767, 0,
gdisp->gimage->unit,
MIN (gdisp->gimage->xresolution,
gdisp->gimage->yresolution),
GIMP_DISPLAY_SHELL (gdisp->shell)->dot_for_dot,
G_OBJECT (gdisp->gimage), "disconnect",
gimp_image_mask_grow_callback, gdisp->gimage);
gtk_widget_show (qbox);
}
void
select_border_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpDisplay *gdisp;
GtkWidget *qbox;
return_if_no_display (gdisp, data);
qbox = gimp_query_size_box (_("Border Selection"),
gdisp->shell,
gimp_standard_help_func,
GIMP_HELP_SELECTION_BORDER,
_("Border selection by"),
selection_border_radius, 1, 32767, 0,
gdisp->gimage->unit,
MIN (gdisp->gimage->xresolution,
gdisp->gimage->yresolution),
GIMP_DISPLAY_SHELL (gdisp->shell)->dot_for_dot,
G_OBJECT (gdisp->gimage), "disconnect",
gimp_image_mask_border_callback, gdisp->gimage);
gtk_widget_show (qbox);
}
void
select_save_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpImage *gimage;
return_if_no_image (gimage, data);
gimp_selection_save (gimp_image_get_mask (gimage));
gimp_image_flush (gimage);
gimp_dialog_factory_dialog_raise (global_dock_factory,
gtk_widget_get_screen (widget),
"gimp-channel-list", -1);
}
void
select_toggle_quickmask_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpImage *gimage;
return_if_no_image (gimage, data);
gimp_image_set_qmask_state (gimage, !gimp_image_get_qmask_state (gimage));
gimp_image_flush (gimage);
}
/* private functions */
static void
gimp_image_mask_feather_callback (GtkWidget *widget,
gdouble size,
GimpUnit unit,
gpointer data)
{
GimpImage *gimage;
gdouble radius_x;
gdouble radius_y;
gimage = GIMP_IMAGE (data);
selection_feather_radius = size;
radius_x = radius_y = selection_feather_radius;
if (unit != GIMP_UNIT_PIXEL)
{
gdouble factor;
factor = (MAX (gimage->xresolution, gimage->yresolution) /
MIN (gimage->xresolution, gimage->yresolution));
if (gimage->xresolution == MIN (gimage->xresolution, gimage->yresolution))
radius_y *= factor;
else
radius_x *= factor;
}
gimp_channel_feather (gimp_image_get_mask (gimage), radius_x, radius_y, TRUE);
gimp_image_flush (gimage);
}
static void
gimp_image_mask_border_callback (GtkWidget *widget,
gdouble size,
GimpUnit unit,
gpointer data)
{
GimpImage *gimage;
gdouble radius_x;
gdouble radius_y;
gimage = GIMP_IMAGE (data);
selection_border_radius = ROUND (size);
radius_x = radius_y = selection_border_radius;
if (unit != GIMP_UNIT_PIXEL)
{
gdouble factor;
factor = (MAX (gimage->xresolution, gimage->yresolution) /
MIN (gimage->xresolution, gimage->yresolution));
if (gimage->xresolution == MIN (gimage->xresolution, gimage->yresolution))
radius_y *= factor;
else
radius_x *= factor;
}
gimp_channel_border (gimp_image_get_mask (gimage), radius_x, radius_y, TRUE);
gimp_image_flush (gimage);
}
static void
gimp_image_mask_grow_callback (GtkWidget *widget,
gdouble size,
GimpUnit unit,
gpointer data)
{
GimpImage *gimage;
gdouble radius_x;
gdouble radius_y;
gimage = GIMP_IMAGE (data);
selection_grow_pixels = ROUND (size);
radius_x = radius_y = selection_grow_pixels;
if (unit != GIMP_UNIT_PIXEL)
{
gdouble factor;
factor = (MAX (gimage->xresolution, gimage->yresolution) /
MIN (gimage->xresolution, gimage->yresolution));
if (gimage->xresolution == MIN (gimage->xresolution, gimage->yresolution))
radius_y *= factor;
else
radius_x *= factor;
}
gimp_channel_grow (gimp_image_get_mask (gimage), radius_x, radius_y, TRUE);
gimp_image_flush (gimage);
}
static void
gimp_image_mask_shrink_callback (GtkWidget *widget,
gdouble size,
GimpUnit unit,
gpointer data)
{
GimpImage *gimage;
gint radius_x;
gint radius_y;
gimage = GIMP_IMAGE (data);
selection_shrink_pixels = ROUND (size);
radius_x = radius_y = selection_shrink_pixels;
selection_shrink_edge_lock =
! GTK_TOGGLE_BUTTON (g_object_get_data (G_OBJECT (widget),
"edge_lock_toggle"))->active;
if (unit != GIMP_UNIT_PIXEL)
{
gdouble factor;
factor = (MAX (gimage->xresolution, gimage->yresolution) /
MIN (gimage->xresolution, gimage->yresolution));
if (gimage->xresolution == MIN (gimage->xresolution, gimage->yresolution))
radius_y *= factor;
else
radius_x *= factor;
}
gimp_channel_shrink (gimp_image_get_mask (gimage), radius_x, radius_y,
selection_shrink_edge_lock, TRUE);
gimp_image_flush (gimage);
}

View File

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

View File

@@ -1,252 +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 "gui-types.h"
#include "config/gimpconfig.h"
#include "config/gimpconfig-utils.h"
#include "config/gimpcoreconfig.h"
#include "core/gimp.h"
#include "core/gimpcontext.h"
#include "core/gimplist.h"
#include "core/gimptemplate.h"
#include "widgets/gimpdialogfactory.h"
#include "widgets/gimphelp-ids.h"
#include "widgets/gimptemplateeditor.h"
#include "widgets/gimptemplateview.h"
#include "widgets/gimpviewabledialog.h"
#include "dialogs.h"
#include "file-new-dialog.h"
#include "templates-commands.h"
#include "gimp-intl.h"
/* public functions */
void
templates_new_template_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpTemplateView *view = GIMP_TEMPLATE_VIEW (data);
gtk_button_clicked (GTK_BUTTON (view->new_button));
}
void
templates_duplicate_template_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpTemplateView *view = GIMP_TEMPLATE_VIEW (data);
gtk_button_clicked (GTK_BUTTON (view->duplicate_button));
}
void
templates_edit_template_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpTemplateView *view = GIMP_TEMPLATE_VIEW (data);
gtk_button_clicked (GTK_BUTTON (view->edit_button));
}
void
templates_create_image_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpTemplateView *view = GIMP_TEMPLATE_VIEW (data);
gtk_button_clicked (GTK_BUTTON (view->create_button));
}
void
templates_delete_template_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpTemplateView *view = GIMP_TEMPLATE_VIEW (data);
gtk_button_clicked (GTK_BUTTON (view->delete_button));
}
static void
templates_new_template_response (GtkWidget *widget,
gint response_id,
GtkWidget *dialog)
{
if (response_id == GTK_RESPONSE_OK)
{
GimpTemplate *template;
Gimp *gimp;
template = g_object_get_data (G_OBJECT (dialog), "gimp-template");
gimp = g_object_get_data (G_OBJECT (dialog), "gimp");
gimp_container_add (gimp->templates, GIMP_OBJECT (template));
gimp_context_set_template (gimp_get_user_context (gimp), template);
}
gtk_widget_destroy (dialog);
}
void
templates_new_template_dialog (Gimp *gimp,
GimpTemplate *unused,
GtkWidget *parent)
{
GimpTemplate *template;
GtkWidget *dialog;
GtkWidget *main_vbox;
GtkWidget *editor;
dialog = gimp_viewable_dialog_new (NULL,
_("New Template"), "gimp-template-new",
GIMP_STOCK_TEMPLATE,
_("Create a New Template"),
parent,
gimp_standard_help_func,
GIMP_HELP_TEMPLATE_NEW,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OK, GTK_RESPONSE_OK,
NULL);
g_signal_connect (dialog, "response",
G_CALLBACK (templates_new_template_response),
dialog);
main_vbox = gtk_vbox_new (FALSE, 4);
gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 6);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), main_vbox,
TRUE, TRUE, 0);
gtk_widget_show (main_vbox);
template = gimp_config_duplicate (GIMP_CONFIG (gimp->config->default_image));
gimp_object_set_name (GIMP_OBJECT (template), _("Unnamed"));
editor = gimp_template_editor_new (template, gimp, TRUE);
g_object_unref (template);
g_object_set_data (G_OBJECT (dialog), "gimp", gimp);
g_object_set_data (G_OBJECT (dialog), "gimp-template", template);
gtk_box_pack_start (GTK_BOX (main_vbox), editor, FALSE, FALSE, 0);
gtk_widget_show (editor);
gtk_widget_show (dialog);
}
static void
templates_edit_template_response (GtkWidget *widget,
gint response_id,
GtkWidget *dialog)
{
if (response_id == GTK_RESPONSE_OK)
{
GimpTemplateEditor *editor;
GimpTemplate *template;
Gimp *gimp;
editor = g_object_get_data (G_OBJECT (dialog), "gimp-template-editor");
template = g_object_get_data (G_OBJECT (dialog), "gimp-template");
gimp = g_object_get_data (G_OBJECT (dialog), "gimp");
gimp_config_sync (GIMP_CONFIG (editor->template),
GIMP_CONFIG (template), 0);
gimp_list_uniquefy_name (GIMP_LIST (gimp->templates),
GIMP_OBJECT (template), TRUE);
}
gtk_widget_destroy (dialog);
}
void
templates_edit_template_dialog (Gimp *gimp,
GimpTemplate *template,
GtkWidget *parent)
{
GtkWidget *dialog;
GtkWidget *main_vbox;
GtkWidget *editor;
dialog = gimp_viewable_dialog_new (GIMP_VIEWABLE (template),
_("Edit Template"), "gimp-template-edit",
GIMP_STOCK_EDIT,
_("Edit Template"),
parent,
gimp_standard_help_func,
GIMP_HELP_TEMPLATE_EDIT,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OK, GTK_RESPONSE_OK,
NULL);
g_signal_connect (dialog, "response",
G_CALLBACK (templates_edit_template_response),
dialog);
main_vbox = gtk_vbox_new (FALSE, 4);
gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 6);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), main_vbox,
TRUE, TRUE, 0);
gtk_widget_show (main_vbox);
g_object_set_data (G_OBJECT (dialog), "gimp", gimp);
g_object_set_data (G_OBJECT (dialog), "gimp-template", template);
template = gimp_config_duplicate (GIMP_CONFIG (template));
editor = gimp_template_editor_new (template, gimp, TRUE);
g_object_unref (template);
gtk_box_pack_start (GTK_BOX (main_vbox), editor, FALSE, FALSE, 0);
gtk_widget_show (editor);
g_object_set_data (G_OBJECT (dialog), "gimp-template-editor", editor);
gtk_widget_show (dialog);
}
void
templates_file_new_dialog (Gimp *gimp,
GimpTemplate *template,
GtkWidget *parent)
{
GtkWidget *dialog;
dialog = gimp_dialog_factory_dialog_new (global_dialog_factory,
gtk_widget_get_screen (parent),
"gimp-file-new-dialog", -1);
if (dialog)
file_new_dialog_set (dialog, NULL, template);
}

View File

@@ -1,44 +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 __TEMPLATES_COMMANDS_H__
#define __TEMPLATES_COMMANDS_H__
void templates_new_template_cmd_callback (GtkWidget *widget,
gpointer data);
void templates_duplicate_template_cmd_callback (GtkWidget *widget,
gpointer data);
void templates_edit_template_cmd_callback (GtkWidget *widget,
gpointer data);
void templates_create_image_cmd_callback (GtkWidget *widget,
gpointer data);
void templates_delete_template_cmd_callback (GtkWidget *widget,
gpointer data);
void templates_new_template_dialog (Gimp *gimp,
GimpTemplate *unused,
GtkWidget *parent);
void templates_edit_template_dialog (Gimp *gimp,
GimpTemplate *template,
GtkWidget *parent);
void templates_file_new_dialog (Gimp *gimp,
GimpTemplate *template,
GtkWidget *parent);
#endif /* __TEMPLATES_COMMANDS_H__ */

View File

@@ -1,201 +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 "gui-types.h"
#include "config/gimpconfig.h"
#include "config/gimpconfig-utils.h"
#include "core/gimp.h"
#include "core/gimplist.h"
#include "core/gimptoolinfo.h"
#include "core/gimptooloptions.h"
#include "widgets/gimpeditor.h"
#include "widgets/gimphelp-ids.h"
#include "widgets/gimpitemfactory.h"
#include "widgets/gimptooloptionseditor.h"
#include "tool-options-commands.h"
#include "gimp-intl.h"
/* local function prototypes */
static void tool_options_save_callback (GtkWidget *widget,
const gchar *name,
gpointer data);
static void tool_options_rename_callback (GtkWidget *widget,
const gchar *name,
gpointer data);
/* public functions */
void
tool_options_save_to_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
GimpToolOptions *options = GIMP_TOOL_OPTIONS (data);
gchar *name;
name = g_strdup (gimp_object_get_name (GIMP_OBJECT (options)));
gimp_config_sync (GIMP_CONFIG (options->tool_info->tool_options),
GIMP_CONFIG (options), 0);
gimp_object_set_name (GIMP_OBJECT (options), name);
g_free (name);
}
void
tool_options_save_new_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
GimpEditor *editor = GIMP_EDITOR (data);
GimpContext *context;
GimpToolInfo *tool_info;
GtkWidget *qbox;
context = gimp_get_user_context (editor->item_factory->gimp);
tool_info = gimp_context_get_tool (context);
qbox = gimp_query_string_box (_("Save Tool Options"),
GTK_WIDGET (editor),
gimp_standard_help_func,
GIMP_HELP_TOOL_OPTIONS_DIALOG,
_("Enter a name for the saved options"),
_("Saved Options"),
NULL, NULL,
tool_options_save_callback, tool_info);
gtk_widget_show (qbox);
}
void
tool_options_restore_from_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
GimpToolOptions *options = GIMP_TOOL_OPTIONS (data);
gimp_config_sync (GIMP_CONFIG (options),
GIMP_CONFIG (options->tool_info->tool_options), 0);
}
void
tool_options_rename_saved_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
GimpToolOptions *options = GIMP_TOOL_OPTIONS (data);
GtkWidget *qbox;
qbox = gimp_query_string_box (_("Rename Saved Tool Options"),
widget,
gimp_standard_help_func,
GIMP_HELP_TOOL_OPTIONS_DIALOG,
_("Enter a new name for the saved options"),
GIMP_OBJECT (options)->name,
NULL, NULL,
tool_options_rename_callback, options);
gtk_widget_show (qbox);
}
void
tool_options_delete_saved_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
GimpToolOptions *options = GIMP_TOOL_OPTIONS (data);
gimp_container_remove (options->tool_info->options_presets,
GIMP_OBJECT (options));
}
void
tool_options_reset_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
GimpToolOptionsEditor *editor = GIMP_TOOL_OPTIONS_EDITOR (data);
if (GTK_WIDGET_SENSITIVE (editor->reset_button))
gtk_button_clicked (GTK_BUTTON (editor->reset_button));
}
void
tool_options_reset_all_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
GimpToolOptionsEditor *editor = GIMP_TOOL_OPTIONS_EDITOR (data);
if (GTK_WIDGET_SENSITIVE (editor->reset_button))
gimp_button_extended_clicked (GIMP_BUTTON (editor->reset_button),
GDK_SHIFT_MASK);
}
/* private functions */
static void
tool_options_save_callback (GtkWidget *widget,
const gchar *name,
gpointer data)
{
GimpToolInfo *tool_info = GIMP_TOOL_INFO (data);
GimpConfig *copy;
if (! name || ! strlen (name))
name = _("Saved Options");
copy = gimp_config_duplicate (GIMP_CONFIG (tool_info->tool_options));
gimp_object_set_name (GIMP_OBJECT (copy), name);
gimp_list_uniquefy_name (GIMP_LIST (tool_info->options_presets),
GIMP_OBJECT (copy), TRUE);
gimp_container_insert (tool_info->options_presets, GIMP_OBJECT (copy), -1);
g_object_unref (copy);
}
static void
tool_options_rename_callback (GtkWidget *widget,
const gchar *name,
gpointer data)
{
GimpToolOptions *options = GIMP_TOOL_OPTIONS (data);
if (! name || ! strlen (name))
name = _("Saved Options");
gimp_object_set_name (GIMP_OBJECT (options), name);
gimp_list_uniquefy_name (GIMP_LIST (options->tool_info->options_presets),
GIMP_OBJECT (options), TRUE);
}

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 __TOOL_OPTIONS_COMMANDS_H__
#define __TOOL_OPTIONS_COMMANDS_H__
void tool_options_save_to_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void tool_options_save_new_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void tool_options_restore_from_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void tool_options_rename_saved_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void tool_options_delete_saved_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void tool_options_reset_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void tool_options_reset_all_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
#endif /* __TOOL_OPTIONS_COMMANDS_H__ */

View File

@@ -1,108 +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 "gui-types.h"
#include "core/gimp.h"
#include "core/gimpcontainer.h"
#include "core/gimpcontext.h"
#include "core/gimpimage.h"
#include "core/gimptoolinfo.h"
#include "widgets/gimpdock.h"
#include "display/gimpdisplay.h"
#include "tools/gimptool.h"
#include "tools/tool_manager.h"
#define return_if_no_gimp(gimp,data) \
if (GIMP_IS_DISPLAY (data)) \
gimp = ((GimpDisplay *) data)->gimage->gimp; \
else if (GIMP_IS_GIMP (data)) \
gimp = data; \
else if (GIMP_IS_DOCK (data)) \
gimp = ((GimpDock *) data)->context->gimp; \
else \
gimp = NULL; \
if (! gimp) \
return
void
tools_default_colors_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
Gimp *gimp;
return_if_no_gimp (gimp, data);
gimp_context_set_default_colors (gimp_get_user_context (gimp));
}
void
tools_swap_colors_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
Gimp *gimp;
return_if_no_gimp (gimp, data);
gimp_context_swap_colors (gimp_get_user_context (gimp));
}
void
tools_select_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
Gimp *gimp;
GimpToolInfo *tool_info;
GimpContext *context;
GimpDisplay *gdisp;
const gchar *identifier;
return_if_no_gimp (gimp, data);
identifier = g_quark_to_string ((GQuark) action);
tool_info = (GimpToolInfo *)
gimp_container_get_child_by_name (gimp->tool_info_list, identifier);
context = gimp_get_user_context (gimp);
/* always allocate a new tool when selected from the image menu
*/
if (gimp_context_get_tool (context) != tool_info)
{
gimp_context_set_tool (context, tool_info);
}
else
{
gimp_context_tool_changed (context);
}
gdisp = gimp_context_get_display (context);
if (gdisp)
tool_manager_initialize_active (gimp, gdisp);
}

View File

@@ -1,34 +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 __TOOLS_COMMANDS_H__
#define __TOOLS_COMMANDS_H__
void tools_default_colors_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void tools_swap_colors_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void tools_select_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
#endif /* __TOOLS_COMMANDS_H__ */

View File

@@ -1,759 +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 "gui-types.h"
#include "core/gimp.h"
#include "core/gimpchannel.h"
#include "core/gimpchannel-select.h"
#include "core/gimpcontainer.h"
#include "core/gimpcontext.h"
#include "core/gimpimage.h"
#include "core/gimpimage-merge.h"
#include "core/gimptoolinfo.h"
#include "pdb/procedural_db.h"
#include "plug-in/plug-in-run.h"
#include "vectors/gimpvectors.h"
#include "vectors/gimpvectors-export.h"
#include "vectors/gimpvectors-import.h"
#include "widgets/gimpdock.h"
#include "widgets/gimphelp-ids.h"
#include "widgets/gimpitemtreeview.h"
#include "widgets/gimpviewabledialog.h"
#include "display/gimpdisplay.h"
#include "tools/gimppainttool.h"
#include "tools/gimpvectortool.h"
#include "tools/tool_manager.h"
#include "stroke-dialog.h"
#include "vectors-commands.h"
#include "gimp-intl.h"
#define return_if_no_image(gimage,data) \
if (GIMP_IS_DISPLAY (data)) \
gimage = ((GimpDisplay *) data)->gimage; \
else if (GIMP_IS_GIMP (data)) \
gimage = gimp_context_get_image (gimp_get_user_context (GIMP (data))); \
else if (GIMP_IS_DOCK (data)) \
gimage = gimp_context_get_image (((GimpDock *) data)->context); \
else if (GIMP_IS_ITEM_TREE_VIEW (data)) \
gimage = ((GimpItemTreeView *) data)->gimage; \
else \
gimage = NULL; \
\
if (! gimage) \
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
static void vectors_import_query (GimpImage *gimage,
GtkWidget *parent);
static void vectors_export_query (GimpImage *gimage,
GimpVectors *vectors,
GtkWidget *parent);
/* public functions */
void
vectors_new_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpImage *gimage;
return_if_no_image (gimage, data);
vectors_new_vectors_query (gimage, NULL, TRUE, widget);
}
void
vectors_raise_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpImage *gimage;
GimpVectors *active_vectors;
return_if_no_vectors (gimage, active_vectors, data);
gimp_image_raise_vectors (gimage, active_vectors);
gimp_image_flush (gimage);
}
void
vectors_lower_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpImage *gimage;
GimpVectors *active_vectors;
return_if_no_vectors (gimage, active_vectors, data);
gimp_image_lower_vectors (gimage, active_vectors);
gimp_image_flush (gimage);
}
void
vectors_duplicate_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpImage *gimage;
GimpVectors *active_vectors;
GimpVectors *new_vectors;
return_if_no_vectors (gimage, active_vectors, data);
new_vectors = GIMP_VECTORS (gimp_item_duplicate (GIMP_ITEM (active_vectors),
G_TYPE_FROM_INSTANCE (active_vectors),
TRUE));
gimp_image_add_vectors (gimage, new_vectors, -1);
gimp_image_flush (gimage);
}
void
vectors_delete_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpImage *gimage;
GimpVectors *active_vectors;
return_if_no_vectors (gimage, active_vectors, data);
gimp_image_remove_vectors (gimage, active_vectors);
gimp_image_flush (gimage);
}
void
vectors_merge_visible_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpImage *gimage;
GimpVectors *active_vectors;
return_if_no_vectors (gimage, active_vectors, data);
gimp_image_merge_visible_vectors (gimage);
gimp_image_flush (gimage);
}
void
vectors_to_selection_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
GimpChannelOps op;
GimpImage *gimage;
GimpVectors *active_vectors;
return_if_no_vectors (gimage, active_vectors, data);
op = (GimpChannelOps) action;
gimp_channel_select_vectors (gimp_image_get_mask (gimage),
_("Path to Selection"),
active_vectors,
op, TRUE, FALSE, 0, 0);
gimp_image_flush (gimage);
}
void
vectors_selection_to_vectors_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpImage *gimage;
return_if_no_image (gimage, data);
vectors_selection_to_vectors (gimage, FALSE);
}
void
vectors_stroke_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpImage *gimage;
GimpVectors *active_vectors;
return_if_no_vectors (gimage, active_vectors, data);
vectors_stroke_vectors (GIMP_ITEM (active_vectors), widget);
}
void
vectors_copy_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpImage *gimage;
GimpVectors *active_vectors;
return_if_no_vectors (gimage, active_vectors, data);
#ifdef __GNUC__
#warning FIXME: need vectors clipboard
#endif
}
void
vectors_paste_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpImage *gimage;
return_if_no_image (gimage, data);
#ifdef __GNUC__
#warning FIXME: need vectors clipboard
#endif
}
void
vectors_import_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpImage *gimage;
return_if_no_image (gimage, data);
vectors_import_query (gimage, widget);
}
void
vectors_export_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpImage *gimage;
GimpVectors *active_vectors;
return_if_no_vectors (gimage, active_vectors, data);
vectors_export_query (gimage, active_vectors, widget);
}
void
vectors_vectors_tool_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpImage *gimage;
GimpVectors *active_vectors;
return_if_no_vectors (gimage, active_vectors, data);
vectors_vectors_tool (active_vectors);
}
void
vectors_edit_attributes_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpImage *gimage;
GimpVectors *active_vectors;
return_if_no_vectors (gimage, active_vectors, data);
vectors_edit_vectors_query (active_vectors, widget);
}
void
vectors_stroke_vectors (GimpItem *item,
GtkWidget *parent)
{
GimpImage *gimage;
GimpDrawable *active_drawable;
GtkWidget *dialog;
g_return_if_fail (GIMP_IS_ITEM (item));
gimage = gimp_item_get_image (item);
active_drawable = gimp_image_active_drawable (gimage);
if (! active_drawable)
{
g_message (_("There is no active layer or channel to stroke to."));
return;
}
dialog = stroke_dialog_new (item, GIMP_STOCK_PATH_STROKE,
GIMP_HELP_PATH_STROKE,
parent);
gtk_widget_show (dialog);
}
void
vectors_selection_to_vectors (GimpImage *gimage,
gboolean advanced)
{
ProcRecord *proc_rec;
Argument *args;
GimpDisplay *gdisp;
g_return_if_fail (GIMP_IS_IMAGE (gimage));
if (advanced)
proc_rec = procedural_db_lookup (gimage->gimp,
"plug_in_sel2path_advanced");
else
proc_rec = procedural_db_lookup (gimage->gimp,
"plug_in_sel2path");
if (! proc_rec)
{
g_message ("Selection to path procedure lookup failed.");
return;
}
gdisp = gimp_context_get_display (gimp_get_user_context (gimage->gimp));
/* plug-in arguments as if called by <Image>/Filters/... */
args = g_new (Argument, 3);
args[0].arg_type = GIMP_PDB_INT32;
args[0].value.pdb_int = GIMP_RUN_INTERACTIVE;
args[1].arg_type = GIMP_PDB_IMAGE;
args[1].value.pdb_int = (gint32) gimp_image_get_ID (gimage);
args[2].arg_type = GIMP_PDB_DRAWABLE;
args[2].value.pdb_int = -1; /* unused */
plug_in_run (gimage->gimp,
proc_rec, args, 3, FALSE, TRUE,
gdisp ? gdisp->ID : 0);
g_free (args);
}
void
vectors_vectors_tool (GimpVectors *vectors)
{
GimpImage *gimage;
GimpTool *active_tool;
g_return_if_fail (GIMP_IS_VECTORS (vectors));
gimage = gimp_item_get_image (GIMP_ITEM (vectors));
active_tool = tool_manager_get_active (gimage->gimp);
if (! GIMP_IS_VECTOR_TOOL (active_tool))
{
GimpContainer *tool_info_list;
GimpToolInfo *tool_info;
tool_info_list = gimage->gimp->tool_info_list;
tool_info = (GimpToolInfo *)
gimp_container_get_child_by_name (tool_info_list,
"gimp-vector-tool");
if (GIMP_IS_TOOL_INFO (tool_info))
{
gimp_context_set_tool (gimp_get_current_context (gimage->gimp),
tool_info);
active_tool = tool_manager_get_active (gimage->gimp);
}
}
if (GIMP_IS_VECTOR_TOOL (active_tool))
gimp_vector_tool_set_vectors (GIMP_VECTOR_TOOL (active_tool), vectors);
}
/**********************************/
/* The new vectors query dialog */
/**********************************/
typedef struct _NewVectorsOptions NewVectorsOptions;
struct _NewVectorsOptions
{
GtkWidget *query_box;
GtkWidget *name_entry;
GimpImage *gimage;
};
static gchar *vectors_name = NULL;
static void
new_vectors_query_response (GtkWidget *widget,
gint response_id,
NewVectorsOptions *options)
{
if (response_id == GTK_RESPONSE_OK)
{
GimpVectors *new_vectors;
GimpImage *gimage;
if (vectors_name)
g_free (vectors_name);
vectors_name =
g_strdup (gtk_entry_get_text (GTK_ENTRY (options->name_entry)));
if ((gimage = options->gimage))
{
new_vectors = gimp_vectors_new (gimage, vectors_name);
gimp_image_add_vectors (gimage, new_vectors, -1);
gimp_image_flush (gimage);
}
}
gtk_widget_destroy (options->query_box);
}
void
vectors_new_vectors_query (GimpImage *gimage,
GimpVectors *template,
gboolean interactive,
GtkWidget *parent)
{
NewVectorsOptions *options;
GtkWidget *hbox;
GtkWidget *vbox;
GtkWidget *table;
GtkWidget *label;
g_return_if_fail (GIMP_IS_IMAGE (gimage));
g_return_if_fail (! template || GIMP_IS_VECTORS (template));
if (template || ! interactive)
{
GimpVectors *new_vectors;
new_vectors = gimp_vectors_new (gimage, _("Empty Path"));
gimp_image_add_vectors (gimage, new_vectors, -1);
return;
}
/* the new options structure */
options = g_new (NewVectorsOptions, 1);
options->gimage = gimage;
/* The dialog */
options->query_box =
gimp_viewable_dialog_new (GIMP_VIEWABLE (gimage),
_("New Path"), "gimp-vectors-new",
GIMP_STOCK_TOOL_PATH,
_("New Path Options"),
parent,
gimp_standard_help_func,
GIMP_HELP_PATH_NEW,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OK, GTK_RESPONSE_OK,
NULL);
g_signal_connect (options->query_box, "response",
G_CALLBACK (new_vectors_query_response),
options);
g_object_weak_ref (G_OBJECT (options->query_box),
(GWeakNotify) g_free,
options);
/* The main hbox */
hbox = gtk_hbox_new (FALSE, 4);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 6);
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (options->query_box)->vbox),
hbox);
/* The vbox */
vbox = gtk_vbox_new (FALSE, 2);
gtk_box_pack_start (GTK_BOX (hbox), vbox, TRUE, TRUE, 0);
/* The table */
table = gtk_table_new (2, 3, FALSE);
gtk_table_set_col_spacings (GTK_TABLE (table), 4);
gtk_table_set_row_spacings (GTK_TABLE (table), 2);
gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0);
/* The name entry hbox, label and entry */
label = gtk_label_new (_("Path name:"));
gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5);
gtk_table_attach (GTK_TABLE (table), label, 0, 1, 0, 1,
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
gtk_widget_show (label);
options->name_entry = gtk_entry_new ();
gtk_widget_set_size_request (options->name_entry, 150, -1);
gtk_table_attach_defaults (GTK_TABLE (table), options->name_entry,
1, 2, 0, 1);
gtk_entry_set_text (GTK_ENTRY (options->name_entry),
(vectors_name ? vectors_name : _("New Path")));
gtk_widget_show (options->name_entry);
gtk_widget_show (table);
gtk_widget_show (vbox);
gtk_widget_show (hbox);
gtk_widget_show (options->query_box);
}
/****************************************/
/* The edit vectors attributes dialog */
/****************************************/
typedef struct _EditVectorsOptions EditVectorsOptions;
struct _EditVectorsOptions
{
GtkWidget *query_box;
GtkWidget *name_entry;
GimpVectors *vectors;
GimpImage *gimage;
};
static void
edit_vectors_query_response (GtkWidget *widget,
gint response_id,
EditVectorsOptions *options)
{
if (response_id == GTK_RESPONSE_OK)
{
GimpVectors *vectors = options->vectors;
if (options->gimage)
{
const gchar *new_name;
new_name = gtk_entry_get_text (GTK_ENTRY (options->name_entry));
if (strcmp (new_name, gimp_object_get_name (GIMP_OBJECT (vectors))))
{
gimp_item_rename (GIMP_ITEM (vectors), new_name);
gimp_image_flush (options->gimage);
}
}
}
gtk_widget_destroy (options->query_box);
}
void
vectors_edit_vectors_query (GimpVectors *vectors,
GtkWidget *parent)
{
EditVectorsOptions *options;
GtkWidget *hbox;
GtkWidget *vbox;
GtkWidget *table;
GtkWidget *label;
g_return_if_fail (GIMP_IS_VECTORS (vectors));
options = g_new0 (EditVectorsOptions, 1);
options->vectors = vectors;
options->gimage = gimp_item_get_image (GIMP_ITEM (vectors));
/* The dialog */
options->query_box =
gimp_viewable_dialog_new (GIMP_VIEWABLE (vectors),
_("Path Attributes"), "gimp-vectors-edit",
GIMP_STOCK_EDIT,
_("Edit Path Attributes"),
parent,
gimp_standard_help_func,
GIMP_HELP_PATH_EDIT,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OK, GTK_RESPONSE_OK,
NULL);
g_signal_connect (options->query_box, "response",
G_CALLBACK (edit_vectors_query_response),
options);
g_object_weak_ref (G_OBJECT (options->query_box),
(GWeakNotify) g_free,
options);
/* The main hbox */
hbox = gtk_hbox_new (FALSE, 4);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 6);
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (options->query_box)->vbox),
hbox);
/* The vbox */
vbox = gtk_vbox_new (FALSE, 2);
gtk_box_pack_start (GTK_BOX (hbox), vbox, TRUE, TRUE, 0);
/* The table */
table = gtk_table_new (2, 3, FALSE);
gtk_table_set_col_spacings (GTK_TABLE (table), 4);
gtk_table_set_row_spacings (GTK_TABLE (table), 2);
gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0);
/* The name entry */
label = gtk_label_new (_("Path name:"));
gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5);
gtk_table_attach (GTK_TABLE (table), label, 0, 1, 0, 1,
GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
gtk_widget_show (label);
options->name_entry = gtk_entry_new ();
gtk_widget_set_size_request (options->name_entry, 150, -1);
gtk_table_attach_defaults (GTK_TABLE (table), options->name_entry,
1, 2, 0, 1);
gtk_entry_set_text (GTK_ENTRY (options->name_entry),
gimp_object_get_name (GIMP_OBJECT (vectors)));
gtk_widget_show (options->name_entry);
gtk_widget_show (table);
gtk_widget_show (vbox);
gtk_widget_show (hbox);
gtk_widget_show (options->query_box);
}
/*******************************/
/* The vectors import dialog */
/*******************************/
static void
vectors_import_response (GtkWidget *dialog,
gint response_id,
GimpImage *gimage)
{
if (response_id == GTK_RESPONSE_OK)
{
const gchar *filename;
GError *error = NULL;
filename = gtk_file_selection_get_filename (GTK_FILE_SELECTION (dialog));
if (gimp_vectors_import_file (gimage, filename, FALSE, FALSE, &error))
{
gimp_image_flush (gimage);
}
else
{
g_message (error->message);
g_error_free (error);
}
}
g_object_weak_unref (G_OBJECT (gimage),
(GWeakNotify) gtk_widget_destroy, dialog);
gtk_widget_destroy (dialog);
}
static void
vectors_import_query (GimpImage *gimage,
GtkWidget *parent)
{
GtkFileSelection *filesel;
filesel =
GTK_FILE_SELECTION (gtk_file_selection_new (_("Import Paths from SVG")));
g_object_weak_ref (G_OBJECT (gimage),
(GWeakNotify) gtk_widget_destroy, filesel);
gtk_window_set_screen (GTK_WINDOW (filesel),
gtk_widget_get_screen (parent));
gtk_window_set_role (GTK_WINDOW (filesel), "gimp-vectors-import");
gtk_window_set_position (GTK_WINDOW (filesel), GTK_WIN_POS_MOUSE);
gtk_container_set_border_width (GTK_CONTAINER (filesel), 6);
gtk_container_set_border_width (GTK_CONTAINER (filesel->button_area), 4);
g_signal_connect (filesel, "response",
G_CALLBACK (vectors_import_response),
gimage);
g_signal_connect (filesel, "delete_event",
G_CALLBACK (gtk_true),
NULL);
/* FIXME: add a proper file selector
and controls for merge and scale options */
gtk_widget_show (GTK_WIDGET (filesel));
}
/*******************************/
/* The vectors export dialog */
/*******************************/
static void
vectors_export_response (GtkWidget *dialog,
gint response_id,
GimpImage *gimage)
{
if (response_id == GTK_RESPONSE_OK)
{
const gchar *filename;
GError *error = NULL;
filename = gtk_file_selection_get_filename (GTK_FILE_SELECTION (dialog));
if (! gimp_vectors_export_file (gimage, NULL, filename, &error))
{
g_message (error->message);
g_error_free (error);
}
}
g_object_weak_unref (G_OBJECT (gimage),
(GWeakNotify) gtk_widget_destroy, dialog);
gtk_widget_destroy (dialog);
}
static void
vectors_export_query (GimpImage *gimage,
GimpVectors *vectors,
GtkWidget *parent)
{
GtkFileSelection *filesel;
filesel =
GTK_FILE_SELECTION (gtk_file_selection_new (_("Export Path to SVG")));
g_object_weak_ref (G_OBJECT (gimage),
(GWeakNotify) gtk_widget_destroy, filesel);
gtk_window_set_screen (GTK_WINDOW (filesel),
gtk_widget_get_screen (parent));
gtk_window_set_role (GTK_WINDOW (filesel), "gimp-vectors-export");
gtk_window_set_position (GTK_WINDOW (filesel), GTK_WIN_POS_MOUSE);
gtk_container_set_border_width (GTK_CONTAINER (filesel), 6);
gtk_container_set_border_width (GTK_CONTAINER (filesel->button_area), 4);
g_signal_connect (filesel, "response",
G_CALLBACK (vectors_export_response),
gimage);
g_signal_connect (filesel, "delete_event",
G_CALLBACK (gtk_true),
NULL);
gtk_widget_show (GTK_WIDGET (filesel));
}

View File

@@ -1,68 +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 __VECTORS_COMMANDS_H__
#define __VECTORS_COMMANDS_H__
void vectors_new_cmd_callback (GtkWidget *widget,
gpointer data);
void vectors_raise_cmd_callback (GtkWidget *widget,
gpointer data);
void vectors_lower_cmd_callback (GtkWidget *widget,
gpointer data);
void vectors_duplicate_cmd_callback (GtkWidget *widget,
gpointer data);
void vectors_delete_cmd_callback (GtkWidget *widget,
gpointer data);
void vectors_merge_visible_cmd_callback (GtkWidget *widget,
gpointer data);
void vectors_to_selection_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void vectors_selection_to_vectors_cmd_callback (GtkWidget *widget,
gpointer data);
void vectors_stroke_cmd_callback (GtkWidget *widget,
gpointer data);
void vectors_copy_cmd_callback (GtkWidget *widget,
gpointer data);
void vectors_paste_cmd_callback (GtkWidget *widget,
gpointer data);
void vectors_import_cmd_callback (GtkWidget *widget,
gpointer data);
void vectors_export_cmd_callback (GtkWidget *widget,
gpointer data);
void vectors_vectors_tool_cmd_callback (GtkWidget *widget,
gpointer data);
void vectors_edit_attributes_cmd_callback (GtkWidget *widget,
gpointer data);
void vectors_stroke_vectors (GimpItem *item,
GtkWidget *parent);
void vectors_selection_to_vectors (GimpImage *gimage,
gboolean advanced);
void vectors_vectors_tool (GimpVectors *vectors);
void vectors_new_vectors_query (GimpImage *gimage,
GimpVectors *template,
gboolean interactive,
GtkWidget *parent);
void vectors_edit_vectors_query (GimpVectors *vectors,
GtkWidget *parent);
#endif /* __VECTORS_COMMANDS_H__ */

View File

@@ -1,504 +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 "gui-types.h"
#include "config/gimpguiconfig.h"
#include "core/gimp.h"
#include "core/gimpcontext.h"
#include "core/gimpimage.h"
#include "display/gimpdisplay.h"
#include "display/gimpdisplay-foreach.h"
#include "display/gimpdisplayshell.h"
#include "display/gimpdisplayshell-appearance.h"
#include "display/gimpdisplayshell-filter-dialog.h"
#include "display/gimpdisplayshell-scale.h"
#include "widgets/gimpdock.h"
#include "widgets/gimpdialogfactory.h"
#include "widgets/gimpitemfactory.h"
#include "dialogs.h"
#include "info-dialog.h"
#include "info-window.h"
#include "view-commands.h"
#define return_if_no_display(gdisp, data) \
if (GIMP_IS_DISPLAY (data)) \
gdisp = data; \
else if (GIMP_IS_GIMP (data)) \
gdisp = gimp_context_get_display (gimp_get_user_context (GIMP (data))); \
else if (GIMP_IS_DOCK (data)) \
gdisp = gimp_context_get_display (((GimpDock *) data)->context); \
else \
gdisp = NULL; \
if (! gdisp) \
return
#define IS_ACTIVE_DISPLAY(gdisp) \
((gdisp) == \
gimp_context_get_display (gimp_get_user_context ((gdisp)->gimage->gimp)))
void
view_zoom_out_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpDisplay *gdisp;
return_if_no_display (gdisp, data);
gimp_display_shell_scale (GIMP_DISPLAY_SHELL (gdisp->shell),
GIMP_ZOOM_OUT, 0.0);
}
void
view_zoom_in_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpDisplay *gdisp;
return_if_no_display (gdisp, data);
gimp_display_shell_scale (GIMP_DISPLAY_SHELL (gdisp->shell),
GIMP_ZOOM_IN, 0.0);
}
void
view_zoom_fit_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpDisplay *gdisp;
return_if_no_display (gdisp, data);
gimp_display_shell_scale_fit (GIMP_DISPLAY_SHELL (gdisp->shell));
}
void
view_zoom_cmd_callback (GtkWidget *widget,
gpointer data,
guint scale)
{
GimpDisplay *gdisp;
GimpDisplayShell *shell;
return_if_no_display (gdisp, data);
if (! GTK_CHECK_MENU_ITEM (widget)->active)
return;
shell = GIMP_DISPLAY_SHELL (gdisp->shell);
if (fabs (scale - shell->scale) > 0.0001)
gimp_display_shell_scale (shell, GIMP_ZOOM_TO, (gdouble) scale / 10000);
}
void
view_zoom_other_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpDisplay *gdisp;
GimpDisplayShell *shell;
return_if_no_display (gdisp, data);
if (! GTK_CHECK_MENU_ITEM (widget)->active)
return;
shell = GIMP_DISPLAY_SHELL (gdisp->shell);
/* check if we are activated by the user or from image_menu_set_zoom() */
if (shell->scale != shell->other_scale)
gimp_display_shell_scale_dialog (shell);
}
void
view_dot_for_dot_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpDisplay *gdisp;
GimpDisplayShell *shell;
return_if_no_display (gdisp, data);
shell = GIMP_DISPLAY_SHELL (gdisp->shell);
if (shell->dot_for_dot != GTK_CHECK_MENU_ITEM (widget)->active)
{
gimp_display_shell_scale_set_dot_for_dot (shell,
GTK_CHECK_MENU_ITEM (widget)->active);
gimp_item_factory_set_active (GTK_ITEM_FACTORY (shell->menubar_factory),
"/View/Dot for Dot",
shell->dot_for_dot);
if (IS_ACTIVE_DISPLAY (gdisp))
gimp_item_factory_set_active (GTK_ITEM_FACTORY (shell->popup_factory),
"/View/Dot for Dot",
shell->dot_for_dot);
}
}
void
view_info_window_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpDisplay *gdisp;
GimpDisplayShell *shell;
return_if_no_display (gdisp, data);
shell = GIMP_DISPLAY_SHELL (gdisp->shell);
if (GIMP_GUI_CONFIG (gdisp->gimage->gimp->config)->info_window_per_display)
{
if (! shell->info_dialog)
shell->info_dialog = info_window_create (gdisp);
/* To update the fields of the info window for the first time. *
* It's no use updating it in info_window_create() because the *
* pointer of the info window is not present in the shell yet. */
info_window_update (gdisp);
info_dialog_present (shell->info_dialog);
}
else
{
info_window_follow_auto (gdisp->gimage->gimp);
}
}
void
view_navigation_window_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpDisplay *gdisp;
GimpDisplayShell *shell;
return_if_no_display (gdisp, data);
shell = GIMP_DISPLAY_SHELL (gdisp->shell);
gimp_dialog_factory_dialog_raise (global_dock_factory,
gtk_widget_get_screen (widget),
"gimp-navigation-view", -1);
}
void
view_display_filters_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpDisplay *gdisp;
GimpDisplayShell *shell;
return_if_no_display (gdisp, data);
shell = GIMP_DISPLAY_SHELL (gdisp->shell);
if (! shell->filters_dialog)
{
shell->filters_dialog = gimp_display_shell_filter_dialog_new (shell);
g_signal_connect (shell->filters_dialog, "destroy",
G_CALLBACK (gtk_widget_destroyed),
&shell->filters_dialog);
}
gtk_window_present (GTK_WINDOW (shell->filters_dialog));
}
void
view_toggle_selection_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpDisplay *gdisp;
GimpDisplayShell *shell;
return_if_no_display (gdisp, data);
shell = GIMP_DISPLAY_SHELL (gdisp->shell);
gimp_display_shell_set_show_selection (shell,
GTK_CHECK_MENU_ITEM (widget)->active);
}
void
view_toggle_layer_boundary_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpDisplay *gdisp;
GimpDisplayShell *shell;
return_if_no_display (gdisp, data);
shell = GIMP_DISPLAY_SHELL (gdisp->shell);
gimp_display_shell_set_show_layer (shell,
GTK_CHECK_MENU_ITEM (widget)->active);
}
void
view_toggle_menubar_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpDisplay *gdisp;
GimpDisplayShell *shell;
return_if_no_display (gdisp, data);
shell = GIMP_DISPLAY_SHELL (gdisp->shell);
gimp_display_shell_set_show_menubar (shell,
GTK_CHECK_MENU_ITEM (widget)->active);
}
void
view_toggle_rulers_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpDisplay *gdisp;
GimpDisplayShell *shell;
return_if_no_display (gdisp, data);
shell = GIMP_DISPLAY_SHELL (gdisp->shell);
gimp_display_shell_set_show_rulers (shell,
GTK_CHECK_MENU_ITEM (widget)->active);
}
void
view_toggle_scrollbars_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpDisplay *gdisp;
GimpDisplayShell *shell;
return_if_no_display (gdisp, data);
shell = GIMP_DISPLAY_SHELL (gdisp->shell);
gimp_display_shell_set_show_scrollbars (shell,
GTK_CHECK_MENU_ITEM (widget)->active);
}
void
view_toggle_statusbar_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpDisplay *gdisp;
GimpDisplayShell *shell;
return_if_no_display (gdisp, data);
shell = GIMP_DISPLAY_SHELL (gdisp->shell);
gimp_display_shell_set_show_statusbar (shell,
GTK_CHECK_MENU_ITEM (widget)->active);
}
void
view_toggle_guides_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpDisplay *gdisp;
GimpDisplayShell *shell;
return_if_no_display (gdisp, data);
shell = GIMP_DISPLAY_SHELL (gdisp->shell);
gimp_display_shell_set_show_guides (shell,
GTK_CHECK_MENU_ITEM (widget)->active);
}
void
view_snap_to_guides_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpDisplay *gdisp;
GimpDisplayShell *shell;
return_if_no_display (gdisp, data);
shell = GIMP_DISPLAY_SHELL (gdisp->shell);
if (shell->snap_to_guides != GTK_CHECK_MENU_ITEM (widget)->active)
{
shell->snap_to_guides = GTK_CHECK_MENU_ITEM (widget)->active;
gimp_item_factory_set_active (GTK_ITEM_FACTORY (shell->menubar_factory),
"/View/Snap to Guides",
shell->snap_to_guides);
if (IS_ACTIVE_DISPLAY (gdisp))
gimp_item_factory_set_active (GTK_ITEM_FACTORY (shell->popup_factory),
"/View/Snap to Guides",
shell->snap_to_guides);
}
}
void
view_toggle_grid_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpDisplay *gdisp;
GimpDisplayShell *shell;
return_if_no_display (gdisp, data);
shell = GIMP_DISPLAY_SHELL (gdisp->shell);
gimp_display_shell_set_show_grid (shell,
GTK_CHECK_MENU_ITEM (widget)->active);
}
void
view_snap_to_grid_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpDisplay *gdisp;
GimpDisplayShell *shell;
return_if_no_display (gdisp, data);
shell = GIMP_DISPLAY_SHELL (gdisp->shell);
if (shell->snap_to_grid != GTK_CHECK_MENU_ITEM (widget)->active)
{
shell->snap_to_grid = GTK_CHECK_MENU_ITEM (widget)->active;
gimp_item_factory_set_active (GTK_ITEM_FACTORY (shell->menubar_factory),
"/View/Snap to Grid",
shell->snap_to_grid);
if (IS_ACTIVE_DISPLAY (gdisp))
gimp_item_factory_set_active (GTK_ITEM_FACTORY (shell->popup_factory),
"/View/Snap to Grid",
shell->snap_to_grid);
}
}
void
view_new_view_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpDisplay *gdisp;
return_if_no_display (gdisp, data);
gimp_create_display (gdisp->gimage->gimp, gdisp->gimage,
GIMP_DISPLAY_SHELL (gdisp->shell)->scale);
}
void
view_shrink_wrap_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpDisplay *gdisp;
return_if_no_display (gdisp, data);
gimp_display_shell_scale_shrink_wrap (GIMP_DISPLAY_SHELL (gdisp->shell));
}
void
view_fullscreen_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpDisplay *gdisp;
GimpDisplayShell *shell;
gboolean fullscreen;
return_if_no_display (gdisp, data);
shell = GIMP_DISPLAY_SHELL (gdisp->shell);
gimp_display_shell_set_fullscreen (shell,
GTK_CHECK_MENU_ITEM (widget)->active);
fullscreen = (shell->window_state & GDK_WINDOW_STATE_FULLSCREEN) != 0;
if (fullscreen != GTK_CHECK_MENU_ITEM (widget)->active)
{
gimp_item_factory_set_active (GTK_ITEM_FACTORY (shell->menubar_factory),
"/View/Fullscreen",
fullscreen);
if (IS_ACTIVE_DISPLAY (gdisp))
gimp_item_factory_set_active (GTK_ITEM_FACTORY (shell->popup_factory),
"/View/Fullscreen",
fullscreen);
}
}
static void
view_change_screen_confirm_callback (GtkWidget *query_box,
gint value,
gpointer data)
{
GdkScreen *screen;
screen = gdk_display_get_screen (gtk_widget_get_display (GTK_WIDGET (data)),
value);
if (screen)
gtk_window_set_screen (GTK_WINDOW (data), screen);
}
static void
view_change_screen_destroy_callback (GtkWidget *query_box,
GtkWidget *shell)
{
g_object_set_data (G_OBJECT (shell), "gimp-change-screen-dialog", NULL);
}
void
view_change_screen_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpDisplay *gdisp;
GdkScreen *screen;
GdkDisplay *display;
gint cur_screen;
gint num_screens;
GtkWidget *qbox;
return_if_no_display (gdisp, data);
qbox = g_object_get_data (G_OBJECT (gdisp->shell),
"gimp-change-screen-dialog");
if (qbox)
{
gtk_window_present (GTK_WINDOW (qbox));
return;
}
screen = gtk_widget_get_screen (gdisp->shell);
display = gtk_widget_get_display (gdisp->shell);
cur_screen = gdk_screen_get_number (screen);
num_screens = gdk_display_get_n_screens (display);
qbox = gimp_query_int_box ("Move Display to Screen",
gdisp->shell,
NULL, 0,
"Enter destination screen",
cur_screen, 0, num_screens - 1,
G_OBJECT (gdisp->shell), "destroy",
view_change_screen_confirm_callback,
gdisp->shell);
g_object_set_data (G_OBJECT (gdisp->shell), "gimp-change-screen-dialog", qbox);
g_signal_connect (qbox, "destroy",
G_CALLBACK (view_change_screen_destroy_callback),
gdisp->shell);
gtk_widget_show (qbox);
}

View File

@@ -1,73 +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 __VIEW_COMMANDS_H__
#define __VIEW_COMMANDS_H__
void view_zoom_out_cmd_callback (GtkWidget *widget,
gpointer data);
void view_zoom_in_cmd_callback (GtkWidget *widget,
gpointer data);
void view_zoom_fit_cmd_callback (GtkWidget *widget,
gpointer data);
void view_zoom_cmd_callback (GtkWidget *widget,
gpointer data,
guint scale);
void view_zoom_other_cmd_callback (GtkWidget *widget,
gpointer data);
void view_dot_for_dot_cmd_callback (GtkWidget *widget,
gpointer data);
void view_info_window_cmd_callback (GtkWidget *widget,
gpointer data);
void view_navigation_window_cmd_callback (GtkWidget *widget,
gpointer data);
void view_display_filters_cmd_callback (GtkWidget *widget,
gpointer data);
void view_toggle_selection_cmd_callback (GtkWidget *widget,
gpointer data);
void view_toggle_layer_boundary_cmd_callback (GtkWidget *widget,
gpointer data);
void view_toggle_menubar_cmd_callback (GtkWidget *widget,
gpointer data);
void view_toggle_rulers_cmd_callback (GtkWidget *widget,
gpointer data);
void view_toggle_scrollbars_cmd_callback (GtkWidget *widget,
gpointer data);
void view_toggle_statusbar_cmd_callback (GtkWidget *widget,
gpointer data);
void view_toggle_guides_cmd_callback (GtkWidget *widget,
gpointer data);
void view_snap_to_guides_cmd_callback (GtkWidget *widget,
gpointer data);
void view_toggle_grid_cmd_callback (GtkWidget *widget,
gpointer data);
void view_snap_to_grid_cmd_callback (GtkWidget *widget,
gpointer data);
void view_new_view_cmd_callback (GtkWidget *widget,
gpointer data);
void view_shrink_wrap_cmd_callback (GtkWidget *widget,
gpointer data);
void view_fullscreen_cmd_callback (GtkWidget *widget,
gpointer data);
void view_change_screen_cmd_callback (GtkWidget *widget,
gpointer data);
#endif /* __VIEW_COMMANDS_H__ */

View File

@@ -1,440 +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 "apptypes.h"
#include "appenv.h"
#include "airbrush.h"
#include "drawable.h"
#include "gdisplay.h"
#include "gradient.h"
#include "gimpimage.h"
#include "gimpbrush.h"
#include "gimpcontext.h"
#include "gimpui.h"
#include "paint_funcs.h"
#include "paint_core.h"
#include "paint_options.h"
#include "selection.h"
#include "temp_buf.h"
#include "tool.h"
#include "libgimp/gimpintl.h"
/* The maximum amount of pressure that can be exerted */
#define MAX_PRESSURE 0.075
/* Default pressure setting */
#define AIRBRUSH_PRESSURE_DEFAULT 10.0
#define AIRBRUSH_INCREMENTAL_DEFAULT FALSE
#define OFF 0
#define ON 1
/* the airbrush structures */
typedef struct _AirbrushTimeout AirbrushTimeout;
struct _AirbrushTimeout
{
PaintCore *paint_core;
GimpDrawable *drawable;
};
typedef struct _AirbrushOptions AirbrushOptions;
struct _AirbrushOptions
{
PaintOptions paint_options;
gdouble rate;
gdouble rate_d;
GtkObject *rate_w;
gdouble pressure;
gdouble pressure_d;
GtkObject *pressure_w;
};
/* local function prototypes */
static gpointer airbrush_paint_func (PaintCore *paint_core,
GimpDrawable *drawable,
PaintState state);
static gpointer airbrush_non_gui_paint_func (PaintCore *paint_core,
GimpDrawable *drawable,
PaintState state);
/* the airbrush tool options */
static AirbrushOptions *airbrush_options = NULL;
/* local variables */
static gint timer; /* timer for successive paint applications */
static gint timer_state = OFF; /* state of airbrush tool */
static AirbrushTimeout airbrush_timeout;
static gdouble non_gui_pressure;
static gboolean non_gui_incremental;
/* forward function declarations */
static void airbrush_motion (PaintCore *, GimpDrawable *,
PaintPressureOptions *,
gdouble, PaintApplicationMode);
static gint airbrush_time_out (gpointer);
/* functions */
static void
airbrush_options_reset (void)
{
AirbrushOptions *options = airbrush_options;
paint_options_reset ((PaintOptions *) options);
gtk_adjustment_set_value (GTK_ADJUSTMENT (options->rate_w),
options->rate_d);
gtk_adjustment_set_value (GTK_ADJUSTMENT (options->pressure_w),
options->pressure_d);
}
static AirbrushOptions *
airbrush_options_new (void)
{
AirbrushOptions *options;
GtkWidget *vbox;
GtkWidget *table;
GtkWidget *scale;
/* the new airbrush tool options structure */
options = g_new (AirbrushOptions, 1);
paint_options_init ((PaintOptions *) options,
AIRBRUSH,
airbrush_options_reset);
options->rate = options->rate_d = 80.0;
options->pressure = options->pressure_d = AIRBRUSH_PRESSURE_DEFAULT;
/* the main vbox */
vbox = ((ToolOptions *) options)->main_vbox;
/* the rate scale */
table = gtk_table_new (2, 2, FALSE);
gtk_table_set_col_spacing (GTK_TABLE (table), 0, 4);
gtk_table_set_row_spacings (GTK_TABLE (table), 1);
gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0);
options->rate_w =
gtk_adjustment_new (options->rate_d, 0.0, 150.0, 1.0, 1.0, 0.0);
scale = gtk_hscale_new (GTK_ADJUSTMENT (options->rate_w));
gtk_scale_set_value_pos (GTK_SCALE (scale), GTK_POS_TOP);
gtk_range_set_update_policy (GTK_RANGE (scale), GTK_UPDATE_DELAYED);
gtk_signal_connect (GTK_OBJECT (options->rate_w), "value_changed",
GTK_SIGNAL_FUNC (gimp_double_adjustment_update),
&options->rate);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
_("Rate:"), 1.0, 1.0,
scale, 1, FALSE);
/* the pressure scale */
options->pressure_w =
gtk_adjustment_new (options->pressure_d, 0.0, 100.0, 1.0, 1.0, 0.0);
scale = gtk_hscale_new (GTK_ADJUSTMENT (options->pressure_w));
gtk_scale_set_value_pos (GTK_SCALE (scale), GTK_POS_TOP);
gtk_range_set_update_policy (GTK_RANGE (scale), GTK_UPDATE_DELAYED);
gtk_signal_connect (GTK_OBJECT (options->pressure_w), "value_changed",
GTK_SIGNAL_FUNC (gimp_double_adjustment_update),
&options->pressure);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 1,
_("Pressure:"), 1.0, 1.0,
scale, 1, FALSE);
gtk_widget_show (table);
return options;
}
Tool *
tools_new_airbrush (void)
{
Tool * tool;
PaintCore * private;
/* The tool options */
if (! airbrush_options)
{
airbrush_options = airbrush_options_new ();
tools_register (AIRBRUSH, (ToolOptions *) airbrush_options);
}
tool = paint_core_new (AIRBRUSH);
private = (PaintCore *) tool->private;
private->paint_func = airbrush_paint_func;
private->pick_colors = TRUE;
private->flags |= TOOL_CAN_HANDLE_CHANGING_BRUSH;
return tool;
}
static gpointer
airbrush_paint_func (PaintCore *paint_core,
GimpDrawable *drawable,
PaintState state)
{
GimpBrush *brush;
gdouble rate;
if (!drawable)
return NULL;
brush = gimp_context_get_brush (NULL);
switch (state)
{
case INIT_PAINT :
/* timer_state = OFF; */
if (timer_state == ON)
{
g_warning ("killing stray timer, please report to lewing@gimp.org");
gtk_timeout_remove (timer);
}
timer_state = OFF;
break;
case MOTION_PAINT :
if (timer_state == ON)
gtk_timeout_remove (timer);
timer_state = OFF;
airbrush_motion (paint_core, drawable,
airbrush_options->paint_options.pressure_options,
airbrush_options->pressure,
airbrush_options->paint_options.incremental ?
INCREMENTAL : CONSTANT);
if (airbrush_options->rate != 0.0)
{
airbrush_timeout.paint_core = paint_core;
airbrush_timeout.drawable = drawable;
rate = airbrush_options->paint_options.pressure_options->rate ?
(10000 / (airbrush_options->rate * 2.0 * paint_core->curpressure)) :
(10000 / airbrush_options->rate);
timer = gtk_timeout_add (rate, airbrush_time_out, NULL);
timer_state = ON;
}
break;
case FINISH_PAINT :
if (timer_state == ON)
gtk_timeout_remove (timer);
timer_state = OFF;
break;
default :
break;
}
return NULL;
}
void
tools_free_airbrush (Tool *tool)
{
if (timer_state == ON)
gtk_timeout_remove (timer);
timer_state = OFF;
paint_core_free (tool);
}
static gint
airbrush_time_out (gpointer client_data)
{
/* service the timer */
airbrush_motion (airbrush_timeout.paint_core,
airbrush_timeout.drawable,
airbrush_options->paint_options.pressure_options,
airbrush_options->pressure,
airbrush_options->paint_options.incremental ?
INCREMENTAL : CONSTANT);
gdisplays_flush ();
/* restart the timer */
if (airbrush_options->rate != 0.0)
{
if (airbrush_options->paint_options.pressure_options->rate)
{
/* set a new timer */
timer = gtk_timeout_add ((10000 / (airbrush_options->rate * 2.0 * airbrush_timeout.paint_core->curpressure)),
airbrush_time_out, NULL);
return FALSE;
}
else
return TRUE;
}
else
return FALSE;
}
static void
airbrush_motion (PaintCore *paint_core,
GimpDrawable *drawable,
PaintPressureOptions *pressure_options,
double pressure,
PaintApplicationMode mode)
{
GImage *gimage;
TempBuf *area;
guchar col[MAX_CHANNELS];
gdouble scale;
if (!drawable)
return;
if (! (gimage = gimp_drawable_gimage (drawable)))
return;
if (pressure_options->size)
scale = paint_core->curpressure;
else
scale = 1.0;
if (! (area = paint_core_get_paint_area (paint_core, drawable, scale)))
return;
/* color the pixels */
if (pressure_options->color)
{
GimpRGB color;
gradient_get_color_at (gimp_context_get_gradient (NULL),
paint_core->curpressure, &color);
gimp_rgba_get_uchar (&color,
&col[RED_PIX],
&col[GREEN_PIX],
&col[BLUE_PIX],
&col[ALPHA_PIX]);
mode = INCREMENTAL;
color_pixels (temp_buf_data (area), col,
area->width * area->height, area->bytes);
}
else if (paint_core->brush && paint_core->brush->pixmap)
{
mode = INCREMENTAL;
paint_core_color_area_with_pixmap (paint_core, gimage, drawable, area,
scale, SOFT);
}
else
{
gimp_image_get_foreground (gimage, drawable, col);
col[area->bytes - 1] = OPAQUE_OPACITY;
color_pixels (temp_buf_data (area), col,
area->width * area->height, area->bytes);
}
if (pressure_options->pressure)
pressure = pressure * 2.0 * paint_core->curpressure;
/* paste the newly painted area to the image */
paint_core_paste_canvas (paint_core, drawable,
MIN (pressure, 255),
(gint) (gimp_context_get_opacity (NULL) * 255),
gimp_context_get_paint_mode (NULL),
SOFT, scale, mode);
}
static gpointer
airbrush_non_gui_paint_func (PaintCore *paint_core,
GimpDrawable *drawable,
PaintState state)
{
airbrush_motion (paint_core, drawable, &non_gui_pressure_options,
non_gui_pressure, non_gui_incremental);
return NULL;
}
gboolean
airbrush_non_gui_default (GimpDrawable *drawable,
gint num_strokes,
gdouble *stroke_array)
{
AirbrushOptions *options = airbrush_options;
gdouble pressure = AIRBRUSH_PRESSURE_DEFAULT;
if(options)
pressure = options->pressure;
return airbrush_non_gui (drawable, pressure, num_strokes, stroke_array);
}
gboolean
airbrush_non_gui (GimpDrawable *drawable,
gdouble pressure,
gint num_strokes,
gdouble *stroke_array)
{
gint i;
if (paint_core_init (&non_gui_paint_core, drawable,
stroke_array[0], stroke_array[1]))
{
/* Set the paint core's paint func */
non_gui_paint_core.paint_func = airbrush_non_gui_paint_func;
non_gui_pressure = pressure;
non_gui_paint_core.startx = non_gui_paint_core.lastx = stroke_array[0];
non_gui_paint_core.starty = non_gui_paint_core.lasty = stroke_array[1];
airbrush_non_gui_paint_func (&non_gui_paint_core, drawable, 0);
for (i = 1; i < num_strokes; i++)
{
non_gui_paint_core.curx = stroke_array[i * 2 + 0];
non_gui_paint_core.cury = stroke_array[i * 2 + 1];
paint_core_interpolate (&non_gui_paint_core, drawable);
non_gui_paint_core.lastx = non_gui_paint_core.curx;
non_gui_paint_core.lasty = non_gui_paint_core.cury;
}
/* Finish the painting */
paint_core_finish (&non_gui_paint_core, drawable, -1);
/* Cleanup */
paint_core_cleanup ();
return TRUE;
}
return FALSE;
}

View File

@@ -203,7 +203,8 @@ app_run (const gchar *full_prog_name,
gimp_load_config (gimp, alternate_system_gimprc, alternate_gimprc);
/* initialize lowlevel stuff */
swap_is_ok = base_init (GIMP_BASE_CONFIG (gimp->config), use_cpu_accel);
swap_is_ok = base_init (GIMP_BASE_CONFIG (gimp->config),
be_verbose, use_cpu_accel);
if (! no_interface)
update_status_func = gui_init (gimp, no_splash);

View File

@@ -60,6 +60,7 @@ static void base_tile_cache_size_notify (GObject *config,
gboolean
base_init (GimpBaseConfig *config,
gboolean be_verbose,
gboolean use_cpu_accel)
{
gchar *swapfile;
@@ -98,7 +99,7 @@ base_init (GimpBaseConfig *config,
swap_is_ok = tile_swap_test ();
gimp_composite_init (use_cpu_accel);
gimp_composite_init (be_verbose, use_cpu_accel);
paint_funcs_setup ();

View File

@@ -20,6 +20,7 @@
#define __BASE_H__
gboolean base_init (GimpBaseConfig *config,
gboolean be_verbose,
gboolean use_cpu_accel);
void base_exit (void);

View File

@@ -37,8 +37,9 @@
#include "cpu-accel.h"
#if defined(ARCH_X86) && defined(USE_MMX) && defined(__GNUC__)
#ifdef ARCH_X86
#define HAVE_ACCEL 1
typedef enum
{
@@ -135,6 +136,8 @@ arch_get_vendor (void)
#ifdef ARCH_X86_64
if (strcmp (id, "AuthenticAMD") == 0)
return ARCH_X86_VENDOR_AMD;
else if (strcmp (id, "GenuineIntel") == 0)
return ARCH_X86_VENDOR_INTEL;
#else
if (strcmp (id, "GenuineIntel") == 0)
return ARCH_X86_VENDOR_INTEL;
@@ -287,6 +290,33 @@ arch_accel_cyrix (void)
return caps;
}
#ifdef USE_SSE
static jmp_buf sigill_return;
static void
sigill_handler (gint n)
{
longjmp (sigill_return, 1);
}
static gboolean
arch_accel_sse_os_support (void)
{
if (setjmp (sigill_return))
{
return FALSE;
}
else
{
signal (SIGILL, sigill_handler);
__asm__ __volatile__ ("xorps %xmm0, %xmm0");
signal (SIGILL, SIG_DFL);
}
return TRUE;
}
#endif /* USE_SSE */
static guint32
arch_accel (void)
{
@@ -320,21 +350,20 @@ arch_accel (void)
break;
}
#ifdef USE_SSE
if ((caps & CPU_ACCEL_X86_SSE) && !arch_accel_sse_os_support ())
caps &= ~(CPU_ACCEL_X86_SSE | CPU_ACCEL_X86_SSE2);
#endif
return caps;
}
static jmp_buf sigill_return;
static void
sigill_handler (gint n)
{
longjmp (sigill_return, 1);
}
#endif /* ARCH_X86 */
#endif /* ARCH_X86 && USE_MMX && __GNUC__ */
#if defined (ARCH_PPC) && defined (USE_ALTIVEC)
#if defined (ARCH_PPC) && defined (USE_ALTIVEC) && defined(__GNUC__)
#define HAVE_ACCEL 1
static sigjmp_buf jmpbuf;
static volatile sig_atomic_t canjump = 0;
@@ -366,22 +395,22 @@ arch_accel (void)
canjump = 1;
asm volatile ("mtspr 256, %0\n\t"
"vand %%v0, %%v0, %%v0"
:
: "r" (-1));
"vand %%v0, %%v0, %%v0"
:
: "r" (-1));
signal (SIGILL, SIG_DFL);
return CPU_ACCEL_PPC_ALTIVEC;
}
#endif /* ARCH_PPC */
#endif /* ARCH_PPC && USE_ALTIVEC && __GNUC__ */
guint32
cpu_accel (void)
{
#if defined (ARCH_X86) || (defined (ARCH_PPC) && defined (USE_ALTIVEC))
#ifdef HAVE_ACCEL
static guint32 accel = ~0U;
if (accel != ~0U)
@@ -389,26 +418,9 @@ cpu_accel (void)
accel = arch_accel ();
#ifdef USE_SSE
/* test OS support for SSE */
if (accel & CPU_ACCEL_X86_SSE)
{
if (setjmp (sigill_return))
{
accel &= ~(CPU_ACCEL_X86_SSE | CPU_ACCEL_X86_SSE2);
}
else
{
signal (SIGILL, sigill_handler);
__asm__ __volatile__ ("xorps %xmm0, %xmm0");
signal (SIGILL, SIG_DFL);
}
}
#endif /* USE_SSE */
return accel;
#else /* !ARCH_X86 && !ARCH_PPC/USE_ALTIVEC */
#else /* !HAVE_ACCEL */
return 0;
#endif
}

View File

@@ -86,7 +86,7 @@ curves_channel_reset (Curves *curves,
for (j = 0; j < 256; j++)
curves->curve[channel][j] = j;
for (j = 0; j < 17; j++)
for (j = 0; j < CURVES_NUM_POINTS; j++)
{
curves->points[channel][j][0] = -1;
curves->points[channel][j][1] = -1;
@@ -94,8 +94,8 @@ curves_channel_reset (Curves *curves,
curves->points[channel][0][0] = 0;
curves->points[channel][0][1] = 0;
curves->points[channel][16][0] = 255;
curves->points[channel][16][1] = 255;
curves->points[channel][CURVES_NUM_POINTS - 1][0] = 255;
curves->points[channel][CURVES_NUM_POINTS - 1][1] = 255;
}
void
@@ -103,7 +103,7 @@ curves_calculate_curve (Curves *curves,
GimpHistogramChannel channel)
{
gint i;
gint points[17];
gint points[CURVES_NUM_POINTS];
gint num_pts;
gint p1, p2, p3, p4;
@@ -117,7 +117,7 @@ curves_calculate_curve (Curves *curves,
case GIMP_CURVE_SMOOTH:
/* cycle through the curves */
num_pts = 0;
for (i = 0; i < 17; i++)
for (i = 0; i < CURVES_NUM_POINTS; i++)
if (curves->points[channel][i][0] != -1)
points[num_pts++] = i;
@@ -156,7 +156,7 @@ curves_calculate_curve (Curves *curves,
gfloat
curves_lut_func (Curves *curves,
gint nchannels,
gint n_channels,
gint channel,
gfloat value)
{
@@ -165,33 +165,39 @@ curves_lut_func (Curves *curves,
gdouble inten;
gint j;
if (nchannels == 1)
j = 0;
if (n_channels <= 2)
j = channel;
else
j = channel + 1;
inten = value;
/* For color images this runs through the loop with j = channel +1
the first time and j = 0 the second time */
/* For bw images this runs through the loop with j = 0 the first and
only time */
/* For RGB and RGBA images this runs through the loop with j = channel + 1
* the first time and j = 0 the second time
*
* For GRAY images this runs through the loop with j = 0 the first and
* only time
*/
for (; j >= 0; j -= (channel + 1))
{
/* don't apply the overall curve to the alpha channel */
if (j == 0 && (nchannels == 2 || nchannels == 4)
&& channel == nchannels -1)
if (j == 0 && (n_channels == 2 || n_channels == 4) &&
channel == n_channels - 1)
return inten;
if (inten < 0.0)
inten = curves->curve[j][0]/255.0;
{
inten = curves->curve[j][0]/255.0;
}
else if (inten >= 1.0)
inten = curves->curve[j][255]/255.0;
{
inten = curves->curve[j][255]/255.0;
}
else /* interpolate the curve */
{
index = floor(inten * 255.0);
f = inten*255.0 - index;
inten = ((1.0 - f) * curves->curve[j][index ] +
inten = ((1.0 - f) * curves->curve[j][index ] +
( f) * curves->curve[j][index + 1] ) / 255.0;
}
}

View File

@@ -19,11 +19,12 @@
#ifndef __CURVES_H__
#define __CURVES_H__
#define CURVES_NUM_POINTS 17
struct _Curves
{
GimpCurveType curve_type[5];
gint points[5][17][2];
gint points[5][CURVES_NUM_POINTS][2];
guchar curve[5][256];
};

View File

@@ -212,7 +212,7 @@ levels_adjust_by_colors (Levels *levels,
return;
/* Map selected color to corresponding lightness */
levels->gamma[channel] = log (inten) / log (out_light);
levels->gamma[channel] = log (inten) / log (out_light);
}
}
@@ -259,32 +259,36 @@ levels_lut_func (Levels *levels,
gdouble inten;
gint j;
if (n_channels == 1)
j = 0;
if (n_channels <= 2)
j = channel;
else
j = channel + 1;
inten = value;
/* For color images this runs through the loop with j = channel +1
/* For RGB and RGBA images this runs through the loop with j = channel + 1
* the first time and j = 0 the second time
*
* For bw images this runs through the loop with j = 0 the first and
* only time
* For GRAY images this runs through the loop with j = 0 the first and
* only time
*/
for (; j >= 0; j -= (channel + 1))
{
/* don't apply the overall curve to the alpha channel */
if (j == 0 && (n_channels == 2 || n_channels == 4)
&& channel == n_channels -1)
if (j == 0 && (n_channels == 2 || n_channels == 4) &&
channel == n_channels - 1)
return inten;
/* determine input intensity */
if (levels->high_input[j] != levels->low_input[j])
inten = ((gdouble) (255.0 * inten - levels->low_input[j]) /
(gdouble) (levels->high_input[j] - levels->low_input[j]));
{
inten = ((gdouble) (255.0 * inten - levels->low_input[j]) /
(gdouble) (levels->high_input[j] - levels->low_input[j]));
}
else
inten = (gdouble) (255.0 * inten - levels->low_input[j]);
{
inten = (gdouble) (255.0 * inten - levels->low_input[j]);
}
if (levels->gamma[j] != 0.0)
{

View File

@@ -440,11 +440,11 @@ tile_manager_map (TileManager *tm,
{
Tile **tiles;
Tile **tile_ptr;
gint ntiles;
gint nrows, ncols;
gint right_tile;
gint bottom_tile;
gint i, j, k;
gint ntiles;
gint nrows, ncols;
gint right_tile;
gint bottom_tile;
gint i, j, k;
g_return_if_fail (tm != NULL);
g_return_if_fail (srctile != NULL);
@@ -615,16 +615,41 @@ tile_manager_set_offsets (TileManager *tm,
}
gint64
tile_manager_get_memsize (const TileManager *tm)
tile_manager_get_memsize (const TileManager *tm,
gboolean sparse)
{
gint64 memsize = 0;
gint64 memsize;
g_return_val_if_fail (tm != NULL, 0);
memsize += (sizeof (TileManager) +
(gint64) tm->ntile_rows * tm->ntile_cols *
(sizeof (Tile) + sizeof (gpointer)) +
(gint64) tm->width * tm->height * tm->bpp);
/* the tile manager itself */
memsize = sizeof (TileManager);
/* the array of tiles */
memsize += (gint64) tm->ntile_rows * tm->ntile_cols * (sizeof (Tile) +
sizeof (gpointer));
/* the memory allocated for the tiles */
if (sparse)
{
if (tm->tiles)
{
Tile **tiles = tm->tiles;
gint64 size = TILE_WIDTH * TILE_HEIGHT * tm->bpp;
gint i, j;
for (i = 0; i < tm->ntile_rows; i++)
for (j = 0; j < tm->ntile_cols; j++, tiles++)
{
if (tile_is_valid (*tiles))
memsize += size;
}
}
}
else
{
memsize += (gint64) tm->width * tm->height * tm->bpp;
}
return memsize;
}

View File

@@ -123,7 +123,8 @@ void tile_manager_set_offsets (TileManager *tm,
gint x,
gint y);
gint64 tile_manager_get_memsize (const TileManager *tm);
gint64 tile_manager_get_memsize (const TileManager *tm,
gboolean sparse);
void tile_manager_get_tile_coordinates (TileManager *tm,
Tile *tile,

View File

@@ -54,14 +54,13 @@ libappcomposite_a_SOURCES = \
$(libappcomposite_a_sources)
regenerate: gimp-composite-generic.o gimp-composite-mmx.o gimp-composite-sse.o gimp-composite-sse2.o gimp-composite-3dnow.o gimp-composite-altivec.o gimp-composite-vis.o
$(srcdir)/make-installer.py -f gimp-composite-generic.o
$(srcdir)/make-installer.py -t -r '(__GNUC__ >= 3) && defined(USE_MMX) && defined(ARCH_X86) && (defined(ARCH_X86_64) || !defined(PIC))' -f gimp-composite-mmx.o
$(srcdir)/make-installer.py -t -r '(__GNUC__ >= 3) && defined(USE_SSE) && defined(ARCH_X86) && (defined(ARCH_X86_64) || !defined(PIC))' -f gimp-composite-sse.o
$(srcdir)/make-installer.py -t -r '(__GNUC__ >= 3) && defined(USE_SSE) && defined(ARCH_X86) && (defined(ARCH_X86_64) || !defined(PIC))' -f gimp-composite-sse2.o
$(srcdir)/make-installer.py -t -r '(__GNUC__ >= 3) && defined(USE_3DNOW) && defined(ARCH_X86) && (defined(ARCH_X86_64) || !defined(PIC))' -f gimp-composite-3dnow.o
$(srcdir)/make-installer.py -t -r '(__GNUC__ >= 3) && defined(USE_ALTIVEC) && defined(ARCH_PPC)' -f gimp-composite-altivec.o
$(srcdir)/make-installer.py -t -r '(__GNUC__ >= 3) && defined(USE_VIS) && defined(ARCH_SPARC)' -f gimp-composite-vis.o
$(srcdir)/make-installer.py -f gimp-composite-generic.o
$(srcdir)/make-installer.py -t -r 'defined(COMPILE_MMX_IS_OKAY)' -f gimp-composite-mmx.o
$(srcdir)/make-installer.py -t -r 'defined(COMPILE_SSE_IS_OKAY)' -f gimp-composite-sse.o
$(srcdir)/make-installer.py -t -r 'defined(COMPILE_SSE2_IS_OKAY)' -f gimp-composite-sse2.o
$(srcdir)/make-installer.py -t -r 'defined(COMPILE_3DNOW_IS_OKAY)' -f gimp-composite-3dnow.o
$(srcdir)/make-installer.py -t -r 'defined(COMPILE_ALTIVEC_IS_OKAY)' -f gimp-composite-altivec.o
$(srcdir)/make-installer.py -t -r 'defined(COMPILE_VIS_IS_OKAY)' -f gimp-composite-vis.o
EXTRA_DIST = \
make-installer.py \

View File

@@ -19,7 +19,7 @@
int
gimp_composite_3dnow_test (int iterations, int n_pixels)
{
#if (__GNUC__ >= 3) && defined(USE_3DNOW) && defined(ARCH_X86) && (defined(ARCH_X86_64) || !defined(PIC))
#if defined(COMPILE_3DNOW_IS_OKAY)
GimpCompositeContext generic_ctx;
GimpCompositeContext special_ctx;
double ft0;
@@ -78,7 +78,7 @@ main (int argc, char *argv[])
putenv ("GIMP_COMPOSITE=0x1");
iterations = 1;
iterations = 10;
n_pixels = 1048593;
argv++, argc--;

View File

@@ -31,22 +31,17 @@
#include "base/cpu-accel.h"
#include "gimp-composite.h"
#include "gimp-composite-3dnow.h"
#if defined(USE_MMX)
#if defined(ARCH_X86)
#if __GNUC__ >= 3
#if defined(ARCH_X86_64) || !defined(PIC)
#ifdef COMPILE_3DNOW_IS_OKAY
#endif /* ARCH_X86_64 || !PIC */
#endif /* __GNUC__ > 3 */
#endif /* ARCH_X86 */
#endif /* USE_MMX */
#endif
gboolean
gimp_composite_3dnow_init (void)
{
#if defined(USE_MMX) && defined(ARCH_X86) && (defined(ARCH_X86_64) || !defined(PIC))
#ifdef COMPILE_3DNOW_IS_OKAY
if (cpu_accel () & CPU_ACCEL_X86_3DNOW)
{
return (TRUE);

View File

@@ -9,4 +9,16 @@ extern gboolean gimp_composite_3dnow_init (void);
*/
extern gboolean gimp_composite_3dnow_install (void);
#if !defined(__INTEL_COMPILER)
#if defined(USE_MMX)
#if defined(ARCH_X86)
#if __GNUC__ >= 3
#if defined(ARCH_X86_64) || !defined(PIC)
#define COMPILE_3DNOW_IS_OKAY (1)
#endif /* ARCH_X86_64 || !PIC */
#endif /* __GNUC__ > 3 */
#endif /* ARCH_X86 */
#endif /* USE_MMX */
#endif /* !defined(__INTEL_COMPILER) */
#endif

View File

@@ -19,7 +19,7 @@
int
gimp_composite_altivec_test (int iterations, int n_pixels)
{
#if (__GNUC__ >= 3) && defined(USE_ALTIVEC) && defined(ARCH_PPC)
#if defined(COMPILE_ALTIVEC_IS_OKAY)
GimpCompositeContext generic_ctx;
GimpCompositeContext special_ctx;
double ft0;
@@ -78,7 +78,7 @@ main (int argc, char *argv[])
putenv ("GIMP_COMPOSITE=0x1");
iterations = 1;
iterations = 10;
n_pixels = 1048593;
argv++, argc--;

View File

@@ -30,16 +30,14 @@
#include "gimp-composite.h"
#include "gimp-composite-altivec.h"
#ifdef ARCH_PPC
#if __GNUC__ >= 3
#ifdef COMPILE_ALTIVEC_IS_OKAY
#endif /* __GNUC__ > 3 */
#endif /* ARCH_PPC */
#endif
gboolean
gimp_composite_altivec_init (void)
{
#ifdef ARCH_PPC
#ifdef COMPILE_ALTIVEC_IS_OKAY
if (cpu_accel () & CPU_ACCEL_PPC_ALTIVEC)
{
return (TRUE);

View File

@@ -9,4 +9,10 @@ extern gboolean gimp_composite_altivec_init (void);
*/
extern gboolean gimp_composite_altivec_install (void);
#ifdef ARCH_PPC
#if __GNUC__ >= 3
#define COMPILE_ALTIVEC_IS_OKAY (1)
#endif /* __GNUC__ > 3 */
#endif /* ARCH_PPC */
#endif

View File

@@ -16,7 +16,7 @@ static struct install_table {
GimpPixelFormat D;
void (*function)(GimpCompositeContext *);
} _gimp_composite_mmx[] = {
#if (__GNUC__ >= 3) && defined(USE_MMX) && defined(ARCH_X86) && (defined(ARCH_X86_64) || !defined(PIC))
#if defined(COMPILE_MMX_IS_OKAY)
{ GIMP_COMPOSITE_MULTIPLY, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, gimp_composite_multiply_rgba8_rgba8_rgba8_mmx },
{ GIMP_COMPOSITE_SCREEN, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, gimp_composite_screen_rgba8_rgba8_rgba8_mmx },
{ GIMP_COMPOSITE_DIFFERENCE, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, gimp_composite_difference_rgba8_rgba8_rgba8_mmx },

View File

@@ -19,7 +19,7 @@
int
gimp_composite_mmx_test (int iterations, int n_pixels)
{
#if (__GNUC__ >= 3) && defined(USE_MMX) && defined(ARCH_X86) && (defined(ARCH_X86_64) || !defined(PIC))
#if defined(COMPILE_MMX_IS_OKAY)
GimpCompositeContext generic_ctx;
GimpCompositeContext special_ctx;
double ft0;
@@ -71,10 +71,10 @@ gimp_composite_mmx_test (int iterations, int n_pixels)
ft1 = gimp_composite_regression_time_function (iterations, gimp_composite_addition_rgba8_rgba8_rgba8_mmx, &special_ctx);
if (gimp_composite_regression_compare_contexts ("addition", &generic_ctx, &special_ctx))
{
printf("addition failed\n");
printf("addition_rgba8_rgba8_rgba8 failed\n");
return (1);
}
gimp_composite_regression_timer_report ("addition", ft0, ft1);
gimp_composite_regression_timer_report ("addition_rgba8_rgba8_rgba8", ft0, ft1);
gimp_composite_context_init (&special_ctx, GIMP_COMPOSITE_BURN, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, n_pixels, (unsigned char *) rgba8A, (unsigned char *) rgba8B, (unsigned char *) rgba8B, (unsigned char *) rgba8D2);
gimp_composite_context_init (&generic_ctx, GIMP_COMPOSITE_BURN, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, n_pixels, (unsigned char *) rgba8A, (unsigned char *) rgba8B, (unsigned char *) rgba8B, (unsigned char *) rgba8D1);
@@ -82,10 +82,10 @@ gimp_composite_mmx_test (int iterations, int n_pixels)
ft1 = gimp_composite_regression_time_function (iterations, gimp_composite_burn_rgba8_rgba8_rgba8_mmx, &special_ctx);
if (gimp_composite_regression_compare_contexts ("burn", &generic_ctx, &special_ctx))
{
printf("burn failed\n");
printf("burn_rgba8_rgba8_rgba8 failed\n");
return (1);
}
gimp_composite_regression_timer_report ("burn", ft0, ft1);
gimp_composite_regression_timer_report ("burn_rgba8_rgba8_rgba8", ft0, ft1);
gimp_composite_context_init (&special_ctx, GIMP_COMPOSITE_DARKEN, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, n_pixels, (unsigned char *) rgba8A, (unsigned char *) rgba8B, (unsigned char *) rgba8B, (unsigned char *) rgba8D2);
gimp_composite_context_init (&generic_ctx, GIMP_COMPOSITE_DARKEN, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, n_pixels, (unsigned char *) rgba8A, (unsigned char *) rgba8B, (unsigned char *) rgba8B, (unsigned char *) rgba8D1);
@@ -93,10 +93,10 @@ gimp_composite_mmx_test (int iterations, int n_pixels)
ft1 = gimp_composite_regression_time_function (iterations, gimp_composite_darken_rgba8_rgba8_rgba8_mmx, &special_ctx);
if (gimp_composite_regression_compare_contexts ("darken", &generic_ctx, &special_ctx))
{
printf("darken failed\n");
printf("darken_rgba8_rgba8_rgba8 failed\n");
return (1);
}
gimp_composite_regression_timer_report ("darken", ft0, ft1);
gimp_composite_regression_timer_report ("darken_rgba8_rgba8_rgba8", ft0, ft1);
gimp_composite_context_init (&special_ctx, GIMP_COMPOSITE_DIFFERENCE, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, n_pixels, (unsigned char *) rgba8A, (unsigned char *) rgba8B, (unsigned char *) rgba8B, (unsigned char *) rgba8D2);
gimp_composite_context_init (&generic_ctx, GIMP_COMPOSITE_DIFFERENCE, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, n_pixels, (unsigned char *) rgba8A, (unsigned char *) rgba8B, (unsigned char *) rgba8B, (unsigned char *) rgba8D1);
@@ -104,10 +104,10 @@ gimp_composite_mmx_test (int iterations, int n_pixels)
ft1 = gimp_composite_regression_time_function (iterations, gimp_composite_difference_rgba8_rgba8_rgba8_mmx, &special_ctx);
if (gimp_composite_regression_compare_contexts ("difference", &generic_ctx, &special_ctx))
{
printf("difference failed\n");
printf("difference_rgba8_rgba8_rgba8 failed\n");
return (1);
}
gimp_composite_regression_timer_report ("difference", ft0, ft1);
gimp_composite_regression_timer_report ("difference_rgba8_rgba8_rgba8", ft0, ft1);
gimp_composite_context_init (&special_ctx, GIMP_COMPOSITE_GRAIN_EXTRACT, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, n_pixels, (unsigned char *) rgba8A, (unsigned char *) rgba8B, (unsigned char *) rgba8B, (unsigned char *) rgba8D2);
gimp_composite_context_init (&generic_ctx, GIMP_COMPOSITE_GRAIN_EXTRACT, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, n_pixels, (unsigned char *) rgba8A, (unsigned char *) rgba8B, (unsigned char *) rgba8B, (unsigned char *) rgba8D1);
@@ -115,10 +115,10 @@ gimp_composite_mmx_test (int iterations, int n_pixels)
ft1 = gimp_composite_regression_time_function (iterations, gimp_composite_grain_extract_rgba8_rgba8_rgba8_mmx, &special_ctx);
if (gimp_composite_regression_compare_contexts ("grain_extract", &generic_ctx, &special_ctx))
{
printf("grain_extract failed\n");
printf("grain_extract_rgba8_rgba8_rgba8 failed\n");
return (1);
}
gimp_composite_regression_timer_report ("grain_extract", ft0, ft1);
gimp_composite_regression_timer_report ("grain_extract_rgba8_rgba8_rgba8", ft0, ft1);
gimp_composite_context_init (&special_ctx, GIMP_COMPOSITE_GRAIN_MERGE, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, n_pixels, (unsigned char *) rgba8A, (unsigned char *) rgba8B, (unsigned char *) rgba8B, (unsigned char *) rgba8D2);
gimp_composite_context_init (&generic_ctx, GIMP_COMPOSITE_GRAIN_MERGE, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, n_pixels, (unsigned char *) rgba8A, (unsigned char *) rgba8B, (unsigned char *) rgba8B, (unsigned char *) rgba8D1);
@@ -126,10 +126,10 @@ gimp_composite_mmx_test (int iterations, int n_pixels)
ft1 = gimp_composite_regression_time_function (iterations, gimp_composite_grain_merge_rgba8_rgba8_rgba8_mmx, &special_ctx);
if (gimp_composite_regression_compare_contexts ("grain_merge", &generic_ctx, &special_ctx))
{
printf("grain_merge failed\n");
printf("grain_merge_rgba8_rgba8_rgba8 failed\n");
return (1);
}
gimp_composite_regression_timer_report ("grain_merge", ft0, ft1);
gimp_composite_regression_timer_report ("grain_merge_rgba8_rgba8_rgba8", ft0, ft1);
gimp_composite_context_init (&special_ctx, GIMP_COMPOSITE_LIGHTEN, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, n_pixels, (unsigned char *) rgba8A, (unsigned char *) rgba8B, (unsigned char *) rgba8B, (unsigned char *) rgba8D2);
gimp_composite_context_init (&generic_ctx, GIMP_COMPOSITE_LIGHTEN, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, n_pixels, (unsigned char *) rgba8A, (unsigned char *) rgba8B, (unsigned char *) rgba8B, (unsigned char *) rgba8D1);
@@ -137,10 +137,10 @@ gimp_composite_mmx_test (int iterations, int n_pixels)
ft1 = gimp_composite_regression_time_function (iterations, gimp_composite_lighten_rgba8_rgba8_rgba8_mmx, &special_ctx);
if (gimp_composite_regression_compare_contexts ("lighten", &generic_ctx, &special_ctx))
{
printf("lighten failed\n");
printf("lighten_rgba8_rgba8_rgba8 failed\n");
return (1);
}
gimp_composite_regression_timer_report ("lighten", ft0, ft1);
gimp_composite_regression_timer_report ("lighten_rgba8_rgba8_rgba8", ft0, ft1);
gimp_composite_context_init (&special_ctx, GIMP_COMPOSITE_MULTIPLY, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, n_pixels, (unsigned char *) rgba8A, (unsigned char *) rgba8B, (unsigned char *) rgba8B, (unsigned char *) rgba8D2);
gimp_composite_context_init (&generic_ctx, GIMP_COMPOSITE_MULTIPLY, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, n_pixels, (unsigned char *) rgba8A, (unsigned char *) rgba8B, (unsigned char *) rgba8B, (unsigned char *) rgba8D1);
@@ -148,10 +148,10 @@ gimp_composite_mmx_test (int iterations, int n_pixels)
ft1 = gimp_composite_regression_time_function (iterations, gimp_composite_multiply_rgba8_rgba8_rgba8_mmx, &special_ctx);
if (gimp_composite_regression_compare_contexts ("multiply", &generic_ctx, &special_ctx))
{
printf("multiply failed\n");
printf("multiply_rgba8_rgba8_rgba8 failed\n");
return (1);
}
gimp_composite_regression_timer_report ("multiply", ft0, ft1);
gimp_composite_regression_timer_report ("multiply_rgba8_rgba8_rgba8", ft0, ft1);
gimp_composite_context_init (&special_ctx, GIMP_COMPOSITE_SCALE, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, n_pixels, (unsigned char *) rgba8A, (unsigned char *) rgba8B, (unsigned char *) rgba8B, (unsigned char *) rgba8D2);
gimp_composite_context_init (&generic_ctx, GIMP_COMPOSITE_SCALE, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, n_pixels, (unsigned char *) rgba8A, (unsigned char *) rgba8B, (unsigned char *) rgba8B, (unsigned char *) rgba8D1);
@@ -159,10 +159,10 @@ gimp_composite_mmx_test (int iterations, int n_pixels)
ft1 = gimp_composite_regression_time_function (iterations, gimp_composite_scale_rgba8_rgba8_rgba8_mmx, &special_ctx);
if (gimp_composite_regression_compare_contexts ("scale", &generic_ctx, &special_ctx))
{
printf("scale failed\n");
printf("scale_rgba8_rgba8_rgba8 failed\n");
return (1);
}
gimp_composite_regression_timer_report ("scale", ft0, ft1);
gimp_composite_regression_timer_report ("scale_rgba8_rgba8_rgba8", ft0, ft1);
gimp_composite_context_init (&special_ctx, GIMP_COMPOSITE_SCREEN, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, n_pixels, (unsigned char *) rgba8A, (unsigned char *) rgba8B, (unsigned char *) rgba8B, (unsigned char *) rgba8D2);
gimp_composite_context_init (&generic_ctx, GIMP_COMPOSITE_SCREEN, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, n_pixels, (unsigned char *) rgba8A, (unsigned char *) rgba8B, (unsigned char *) rgba8B, (unsigned char *) rgba8D1);
@@ -170,10 +170,10 @@ gimp_composite_mmx_test (int iterations, int n_pixels)
ft1 = gimp_composite_regression_time_function (iterations, gimp_composite_screen_rgba8_rgba8_rgba8_mmx, &special_ctx);
if (gimp_composite_regression_compare_contexts ("screen", &generic_ctx, &special_ctx))
{
printf("screen failed\n");
printf("screen_rgba8_rgba8_rgba8 failed\n");
return (1);
}
gimp_composite_regression_timer_report ("screen", ft0, ft1);
gimp_composite_regression_timer_report ("screen_rgba8_rgba8_rgba8", ft0, ft1);
gimp_composite_context_init (&special_ctx, GIMP_COMPOSITE_SUBTRACT, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, n_pixels, (unsigned char *) rgba8A, (unsigned char *) rgba8B, (unsigned char *) rgba8B, (unsigned char *) rgba8D2);
gimp_composite_context_init (&generic_ctx, GIMP_COMPOSITE_SUBTRACT, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, n_pixels, (unsigned char *) rgba8A, (unsigned char *) rgba8B, (unsigned char *) rgba8B, (unsigned char *) rgba8D1);
@@ -181,10 +181,10 @@ gimp_composite_mmx_test (int iterations, int n_pixels)
ft1 = gimp_composite_regression_time_function (iterations, gimp_composite_subtract_rgba8_rgba8_rgba8_mmx, &special_ctx);
if (gimp_composite_regression_compare_contexts ("subtract", &generic_ctx, &special_ctx))
{
printf("subtract failed\n");
printf("subtract_rgba8_rgba8_rgba8 failed\n");
return (1);
}
gimp_composite_regression_timer_report ("subtract", ft0, ft1);
gimp_composite_regression_timer_report ("subtract_rgba8_rgba8_rgba8", ft0, ft1);
gimp_composite_context_init (&special_ctx, GIMP_COMPOSITE_SWAP, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, n_pixels, (unsigned char *) rgba8A, (unsigned char *) rgba8B, (unsigned char *) rgba8B, (unsigned char *) rgba8D2);
gimp_composite_context_init (&generic_ctx, GIMP_COMPOSITE_SWAP, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, n_pixels, (unsigned char *) rgba8A, (unsigned char *) rgba8B, (unsigned char *) rgba8B, (unsigned char *) rgba8D1);
@@ -192,10 +192,10 @@ gimp_composite_mmx_test (int iterations, int n_pixels)
ft1 = gimp_composite_regression_time_function (iterations, gimp_composite_swap_rgba8_rgba8_rgba8_mmx, &special_ctx);
if (gimp_composite_regression_compare_contexts ("swap", &generic_ctx, &special_ctx))
{
printf("swap failed\n");
printf("swap_rgba8_rgba8_rgba8 failed\n");
return (1);
}
gimp_composite_regression_timer_report ("swap", ft0, ft1);
gimp_composite_regression_timer_report ("swap_rgba8_rgba8_rgba8", ft0, ft1);
#endif
return (0);
}
@@ -210,7 +210,7 @@ main (int argc, char *argv[])
putenv ("GIMP_COMPOSITE=0x1");
iterations = 1;
iterations = 10;
n_pixels = 1048593;
argv++, argc--;

File diff suppressed because it is too large Load Diff

View File

@@ -4,13 +4,31 @@
extern gboolean gimp_composite_mmx_init (void);
/*
* The function gimp_composite_*_install() is defined in the code generated by make-install.py
* I hate to create a .h file just for that declaration, so I do it here (for now).
* The function gimp_composite_*_install() is defined in the code
* generated by make-install.py I hate to have make-install.py create
* a .h file just for that declaration, so I do it here.
*/
extern gboolean gimp_composite_mmx_install (void);
#ifdef USE_MMX
/*
* Rummage through the compile-time environment to ensure this file
* can actually be compiled like we expect it to. If all is okay,
* define the manifest constant COMPILE_IS_OKAY.
*/
#if !defined(__INTEL_COMPILER)
#if defined(USE_MMX)
#if defined(ARCH_X86)
#if __GNUC__ >= 3
#if defined(ARCH_X86_64) || !defined(PIC)
#define COMPILE_MMX_IS_OKAY (1)
#endif /* defined(ARCH_X86_64) || !defined(PIC) */
#endif /* __GNUC__ >= 3 */
#endif /* defined(ARCH_X86) */
#endif /* defined(USE_MMX) */
#endif /* !defined(__INTEL_COMPILER) */
#ifdef COMPILE_MMX_IS_OKAY
/*
*
*/
@@ -38,6 +56,6 @@ extern void gimp_composite_subtract_rgba8_rgba8_rgba8_mmx (GimpCompositeContext
extern void gimp_composite_swap_rgba8_rgba8_rgba8_mmx (GimpCompositeContext *ctx);
extern void gimp_composite_valueonly_rgba8_rgba8_rgba8_mmx (GimpCompositeContext *ctx);
#endif /* __GNUC__ > 3 */
#endif /* USE_MMX */
extern void gimp_composite_addition_va8_va8_va8_mmx (GimpCompositeContext *ctx);
#endif /* COMPILE_IS_OKAY */
#endif

View File

@@ -29,6 +29,25 @@
#include <sys/time.h>
#ifndef timersub
/*
* Linux <sys/time.h> has a handy macro for finding the difference between
* two timers. This is lifted directly from <sys/time.h> on a GLIBC 2.2.x
* system.
*/
#define timersub(a, b, result) \
do { \
(result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \
(result)->tv_usec = (a)->tv_usec - (b)->tv_usec; \
if ((result)->tv_usec < 0) \
{ \
--(result)->tv_sec; \
(result)->tv_usec += 1000000; \
} \
} while (0)
#endif
#include <glib-object.h>
#include "base/base-types.h"
@@ -40,11 +59,11 @@
/**
* gimp_composite_regression_print_vector:
* @vector:
* @format:
* @n_pixels:
*
*
* @vector:
* @format:
* @n_pixels:
*
*
**/
void
gimp_composite_regression_print_vector (guchar vector[], GimpPixelFormat format, gulong n_pixels)
@@ -77,10 +96,10 @@ gimp_composite_regression_print_vector (guchar vector[], GimpPixelFormat format,
/**
* gimp_composite_regression_print_vector_v8:
* @v:
* @n_pixels:
*
*
* @v:
* @n_pixels:
*
*
**/
void
gimp_composite_regression_print_vector_v8 (gimp_v8_t v[], unsigned int n_pixels)
@@ -95,10 +114,10 @@ gimp_composite_regression_print_vector_v8 (gimp_v8_t v[], unsigned int n_pixels)
/**
* gimp_composite_regression_print_vector_va8:
* @v:
* @n_pixels:
*
*
* @v:
* @n_pixels:
*
*
**/
void
gimp_composite_regression_print_vector_va8 (gimp_va8_t v[], unsigned int n_pixels)
@@ -113,10 +132,10 @@ gimp_composite_regression_print_vector_va8 (gimp_va8_t v[], unsigned int n_pixel
/**
* gimp_composite_regression_print_vector_rgb8:
* @rgb8:
* @n_pixels:
*
*
* @rgb8:
* @n_pixels:
*
*
**/
void
gimp_composite_regression_print_vector_rgb8 (gimp_rgb8_t v[], unsigned int n_pixels)
@@ -131,10 +150,10 @@ gimp_composite_regression_print_vector_rgb8 (gimp_rgb8_t v[], unsigned int n_pix
/**
* gimp_composite_regression_print_vector_rgba8:
* @v:
* @n_pixels:
*
*
* @v:
* @n_pixels:
*
*
**/
void
gimp_composite_regression_print_vector_rgba8 (gimp_rgba8_t v[], unsigned int n_pixels)
@@ -149,9 +168,9 @@ gimp_composite_regression_print_vector_rgba8 (gimp_rgba8_t v[], unsigned int n_p
/**
* gimp_composite_regression_print_rgba8:
* @rgba8:
*
*
* @rgba8:
*
*
**/
void
gimp_composite_regression_print_rgba8 (gimp_rgba8_t *rgba8)
@@ -162,9 +181,9 @@ gimp_composite_regression_print_rgba8 (gimp_rgba8_t *rgba8)
/**
* gimp_composite_regression_print_va8:
* @va8:
*
*
* @va8:
*
*
**/
void
gimp_composite_regression_print_va8 (gimp_va8_t *va8)
@@ -175,13 +194,13 @@ gimp_composite_regression_print_va8 (gimp_va8_t *va8)
/**
* gimp_composite_regression_compare_contexts:
* @operation:
* @ctx1:
* @ctx2:
*
*
*
* Return value:
* @operation:
* @ctx1:
* @ctx2:
*
*
*
* Return value:
**/
int
gimp_composite_regression_compare_contexts (char *operation, GimpCompositeContext *ctx1, GimpCompositeContext *ctx2)
@@ -287,16 +306,16 @@ gimp_composite_regression_compare_contexts (char *operation, GimpCompositeContex
/**
* gimp_composite_regression_comp_rgba8:
* @str:
* @rgba8A:
* @rgba8B:
* @expected:
* @actual:
* @length:
*
*
*
* Return value:
* @str:
* @rgba8A:
* @rgba8B:
* @expected:
* @actual:
* @length:
*
*
*
* Return value:
**/
int
gimp_composite_regression_comp_rgba8 (char *str, gimp_rgba8_t *rgba8A, gimp_rgba8_t *rgba8B, gimp_rgba8_t *expected, gimp_rgba8_t *actual, u_long length)
@@ -335,16 +354,16 @@ gimp_composite_regression_comp_rgba8 (char *str, gimp_rgba8_t *rgba8A, gimp_rgba
/**
* gimp_composite_regression_comp_va8:
* @str:
* @va8A:
* @va8B:
* @expected:
* @actual:
* @length:
*
*
*
* Return value:
* @str:
* @va8A:
* @va8B:
* @expected:
* @actual:
* @length:
*
*
*
* Return value:
**/
int
gimp_composite_regression_comp_va8 (char *str, gimp_va8_t *va8A, gimp_va8_t *va8B, gimp_va8_t *expected, gimp_va8_t *actual, u_long length)
@@ -380,11 +399,11 @@ gimp_composite_regression_comp_va8 (char *str, gimp_va8_t *va8A, gimp_va8_t *va8
/**
* gimp_composite_regression_dump_rgba8:
* @str:
* @rgba:
* @n_pixels:
*
*
* @str:
* @rgba:
* @n_pixels:
*
*
**/
void
gimp_composite_regression_dump_rgba8 (char *str, gimp_rgba8_t *rgba, u_long n_pixels)
@@ -402,30 +421,30 @@ gimp_composite_regression_dump_rgba8 (char *str, gimp_rgba8_t *rgba, u_long n_pi
#define tv_to_secs(tv) ((double) ((tv).tv_sec) + (double) ((tv).tv_usec / 1000000.0))
#define timer_report(name,t1,t2) printf("%-17s %17.7f %17.7f %17.7f%c\n", name, tv_to_secs(t1), tv_to_secs(t2), tv_to_secs(t1)/tv_to_secs(t2), tv_to_secs(t1)/tv_to_secs(t2) > 1.0 ? ' ' : '*');
#define timer_report(name,t1,t2) printf("%-32s %10.4f %10.4f %10.4f%c\n", name, tv_to_secs(t1), tv_to_secs(t2), tv_to_secs(t1)/tv_to_secs(t2), tv_to_secs(t1)/tv_to_secs(t2) > 1.0 ? ' ' : '*');
/**
* gimp_composite_regression_timer_report:
* @name:
* @t1:
* @t2:
*
*
* @name:
* @t1:
* @t2:
*
*
**/
void
gimp_composite_regression_timer_report (char *name, double t1, double t2)
{
printf ("%-17s %17.7f %17.7f %17.7f%c\n", name, t1, t2, t1/t2, t1/t2 > 1.0 ? ' ' : '*');
printf ("%-32s %10.4f %10.4f %10.4f%c\n", name, t1, t2, t1/t2, t1/t2 > 1.0 ? ' ' : '*');
}
/**
* gimp_composite_regression_time_function:
* @iterations:
* @func:
*
*
*
* Return value:
* @iterations:
* @func:
*
*
*
* Return value:
**/
double
gimp_composite_regression_time_function (u_long iterations, void (*func)(), GimpCompositeContext *ctx)
@@ -435,21 +454,21 @@ gimp_composite_regression_time_function (u_long iterations, void (*func)(), Gimp
struct timeval tv_elapsed;
u_long i;
gettimeofday(&t0, NULL);
gettimeofday (&t0, NULL);
for (i = 0; i < iterations; i++) { (*func)(ctx); }
gettimeofday(&t1, NULL);
timersub(&t1, &t0, &tv_elapsed);
gettimeofday (&t1, NULL);
timersub (&t1, &t0, &tv_elapsed);
return (tv_to_secs(tv_elapsed));
return (tv_to_secs (tv_elapsed));
}
/**
* gimp_composite_regression_random_rgba8:
* @n_pixels:
*
*
*
* Return value:
* @n_pixels:
*
*
*
* Return value:
**/
gimp_rgba8_t *
gimp_composite_regression_random_rgba8 (u_long n_pixels)
@@ -471,11 +490,11 @@ gimp_composite_regression_random_rgba8 (u_long n_pixels)
/**
* gimp_composite_regression_fixed_rgba8:
* @n_pixels:
*
*
*
* Return value:
* @n_pixels:
*
*
*
* Return value:
**/
gimp_rgba8_t *
gimp_composite_regression_fixed_rgba8 (u_long n_pixels)
@@ -499,21 +518,21 @@ gimp_composite_regression_fixed_rgba8 (u_long n_pixels)
/**
* gimp_composite_context_init:
* @ctx:
* @op:
* @a_format:
* @b_format:
* @d_format:
* @m_format:
* @n_pixels:
* @A:
* @B:
* @M:
* @D:
*
*
*
* Return value:
* @ctx:
* @op:
* @a_format:
* @b_format:
* @d_format:
* @m_format:
* @n_pixels:
* @A:
* @B:
* @M:
* @D:
*
*
*
* Return value:
**/
GimpCompositeContext *
gimp_composite_context_init (GimpCompositeContext *ctx,

View File

@@ -16,7 +16,7 @@ static struct install_table {
GimpPixelFormat D;
void (*function)(GimpCompositeContext *);
} _gimp_composite_sse[] = {
#if (__GNUC__ >= 3) && defined(USE_SSE) && defined(ARCH_X86) && (defined(ARCH_X86_64) || !defined(PIC))
#if defined(COMPILE_SSE_IS_OKAY)
{ GIMP_COMPOSITE_MULTIPLY, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, gimp_composite_multiply_rgba8_rgba8_rgba8_sse },
{ GIMP_COMPOSITE_SCREEN, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, gimp_composite_screen_rgba8_rgba8_rgba8_sse },
{ GIMP_COMPOSITE_DIFFERENCE, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, gimp_composite_difference_rgba8_rgba8_rgba8_sse },

View File

@@ -19,7 +19,7 @@
int
gimp_composite_sse_test (int iterations, int n_pixels)
{
#if (__GNUC__ >= 3) && defined(USE_SSE) && defined(ARCH_X86) && (defined(ARCH_X86_64) || !defined(PIC))
#if defined(COMPILE_SSE_IS_OKAY)
GimpCompositeContext generic_ctx;
GimpCompositeContext special_ctx;
double ft0;
@@ -71,10 +71,10 @@ gimp_composite_sse_test (int iterations, int n_pixels)
ft1 = gimp_composite_regression_time_function (iterations, gimp_composite_addition_rgba8_rgba8_rgba8_sse, &special_ctx);
if (gimp_composite_regression_compare_contexts ("addition", &generic_ctx, &special_ctx))
{
printf("addition failed\n");
printf("addition_rgba8_rgba8_rgba8 failed\n");
return (1);
}
gimp_composite_regression_timer_report ("addition", ft0, ft1);
gimp_composite_regression_timer_report ("addition_rgba8_rgba8_rgba8", ft0, ft1);
gimp_composite_context_init (&special_ctx, GIMP_COMPOSITE_BURN, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, n_pixels, (unsigned char *) rgba8A, (unsigned char *) rgba8B, (unsigned char *) rgba8B, (unsigned char *) rgba8D2);
gimp_composite_context_init (&generic_ctx, GIMP_COMPOSITE_BURN, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, n_pixels, (unsigned char *) rgba8A, (unsigned char *) rgba8B, (unsigned char *) rgba8B, (unsigned char *) rgba8D1);
@@ -82,10 +82,10 @@ gimp_composite_sse_test (int iterations, int n_pixels)
ft1 = gimp_composite_regression_time_function (iterations, gimp_composite_burn_rgba8_rgba8_rgba8_sse, &special_ctx);
if (gimp_composite_regression_compare_contexts ("burn", &generic_ctx, &special_ctx))
{
printf("burn failed\n");
printf("burn_rgba8_rgba8_rgba8 failed\n");
return (1);
}
gimp_composite_regression_timer_report ("burn", ft0, ft1);
gimp_composite_regression_timer_report ("burn_rgba8_rgba8_rgba8", ft0, ft1);
gimp_composite_context_init (&special_ctx, GIMP_COMPOSITE_DARKEN, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, n_pixels, (unsigned char *) rgba8A, (unsigned char *) rgba8B, (unsigned char *) rgba8B, (unsigned char *) rgba8D2);
gimp_composite_context_init (&generic_ctx, GIMP_COMPOSITE_DARKEN, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, n_pixels, (unsigned char *) rgba8A, (unsigned char *) rgba8B, (unsigned char *) rgba8B, (unsigned char *) rgba8D1);
@@ -93,10 +93,10 @@ gimp_composite_sse_test (int iterations, int n_pixels)
ft1 = gimp_composite_regression_time_function (iterations, gimp_composite_darken_rgba8_rgba8_rgba8_sse, &special_ctx);
if (gimp_composite_regression_compare_contexts ("darken", &generic_ctx, &special_ctx))
{
printf("darken failed\n");
printf("darken_rgba8_rgba8_rgba8 failed\n");
return (1);
}
gimp_composite_regression_timer_report ("darken", ft0, ft1);
gimp_composite_regression_timer_report ("darken_rgba8_rgba8_rgba8", ft0, ft1);
gimp_composite_context_init (&special_ctx, GIMP_COMPOSITE_DIFFERENCE, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, n_pixels, (unsigned char *) rgba8A, (unsigned char *) rgba8B, (unsigned char *) rgba8B, (unsigned char *) rgba8D2);
gimp_composite_context_init (&generic_ctx, GIMP_COMPOSITE_DIFFERENCE, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, n_pixels, (unsigned char *) rgba8A, (unsigned char *) rgba8B, (unsigned char *) rgba8B, (unsigned char *) rgba8D1);
@@ -104,10 +104,10 @@ gimp_composite_sse_test (int iterations, int n_pixels)
ft1 = gimp_composite_regression_time_function (iterations, gimp_composite_difference_rgba8_rgba8_rgba8_sse, &special_ctx);
if (gimp_composite_regression_compare_contexts ("difference", &generic_ctx, &special_ctx))
{
printf("difference failed\n");
printf("difference_rgba8_rgba8_rgba8 failed\n");
return (1);
}
gimp_composite_regression_timer_report ("difference", ft0, ft1);
gimp_composite_regression_timer_report ("difference_rgba8_rgba8_rgba8", ft0, ft1);
gimp_composite_context_init (&special_ctx, GIMP_COMPOSITE_GRAIN_EXTRACT, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, n_pixels, (unsigned char *) rgba8A, (unsigned char *) rgba8B, (unsigned char *) rgba8B, (unsigned char *) rgba8D2);
gimp_composite_context_init (&generic_ctx, GIMP_COMPOSITE_GRAIN_EXTRACT, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, n_pixels, (unsigned char *) rgba8A, (unsigned char *) rgba8B, (unsigned char *) rgba8B, (unsigned char *) rgba8D1);
@@ -115,10 +115,10 @@ gimp_composite_sse_test (int iterations, int n_pixels)
ft1 = gimp_composite_regression_time_function (iterations, gimp_composite_grain_extract_rgba8_rgba8_rgba8_sse, &special_ctx);
if (gimp_composite_regression_compare_contexts ("grain_extract", &generic_ctx, &special_ctx))
{
printf("grain_extract failed\n");
printf("grain_extract_rgba8_rgba8_rgba8 failed\n");
return (1);
}
gimp_composite_regression_timer_report ("grain_extract", ft0, ft1);
gimp_composite_regression_timer_report ("grain_extract_rgba8_rgba8_rgba8", ft0, ft1);
gimp_composite_context_init (&special_ctx, GIMP_COMPOSITE_GRAIN_MERGE, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, n_pixels, (unsigned char *) rgba8A, (unsigned char *) rgba8B, (unsigned char *) rgba8B, (unsigned char *) rgba8D2);
gimp_composite_context_init (&generic_ctx, GIMP_COMPOSITE_GRAIN_MERGE, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, n_pixels, (unsigned char *) rgba8A, (unsigned char *) rgba8B, (unsigned char *) rgba8B, (unsigned char *) rgba8D1);
@@ -126,10 +126,10 @@ gimp_composite_sse_test (int iterations, int n_pixels)
ft1 = gimp_composite_regression_time_function (iterations, gimp_composite_grain_merge_rgba8_rgba8_rgba8_sse, &special_ctx);
if (gimp_composite_regression_compare_contexts ("grain_merge", &generic_ctx, &special_ctx))
{
printf("grain_merge failed\n");
printf("grain_merge_rgba8_rgba8_rgba8 failed\n");
return (1);
}
gimp_composite_regression_timer_report ("grain_merge", ft0, ft1);
gimp_composite_regression_timer_report ("grain_merge_rgba8_rgba8_rgba8", ft0, ft1);
gimp_composite_context_init (&special_ctx, GIMP_COMPOSITE_LIGHTEN, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, n_pixels, (unsigned char *) rgba8A, (unsigned char *) rgba8B, (unsigned char *) rgba8B, (unsigned char *) rgba8D2);
gimp_composite_context_init (&generic_ctx, GIMP_COMPOSITE_LIGHTEN, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, n_pixels, (unsigned char *) rgba8A, (unsigned char *) rgba8B, (unsigned char *) rgba8B, (unsigned char *) rgba8D1);
@@ -137,10 +137,10 @@ gimp_composite_sse_test (int iterations, int n_pixels)
ft1 = gimp_composite_regression_time_function (iterations, gimp_composite_lighten_rgba8_rgba8_rgba8_sse, &special_ctx);
if (gimp_composite_regression_compare_contexts ("lighten", &generic_ctx, &special_ctx))
{
printf("lighten failed\n");
printf("lighten_rgba8_rgba8_rgba8 failed\n");
return (1);
}
gimp_composite_regression_timer_report ("lighten", ft0, ft1);
gimp_composite_regression_timer_report ("lighten_rgba8_rgba8_rgba8", ft0, ft1);
gimp_composite_context_init (&special_ctx, GIMP_COMPOSITE_MULTIPLY, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, n_pixels, (unsigned char *) rgba8A, (unsigned char *) rgba8B, (unsigned char *) rgba8B, (unsigned char *) rgba8D2);
gimp_composite_context_init (&generic_ctx, GIMP_COMPOSITE_MULTIPLY, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, n_pixels, (unsigned char *) rgba8A, (unsigned char *) rgba8B, (unsigned char *) rgba8B, (unsigned char *) rgba8D1);
@@ -148,10 +148,10 @@ gimp_composite_sse_test (int iterations, int n_pixels)
ft1 = gimp_composite_regression_time_function (iterations, gimp_composite_multiply_rgba8_rgba8_rgba8_sse, &special_ctx);
if (gimp_composite_regression_compare_contexts ("multiply", &generic_ctx, &special_ctx))
{
printf("multiply failed\n");
printf("multiply_rgba8_rgba8_rgba8 failed\n");
return (1);
}
gimp_composite_regression_timer_report ("multiply", ft0, ft1);
gimp_composite_regression_timer_report ("multiply_rgba8_rgba8_rgba8", ft0, ft1);
gimp_composite_context_init (&special_ctx, GIMP_COMPOSITE_SCALE, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, n_pixels, (unsigned char *) rgba8A, (unsigned char *) rgba8B, (unsigned char *) rgba8B, (unsigned char *) rgba8D2);
gimp_composite_context_init (&generic_ctx, GIMP_COMPOSITE_SCALE, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, n_pixels, (unsigned char *) rgba8A, (unsigned char *) rgba8B, (unsigned char *) rgba8B, (unsigned char *) rgba8D1);
@@ -159,10 +159,10 @@ gimp_composite_sse_test (int iterations, int n_pixels)
ft1 = gimp_composite_regression_time_function (iterations, gimp_composite_scale_rgba8_rgba8_rgba8_sse, &special_ctx);
if (gimp_composite_regression_compare_contexts ("scale", &generic_ctx, &special_ctx))
{
printf("scale failed\n");
printf("scale_rgba8_rgba8_rgba8 failed\n");
return (1);
}
gimp_composite_regression_timer_report ("scale", ft0, ft1);
gimp_composite_regression_timer_report ("scale_rgba8_rgba8_rgba8", ft0, ft1);
gimp_composite_context_init (&special_ctx, GIMP_COMPOSITE_SCREEN, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, n_pixels, (unsigned char *) rgba8A, (unsigned char *) rgba8B, (unsigned char *) rgba8B, (unsigned char *) rgba8D2);
gimp_composite_context_init (&generic_ctx, GIMP_COMPOSITE_SCREEN, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, n_pixels, (unsigned char *) rgba8A, (unsigned char *) rgba8B, (unsigned char *) rgba8B, (unsigned char *) rgba8D1);
@@ -170,10 +170,10 @@ gimp_composite_sse_test (int iterations, int n_pixels)
ft1 = gimp_composite_regression_time_function (iterations, gimp_composite_screen_rgba8_rgba8_rgba8_sse, &special_ctx);
if (gimp_composite_regression_compare_contexts ("screen", &generic_ctx, &special_ctx))
{
printf("screen failed\n");
printf("screen_rgba8_rgba8_rgba8 failed\n");
return (1);
}
gimp_composite_regression_timer_report ("screen", ft0, ft1);
gimp_composite_regression_timer_report ("screen_rgba8_rgba8_rgba8", ft0, ft1);
gimp_composite_context_init (&special_ctx, GIMP_COMPOSITE_SUBTRACT, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, n_pixels, (unsigned char *) rgba8A, (unsigned char *) rgba8B, (unsigned char *) rgba8B, (unsigned char *) rgba8D2);
gimp_composite_context_init (&generic_ctx, GIMP_COMPOSITE_SUBTRACT, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, n_pixels, (unsigned char *) rgba8A, (unsigned char *) rgba8B, (unsigned char *) rgba8B, (unsigned char *) rgba8D1);
@@ -181,10 +181,10 @@ gimp_composite_sse_test (int iterations, int n_pixels)
ft1 = gimp_composite_regression_time_function (iterations, gimp_composite_subtract_rgba8_rgba8_rgba8_sse, &special_ctx);
if (gimp_composite_regression_compare_contexts ("subtract", &generic_ctx, &special_ctx))
{
printf("subtract failed\n");
printf("subtract_rgba8_rgba8_rgba8 failed\n");
return (1);
}
gimp_composite_regression_timer_report ("subtract", ft0, ft1);
gimp_composite_regression_timer_report ("subtract_rgba8_rgba8_rgba8", ft0, ft1);
gimp_composite_context_init (&special_ctx, GIMP_COMPOSITE_SWAP, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, n_pixels, (unsigned char *) rgba8A, (unsigned char *) rgba8B, (unsigned char *) rgba8B, (unsigned char *) rgba8D2);
gimp_composite_context_init (&generic_ctx, GIMP_COMPOSITE_SWAP, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, n_pixels, (unsigned char *) rgba8A, (unsigned char *) rgba8B, (unsigned char *) rgba8B, (unsigned char *) rgba8D1);
@@ -192,10 +192,10 @@ gimp_composite_sse_test (int iterations, int n_pixels)
ft1 = gimp_composite_regression_time_function (iterations, gimp_composite_swap_rgba8_rgba8_rgba8_sse, &special_ctx);
if (gimp_composite_regression_compare_contexts ("swap", &generic_ctx, &special_ctx))
{
printf("swap failed\n");
printf("swap_rgba8_rgba8_rgba8 failed\n");
return (1);
}
gimp_composite_regression_timer_report ("swap", ft0, ft1);
gimp_composite_regression_timer_report ("swap_rgba8_rgba8_rgba8", ft0, ft1);
#endif
return (0);
}
@@ -210,7 +210,7 @@ main (int argc, char *argv[])
putenv ("GIMP_COMPOSITE=0x1");
iterations = 1;
iterations = 10;
n_pixels = 1048593;
argv++, argc--;

View File

@@ -4,7 +4,6 @@
* 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
@@ -41,16 +40,15 @@
#include "gimp-composite.h"
#include "gimp-composite-sse.h"
#include "gimp-composite-x86.h"
#if defined(USE_SSE)
#if defined(ARCH_X86)
#if __GNUC__ >= 3
#if defined(ARCH_X86_64) || !defined(PIC)
#ifdef COMPILE_SSE_IS_OKAY
#include "gimp-composite-x86.h"
#define pminub(src,dst,tmp) "pminub " "%%" #src ", %%" #dst
#define pmaxub(src,dst,tmp) "pmaxub " "%%" #src ", %%" #dst
#if 0
/*
* Double-word divide. Adjusted for subsequent unsigned packing
* (high-order bit of each word is cleared)
@@ -68,7 +66,8 @@
"roll $16, %%eax; " \
"btr $15, %%eax; " \
"movd %%eax,%%" #quotient ";"
#endif
#if 0
/*
* Quadword divide. No adjustment for subsequent unsigned packing
* (high-order bit of each word is left alone)
@@ -152,6 +151,7 @@ static const guint32 va8_alpha_mask[2] = { 0xFF00FF00, 0xFF00FF00 };
static const guint32 va8_b255[2] = { 0xFFFFFFFF, 0xFFFFFFFF };
static const guint32 va8_w1[2] = { 0x00010001, 0x00010001 };
static const guint32 va8_w255[2] = { 0x00FF00FF, 0x00FF00FF };
#endif
/*
*
@@ -159,48 +159,51 @@ static const guint32 va8_w255[2] = { 0x00FF00FF, 0x00FF00FF };
void
gimp_composite_addition_rgba8_rgba8_rgba8_sse (GimpCompositeContext *_op)
{
GimpCompositeContext op = *_op;
uint64 *d = (uint64 *) _op->D;
uint64 *a = (uint64 *) _op->A;
uint64 *b = (uint64 *) _op->B;
gulong n_pixels = _op->n_pixels;
asm volatile ("movq %0,%%mm0"
: /* empty */
: "m" (*rgba8_alpha_mask_64)
: "%mm0");
for (; op.n_pixels >= 2; op.n_pixels -= 2)
for (; n_pixels >= 2; n_pixels -= 2)
{
asm (" movq %1, %%mm2\n"
"\tmovq %2, %%mm3\n"
"\tmovq %%mm2, %%mm4\n"
"\tpaddusb %%mm3, %%mm4\n"
"\tmovq %%mm0, %%mm1\n"
"\tpandn %%mm4, %%mm1\n"
"\tpminub %%mm3, %%mm2\n"
"\tpand %%mm0, %%mm2\n"
"\tpor %%mm2, %%mm1\n"
"\tmovq %%mm1, %0\n"
: "=m" (*op.D)
: "m" (*op.A), "m" (*op.B)
: "%mm0", "%mm1", "%mm2", "%mm3", "%mm4", "%mm5", "%mm6", "%mm7");
op.A += 8;
op.B += 8;
op.D += 8;
}
if (op.n_pixels)
{
asm volatile (" movd %1, %%mm2\n"
"\tmovd %2, %%mm3\n"
asm volatile (" movq %1, %%mm2\n"
"\tmovq %2, %%mm3\n"
"\tmovq %%mm2, %%mm4\n"
"\tpaddusb %%mm3, %%mm4\n"
"\tmovq %%mm0, %%mm1\n"
"\tpandn %%mm4, %%mm1\n"
"\tpminub %%mm3, %%mm2\n"
"\t" pminub(mm3, mm2, mm4) "\n"
"\tpand %%mm0, %%mm2\n"
"\tpor %%mm2, %%mm1\n"
"\tmovq %%mm1, %0\n"
: "=m" (*d)
: "m" (*a), "m" (*b)
: "%mm0", "%mm1", "%mm2", "%mm3", "%mm4");
a++;
b++;
d++;
}
if (n_pixels > 0)
{
asm volatile (" movd %1, %%mm2\n"
"\tmovd %2, %%mm3\n"
"\tmovq %%mm2, %%mm4\n"
"\tpaddusb %%mm3, %%mm4\n"
"\tmovq %%mm0, %%mm1\n"
"\tpandn %%mm4, %%mm1\n"
"\t" pminub(mm3, mm2, mm4) "\n"
"\tpand %%mm0, %%mm2\n"
"\tpor %%mm2, %%mm1\n"
"\tmovd %%mm1, %0\n"
: "=m" (*op.D)
: "m" (*op.A), "m" (*op.B)
: "%mm0", "%mm1", "%mm2", "%mm3", "%mm4", "%mm5", "%mm6", "%mm7");
: "=m" (*d)
: "m" (*a), "m" (*b)
: "%mm0", "%mm1", "%mm2", "%mm3", "%mm4");
}
asm("emms");
@@ -210,63 +213,66 @@ gimp_composite_addition_rgba8_rgba8_rgba8_sse (GimpCompositeContext *_op)
void
gimp_composite_burn_rgba8_rgba8_rgba8_sse (GimpCompositeContext *_op)
{
GimpCompositeContext op = *_op;
uint64 *d = (uint64 *) _op->D;
uint64 *a = (uint64 *) _op->A;
uint64 *b = (uint64 *) _op->B;
gulong n_pixels = _op->n_pixels;
for (; op.n_pixels >= 2; op.n_pixels -= 2)
for (; n_pixels >= 2; n_pixels -= 2)
{
asm (" movq %1,%%mm0\n"
"\tmovq %2,%%mm1\n"
asm volatile (" movq %1,%%mm0\n"
"\tmovq %2,%%mm1\n"
"\tmovq %3,%%mm2\n"
"\tpsubb %%mm0,%%mm2\n" /* mm2 = 255 - A */
"\tpxor %%mm4,%%mm4\n"
"\tpunpcklbw %%mm2,%%mm4\n" /* mm4 = (255- A) * 256 */
"\tmovq %3,%%mm2\n"
"\tpsubb %%mm0,%%mm2\n" /* mm2 = 255 - A */
"\tpxor %%mm4,%%mm4\n"
"\tpunpcklbw %%mm2,%%mm4\n" /* mm4 = (255- A) * 256 */
"\tmovq %%mm1,%%mm3\n"
"\tpxor %%mm5,%%mm5\n"
"\tpunpcklbw %%mm5,%%mm3\n"
"\tmovq %4,%%mm5\n"
"\tpaddusw %%mm3,%%mm5\n" /* mm5 = B + 1 */
"\tmovq %%mm1,%%mm3\n"
"\tpxor %%mm5,%%mm5\n"
"\tpunpcklbw %%mm5,%%mm3\n"
"\tmovq %4,%%mm5\n"
"\tpaddusw %%mm3,%%mm5\n" /* mm5 = B + 1 */
"\t" pdivwqX(mm4,mm5,mm7) "\n"
"\t" pdivwqX(mm4,mm5,mm7) "\n"
"\tmovq %3,%%mm2\n"
"\tpsubb %%mm0,%%mm2\n" /* mm2 = 255 - A */
"\tpxor %%mm4,%%mm4\n"
"\tpunpckhbw %%mm2,%%mm4\n" /* mm4 = (255- A) * 256 */
"\tmovq %3,%%mm2\n"
"\tpsubb %%mm0,%%mm2\n" /* mm2 = 255 - A */
"\tpxor %%mm4,%%mm4\n"
"\tpunpckhbw %%mm2,%%mm4\n" /* mm4 = (255- A) * 256 */
"\tmovq %%mm1,%%mm3\n"
"\tpxor %%mm5,%%mm5\n"
"\tpunpckhbw %%mm5,%%mm3\n"
"\tmovq %4,%%mm5\n"
"\tpaddusw %%mm3,%%mm5\n" /* mm5 = B + 1 */
"\t" pdivwqX(mm4,mm5,mm6) "\n"
"\tmovq %%mm1,%%mm3\n"
"\tpxor %%mm5,%%mm5\n"
"\tpunpckhbw %%mm5,%%mm3\n"
"\tmovq %4,%%mm5\n"
"\tpaddusw %%mm3,%%mm5\n" /* mm5 = B + 1 */
"\t" pdivwqX(mm4,mm5,mm6) "\n"
"\tmovq %5,%%mm4\n"
"\tmovq %%mm4,%%mm5\n"
"\tpsubusw %%mm6,%%mm4\n"
"\tpsubusw %%mm7,%%mm5\n"
"\tmovq %5,%%mm4\n"
"\tmovq %%mm4,%%mm5\n"
"\tpsubusw %%mm6,%%mm4\n"
"\tpsubusw %%mm7,%%mm5\n"
"\tpackuswb %%mm4,%%mm5\n"
"\tpackuswb %%mm4,%%mm5\n"
"\tpminub %%mm0,%%mm1\n" /* mm1 = min(mm0,mm1) clobber mm3 */
"\t" pminub(mm0,mm1,mm3) "\n" /* mm1 = min(mm0,mm1) clobber mm3 */
"\tmovq %6,%%mm7\n"
"\tpand %%mm7,%%mm1\n" /* mm1 = mm7 & alpha_mask */
"\tmovq %6,%%mm7\n" /* mm6 = rgba8_alpha_mask_64 */
"\tpand %%mm7,%%mm1\n" /* mm1 = mm7 & alpha_mask */
"\tpandn %%mm5,%%mm7\n" /* mm7 = ~mm7 & mm5 */
"\tpor %%mm1,%%mm7\n" /* mm7 = mm7 | mm1 */
"\tmovq %%mm7,%0\n"
: "=m" (*op.D)
: "m" (*op.A), "m" (*op.B), "m" (*rgba8_b255_64), "m" (*rgba8_w1_64), "m" (*rgba8_w255_64), "m" (*rgba8_alpha_mask_64)
: "0", "1", "2", "%mm1", "%mm2", "%mm3", "%mm4", "%mm5", "%mm6", "%mm7");
op.A += 8;
op.B += 8;
op.D += 8;
"\tpandn %%mm5,%%mm7\n" /* mm7 = ~mm7 & mm5 */
"\tpor %%mm1,%%mm7\n" /* mm7 = mm7 | mm1 */
"\tmovq %%mm7,%0\n"
: "=m" (*d)
: "m" (*a), "m" (*b), "m" (*rgba8_b255_64), "m" (*rgba8_w1_64), "m" (*rgba8_w255_64), "m" (*rgba8_alpha_mask_64)
: pdivwqX_clobber, "%mm0", "%mm1", "%mm2", "%mm3", "%mm4", "%mm5", "%mm6", "%mm7");
d++;
b++;
a++;
}
if (op.n_pixels)
if (n_pixels > 0)
{
asm volatile (" movd %1,%%mm0\n"
"\tmovd %2,%%mm1\n"
@@ -303,7 +309,7 @@ gimp_composite_burn_rgba8_rgba8_rgba8_sse (GimpCompositeContext *_op)
"\tpackuswb %%mm4,%%mm5\n"
"\tpminub %%mm0,%%mm1\n" /* mm1 = min(mm0,mm1) clobber mm3 */
"\t" pminub(mm0,mm1,mm3) "\n" /* mm1 = min(mm0,mm1) clobber mm3 */
"\tmovq %6,%%mm7\n"
"\tpand %%mm7,%%mm1\n" /* mm1 = mm7 & alpha_mask */
@@ -312,9 +318,9 @@ gimp_composite_burn_rgba8_rgba8_rgba8_sse (GimpCompositeContext *_op)
"\tpor %%mm1,%%mm7\n" /* mm7 = mm7 | mm1 */
"\tmovd %%mm7,%0\n"
: "=m" (*op.D)
: "m" (*op.A), "m" (*op.B), "m" (*rgba8_b255_64), "m" (*rgba8_w1_64), "m" (*rgba8_w255_64), "m" (*rgba8_alpha_mask_64)
: "0", "1", "2", "%mm1", "%mm2", "%mm3", "%mm4", "%mm5", "%mm6", "%mm7");
: "=m" (*d)
: "m" (*a), "m" (*b), "m" (*rgba8_b255_64), "m" (*rgba8_w1_64), "m" (*rgba8_w255_64), "m" (*rgba8_alpha_mask_64)
: pdivwqX_clobber, "%mm0", "%mm1", "%mm2", "%mm3", "%mm4", "%mm5", "%mm6", "%mm7");
}
asm("emms");
@@ -324,29 +330,33 @@ gimp_composite_burn_rgba8_rgba8_rgba8_sse (GimpCompositeContext *_op)
void
gimp_composite_darken_rgba8_rgba8_rgba8_sse (GimpCompositeContext *_op)
{
GimpCompositeContext op = *_op;
uint64 *d = (uint64 *) _op->D;
uint64 *a = (uint64 *) _op->A;
uint64 *b = (uint64 *) _op->B;
gulong n_pixels = _op->n_pixels;
for (; op.n_pixels >= 2; op.n_pixels -= 2)
for (; n_pixels >= 2; n_pixels -= 2)
{
asm volatile (" movq %1, %%mm2\n"
"\tpminub %2, %%mm2\n"
asm volatile (" movq %1, %%mm2\n"
"\tmovq %2, %%mm3\n"
"\t" pminub(mm3, mm2, mm4) "\n"
"\tmovq %%mm2, %0\n"
: "=m" (*op.D)
: "m" (*op.A), "m" (*op.B)
: "=m" (*d)
: "m" (*a), "m" (*b)
: "%mm1", "%mm2", "%mm3", "%mm4");
op.A += 8;
op.B += 8;
op.D += 8;
a++;
b++;
d++;
}
if (op.n_pixels)
if (n_pixels > 0)
{
asm volatile (" movd %1, %%mm2\n"
"\tmovd %2, %%mm3\n"
"\tpminub %%mm3, %%mm2\n"
asm volatile (" movd %1, %%mm2\n"
"\tmovd %2, %%mm3\n"
"\t" pminub(mm3, mm2, mm4) "\n"
"\tmovd %%mm2, %0\n"
: "=m" (*op.D)
: "m" (*op.A), "m" (*op.B)
: "=m" (*d)
: "m" (*a), "m" (*b)
: "%mm2", "%mm3", "%mm4");
}
@@ -356,11 +366,14 @@ gimp_composite_darken_rgba8_rgba8_rgba8_sse (GimpCompositeContext *_op)
void
gimp_composite_difference_rgba8_rgba8_rgba8_sse (GimpCompositeContext *_op)
{
GimpCompositeContext op = *_op;
uint64 *d = (uint64 *) _op->D;
uint64 *a = (uint64 *) _op->A;
uint64 *b = (uint64 *) _op->B;
gulong n_pixels = _op->n_pixels;
asm volatile ("movq %0,%%mm0" : : "m" (*rgba8_alpha_mask_64) : "%mm0");
for (; op.n_pixels >= 2; op.n_pixels -= 2)
for (; n_pixels >= 2; n_pixels -= 2)
{
asm volatile (" movq %1, %%mm2\n"
"\tmovq %2, %%mm3\n"
@@ -375,15 +388,15 @@ gimp_composite_difference_rgba8_rgba8_rgba8_sse (GimpCompositeContext *_op)
"\tpand %%mm0, %%mm2\n"
"\tpor %%mm2, %%mm1\n"
"\tmovq %%mm1, %0\n"
: "=m" (*op.D)
: "m" (*op.A), "m" (*op.B)
: "=m" (*d)
: "m" (*a), "m" (*b)
: "%mm1", "%mm2", "%mm3", "%mm4");
op.A += 8;
op.B += 8;
op.D += 8;
a++;
b++;
d++;
}
if (op.n_pixels)
if (n_pixels > 0)
{
asm volatile (" movd %1, %%mm2\n"
"\tmovd %2, %%mm3\n"
@@ -398,14 +411,15 @@ gimp_composite_difference_rgba8_rgba8_rgba8_sse (GimpCompositeContext *_op)
"\tpand %%mm0, %%mm2\n"
"\tpor %%mm2, %%mm1\n"
"\tmovd %%mm1, %0\n"
: "=m" (*op.D)
: "m" (*op.A), "m" (*op.B), "m" (*op.D)
: "=m" (*d)
: "m" (*a), "m" (*b)
: "%mm1", "%mm2", "%mm3", "%mm4");
}
asm("emms");
}
#if 0
void
xxxgimp_composite_divide_rgba8_rgba8_rgba8_sse (GimpCompositeContext *_op)
{
@@ -419,8 +433,8 @@ xxxgimp_composite_divide_rgba8_rgba8_rgba8_sse (GimpCompositeContext *_op)
for (; op.n_pixels >= 2; op.n_pixels -= 2)
{
asm volatile (" movq %0,%%mm0\n"
"\tmovq %1,%%mm1\n"
asm volatile (" movq %1,%%mm0\n"
"\tmovq %2,%%mm1\n"
"\tpxor %%mm2,%%mm2\n"
"\tpunpcklbw %%mm0,%%mm2\n" /* mm2 = A*256 */
@@ -452,10 +466,10 @@ xxxgimp_composite_divide_rgba8_rgba8_rgba8_sse (GimpCompositeContext *_op)
"\tpand %%mm2,%%mm1\n"
"\tpor %%mm1,%%mm3\n"
"\tmovq %%mm3,%2\n"
: /* empty */
: "m" (*op.A), "m" (*op.B), "m" (*op.D), "m" (*rgba8_alpha_mask_64)
: "%eax", "%ecx", "%edx", "0", "1", "2", "%mm1", "%mm2", "%mm3", "%mm4", "%mm5");
"\tmovq %%mm3,%0\n"
: "=m" (*op.D)
: "m" (*op.A), "m" (*op.B), "m" (*rgba8_alpha_mask_64)
: "%eax", "%ecx", "%edx", "%mm1", "%mm2", "%mm3", "%mm4", "%mm5");
op.A += 8;
op.B += 8;
op.D += 8;
@@ -463,8 +477,8 @@ xxxgimp_composite_divide_rgba8_rgba8_rgba8_sse (GimpCompositeContext *_op)
if (op.n_pixels)
{
asm volatile (" movd %0,%%mm0\n"
"\tmovd %1,%%mm1\n"
asm volatile (" movd %1,%%mm0\n"
"\tmovd %2,%%mm1\n"
"\tpxor %%mm2,%%mm2\n"
"\tpunpcklbw %%mm0,%%mm2\n" /* mm2 = A*256 */
@@ -497,15 +511,17 @@ xxxgimp_composite_divide_rgba8_rgba8_rgba8_sse (GimpCompositeContext *_op)
"\tpand %%mm2,%%mm1\n"
"\tpor %%mm1,%%mm3\n"
"\tmovd %%mm3,%2\n"
: /* empty */
: "m" (*op.A), "m" (*op.B), "m" (*op.D), "m" (*rgba8_alpha_mask_64)
: "%eax", "%ecx", "%edx", "0", "1", "2", "%mm1", "%mm2", "%mm3", "%mm4", "%mm5");
"\tmovd %%mm3,%0\n"
: "=m" (*op.D)
: "m" (*op.A), "m" (*op.B), "m" (*rgba8_alpha_mask_64)
: "%eax", "%ecx", "%edx", "%mm1", "%mm2", "%mm3", "%mm4", "%mm5");
}
asm("emms");
}
#endif
#if 0
void
xxxgimp_composite_dodge_rgba8_rgba8_rgba8_sse (GimpCompositeContext *_op)
{
@@ -513,8 +529,8 @@ xxxgimp_composite_dodge_rgba8_rgba8_rgba8_sse (GimpCompositeContext *_op)
for (; op.n_pixels >= 2; op.n_pixels -= 2)
{
asm volatile (" movq %0,%%mm0\n"
"\tmovq %1,%%mm1\n"
asm volatile (" movq %1,%%mm0\n"
"\tmovq %2,%%mm1\n"
"\tmovq %%mm1,%%mm3\n"
"\tpxor %%mm2,%%mm2\n"
"\tpunpcklbw %%mm2,%%mm3\n"
@@ -545,10 +561,10 @@ xxxgimp_composite_dodge_rgba8_rgba8_rgba8_sse (GimpCompositeContext *_op)
"\tpor %%mm6,%%mm7\n"
"\tmovq %%mm7,%2\n"
: /* empty */
: "m" (*op.A), "m" (*op.B), "m" (*op.D), "m" (*rgba8_w256_64), "m" (*rgba8_alpha_mask_64)
: "0", "1", "2", "%eax", "%ecx", "%edx", "%mm0", "%mm1", "%mm2", "%mm3", "%mm4", "%mm5", "%mm6", "%mm7");
"\tmovq %%mm7,%0\n"
: "=m" (*op.D)
: "m" (*op.A), "m" (*op.B), "m" (*rgba8_w256_64), "m" (*rgba8_alpha_mask_64)
: "%eax", "%ecx", "%edx", "%mm0", "%mm1", "%mm2", "%mm3", "%mm4", "%mm5", "%mm6", "%mm7");
op.A += 8;
op.B += 8;
op.D += 8;
@@ -556,8 +572,8 @@ xxxgimp_composite_dodge_rgba8_rgba8_rgba8_sse (GimpCompositeContext *_op)
if (op.n_pixels)
{
asm volatile (" movd %0,%%mm0\n"
"\tmovq %1,%%mm1\n"
asm volatile (" movd %1,%%mm0\n"
"\tmovq %2,%%mm1\n"
"\tmovq %%mm1,%%mm3\n"
"\tpxor %%mm2,%%mm2\n"
"\tpunpcklbw %%mm2,%%mm3\n"
@@ -589,18 +605,23 @@ xxxgimp_composite_dodge_rgba8_rgba8_rgba8_sse (GimpCompositeContext *_op)
"\tpor %%mm6,%%mm7\n"
"\tmovd %%mm7,%2\n"
: /* empty */
: "m" (*op.A), "m" (*op.B), "m" (*op.D), "m" (*rgba8_w256_64), "m" (*rgba8_alpha_mask_64)
: "0", "1", "2", "%eax", "%ecx", "%edx", "%mm1", "%mm2", "%mm3", "%mm4", "%mm5");
: "=m" (*op.D)
: "m" (*op.A), "m" (*op.B), "m" (*rgba8_w256_64), "m" (*rgba8_alpha_mask_64)
: "%eax", "%ecx", "%edx", "%mm1", "%mm2", "%mm3", "%mm4", "%mm5");
}
asm("emms");
}
#endif
void
gimp_composite_grain_extract_rgba8_rgba8_rgba8_sse (GimpCompositeContext *_op)
{
GimpCompositeContext op = *_op;
uint64 *d = (uint64 *) _op->D;
uint64 *a = (uint64 *) _op->A;
uint64 *b = (uint64 *) _op->B;
gulong n_pixels = _op->n_pixels;
asm volatile (" movq %0,%%mm0\n"
"\tpxor %%mm6,%%mm6\n"
@@ -610,7 +631,7 @@ gimp_composite_grain_extract_rgba8_rgba8_rgba8_sse (GimpCompositeContext *_op)
: "%mm0", "%mm6", "%mm7");
for (; op.n_pixels >= 2; op.n_pixels -= 2)
for (; n_pixels >= 2; n_pixels -= 2)
{
asm volatile (" movq %1,%%mm2\n"
"\tmovq %2,%%mm3\n"
@@ -637,15 +658,15 @@ gimp_composite_grain_extract_rgba8_rgba8_rgba8_sse (GimpCompositeContext *_op)
"\tpor %%mm2,%%mm1\n"
"\tmovq %%mm1,%0\n"
: "+m" (*op.D)
: "m" (*op.A), "m" (*op.B)
: "=m" (*d)
: "m" (*a), "m" (*b)
: "%mm1", "%mm2", "%mm3", "%mm4");
op.A += 8;
op.B += 8;
op.D += 8;
a++;
b++;
d++;
}
if (op.n_pixels)
if (n_pixels > 0)
{
asm volatile (" movd %1, %%mm2\n"
"\tmovd %2, %%mm3\n"
@@ -669,8 +690,8 @@ gimp_composite_grain_extract_rgba8_rgba8_rgba8_sse (GimpCompositeContext *_op)
"\tpor %%mm2, %%mm1\n"
"\tmovd %%mm1, %0\n"
: "+m" (*op.D)
: "m" (*op.A), "m" (*op.B)
: "=m" (*d)
: "m" (*a), "m" (*b)
: "%mm1", "%mm2", "%mm3", "%mm4");
}
@@ -680,7 +701,10 @@ gimp_composite_grain_extract_rgba8_rgba8_rgba8_sse (GimpCompositeContext *_op)
void
gimp_composite_grain_merge_rgba8_rgba8_rgba8_sse (GimpCompositeContext *_op)
{
GimpCompositeContext op = *_op;
uint64 *d = (uint64 *) _op->D;
uint64 *a = (uint64 *) _op->A;
uint64 *b = (uint64 *) _op->B;
gulong n_pixels = _op->n_pixels;
asm volatile ("movq %0, %%mm0\n"
"pxor %%mm6, %%mm6\n"
@@ -689,7 +713,7 @@ gimp_composite_grain_merge_rgba8_rgba8_rgba8_sse (GimpCompositeContext *_op)
: "m" (*rgba8_alpha_mask_64), "m" (*rgba8_w128_64)
: "%mm0", "%mm6", "%mm7");
for (; op.n_pixels >= 2; op.n_pixels -= 2)
for (; n_pixels >= 2; n_pixels -= 2)
{
asm volatile (" movq %1, %%mm2\n"
"\tmovq %2, %%mm3\n"
@@ -713,15 +737,15 @@ gimp_composite_grain_merge_rgba8_rgba8_rgba8_sse (GimpCompositeContext *_op)
"\tpandn %%mm4, %%mm1\n"
"\tpor %%mm2, %%mm1\n"
"\tmovq %%mm1, %0\n"
: "+m" (*op.D)
: "m" (*op.A), "m" (*op.B)
: "0", "1", "2", "%mm1", "%mm2", "%mm3", "%mm4");
op.A += 8;
op.B += 8;
op.D += 8;
: "=m" (*d)
: "m" (*a), "m" (*b)
: "%mm1", "%mm2", "%mm3", "%mm4");
a++;
b++;
d++;
}
if (op.n_pixels)
if (n_pixels > 0)
{
asm volatile (" movd %1, %%mm2\n"
"\tmovd %2, %%mm3\n"
@@ -744,9 +768,9 @@ gimp_composite_grain_merge_rgba8_rgba8_rgba8_sse (GimpCompositeContext *_op)
"\tpor %%mm2, %%mm1\n"
"\tmovd %%mm1, %0\n"
: "+m" (*op.D)
: "m" (*op.A), "m" (*op.B)
: "0", "1", "2", "%mm1", "%mm2", "%mm3", "%mm4");
: "+m" (*d)
: "m" (*a), "m" (*b)
: "%mm1", "%mm2", "%mm3", "%mm4");
}
asm("emms");
@@ -755,11 +779,14 @@ gimp_composite_grain_merge_rgba8_rgba8_rgba8_sse (GimpCompositeContext *_op)
void
gimp_composite_lighten_rgba8_rgba8_rgba8_sse (GimpCompositeContext *_op)
{
GimpCompositeContext op = *_op;
uint64 *d = (uint64 *) _op->D;
uint64 *a = (uint64 *) _op->A;
uint64 *b = (uint64 *) _op->B;
gulong n_pixels = _op->n_pixels;
asm volatile ("movq %0,%%mm0" : : "m" (*rgba8_alpha_mask_64) : "%mm0");
for (; op.n_pixels >= 2; op.n_pixels -= 2)
for (; n_pixels >= 2; n_pixels -= 2)
{
asm volatile (" movq %1, %%mm2\n"
"\tmovq %2, %%mm3\n"
@@ -771,15 +798,15 @@ gimp_composite_lighten_rgba8_rgba8_rgba8_sse (GimpCompositeContext *_op)
"\tpand %%mm0, %%mm3\n"
"\tpor %%mm3, %%mm1\n"
"\tmovq %%mm1, %0\n"
: "=m" (*op.D)
: "m" (*op.A), "m" (*op.B)
: "=m" (*d)
: "m" (*a), "m" (*b)
: "%mm1", "%mm2", "%mm3", "%mm4", "%mm5");
op.A += 8;
op.B += 8;
op.D += 8;
a++;
b++;
d++;
}
if (op.n_pixels)
if (n_pixels > 0)
{
asm volatile (" movd %1, %%mm2\n"
"\tmovd %2, %%mm3\n"
@@ -794,8 +821,8 @@ gimp_composite_lighten_rgba8_rgba8_rgba8_sse (GimpCompositeContext *_op)
"\tpand %%mm0, %%mm3\n"
"\tpor %%mm3, %%mm1\n"
"\tmovd %%mm1, %0\n"
: "=m" (*op.D)
: "m" (*op.A), "m" (*op.B)
: "=m" (*d)
: "m" (*a), "m" (*b)
: "%mm1", "%mm2", "%mm3", "%mm4", "%mm5");
}
@@ -805,16 +832,19 @@ gimp_composite_lighten_rgba8_rgba8_rgba8_sse (GimpCompositeContext *_op)
void
gimp_composite_multiply_rgba8_rgba8_rgba8_sse (GimpCompositeContext *_op)
{
GimpCompositeContext op = *_op;
uint64 *d = (uint64 *) _op->D;
uint64 *a = (uint64 *) _op->A;
uint64 *b = (uint64 *) _op->B;
gulong n_pixels = _op->n_pixels;
asm volatile ("movq %0,%%mm0" : : "m" (*rgba8_alpha_mask_64) : "%mm0");
asm volatile ("movq %0,%%mm7" : : "m" (*rgba8_w128_64) : "%mm7");
asm volatile ("pxor %%mm6,%%mm6" : : : "%mm6");
for (; op.n_pixels >= 2; op.n_pixels -= 2)
for (; n_pixels >= 2; n_pixels -= 2)
{
asm volatile (" movq %0, %%mm2\n"
"\tmovq %1, %%mm3\n"
asm volatile (" movq %1, %%mm2\n"
"\tmovq %2, %%mm3\n"
mmx_low_bytes_to_words(mm2,mm1,mm6)
mmx_low_bytes_to_words(mm3,mm5,mm6)
@@ -833,19 +863,19 @@ gimp_composite_multiply_rgba8_rgba8_rgba8_sse (GimpCompositeContext *_op)
"\tpand %%mm0, %%mm2\n"
"\tpor %%mm2, %%mm1\n"
"\tmovq %%mm1, %2\n"
: /* empty */
: "m" (*op.A), "m" (*op.B), "m" (*op.D)
: "0", "1", "2", "%mm1", "%mm2", "%mm3", "%mm4", "%mm5");
op.A += 8;
op.B += 8;
op.D += 8;
"\tmovq %%mm1, %0\n"
: "=m" (*d)
: "m" (*a), "m" (*b)
: "%mm1", "%mm2", "%mm3", "%mm4", "%mm5");
a++;
b++;
d++;
}
if (op.n_pixels)
if (n_pixels > 0)
{
asm volatile (" movd %0, %%mm2\n"
"\tmovd %1, %%mm3\n"
asm volatile (" movd %1, %%mm2\n"
"\tmovd %2, %%mm3\n"
mmx_low_bytes_to_words(mm2,mm1,mm6)
mmx_low_bytes_to_words(mm3,mm5,mm6)
@@ -860,15 +890,16 @@ gimp_composite_multiply_rgba8_rgba8_rgba8_sse (GimpCompositeContext *_op)
"\tpand %%mm0, %%mm2\n"
"\tpor %%mm2, %%mm1\n"
"\tmovd %%mm1, %2\n"
: /* empty */
: "m" (*op.A), "m" (*op.B), "m" (*op.D)
: "0", "1", "2", "%mm1", "%mm2", "%mm3", "%mm4", "%mm5");
"\tmovd %%mm1, %0\n"
: "=m" (*d)
: "m" (*a), "m" (*b)
: "%mm1", "%mm2", "%mm3", "%mm4", "%mm5");
}
asm("emms");
}
#if 0
static void
sse_op_overlay(void)
{
@@ -931,8 +962,8 @@ xxxgimp_composite_overlay_rgba8_rgba8_rgba8_sse (GimpCompositeContext *_op)
for (; op.n_pixels >= 2; op.n_pixels -= 2)
{
asm volatile (" movq %0,%%mm2\n"
"\tmovq %1,%%mm3\n"
asm volatile (" movq %1,%%mm2\n"
"\tmovq %2,%%mm3\n"
/* low bytes */
mmx_low_bytes_to_words(mm3,mm5,mm0)
@@ -972,10 +1003,10 @@ xxxgimp_composite_overlay_rgba8_rgba8_rgba8_sse (GimpCompositeContext *_op)
"\tpor %%mm3,%%mm1\n"
"\tmovq %%mm1,%2\n"
: "+m" (*op.A), "+m" (*op.B), "+m" (*op.D)
: "m" (*rgba8_w2_64), "m" (*rgba8_alpha_mask_64)
: "0", "1", "2", "%mm1", "%mm2", "%mm3", "%mm4");
"\tmovq %%mm1,%0\n"
: "=m" (*op.D)
: "m" (*op.A), "m" (*op.B), "m" (*rgba8_w2_64), "m" (*rgba8_alpha_mask_64)
: "%mm1", "%mm2", "%mm3", "%mm4");
op.A += 8;
op.B += 8;
op.D += 8;
@@ -983,8 +1014,8 @@ xxxgimp_composite_overlay_rgba8_rgba8_rgba8_sse (GimpCompositeContext *_op)
if (op.n_pixels)
{
asm volatile (" movd %0,%%mm2\n"
"\tmovd %1,%%mm3\n"
asm volatile (" movd %1,%%mm2\n"
"\tmovd %2,%%mm3\n"
/* low bytes */
mmx_low_bytes_to_words(mm3,mm5,mm0)
@@ -1027,20 +1058,23 @@ xxxgimp_composite_overlay_rgba8_rgba8_rgba8_sse (GimpCompositeContext *_op)
"\tpor %%mm3,%%mm1\n"
"\tmovd %%mm1,%2\n"
: /* empty */
: "m" (*op.A), "m" (*op.B), "m" (*op.D), "m" (*rgba8_w2_64), "m" (*rgba8_alpha_mask_64)
: "0", "1", "2", "%mm1", "%mm2", "%mm3", "%mm4");
"\tmovd %%mm1,%0\n"
: "=m" (*op.D)
: "m" (*op.A), "m" (*op.B), "m" (*rgba8_w2_64), "m" (*rgba8_alpha_mask_64)
: "%mm1", "%mm2", "%mm3", "%mm4");
}
asm("emms");
}
#endif
void
gimp_composite_scale_rgba8_rgba8_rgba8_sse (GimpCompositeContext *_op)
{
GimpCompositeContext op = *_op;
uint64 *d = (uint64 *) _op->D;
uint64 *a = (uint64 *) _op->A;
/*uint64 *b = (uint64 *) _op->B;*/
gulong n_pixels = _op->n_pixels;
asm volatile ("pxor %%mm0,%%mm0\n"
"\tmovl %0,%%eax\n"
@@ -1053,10 +1087,10 @@ gimp_composite_scale_rgba8_rgba8_rgba8_sse (GimpCompositeContext *_op)
"\tpor %%mm5,%%mm3\n"
"\tmovq %1,%%mm7\n"
: /* empty */
: "m" (op.scale.scale), "m" (*rgba8_w128_64)
: "m" (_op->scale.scale), "m" (*rgba8_w128_64)
: "%eax", "%ebx", "%mm0", "%mm3", "%mm5", "%mm6", "%mm7");
for (; op.n_pixels >= 2; op.n_pixels -= 2)
for (; n_pixels >= 2; n_pixels -= 2)
{
asm volatile ("movq %1,%%mm2\n"
"\tmovq %%mm2,%%mm1\n"
@@ -1074,14 +1108,14 @@ gimp_composite_scale_rgba8_rgba8_rgba8_sse (GimpCompositeContext *_op)
"\tpackuswb %%mm4,%%mm1\n"
"\tmovq %%mm1,%0\n"
: "+m" (*op.D)
: "m" (*op.A)
: "=m" (*d)
: "m" (*a)
: "%mm1", "%mm2", "%mm4", "%mm5", "%mm7");
op.A += 8;
op.D += 8;
a++;
d++;
}
if (op.n_pixels)
if (n_pixels > 0)
{
asm volatile (" movd %1,%%mm2\n"
"\tmovq %%mm2,%%mm1\n"
@@ -1092,8 +1126,8 @@ gimp_composite_scale_rgba8_rgba8_rgba8_sse (GimpCompositeContext *_op)
"\tpackuswb %%mm0,%%mm1\n"
"\tmovd %%mm1,%0\n"
: "+m" (*op.D)
: "m" (*op.A)
: "=m" (*d)
: "m" (*a)
: "%mm1", "%mm2", "%mm4", "%mm5", "%mm6", "%mm7");
}
@@ -1103,16 +1137,19 @@ gimp_composite_scale_rgba8_rgba8_rgba8_sse (GimpCompositeContext *_op)
void
gimp_composite_screen_rgba8_rgba8_rgba8_sse (GimpCompositeContext *_op)
{
GimpCompositeContext op = *_op;
uint64 *d = (uint64 *) _op->D;
uint64 *a = (uint64 *) _op->A;
uint64 *b = (uint64 *) _op->B;
gulong n_pixels = _op->n_pixels;
asm volatile ("movq %0,%%mm0" : : "m" (*rgba8_alpha_mask_64) : "%mm0");
asm volatile ("movq %0,%%mm7" : : "m" (*rgba8_w128_64) : "%mm7");
asm volatile ("pxor %mm6, %mm6");
for (; op.n_pixels >= 2; op.n_pixels -= 2)
for (; n_pixels >= 2; n_pixels -= 2)
{
asm volatile (" movq %0,%%mm2\n"
"\tmovq %1,%%mm3\n"
asm volatile (" movq %1,%%mm2\n"
"\tmovq %2,%%mm3\n"
"\tpcmpeqb %%mm4,%%mm4\n"
"\tpsubb %%mm2,%%mm4\n"
@@ -1155,19 +1192,19 @@ gimp_composite_screen_rgba8_rgba8_rgba8_sse (GimpCompositeContext *_op)
"\tpor %%mm3,%%mm1\n"
"\tmovq %%mm1,%2\n"
: /* empty */
: "m" (*op.A), "m" (*op.B), "m" (*op.D)
: "0", "1", "2", "%mm1", "%mm2", "%mm3", "%mm4", "%mm5");
op.A += 8;
op.B += 8;
op.D += 8;
"\tmovq %%mm1,%0\n"
: "=m" (*d)
: "m" (*a), "m" (*b)
: "%mm1", "%mm2", "%mm3", "%mm4", "%mm5");
a++;
b++;
d++;
}
if (op.n_pixels)
if (n_pixels > 0)
{
asm volatile (" movd %0,%%mm2\n"
"\tmovd %1,%%mm3\n"
asm volatile (" movd %1,%%mm2\n"
"\tmovd %2,%%mm3\n"
"\tpcmpeqb %%mm4,%%mm4\n"
"\tpsubb %%mm2,%%mm4\n"
@@ -1210,10 +1247,10 @@ gimp_composite_screen_rgba8_rgba8_rgba8_sse (GimpCompositeContext *_op)
"\tpor %%mm3,%%mm1\n"
"\tmovd %%mm1,%2\n"
: /* empty */
: "m" (*op.A), "m" (*op.B), "m" (*op.D)
: "0", "1", "2", "%mm1", "%mm2", "%mm3", "%mm4", "%mm5");
"\tmovd %%mm1,%0\n"
: "=m" (*d)
: "m" (*a), "m" (*b)
: "%mm1", "%mm2", "%mm3", "%mm4", "%mm5");
}
asm("emms");
@@ -1223,11 +1260,14 @@ gimp_composite_screen_rgba8_rgba8_rgba8_sse (GimpCompositeContext *_op)
void
gimp_composite_subtract_rgba8_rgba8_rgba8_sse (GimpCompositeContext *_op)
{
GimpCompositeContext op = *_op;
uint64 *d = (uint64 *) _op->D;
uint64 *a = (uint64 *) _op->A;
uint64 *b = (uint64 *) _op->B;
gulong n_pixels = _op->n_pixels;
asm volatile ("movq %0,%%mm0" : : "m" (*rgba8_alpha_mask_64) : "%mm0");
for (; op.n_pixels >= 2; op.n_pixels -= 2)
for (; n_pixels >= 2; n_pixels -= 2)
{
asm volatile (" movq %1,%%mm2\n"
"\tmovq %2,%%mm3\n"
@@ -1239,15 +1279,15 @@ gimp_composite_subtract_rgba8_rgba8_rgba8_sse (GimpCompositeContext *_op)
"\tpand %%mm0,%%mm2\n"
"\tpor %%mm2,%%mm1\n"
"\tmovq %%mm1,%0\n"
: "+m" (*op.D)
: "m" (*op.A), "m" (*op.B)
: "=m" (*d)
: "m" (*a), "m" (*b)
: "%mm1", "%mm2", "%mm3", "%mm4");
op.A += 8;
op.B += 8;
op.D += 8;
a++;
b++;
d++;
}
if (op.n_pixels)
if (n_pixels > 0)
{
asm volatile (" movd %1,%%mm2\n"
"\tmovd %2,%%mm3\n"
@@ -1259,8 +1299,8 @@ gimp_composite_subtract_rgba8_rgba8_rgba8_sse (GimpCompositeContext *_op)
"\tpand %%mm0,%%mm2\n"
"\tpor %%mm2,%%mm1\n"
"\tmovd %%mm1,%0\n"
: "+m" (*op.D)
: "m" (*op.A), "m" (*op.B)
: "=m" (*d)
: "m" (*a), "m" (*b)
: "%mm1", "%mm2", "%mm3", "%mm4");
}
@@ -1270,28 +1310,30 @@ gimp_composite_subtract_rgba8_rgba8_rgba8_sse (GimpCompositeContext *_op)
void
gimp_composite_swap_rgba8_rgba8_rgba8_sse (GimpCompositeContext *_op)
{
GimpCompositeContext op = *_op;
uint64 *a = (uint64 *) _op->A;
uint64 *b = (uint64 *) _op->B;
gulong n_pixels = _op->n_pixels;
for (; op.n_pixels >= 2; op.n_pixels -= 2)
for (; n_pixels >= 2; n_pixels -= 2)
{
asm volatile (" movq %0,%%mm2\n"
"\tmovq %1,%%mm3\n"
"\tmovq %%mm3,%0\n"
"\tmovq %%mm2,%1\n"
: "+m" (*op.A), "+m" (*op.B)
: "+m" (*a), "+m" (*b)
:
: "%mm1", "%mm2", "%mm3", "%mm4");
op.A += 8;
op.B += 8;
a++;
b++;
}
if (op.n_pixels)
if (n_pixels > 0)
{
asm volatile (" movd %0,%%mm2\n"
"\tmovd %1,%%mm3\n"
"\tmovd %%mm3,%0\n"
"\tmovd %%mm2,%1\n"
: "+m" (*op.A), "+m" (*op.B)
: "+m" (*a), "+m" (*b)
: /* empty */
: "%mm1", "%mm2", "%mm3", "%mm4");
}
@@ -1443,7 +1485,7 @@ xxxgimp_composite_burn_va8_va8_va8_sse (GimpCompositeContext *_op)
"\tmovq %%mm7,(%2); addl $8,%2\n"
: "+r" (op.A), "+r" (op.B), "+r" (op.D)
: "m" (*va8_b255), "m" (*va8_w1), "m" (*va8_w255), "m" (*va8_alpha_mask)
: "0", "1", "2", "%mm1", "%mm2", "%mm3", "%mm4");
: "%mm1", "%mm2", "%mm3", "%mm4");
}
if (op.n_pixels)
@@ -1494,7 +1536,7 @@ xxxgimp_composite_burn_va8_va8_va8_sse (GimpCompositeContext *_op)
"\tmovd %%mm7,(%2)\n"
: /* empty */
: "r" (op.A), "r" (op.B), "r" (op.D), "m" (*va8_b255), "m" (*va8_w1), "m" (*va8_w255), "m" (*va8_alpha_mask)
: "0", "1", "2", "%mm0", "%mm1", "%mm2", "%mm3", "%mm4", "%mm5", "%mm6", "%mm7");
: "%mm0", "%mm1", "%mm2", "%mm3", "%mm4", "%mm5", "%mm6", "%mm7");
}
asm("emms");
@@ -2279,15 +2321,12 @@ xxxgimp_composite_valueonly_va8_va8_va8_sse (GimpCompositeContext *_op)
}
#endif
#endif /* ARCH_X86_64 || !PIC */
#endif /* __GNUC__ > 3 */
#endif /* ARCH_X86 */
#endif /* USE_SSE */
#endif /* COMPILE_SSE_IS_OKAY */
gboolean
gimp_composite_sse_init (void)
{
#if defined(USE_SSE) && defined(ARCH_X86) && (defined(ARCH_X86_64) || !defined(PIC))
#ifdef COMPILE_SSE_IS_OKAY
guint32 cpu = cpu_accel ();
if (cpu & CPU_ACCEL_X86_SSE || cpu & CPU_ACCEL_X86_MMXEXT)

View File

@@ -9,9 +9,19 @@ extern gboolean gimp_composite_sse_init (void);
*/
extern gboolean gimp_composite_sse_install (void);
#ifdef USE_MMX
#ifdef ARCH_X86
#if !defined(__INTEL_COMPILER)
#if defined(USE_SSE)
#if defined(ARCH_X86)
#if __GNUC__ >= 3
#if defined(ARCH_X86_64) || !defined(PIC)
#define COMPILE_SSE_IS_OKAY
#endif /* defined(ARCH_X86_64) || !defined(PIC) */
#endif /* __GNUC__ >= 3 */
#endif /* */
#endif /* */
#endif /* */
#ifdef COMPILE_SSE_IS_OKAY
/*
*
*/
@@ -39,7 +49,5 @@ extern void gimp_composite_swap_rgba8_rgba8_rgba8_sse (GimpCompositeContext *ctx
extern void gimp_composite_valueonly_rgba8_rgba8_rgba8_sse (GimpCompositeContext *ctx);
extern void gimp_composite_scale_rgba8_rgba8_rgba8_sse (GimpCompositeContext *ctx);
#endif /* __GNUC__ > 3 */
#endif /* ARCH_X86 */
#endif /* USE_MMX */
#endif /* COMPILE_SSE_IS_OKAY */
#endif

View File

@@ -16,7 +16,7 @@ static struct install_table {
GimpPixelFormat D;
void (*function)(GimpCompositeContext *);
} _gimp_composite_sse2[] = {
#if (__GNUC__ >= 3) && defined(USE_SSE) && defined(ARCH_X86) && (defined(ARCH_X86_64) || !defined(PIC))
#if defined(COMPILE_SSE2_IS_OKAY)
{ GIMP_COMPOSITE_DIFFERENCE, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, gimp_composite_difference_rgba8_rgba8_rgba8_sse2 },
{ GIMP_COMPOSITE_ADDITION, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, gimp_composite_addition_rgba8_rgba8_rgba8_sse2 },
{ GIMP_COMPOSITE_SUBTRACT, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, gimp_composite_subtract_rgba8_rgba8_rgba8_sse2 },

View File

@@ -19,7 +19,7 @@
int
gimp_composite_sse2_test (int iterations, int n_pixels)
{
#if (__GNUC__ >= 3) && defined(USE_SSE) && defined(ARCH_X86) && (defined(ARCH_X86_64) || !defined(PIC))
#if defined(COMPILE_SSE2_IS_OKAY)
GimpCompositeContext generic_ctx;
GimpCompositeContext special_ctx;
double ft0;
@@ -71,10 +71,10 @@ gimp_composite_sse2_test (int iterations, int n_pixels)
ft1 = gimp_composite_regression_time_function (iterations, gimp_composite_addition_rgba8_rgba8_rgba8_sse2, &special_ctx);
if (gimp_composite_regression_compare_contexts ("addition", &generic_ctx, &special_ctx))
{
printf("addition failed\n");
printf("addition_rgba8_rgba8_rgba8 failed\n");
return (1);
}
gimp_composite_regression_timer_report ("addition", ft0, ft1);
gimp_composite_regression_timer_report ("addition_rgba8_rgba8_rgba8", ft0, ft1);
gimp_composite_context_init (&special_ctx, GIMP_COMPOSITE_DARKEN, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, n_pixels, (unsigned char *) rgba8A, (unsigned char *) rgba8B, (unsigned char *) rgba8B, (unsigned char *) rgba8D2);
gimp_composite_context_init (&generic_ctx, GIMP_COMPOSITE_DARKEN, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, n_pixels, (unsigned char *) rgba8A, (unsigned char *) rgba8B, (unsigned char *) rgba8B, (unsigned char *) rgba8D1);
@@ -82,10 +82,10 @@ gimp_composite_sse2_test (int iterations, int n_pixels)
ft1 = gimp_composite_regression_time_function (iterations, gimp_composite_darken_rgba8_rgba8_rgba8_sse2, &special_ctx);
if (gimp_composite_regression_compare_contexts ("darken", &generic_ctx, &special_ctx))
{
printf("darken failed\n");
printf("darken_rgba8_rgba8_rgba8 failed\n");
return (1);
}
gimp_composite_regression_timer_report ("darken", ft0, ft1);
gimp_composite_regression_timer_report ("darken_rgba8_rgba8_rgba8", ft0, ft1);
gimp_composite_context_init (&special_ctx, GIMP_COMPOSITE_DIFFERENCE, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, n_pixels, (unsigned char *) rgba8A, (unsigned char *) rgba8B, (unsigned char *) rgba8B, (unsigned char *) rgba8D2);
gimp_composite_context_init (&generic_ctx, GIMP_COMPOSITE_DIFFERENCE, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, n_pixels, (unsigned char *) rgba8A, (unsigned char *) rgba8B, (unsigned char *) rgba8B, (unsigned char *) rgba8D1);
@@ -93,10 +93,10 @@ gimp_composite_sse2_test (int iterations, int n_pixels)
ft1 = gimp_composite_regression_time_function (iterations, gimp_composite_difference_rgba8_rgba8_rgba8_sse2, &special_ctx);
if (gimp_composite_regression_compare_contexts ("difference", &generic_ctx, &special_ctx))
{
printf("difference failed\n");
printf("difference_rgba8_rgba8_rgba8 failed\n");
return (1);
}
gimp_composite_regression_timer_report ("difference", ft0, ft1);
gimp_composite_regression_timer_report ("difference_rgba8_rgba8_rgba8", ft0, ft1);
gimp_composite_context_init (&special_ctx, GIMP_COMPOSITE_GRAIN_EXTRACT, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, n_pixels, (unsigned char *) rgba8A, (unsigned char *) rgba8B, (unsigned char *) rgba8B, (unsigned char *) rgba8D2);
gimp_composite_context_init (&generic_ctx, GIMP_COMPOSITE_GRAIN_EXTRACT, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, n_pixels, (unsigned char *) rgba8A, (unsigned char *) rgba8B, (unsigned char *) rgba8B, (unsigned char *) rgba8D1);
@@ -104,10 +104,10 @@ gimp_composite_sse2_test (int iterations, int n_pixels)
ft1 = gimp_composite_regression_time_function (iterations, gimp_composite_grain_extract_rgba8_rgba8_rgba8_sse2, &special_ctx);
if (gimp_composite_regression_compare_contexts ("grain_extract", &generic_ctx, &special_ctx))
{
printf("grain_extract failed\n");
printf("grain_extract_rgba8_rgba8_rgba8 failed\n");
return (1);
}
gimp_composite_regression_timer_report ("grain_extract", ft0, ft1);
gimp_composite_regression_timer_report ("grain_extract_rgba8_rgba8_rgba8", ft0, ft1);
gimp_composite_context_init (&special_ctx, GIMP_COMPOSITE_LIGHTEN, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, n_pixels, (unsigned char *) rgba8A, (unsigned char *) rgba8B, (unsigned char *) rgba8B, (unsigned char *) rgba8D2);
gimp_composite_context_init (&generic_ctx, GIMP_COMPOSITE_LIGHTEN, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, n_pixels, (unsigned char *) rgba8A, (unsigned char *) rgba8B, (unsigned char *) rgba8B, (unsigned char *) rgba8D1);
@@ -115,10 +115,10 @@ gimp_composite_sse2_test (int iterations, int n_pixels)
ft1 = gimp_composite_regression_time_function (iterations, gimp_composite_lighten_rgba8_rgba8_rgba8_sse2, &special_ctx);
if (gimp_composite_regression_compare_contexts ("lighten", &generic_ctx, &special_ctx))
{
printf("lighten failed\n");
printf("lighten_rgba8_rgba8_rgba8 failed\n");
return (1);
}
gimp_composite_regression_timer_report ("lighten", ft0, ft1);
gimp_composite_regression_timer_report ("lighten_rgba8_rgba8_rgba8", ft0, ft1);
gimp_composite_context_init (&special_ctx, GIMP_COMPOSITE_SUBTRACT, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, n_pixels, (unsigned char *) rgba8A, (unsigned char *) rgba8B, (unsigned char *) rgba8B, (unsigned char *) rgba8D2);
gimp_composite_context_init (&generic_ctx, GIMP_COMPOSITE_SUBTRACT, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, n_pixels, (unsigned char *) rgba8A, (unsigned char *) rgba8B, (unsigned char *) rgba8B, (unsigned char *) rgba8D1);
@@ -126,10 +126,10 @@ gimp_composite_sse2_test (int iterations, int n_pixels)
ft1 = gimp_composite_regression_time_function (iterations, gimp_composite_subtract_rgba8_rgba8_rgba8_sse2, &special_ctx);
if (gimp_composite_regression_compare_contexts ("subtract", &generic_ctx, &special_ctx))
{
printf("subtract failed\n");
printf("subtract_rgba8_rgba8_rgba8 failed\n");
return (1);
}
gimp_composite_regression_timer_report ("subtract", ft0, ft1);
gimp_composite_regression_timer_report ("subtract_rgba8_rgba8_rgba8", ft0, ft1);
gimp_composite_context_init (&special_ctx, GIMP_COMPOSITE_SWAP, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, n_pixels, (unsigned char *) rgba8A, (unsigned char *) rgba8B, (unsigned char *) rgba8B, (unsigned char *) rgba8D2);
gimp_composite_context_init (&generic_ctx, GIMP_COMPOSITE_SWAP, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, n_pixels, (unsigned char *) rgba8A, (unsigned char *) rgba8B, (unsigned char *) rgba8B, (unsigned char *) rgba8D1);
@@ -137,10 +137,10 @@ gimp_composite_sse2_test (int iterations, int n_pixels)
ft1 = gimp_composite_regression_time_function (iterations, gimp_composite_swap_rgba8_rgba8_rgba8_sse2, &special_ctx);
if (gimp_composite_regression_compare_contexts ("swap", &generic_ctx, &special_ctx))
{
printf("swap failed\n");
printf("swap_rgba8_rgba8_rgba8 failed\n");
return (1);
}
gimp_composite_regression_timer_report ("swap", ft0, ft1);
gimp_composite_regression_timer_report ("swap_rgba8_rgba8_rgba8", ft0, ft1);
#endif
return (0);
}
@@ -155,7 +155,7 @@ main (int argc, char *argv[])
putenv ("GIMP_COMPOSITE=0x1");
iterations = 1;
iterations = 10;
n_pixels = 1048593;
argv++, argc--;

View File

@@ -34,12 +34,10 @@
#include "gimp-composite.h"
#include "gimp-composite-sse2.h"
#include "gimp-composite-x86.h"
#if defined(USE_SSE)
#if defined(ARCH_X86)
#if __GNUC__ >= 3
#if defined(ARCH_X86_64) || !defined(PIC)
#ifdef COMPILE_SSE2_IS_OKAY
#include "gimp-composite-x86.h"
static const guint32 rgba8_alpha_mask_128[4] = { 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000 };
static const guint32 rgba8_b1_128[4] = { 0x01010101, 0x01010101, 0x01010101, 0x01010101 };
@@ -90,7 +88,13 @@ debug_display_sse (void)
void
gimp_composite_addition_rgba8_rgba8_rgba8_sse2 (GimpCompositeContext *_op)
{
GimpCompositeContext op = *_op;
uint64 *d;
uint64 *a;
uint64 *b;
uint128 *D = (uint128 *) _op->D;
uint128 *A = (uint128 *) _op->A;
uint128 *B = (uint128 *) _op->B;
gulong n_pixels = _op->n_pixels;
asm volatile (" movdqu %0,%%xmm0\n"
"\tmovq %1,%%mm0"
@@ -98,48 +102,52 @@ gimp_composite_addition_rgba8_rgba8_rgba8_sse2 (GimpCompositeContext *_op)
: "m" (*rgba8_alpha_mask_128), "m" (*rgba8_alpha_mask_64)
: "%xmm0", "%mm0");
for (; op.n_pixels >= 4; op.n_pixels -= 4)
for (; n_pixels >= 4; n_pixels -= 4)
{
asm (" movdqu %1,%%xmm2\n"
"\tmovdqu %2,%%xmm3\n"
"\tmovdqu %%xmm2,%%xmm4\n"
"\tpaddusb %%xmm3,%%xmm4\n"
"\tmovdqu %%xmm0,%%xmm1\n"
"\tpandn %%xmm4,%%xmm1\n"
"\tpminub %%xmm3,%%xmm2\n"
"\tpand %%xmm0,%%xmm2\n"
"\tpor %%xmm2,%%xmm1\n"
"\tmovdqu %%xmm1,%0\n"
: "+m" (*op.D)
: "m" (*op.A), "m" (*op.B)
: "%xmm0", "%xmm1", "%xmm2", "%xmm3", "%xmm4", "%xmm5", "%xmm6", "%xmm7");
op.A += 16;
op.B += 16;
op.D += 16;
asm volatile (" movdqu %1,%%xmm2\n"
"\tmovdqu %2,%%xmm3\n"
"\tmovdqu %%xmm2,%%xmm4\n"
"\tpaddusb %%xmm3,%%xmm4\n"
"\tmovdqu %%xmm0,%%xmm1\n"
"\tpandn %%xmm4,%%xmm1\n"
"\tpminub %%xmm3,%%xmm2\n"
"\tpand %%xmm0,%%xmm2\n"
"\tpor %%xmm2,%%xmm1\n"
"\tmovdqu %%xmm1,%0\n"
: "=m" (*D)
: "m" (*A), "m" (*B)
: "%xmm0", "%xmm1", "%xmm2", "%xmm3", "%xmm4", "%xmm5", "%xmm6", "%xmm7");
A++;
B++;
D++;
}
for (; op.n_pixels >= 2; op.n_pixels -= 2)
a = (uint64 *) A;
b = (uint64 *) B;
d = (uint64 *) D;
for (; n_pixels >= 2; n_pixels -= 2)
{
asm (" movq %1,%%mm2\n"
"\tmovq %2,%%mm3\n"
"\tmovq %%mm2,%%mm4\n"
"\tpaddusb %%mm3,%%mm4\n"
"\tmovq %%mm0,%%mm1\n"
"\tpandn %%mm4,%%mm1\n"
"\tpminub %%mm3,%%mm2\n"
"\tpand %%mm0,%%mm2\n"
"\tpor %%mm2,%%mm1\n"
"\tmovq %%mm1,%0\n"
: "+m" (*op.D)
: "m" (*op.A), "m" (*op.B)
: "%mm0", "%mm1", "%mm2", "%mm3", "%mm4", "%mm5", "%mm6", "%mm7");
op.A += 8;
op.B += 8;
op.D += 8;
asm volatile (" movq %1,%%mm2\n"
"\tmovq %2,%%mm3\n"
"\tmovq %%mm2,%%mm4\n"
"\tpaddusb %%mm3,%%mm4\n"
"\tmovq %%mm0,%%mm1\n"
"\tpandn %%mm4,%%mm1\n"
"\tpminub %%mm3,%%mm2\n"
"\tpand %%mm0,%%mm2\n"
"\tpor %%mm2,%%mm1\n"
"\tmovq %%mm1,%0\n"
: "=m" (*d)
: "m" (*a), "m" (*b)
: "%mm0", "%mm1", "%mm2", "%mm3", "%mm4", "%mm5", "%mm6", "%mm7");
a++;
b++;
d++;
}
for (; op.n_pixels >= 1; op.n_pixels -= 1)
if (n_pixels > 0)
{
asm volatile (" movd %1,%%mm2\n"
"\tmovd %2,%%mm3\n"
@@ -151,64 +159,73 @@ gimp_composite_addition_rgba8_rgba8_rgba8_sse2 (GimpCompositeContext *_op)
"\tpand %%mm0,%%mm2\n"
"\tpor %%mm2,%%mm1\n"
"\tmovd %%mm1,%0\n"
: "+m" (*op.D)
: "m" (*op.A), "m" (*op.B)
: "=m" (*d)
: "m" (*a), "m" (*b)
: "%mm0", "%mm1", "%mm2", "%mm3", "%mm4", "%mm5", "%mm6", "%mm7");
op.A += 4;
op.B += 4;
op.D += 4;
}
asm("emms");
}
#if 0
void
xxxgimp_composite_burn_rgba8_rgba8_rgba8_sse2 (GimpCompositeContext *_op)
{
}
#endif
void
gimp_composite_darken_rgba8_rgba8_rgba8_sse2 (GimpCompositeContext *_op)
{
GimpCompositeContext op = *_op;
uint64 *d;
uint64 *a;
uint64 *b;
uint128 *D = (uint128 *) _op->D;
uint128 *A = (uint128 *) _op->A;
uint128 *B = (uint128 *) _op->B;
gulong n_pixels = _op->n_pixels;
for (; op.n_pixels >= 4; op.n_pixels -= 4)
for (; n_pixels >= 4; n_pixels -= 4)
{
asm volatile (" movdqu %1,%%xmm2\n"
"\tmovdqu %2,%%xmm3\n"
"\tpminub %%xmm3,%%xmm2\n"
"\tmovdqu %%xmm2,%0\n"
: "=m" (*op.D)
: "m" (*op.A), "m" (*op.B)
: "=m" (*D)
: "m" (*A), "m" (*B)
: "%xmm1", "%xmm2", "%xmm3", "%xmm4");
op.A += 16;
op.B += 16;
op.D += 16;
A++;
B++;
D++;
}
for (; op.n_pixels >= 2; op.n_pixels -= 2)
a = (uint64 *) A;
b = (uint64 *) B;
d = (uint64 *) D;
for (; n_pixels >= 2; n_pixels -= 2)
{
asm volatile (" movq %1, %%mm2\n"
"\tpminub %2, %%mm2\n"
"\tmovq %%mm2, %0\n"
: "=m" (*op.D)
: "m" (*op.A), "m" (*op.B)
: "=m" (*d)
: "m" (*a), "m" (*b)
: "%mm1", "%mm2", "%mm3", "%mm4");
op.A += 8;
op.B += 8;
op.D += 8;
a++;
b++;
d++;
}
if (op.n_pixels)
if (n_pixels > 0)
{
asm volatile (" movd %1, %%mm2\n"
"\tmovd %2, %%mm3\n"
"\tpminub %%mm3, %%mm2\n"
"\tmovd %%mm2, %0\n"
: "=m" (*op.D)
: "m" (*op.A), "m" (*op.B)
: "=m" (*d)
: "m" (*a), "m" (*b)
: "%mm2", "%mm3", "%mm4");
}
@@ -218,15 +235,21 @@ gimp_composite_darken_rgba8_rgba8_rgba8_sse2 (GimpCompositeContext *_op)
void
gimp_composite_difference_rgba8_rgba8_rgba8_sse2 (GimpCompositeContext *_op)
{
GimpCompositeContext op = *_op;
uint64 *d;
uint64 *a;
uint64 *b;
uint128 *D = (uint128 *) _op->D;
uint128 *A = (uint128 *) _op->A;
uint128 *B = (uint128 *) _op->B;
gulong n_pixels = _op->n_pixels;
asm volatile (" movq %0,%%mm0\n"
"\tmovdqu %1,%%xmm0"
:
: /* */
: "m" (*rgba8_alpha_mask_64), "m" (*rgba8_alpha_mask_128)
: "%mm0", "%xmm0");
for (; op.n_pixels >= 4; op.n_pixels -= 4)
for (; n_pixels >= 4; n_pixels -= 4)
{
asm volatile (" movdqu %1,%%xmm2\n"
"\tmovdqu %2,%%xmm3\n"
@@ -241,15 +264,19 @@ gimp_composite_difference_rgba8_rgba8_rgba8_sse2 (GimpCompositeContext *_op)
"\tpand %%xmm0,%%xmm2\n"
"\tpor %%xmm2,%%xmm1\n"
"\tmovdqu %%xmm1,%0\n"
: "+m" (*op.D)
: "m" (*op.A), "m" (*op.B)
: "=m" (*D)
: "m" (*A), "m" (*B)
: "%xmm1", "%xmm2", "%xmm3", "%xmm4", "%xmm5");
op.A += 16;
op.B += 16;
op.D += 16;
A++;
B++;
D++;
}
for (; op.n_pixels >= 2; op.n_pixels -= 2)
a = (uint64 *) A;
b = (uint64 *) B;
d = (uint64 *) D;
for (; n_pixels >= 2; n_pixels -= 2)
{
asm volatile (" movq %1, %%mm2\n"
"\tmovq %2, %%mm3\n"
@@ -264,15 +291,15 @@ gimp_composite_difference_rgba8_rgba8_rgba8_sse2 (GimpCompositeContext *_op)
"\tpand %%mm0, %%mm2\n"
"\tpor %%mm2, %%mm1\n"
"\tmovq %%mm1, %0\n"
: "+m" (*op.D)
: "m" (*op.A), "m" (*op.B)
: "=m" (*d)
: "m" (*a), "m" (*b)
: "%mm1", "%mm2", "%mm3", "%mm4", "%mm5");
op.A += 8;
op.B += 8;
op.D += 8;
a++;
b++;
d++;
}
if (op.n_pixels)
if (n_pixels > 0)
{
asm volatile (" movd %1, %%mm2\n"
"\tmovd %2, %%mm3\n"
@@ -287,8 +314,8 @@ gimp_composite_difference_rgba8_rgba8_rgba8_sse2 (GimpCompositeContext *_op)
"\tpand %%mm0, %%mm2\n"
"\tpor %%mm2, %%mm1\n"
"\tmovd %%mm1, %0\n"
: "+m" (*op.D)
: "m" (*op.A), "m" (*op.B)
: "=m" (*d)
: "m" (*a), "m" (*b)
: "%mm1", "%mm2", "%mm3", "%mm4", "%mm5");
}
@@ -296,16 +323,16 @@ gimp_composite_difference_rgba8_rgba8_rgba8_sse2 (GimpCompositeContext *_op)
}
#if 0
void
xxxgimp_composite_dodge_rgba8_rgba8_rgba8_sse2 (GimpCompositeContext *_op)
{
GimpCompositeContext op = *_op;
#if 0
for (; op.n_pixels >= 4; op.n_pixels -= 4)
{
asm volatile (" movdqu %0,%%xmm0\n"
"\tmovdqu %1,%%xmm1\n"
asm volatile (" movdqu %1,%%xmm0\n"
"\tmovdqu %2,%%xmm1\n"
"\tmovdqu %%xmm1,%%xmm3\n"
"\tpxor %%xmm2,%%xmm2\n"
"\tpunpcklbw %%xmm2,%%xmm3\n"
@@ -336,20 +363,19 @@ xxxgimp_composite_dodge_rgba8_rgba8_rgba8_sse2 (GimpCompositeContext *_op)
"\tpor %%xmm6,%%xmm7\n"
"\tmovdqu %%xmm7,%2\n"
: /* empty */
: "m" (*op.A), "m" (*op.B), "m" (*op.D), "m" (*rgba8_w256_128), "m" (*rgba8_alpha_mask_128)
: "0", "1", "2", "%eax", "%ecx", "%edx", "%xmm0", "%xmm1", "%xmm2", "%xmm3", "%xmm4", "%xmm5", "%xmm6", "%xmm7");
"\tmovdqu %%xmm7,%0\n"
: "=m" (*op.D)
: "m" (*op.A), "m" (*op.B), "m" (*rgba8_w256_128), "m" (*rgba8_alpha_mask_128)
: "%eax", "%ecx", "%edx", "%xmm0", "%xmm1", "%xmm2", "%xmm3", "%xmm4", "%xmm5", "%xmm6", "%xmm7");
op.A += 16;
op.B += 16;
op.D += 16;
}
#endif
for (; op.n_pixels >= 2; op.n_pixels -= 2)
{
asm volatile (" movq %0,%%mm0\n"
"\tmovq %1,%%mm1\n"
asm volatile (" movq %1,%%mm0\n"
"\tmovq %2,%%mm1\n"
"\tmovq %%mm1,%%mm3\n"
"\tpxor %%mm2,%%mm2\n"
"\tpunpcklbw %%mm2,%%mm3\n"
@@ -380,10 +406,10 @@ xxxgimp_composite_dodge_rgba8_rgba8_rgba8_sse2 (GimpCompositeContext *_op)
"\tpor %%mm6,%%mm7\n"
"\tmovq %%mm7,%2\n"
: /* empty */
: "m" (*op.A), "m" (*op.B), "m" (*op.D), "m" (*rgba8_w256_64), "m" (*rgba8_alpha_mask_64)
: "0", "1", "2", "%eax", "%ecx", "%edx", "%mm0", "%mm1", "%mm2", "%mm3", "%mm4", "%mm5", "%mm6", "%mm7");
"\tmovq %%mm7,%0\n"
: (*op.D)
: "m" (*op.A), "m" (*op.B), "m" (*rgba8_w256_64), "m" (*rgba8_alpha_mask_64)
: "%eax", "%ecx", "%edx", "%mm0", "%mm1", "%mm2", "%mm3", "%mm4", "%mm5", "%mm6", "%mm7");
op.A += 8;
op.B += 8;
op.D += 8;
@@ -391,8 +417,8 @@ xxxgimp_composite_dodge_rgba8_rgba8_rgba8_sse2 (GimpCompositeContext *_op)
if (op.n_pixels)
{
asm volatile (" movd %0,%%mm0\n"
"\tmovq %1,%%mm1\n"
asm volatile (" movd %1,%%mm0\n"
"\tmovq %2,%%mm1\n"
"\tmovq %%mm1,%%mm3\n"
"\tpxor %%mm2,%%mm2\n"
"\tpunpcklbw %%mm2,%%mm3\n"
@@ -423,31 +449,38 @@ xxxgimp_composite_dodge_rgba8_rgba8_rgba8_sse2 (GimpCompositeContext *_op)
"\tpor %%mm6,%%mm7\n"
"\tmovd %%mm7,%2\n"
: /* empty */
: "m" (*op.A), "m" (*op.B), "m" (*op.D), "m" (*rgba8_w256_64), "m" (*rgba8_alpha_mask_64)
: "0", "1", "2", "%eax", "%ecx", "%edx", "%mm1", "%mm2", "%mm3", "%mm4", "%mm5");
"\tmovd %%mm7,%0\n"
: "=m" (*op.D)
: "m" (*op.A), "m" (*op.B), "m" (*rgba8_w256_64), "m" (*rgba8_alpha_mask_64)
: "%eax", "%ecx", "%edx", "%mm1", "%mm2", "%mm3", "%mm4", "%mm5");
}
asm("emms");
}
#endif
void
gimp_composite_grain_extract_rgba8_rgba8_rgba8_sse2 (GimpCompositeContext *_op)
{
GimpCompositeContext op = *_op;
uint64 *d;
uint64 *a;
uint64 *b;
uint128 *D = (uint128 *) _op->D;
uint128 *A = (uint128 *) _op->A;
uint128 *B = (uint128 *) _op->B;
gulong n_pixels = _op->n_pixels;
asm volatile (" movq %0,%%mm0\n"
"\tpxor %%mm6,%%mm6\n"
"\tmovq %1,%%mm7\n"
"\tmovdqu %2,%%xmm0\n"
"\tmovdqu %2,%%xmm0\n"
"\tpxor %%xmm6,%%xmm6\n"
"\tmovdqu %3,%%xmm7\n"
: /* empty */
: "m" (*rgba8_alpha_mask_64), "m" (*rgba8_w128_64), "m" (*rgba8_alpha_mask_128), "m" (*rgba8_w128_128)
: "%mm0", "%mm6", "%mm7", "%xmm0", "%xmm6", "%xmm7");
for (; op.n_pixels >= 4; op.n_pixels -= 4)
for (; n_pixels >= 4; n_pixels -= 4)
{
asm volatile (" movdqu %1,%%xmm2\n"
"\tmovdqu %2,%%xmm3\n"
@@ -474,15 +507,19 @@ gimp_composite_grain_extract_rgba8_rgba8_rgba8_sse2 (GimpCompositeContext *_op)
"\tpor %%xmm2,%%xmm1\n"
"\tmovdqu %%xmm1,%0\n"
: "+m" (*op.D)
: "m" (*op.A), "m" (*op.B)
: "=m" (*D)
: "m" (*A), "m" (*B)
: "%xmm1", "%xmm2", "%xmm3", "%xmm4");
op.A += 16;
op.B += 16;
op.D += 16;
A++;
B++;
D++;
}
for (; op.n_pixels >= 2; op.n_pixels -= 2)
a = (uint64 *) A;
b = (uint64 *) B;
d = (uint64 *) D;
for (; n_pixels >= 2; n_pixels -= 2)
{
asm volatile (" movq %1,%%mm2\n"
"\tmovq %2,%%mm3\n"
@@ -509,15 +546,15 @@ gimp_composite_grain_extract_rgba8_rgba8_rgba8_sse2 (GimpCompositeContext *_op)
"\tpor %%mm2,%%mm1\n"
"\tmovq %%mm1,%0\n"
: "+m" (*op.D)
: "m" (*op.A), "m" (*op.B)
: "=m" (*d)
: "m" (*a), "m" (*b)
: "%mm1", "%mm2", "%mm3", "%mm4");
op.A += 8;
op.B += 8;
op.D += 8;
a++;
b++;
d++;
}
if (op.n_pixels)
if (n_pixels > 0)
{
asm volatile (" movd %1, %%mm2\n"
"\tmovd %2, %%mm3\n"
@@ -534,8 +571,8 @@ gimp_composite_grain_extract_rgba8_rgba8_rgba8_sse2 (GimpCompositeContext *_op)
"\tpand %%mm0, %%mm2\n"
"\tpor %%mm2, %%mm1\n"
"\tmovd %%mm1, %0\n"
: "+m" (*op.D)
: "m" (*op.A), "m" (*op.B)
: "=m" (*d)
: "m" (*a), "m" (*b)
: "%mm1", "%mm2", "%mm3", "%mm4");
}
@@ -545,11 +582,17 @@ gimp_composite_grain_extract_rgba8_rgba8_rgba8_sse2 (GimpCompositeContext *_op)
void
gimp_composite_lighten_rgba8_rgba8_rgba8_sse2 (GimpCompositeContext *_op)
{
GimpCompositeContext op = *_op;
uint64 *d;
uint64 *a;
uint64 *b;
uint128 *D = (uint128 *) _op->D;
uint128 *A = (uint128 *) _op->A;
uint128 *B = (uint128 *) _op->B;
gulong n_pixels = _op->n_pixels;
asm volatile ("movq %0,%%mm0" : : "m" (*rgba8_alpha_mask_64) : "%mm0");
for (; op.n_pixels >= 4; op.n_pixels -= 4)
for (; n_pixels >= 4; n_pixels -= 4)
{
asm volatile (" movdqu %1, %%xmm2\n"
"\tmovdqu %2, %%xmm3\n"
@@ -561,15 +604,19 @@ gimp_composite_lighten_rgba8_rgba8_rgba8_sse2 (GimpCompositeContext *_op)
"\tpand %%xmm0, %%xmm3\n"
"\tpor %%xmm3, %%xmm1\n"
"\tmovdqu %%xmm1, %0\n"
: "=m" (*op.D)
: "m" (*op.A), "m" (*op.B)
: "=m" (*D)
: "m" (*A), "m" (*B)
: "%xmm1", "%xmm2", "%xmm3", "%xmm4");
op.A += 16;
op.B += 16;
op.D += 16;
A++;
B++;
D++;
}
for (; op.n_pixels >= 2; op.n_pixels -= 2)
a = (uint64 *) A;
b = (uint64 *) B;
d = (uint64 *) D;
for (; n_pixels >= 2; n_pixels -= 2)
{
asm volatile (" movq %1, %%mm2\n"
"\tmovq %2, %%mm3\n"
@@ -581,15 +628,15 @@ gimp_composite_lighten_rgba8_rgba8_rgba8_sse2 (GimpCompositeContext *_op)
"\tpand %%mm0, %%mm3\n"
"\tpor %%mm3, %%mm1\n"
"\tmovq %%mm1, %0\n"
: "=m" (*op.D)
: "m" (*op.A), "m" (*op.B)
: "=m" (*d)
: "m" (*a), "m" (*b)
: "%mm1", "%mm2", "%mm3", "%mm4");
op.A += 8;
op.B += 8;
op.D += 8;
a++;
b++;
d++;
}
if (op.n_pixels)
if (n_pixels > 0)
{
asm volatile (" movd %1, %%mm2\n"
"\tmovd %2, %%mm3\n"
@@ -601,8 +648,8 @@ gimp_composite_lighten_rgba8_rgba8_rgba8_sse2 (GimpCompositeContext *_op)
"\tpand %%mm0, %%mm3\n"
"\tpor %%mm3, %%mm1\n"
"\tmovd %%mm1, %0\n"
: "=m" (*op.D)
: "m" (*op.A), "m" (*op.B)
: "=m" (*d)
: "m" (*a), "m" (*b)
: "%mm1", "%mm2", "%mm3", "%mm4");
}
@@ -612,7 +659,13 @@ gimp_composite_lighten_rgba8_rgba8_rgba8_sse2 (GimpCompositeContext *_op)
void
gimp_composite_subtract_rgba8_rgba8_rgba8_sse2 (GimpCompositeContext *_op)
{
GimpCompositeContext op = *_op;
uint64 *d;
uint64 *a;
uint64 *b;
uint128 *D = (uint128 *) _op->D;
uint128 *A = (uint128 *) _op->A;
uint128 *B = (uint128 *) _op->B;
gulong n_pixels = _op->n_pixels;
asm volatile (" movq %0,%%mm0\n"
"\tmovdqu %1,%%xmm0\n"
@@ -620,7 +673,7 @@ gimp_composite_subtract_rgba8_rgba8_rgba8_sse2 (GimpCompositeContext *_op)
: "m" (*rgba8_alpha_mask_64), "m" (*rgba8_alpha_mask_128)
: "%mm0", "%xmm0");
for (; op.n_pixels >= 4; op.n_pixels -= 4)
for (; n_pixels >= 4; n_pixels -= 4)
{
asm volatile (" movdqu %1,%%xmm2\n"
"\tmovdqu %2,%%xmm3\n"
@@ -633,15 +686,19 @@ gimp_composite_subtract_rgba8_rgba8_rgba8_sse2 (GimpCompositeContext *_op)
"\tpand %%xmm0,%%xmm2\n"
"\tpor %%xmm2,%%xmm1\n"
"\tmovdqu %%xmm1,%0\n"
: "+m" (*op.D)
: "m" (*op.A), "m" (*op.B)
: "=m" (*D)
: "m" (*A), "m" (*B)
: "%xmm1", "%xmm2", "%xmm3", "%xmm4");
op.A += 16;
op.B += 16;
op.D += 16;
A++;
B++;
D++;
}
for (; op.n_pixels >= 2; op.n_pixels -= 2)
a = (uint64 *) A;
b = (uint64 *) B;
d = (uint64 *) D;
for (; n_pixels >= 2; n_pixels -= 2)
{
asm volatile (" movq %1,%%mm2\n"
"\tmovq %2,%%mm3\n"
@@ -653,15 +710,15 @@ gimp_composite_subtract_rgba8_rgba8_rgba8_sse2 (GimpCompositeContext *_op)
"\tpand %%mm0,%%mm2\n"
"\tpor %%mm2,%%mm1\n"
"\tmovq %%mm1,%0\n"
: "+m" (*op.D)
: "m" (*op.A), "m" (*op.B)
: "=m" (*d)
: "m" (*a), "m" (*b)
: "%mm1", "%mm2", "%mm3", "%mm4");
op.A += 8;
op.B += 8;
op.D += 8;
a++;
b++;
d++;
}
if (op.n_pixels)
if (n_pixels > 0)
{
asm volatile (" movd %1,%%mm2\n"
"\tmovd %2,%%mm3\n"
@@ -673,8 +730,8 @@ gimp_composite_subtract_rgba8_rgba8_rgba8_sse2 (GimpCompositeContext *_op)
"\tpand %%mm0,%%mm2\n"
"\tpor %%mm2,%%mm1\n"
"\tmovd %%mm1,%0\n"
: "+m" (*op.D)
: "m" (*op.A), "m" (*op.B)
: "=m" (*d)
: "m" (*a), "m" (*b)
: "%mm1", "%mm2", "%mm3", "%mm4");
}
@@ -803,15 +860,12 @@ gimp_composite_swap_rgba8_rgba8_rgba8_sse2 (GimpCompositeContext *_op)
asm("emms");
}
#endif /* ARCH_X86_64 || !PIC */
#endif /* __GNUC__ > 3 */
#endif /* defined(ARCH_X86) */
#endif /* defined(USE_SSE) */
#endif /* COMPILE_SSE2_IS_OKAY */
gboolean
gimp_composite_sse2_init (void)
{
#if defined(USE_SSE) && defined(ARCH_X86) && (defined(ARCH_X86_64) || !defined(PIC))
#ifdef COMPILE_SSE2_IS_OKAY
guint32 cpu = cpu_accel ();
if (cpu & CPU_ACCEL_X86_SSE2)

View File

@@ -9,6 +9,19 @@ extern gboolean gimp_composite_sse2_init (void);
*/
extern gboolean gimp_composite_sse2_install (void);
#if !defined(__INTEL_COMPILER)
#if defined(USE_SSE)
#if defined(ARCH_X86)
#if __GNUC__ >= 3
#if defined(ARCH_X86_64) || !defined(PIC)
#define COMPILE_SSE2_IS_OKAY (1)
#endif /* defined(ARCH_X86_64) || !defined(PIC) */
#endif /* __GNUC__ >= 3*/
#endif /* defined(ARCH_X86) */
#endif /* defined(USE_SSE) */
#endif /* !defined(__INTEL_COMPILER) */
#ifdef COMPILE_SSE2_IS_OKAY
extern void gimp_composite_addition_rgba8_rgba8_rgba8_sse2 (GimpCompositeContext *ctx);
extern void gimp_composite_darken_rgba8_rgba8_rgba8_sse2 (GimpCompositeContext *ctx);
extern void gimp_composite_difference_rgba8_rgba8_rgba8_sse2 (GimpCompositeContext *ctx);
@@ -18,3 +31,4 @@ extern void gimp_composite_subtract_rgba8_rgba8_rgba8_sse2 (GimpCompositeContext
extern void gimp_composite_swap_rgba8_rgba8_rgba8_sse2 (GimpCompositeContext *ctx);
extern void gimp_composite_dodge_rgba8_rgba8_rgba8_sse2 (GimpCompositeContext *ctx);
#endif
#endif

View File

@@ -19,7 +19,7 @@
int
gimp_composite_vis_test (int iterations, int n_pixels)
{
#if (__GNUC__ >= 3) && defined(USE_VIS) && defined(ARCH_SPARC)
#if defined(COMPILE_VIS_IS_OKAY)
GimpCompositeContext generic_ctx;
GimpCompositeContext special_ctx;
double ft0;
@@ -78,7 +78,7 @@ main (int argc, char *argv[])
putenv ("GIMP_COMPOSITE=0x1");
iterations = 1;
iterations = 10;
n_pixels = 1048593;
argv++, argc--;

View File

@@ -32,18 +32,14 @@
#include "gimp-composite.h"
#include "gimp-composite-vis.h"
#if defined(USE_VIS)
#if defined(ARCH_SPARC)
#if __GNUC__ >= 3
#ifdef COMPILE_VIS_IS_OKAY
#endif /* __GNUC__ > 3 */
#endif /* defined(ARCH_SPARC) */
#endif /* defined(USE_VIS) */
#endif
gboolean
gimp_composite_vis_init (void)
{
#ifdef ARCH_SPARC
#ifdef COMPILE_VIS_IS_OKAY
return (TRUE);
#else
return (FALSE);

View File

@@ -9,4 +9,12 @@ extern gboolean gimp_composite_vis_init (void);
*/
extern gboolean gimp_composite_vis_install (void);
#if defined(USE_VIS)
#if defined(ARCH_SPARC)
#if __GNUC__ >= 3
#define COMPILE_VIS_IS_OKAY (1)
#endif /* __GNUC__ > 3 */
#endif /* defined(ARCH_SPARC) */
#endif /* defined(USE_VIS) */
#endif

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