mirror of
https://gitlab.gnome.org/GNOME/gimp.git
synced 2025-10-06 01:12:40 +02:00
Compare commits
381 Commits
142b79b728
...
GIMP_2_8_4
Author | SHA1 | Date | |
---|---|---|---|
|
88ecd59c34 | ||
|
8a9af4cdd7 | ||
|
bd6c3468aa | ||
|
6852d01288 | ||
|
60c382ff70 | ||
|
de5267f185 | ||
|
549b3284d8 | ||
|
d2d8563e5e | ||
|
60f0feb65c | ||
|
d99881ab41 | ||
|
d824943b58 | ||
|
4b9af78336 | ||
|
6ee8d39b8c | ||
|
1122488403 | ||
|
f8c86702e9 | ||
|
b31fcbc0f1 | ||
|
6a39d21494 | ||
|
6dcd7c425e | ||
|
c87b59b95f | ||
|
adc8b21b0f | ||
|
5bd861330f | ||
|
db4c8239f3 | ||
|
67753516b7 | ||
|
67cb43963e | ||
|
121308ee7a | ||
|
8432800bdf | ||
|
6b017f97d4 | ||
|
fd5676230c | ||
|
29ca295089 | ||
|
2226e10b5e | ||
|
acebb4ad20 | ||
|
d90069f029 | ||
|
205c64d1b8 | ||
|
5818b9eac1 | ||
|
a2772a721f | ||
|
85fcef0c5c | ||
|
772c717216 | ||
|
e5cee5c56f | ||
|
b717e155d9 | ||
|
050fcb4b37 | ||
|
0d35348718 | ||
|
c6b81f2f4e | ||
|
95e400d597 | ||
|
4e428d923b | ||
|
34f70ad192 | ||
|
67a1f9e40c | ||
|
54ae57f290 | ||
|
6d10655c94 | ||
|
43a1daa5e1 | ||
|
9c36859511 | ||
|
d0bb5aea25 | ||
|
0e7d59af50 | ||
|
7fa86da96d | ||
|
7bbd29b182 | ||
|
a766aa9730 | ||
|
3291348ac6 | ||
|
606dad32b1 | ||
|
f63e5671ae | ||
|
982d08492f | ||
|
5db271cc52 | ||
|
d29f273566 | ||
|
908a71c4cf | ||
|
5860b2e844 | ||
|
acc610ec8a | ||
|
4bbdbb102f | ||
|
50c1e2d872 | ||
|
2a77d536aa | ||
|
e66252cc8a | ||
|
2873262fcc | ||
|
f3de4b4a24 | ||
|
901f396a5e | ||
|
28d42d3dd7 | ||
|
cfacd4f5a6 | ||
|
9d6e8e23df | ||
|
0029694f3c | ||
|
7e06c48a94 | ||
|
9cf76553bd | ||
|
b447b8e85f | ||
|
4f2d0c9ed1 | ||
|
3e72a9215e | ||
|
84461fd759 | ||
|
8c0fd99d89 | ||
|
855246391f | ||
|
fde801cb89 | ||
|
551679f7c4 | ||
|
edf5af1073 | ||
|
6ed49d3997 | ||
|
a8f96a5e3a | ||
|
7831da547a | ||
|
edb7125227 | ||
|
d9e83effd4 | ||
|
88a13a874a | ||
|
4187c415fb | ||
|
c465603540 | ||
|
9821dea3ca | ||
|
19b9ae79da | ||
|
b1a6ac7060 | ||
|
66b4aa2d34 | ||
|
e41e5ab643 | ||
|
f45349e74c | ||
|
bc2b0d117d | ||
|
65aa832148 | ||
|
55d4af3d6b | ||
|
31e2074ce3 | ||
|
f26e5cffe7 | ||
|
bbe007c8d7 | ||
|
ee38c196e2 | ||
|
8689c3108f | ||
|
d895ee7972 | ||
|
527d24bde3 | ||
|
384851f5ea | ||
|
f3c1186e5f | ||
|
0ed086d511 | ||
|
f9387909f3 | ||
|
e09233f080 | ||
|
9d74224731 | ||
|
e8a02362cd | ||
|
7172911bec | ||
|
defef370c4 | ||
|
023850bf0d | ||
|
75f470a56a | ||
|
634ae4a2cf | ||
|
e000f106bf | ||
|
d503425893 | ||
|
2cd165a8b8 | ||
|
4b46d7eb6d | ||
|
220af9ceec | ||
|
3b55877aca | ||
|
fef53f6064 | ||
|
2ba0519456 | ||
|
49debcafdc | ||
|
cb8cd73f33 | ||
|
ec9ed96fd7 | ||
|
72ae6656e7 | ||
|
cd6fa1d9c9 | ||
|
55792c2f30 | ||
|
8d6634c8eb | ||
|
bb1197ed63 | ||
|
d4cfda87ff | ||
|
b03591e405 | ||
|
7deac97a9a | ||
|
5f04bf2684 | ||
|
018a02d8da | ||
|
f7990128b0 | ||
|
a6c404d231 | ||
|
027c744227 | ||
|
0bd7875e5b | ||
|
5745a4fae2 | ||
|
4942105604 | ||
|
192ddf18e7 | ||
|
c1ed52275d | ||
|
b38d44220f | ||
|
2af0e14370 | ||
|
0d879c2aae | ||
|
c3eda35f10 | ||
|
61aa1ea510 | ||
|
991d42c85e | ||
|
844fc444b5 | ||
|
c56cf23c82 | ||
|
f628dcf49f | ||
|
5ab0215794 | ||
|
bae709d0a9 | ||
|
603ae6334b | ||
|
d4ebc9562d | ||
|
f3a4200e72 | ||
|
f0dae90f23 | ||
|
029d9ab9a5 | ||
|
e2915eba7c | ||
|
06342f26c9 | ||
|
e2059dde74 | ||
|
0e2bce2b82 | ||
|
20449b1176 | ||
|
2fb04eaeea | ||
|
b8cd7348cc | ||
|
2b5edbabd2 | ||
|
b142ec6a35 | ||
|
4364989869 | ||
|
ebe673ea49 | ||
|
625431db60 | ||
|
06439dea64 | ||
|
b07473775a | ||
|
dc5aa9adbe | ||
|
f6c08d94bd | ||
|
2f274f0904 | ||
|
1fbdd50249 | ||
|
d812886cdf | ||
|
69397a4c0c | ||
|
a42a02e1a7 | ||
|
1ba763e1dc | ||
|
846ce09b83 | ||
|
92d400a239 | ||
|
fef532a108 | ||
|
f3788ae9c3 | ||
|
2048d65ac1 | ||
|
037af495ad | ||
|
d16776ecb6 | ||
|
06835ad73c | ||
|
4e46009b6b | ||
|
6b642a26da | ||
|
4347b3496a | ||
|
a21aceedf1 | ||
|
89f4c4042f | ||
|
a605d0c4d5 | ||
|
3db516f1e7 | ||
|
24130eec55 | ||
|
bf9f91923c | ||
|
f63d58a554 | ||
|
31ef6fb398 | ||
|
b35c3381b1 | ||
|
47b0212a77 | ||
|
b91f60602a | ||
|
15c8b3f850 | ||
|
209116fcad | ||
|
92f348a96c | ||
|
977311dff8 | ||
|
3445d5f214 | ||
|
7fd0895c0c | ||
|
64b1ade7b0 | ||
|
67525e4c6b | ||
|
7d985af68f | ||
|
d400813027 | ||
|
049258a701 | ||
|
757b5709e4 | ||
|
5f646592a2 | ||
|
cff132d90b | ||
|
cab6d84867 | ||
|
d6091dbce6 | ||
|
0a450f8e22 | ||
|
7506a26940 | ||
|
a56ae5a82d | ||
|
f4ce57aa97 | ||
|
8057908853 | ||
|
a125d8dacc | ||
|
862bbb829f | ||
|
c3e904fab1 | ||
|
d8e71085cc | ||
|
d363043370 | ||
|
40deca6c04 | ||
|
ee4a81d418 | ||
|
917e2f9c90 | ||
|
5d2933c51c | ||
|
05da156b30 | ||
|
2b6bdfaa04 | ||
|
dca5b0896b | ||
|
b874c8af1e | ||
|
ec6db4b994 | ||
|
d8b4de413a | ||
|
8a0e26773c | ||
|
bf503ea7dd | ||
|
313ef397cd | ||
|
8f2246578d | ||
|
f3085d2879 | ||
|
b99e80dc90 | ||
|
416dfc4584 | ||
|
8be0541df5 | ||
|
bf8e42330b | ||
|
df1752f287 | ||
|
6a5b3b61d7 | ||
|
b16aab1e8e | ||
|
9eb45ed8d7 | ||
|
310a8c4458 | ||
|
d81669a671 | ||
|
687fbf4583 | ||
|
8ec18b847c | ||
|
6b63e85a88 | ||
|
a4ecfde635 | ||
|
7212f9973d | ||
|
9783b68d0f | ||
|
0ba99a05ff | ||
|
03f0a1ab57 | ||
|
41ce828243 | ||
|
2fb8ede280 | ||
|
25127e10ad | ||
|
df394ffae0 | ||
|
77db64913d | ||
|
4cd5a2fb22 | ||
|
242d71fd73 | ||
|
8a85b907ff | ||
|
954f72e4f9 | ||
|
d405dbb5ef | ||
|
e2a6c5974a | ||
|
0474376d23 | ||
|
0e31638588 | ||
|
1bf4f74ca5 | ||
|
b121388b03 | ||
|
208e04c66c | ||
|
81b03011ab | ||
|
b3e9473efa | ||
|
c3bf36f3d6 | ||
|
bf7fa23beb | ||
|
5ac0d10aad | ||
|
c66b8c984c | ||
|
e608b47ce8 | ||
|
3019fdc3fb | ||
|
43d2b59849 | ||
|
df53bc6646 | ||
|
8b0cbad26f | ||
|
b02b78bffc | ||
|
9ce8d4fae2 | ||
|
668891e745 | ||
|
20c4a131c5 | ||
|
b803915631 | ||
|
1c910a1b78 | ||
|
3e5cc6ca50 | ||
|
3c6c85c33e | ||
|
5462f0bca0 | ||
|
b50145fb1a | ||
|
354365857e | ||
|
4437b90b63 | ||
|
0008be8484 | ||
|
37a884a31b | ||
|
ca5549a55e | ||
|
91665198d4 | ||
|
74c20f2222 | ||
|
a4fb9692ae | ||
|
e2ad99b98e | ||
|
75ac9cc230 | ||
|
ae741b527b | ||
|
6b54e919f4 | ||
|
8a6be41891 | ||
|
09e80d1a63 | ||
|
6899757b09 | ||
|
187e20f367 | ||
|
4fdb1ec90a | ||
|
c8a3a4f19e | ||
|
a807095434 | ||
|
088c05e77f | ||
|
f6ae4c83ae | ||
|
2a88a5ce02 | ||
|
0b14297f0a | ||
|
741daccf02 | ||
|
be2feeb111 | ||
|
82533e7734 | ||
|
942860ae32 | ||
|
29dbea042e | ||
|
8dc87ae32f | ||
|
780e88c353 | ||
|
0e5e5c912b | ||
|
8d6004e063 | ||
|
d137a44af3 | ||
|
d8f535cc3c | ||
|
1e402a46f0 | ||
|
601db43838 | ||
|
70ca141159 | ||
|
36bb8a625b | ||
|
ef9972da7a | ||
|
5a241911b5 | ||
|
a23a5692cc | ||
|
d8ce061715 | ||
|
e87b912d70 | ||
|
46127dc789 | ||
|
cb2de50697 | ||
|
f8bcdcb9a5 | ||
|
fa8a5a63ab | ||
|
e5ef544559 | ||
|
97eaae4430 | ||
|
136cea976f | ||
|
097ed17822 | ||
|
d661bc3403 | ||
|
c3d43d8378 | ||
|
062d38d141 | ||
|
c4d14752a7 | ||
|
8af18fb9d5 | ||
|
7f37903b11 | ||
|
562862a486 | ||
|
8ec5e86514 | ||
|
a7c57d016f | ||
|
7ef8a96465 | ||
|
32a0c6355e | ||
|
1421545bd6 | ||
|
df1e7763fa | ||
|
4c66e50763 | ||
|
862865e379 | ||
|
f5b184d0d7 | ||
|
4be1d3471b | ||
|
547e9ee713 | ||
|
5b59af7c2e | ||
|
569c122137 | ||
|
f32706a0d1 | ||
|
f7cffc0d6c | ||
|
7757edd702 |
3
AUTHORS
3
AUTHORS
@@ -145,6 +145,7 @@ The following people have contributed code to GIMP:
|
||||
Tom Lechner
|
||||
Elliot Lee
|
||||
Marc Lehmann
|
||||
Simone Karin Lehmann
|
||||
Ray Lehtiniemi
|
||||
Tobias Lenz
|
||||
Frederic Leroy
|
||||
@@ -267,6 +268,7 @@ The following people have contributed code to GIMP:
|
||||
Brion Vibber
|
||||
Helvetix Victorinox
|
||||
Thorsten Vollmer
|
||||
Clayton Walker
|
||||
Rebecca Walter
|
||||
Martin Weber
|
||||
Rupert Weber
|
||||
@@ -299,6 +301,7 @@ The following people have contributed art to GIMP:
|
||||
Mike Schaeffer
|
||||
Carol Spears
|
||||
Jakub Steiner
|
||||
Bernhard Stockmann
|
||||
William Szilveszter
|
||||
|
||||
|
||||
|
9
HACKING
9
HACKING
@@ -88,14 +88,13 @@ part of recent Linux distribution releases.
|
||||
Patches
|
||||
-------
|
||||
|
||||
The best way to submit patches is to publish your git repository and
|
||||
ask developers to git-fetch from you.
|
||||
The best way to submit patches is to provide files created with
|
||||
git-format-patch.
|
||||
|
||||
For bug fixes where the patch is small you can file a bug report at
|
||||
It is recommended that you file a bug report at
|
||||
http://bugzilla.gnome.org/ and attach your patch to it as a plain text
|
||||
file, not compressed. If your patch is reasonably small you can submit
|
||||
it to the gimp-developer@lists.xcf.berkeley.edu mailing list. You can
|
||||
create the patch file with git-format-patch
|
||||
it to the gimp-developer-list@gnome.org mailing list.
|
||||
|
||||
If the patch needs to be discussed, you should also consider using the
|
||||
mailing list instead of Bugzilla because bug reports tend to be hard
|
||||
|
636
NEWS
636
NEWS
@@ -7,637 +7,101 @@ This is the stable branch of GIMP. No new features are being added
|
||||
here, just bug-fixes.
|
||||
|
||||
|
||||
Changes in GIMP 2.8.0
|
||||
=====================
|
||||
Overview of Changes from GIMP 2.8.2 to GIMP 2.8.4
|
||||
=================================================
|
||||
|
||||
|
||||
Core:
|
||||
|
||||
- Add our own GimpOperationBrightnessContrast because GEGL one is different
|
||||
- Move the OSX gimpdir to "~/Library/Application Support"
|
||||
|
||||
|
||||
Plug-ins:
|
||||
GUI:
|
||||
|
||||
- Fix some GFig rendering issues
|
||||
|
||||
|
||||
Source and build system:
|
||||
|
||||
- Depend on Babl 0.1.10, GEGL 0.2.0 and some other new library versions
|
||||
|
||||
|
||||
General:
|
||||
|
||||
- Bug fixes
|
||||
- Translation updates
|
||||
|
||||
|
||||
Changes in GIMP 2.7.5
|
||||
=====================
|
||||
|
||||
|
||||
UI:
|
||||
|
||||
- Minor application menu fixes on the Mac
|
||||
- Make the toolbox arbitrarily resizable again
|
||||
- Add axis labels to the dynamics curves to make them more obvious
|
||||
- Fix dockable showing to do the right thing in both MWM and SWM
|
||||
- Fix some glitches in the tool preset UI, like proper sensitivity
|
||||
|
||||
|
||||
Core:
|
||||
|
||||
- Restore autoshrink functionality in the rectangle tools
|
||||
- Allow smudge to work with dynamic brushes
|
||||
- Make sure tool presets and tool options are consistent after loading
|
||||
- Add automatic tags for the folders a file lives in
|
||||
- Make the default Quick Mask color configurable
|
||||
- Fix Color Balance so the "range" setting actually makes a difference
|
||||
|
||||
|
||||
Plug-ins:
|
||||
|
||||
- Proper toplevel item sorting in the help browser
|
||||
- Use libraries instead of launching programs in file-compressor
|
||||
- Use the Ghostscript library instead of launching ghostscript
|
||||
- Allow to switch off antialiasing when importing from PDF
|
||||
- Embed the page setup in the main print dialog
|
||||
- Port Gfig to cairo
|
||||
- Better names for the default filters in save and export
|
||||
- Make tool drawing (esp. the brush outline) much more responsive
|
||||
- Remember the "maximized" state across sessions
|
||||
- Simplify the splash image code a lot, makes it appear immediately again
|
||||
- Allow the text tool to start on an image without layers
|
||||
- Various fixes for text style attribute handling
|
||||
- Set unconfigured input devices to eraser if GTK+ says they are erasers
|
||||
- Make language selectable in Preferences on OSX
|
||||
|
||||
|
||||
Libgimp:
|
||||
|
||||
- Add PDB API to modify a lot of paint and ink options
|
||||
- Make libgimp drawable combo boxes aware of layer groups
|
||||
- Make sure plug-in windows appear on top on OSX
|
||||
- Fix item width in GimpPageSelector (used e.g. in PDF import)
|
||||
|
||||
|
||||
Data:
|
||||
Plug-ins:
|
||||
|
||||
- Add a new set of default brushes and tool presets from Ramon Miranda
|
||||
- Better default values in the Drop Shadow script
|
||||
- Fix a whole bunch of bugs in the BMP plug-in
|
||||
- On OSX, use the system's screenshot utility
|
||||
|
||||
|
||||
Developer documentation:
|
||||
Installer:
|
||||
|
||||
- Update everything including app/ so all functions appear again
|
||||
- Add Brazilian-Portuguese translation to the Windows installer
|
||||
|
||||
|
||||
Source and build system:
|
||||
|
||||
- Remove the unmaintained makefile.msc build system
|
||||
- Explicitly link plug-ins to -lm when needed
|
||||
- Also create .xz tarballs
|
||||
- Many improvements to the OSX bundle build system
|
||||
- Support automake 1.13
|
||||
|
||||
|
||||
General:
|
||||
|
||||
- Lots of bug fixes
|
||||
- Tons and tons of translation updates
|
||||
- Lots of translation updates
|
||||
|
||||
|
||||
Changes in GIMP 2.7.4
|
||||
=====================
|
||||
|
||||
|
||||
UI:
|
||||
|
||||
- Add a close button to image tabs in single-window mode
|
||||
- Improve the transform tools' undo strings to be more descriptive
|
||||
- Render the layer's "eye" icon in inconsistent state if the layer is
|
||||
visible, but one of its parents isn't
|
||||
- Add proper stacking for canvas items, so things don't hide each other
|
||||
- Make sure single-window-mode and multi-window-mode are always saved
|
||||
consistently in sessionrc
|
||||
Overview of Changes from GIMP 2.8.0 to GIMP 2.8.2
|
||||
=================================================
|
||||
|
||||
|
||||
Core:
|
||||
|
||||
- Fix "render_image_tile_fault: assertion `tile[4] != NULL' failed"
|
||||
warnings that occurred for some image sizes
|
||||
- Fix attachment of the floating selection when the gegl projection
|
||||
is enabled
|
||||
- Replace heal algorithm with a new one by Jean-Yves Couleaud that
|
||||
works much better
|
||||
- Make resource sub-folders show up in UI as tags, allowing users
|
||||
to easily locate resource collections they may have installed
|
||||
- Fix graphics tablet canvas interaction by moving from
|
||||
gdk_pointer_grab() to gtk_grab_add() for most grabs
|
||||
- Stop using motion hints, they are a concept from the dark ages
|
||||
- Make tag matching always case-insensitive
|
||||
- Let the tile-cache-size default to half the physical memory
|
||||
|
||||
|
||||
GUI:
|
||||
|
||||
- Mention that the image was exported in the close warning dialog
|
||||
- Make sure popup windows appear on top on OSX
|
||||
- Allow file opening by dropping to the OSX dock
|
||||
- Fix the visibility logic of the export/overwrite menu items
|
||||
- Remove all "Use GEGL" menu items, they only add bugs and zero function
|
||||
- Improve performance of display filters, especially color management
|
||||
- Fix the image window title to comply with the save/export spec
|
||||
and use the same image name everywhere, not only in the title
|
||||
- Fix positioning of pasted/dropped stuff to be more reasonable
|
||||
|
||||
|
||||
Libgimp:
|
||||
|
||||
- Add a basic paint dynamics PDB interface
|
||||
- Move gimpdir and thumbnails to proper locations on OSX
|
||||
- Implement relocation on OSX
|
||||
- Allow to use $(gimp_installation_dir) in config files
|
||||
|
||||
|
||||
Plug-ins:
|
||||
|
||||
- Make writing color space information to BMP files optional
|
||||
- PSD loader now reads and imports working paths
|
||||
|
||||
|
||||
Script-Fu:
|
||||
|
||||
- Lots and lots of undeprecations
|
||||
|
||||
|
||||
Developer documentation:
|
||||
|
||||
- Add devel-docs/gegl-porting-plan.txt
|
||||
- Fix remembering of JPEG load/save defaults
|
||||
- Revive the page setup dialog on Windows
|
||||
|
||||
|
||||
Source and build system:
|
||||
|
||||
- Make git-version.h generation work in shallow git clones
|
||||
- Modernize use of autotools a bit, maintainer-mode and pdbgen
|
||||
are now enabled by default
|
||||
- Add Windows installer infrastructure
|
||||
- Add infrastructure to build GIMP.app on OSX
|
||||
|
||||
|
||||
General:
|
||||
|
||||
- Make gimptool install scripts in the correct system-wide directory
|
||||
- Fix lots and lots of stuff found by static code analysis
|
||||
|
||||
|
||||
Changes in GIMP 2.7.3
|
||||
=====================
|
||||
|
||||
|
||||
UI:
|
||||
|
||||
- Use GimpSpinScales instead of scale entries in all dockable widgets
|
||||
- Allow the spin scale to control a range larger than its scale's range
|
||||
- Implement RTL mode in GimpSpinScale
|
||||
- Add lots of tooltips to tool options
|
||||
- Allow to drop more things to the empty image window, and simply
|
||||
create new images from them
|
||||
- Cage tool: allow to add handle to the cage when clicking on an edge
|
||||
- Cage tool: allow to remove selected handles from the cage by hitting delete
|
||||
- Remember column widths in multi-column dock windows
|
||||
- Support starting GIMP in single-window mode
|
||||
- When the brush is shared among paint tools, also share all
|
||||
brush-modifying paint options
|
||||
- Use ALT+number and ALT+Tab shortcuts to navigate between images
|
||||
in both single- and multi-window mode
|
||||
- Make 'Export to' always activatable and fall back to 'Export...' if
|
||||
no export target has been set yet
|
||||
- In single-window mode, add new dockable dialogs to the image window
|
||||
instead of in a new window
|
||||
- When switching on single-window mode, put docks in the image window
|
||||
depending on what side of the window they originally had
|
||||
- When switching off single-window mode, distribute dock windows
|
||||
better
|
||||
- Add a canvas item for the transform grid, fixing a major speed
|
||||
regression, and add the same guides options as in the rectangle tools
|
||||
- Don't unmaximize the single-window mode image window when closing
|
||||
images
|
||||
- Resurrect the "You can drop dockable dialogs here" help string
|
||||
below the toolbox
|
||||
- Make pick-and-move with the Move Tool work for layers in a layer
|
||||
group
|
||||
|
||||
|
||||
Core:
|
||||
|
||||
- Add GimpMotionBuffer which abstracts away stroke smoothing behind
|
||||
a simple API and takes it out of GimpDisplayShell
|
||||
- Add a GimpIdTable utility class
|
||||
- Add a GimpDockContainer interface
|
||||
- Add a GimpSessionManaged interface
|
||||
- Add GimpCanvasRectangleGuides which makes the rectangle tool's
|
||||
guides draw properly
|
||||
|
||||
|
||||
Libgimp:
|
||||
|
||||
- Make libgimp depend on GdkPixbuf
|
||||
- Add API to create layers from cairo surfaces
|
||||
- Make it impossible to include individual files from any GIMP
|
||||
library. This was always forbidden and designed so it most
|
||||
probably breaks, but now it reliably breaks using #error
|
||||
- Deprecate the "set_sensitive" logic and use g_object_bind_property()
|
||||
|
||||
|
||||
Plug-ins:
|
||||
|
||||
- Use poppler's cairo API to load PDFs, the pixbuf API is removed
|
||||
- Port screenshot from GdkPixbuf to cairo
|
||||
- Fix the annoying parser build warnings in imagemap
|
||||
- Add a check-for-deprecated-procedures-in-script-fu make target
|
||||
- Update libpng code to not use deprecated API (file-mng and file-png)
|
||||
- Add an Item class to pygimp
|
||||
- Correct/update some labels and defaults in the JPEG plug-in's save dialog UI
|
||||
- Fix "Bug 596410 - gimp-image-get-filename returns NULL for imported files"
|
||||
|
||||
|
||||
Developer documentation:
|
||||
|
||||
- Many updates
|
||||
|
||||
|
||||
Source and build system:
|
||||
|
||||
- Make cairo a global dependency, starting at libgimpcolor
|
||||
- Require poppler >= 0.12.4
|
||||
- Remove gimp-remote for good, it has been disabled for years
|
||||
|
||||
|
||||
General:
|
||||
|
||||
- Some more undeprecations now that we use GTK+ 2.24
|
||||
- Fix lots of warnings that are new in -Wall in GCC 4.6
|
||||
- Lots of bug fixes and cleanup
|
||||
- Lots of translation updates
|
||||
|
||||
|
||||
Changes in GIMP 2.7.2
|
||||
=====================
|
||||
|
||||
|
||||
UI:
|
||||
|
||||
- A lot of undeprecations due to GTK+ 2.22 and 2.24
|
||||
- Lots and lots of cairo porting, calls to gdk_draw_* are gone
|
||||
- Merge the cage transform tool from GSoC
|
||||
- Remove the old bitmap cursors completely and always use RGBA cursors
|
||||
also for compat cursors for old X servers
|
||||
- Add new GimpCanvasItem infrastructure with subclasses for everything
|
||||
that needs to be drawn on the canvas and port all tools to canvas items,
|
||||
this is a huge change that touches all tools and almost all display
|
||||
code, and which finally gets rid of XOR drawing altogether
|
||||
- Switch from purely idle-rendering the display to something that ensures
|
||||
a minimum framerate, so we don't fail to update under heavy load
|
||||
- Make the text tool handle RTL mode better
|
||||
- Change GimpColorMapEditor to use the newly added proxy GimpPalette
|
||||
- Replace the brush scale control in tool options by a brush size
|
||||
one that works in pixels, and does the right thing when the brush
|
||||
changes
|
||||
- Add new widget GimpSpinScale which is a scale with number entry,
|
||||
and use it in all tool options
|
||||
- Make the brush, pattern etc. selectors in tool options more
|
||||
compact and allow to directly jump to the editor dialogs
|
||||
- Make handle sizes in tools consistent
|
||||
- Add an on-canvas progress and use it for tool progress instead of
|
||||
the statusbar
|
||||
- Add a new GimpToolPalette class with lots of code that was
|
||||
in GimpToolBox
|
||||
- Allow to properly drop into and after a layer group
|
||||
- Refactor and clean up the dynamics editor widget, and add colors
|
||||
for the curves
|
||||
- Add support for F2 to rename items in lists
|
||||
- Clean up GimpDeviceStatus internally and visually
|
||||
- Allow to set GimpToolPreset's icon using the new GimpIconPicker widget
|
||||
- Make the text tool's style overlay show default values from the
|
||||
text object if there is no style active at the cursor position/selection
|
||||
- Show the the text size's unit in the text style overlay
|
||||
- Make tool dialogs transient to the image window again
|
||||
- Consistently add a "gimp-" prefix to all window roles
|
||||
- Make the preset buttons in tool options work on the global tool
|
||||
presets instead of the removed per-tool preset lists
|
||||
- Add GimpControllerMouse, which allows to bind extra mouse buttons to
|
||||
arbitrary actions
|
||||
|
||||
|
||||
Core:
|
||||
|
||||
- Add uniform API to turn any GimpItem's outline into a selection
|
||||
- Add support for color tags in text layers
|
||||
- Remove the selection_control() stuff from GimpImage and with it
|
||||
maybe last piece of UI code still not properly separated
|
||||
- Add more validation code for XCF loading
|
||||
- Add accessors to GimpPalette and use them globally
|
||||
- Keep a proxy GimpPalette around for the image's colormap
|
||||
- Don't scale SVGs when pasting or importing them
|
||||
- A lot of changes to the input device handling code, partly
|
||||
merged from the gtk3-port branch, add GimpDeviceManager class
|
||||
- Add smoothing of paint strokes
|
||||
- Fix display filters to work on a cairo surface
|
||||
- Fix and enhance GimpImage's URI/filename handling API
|
||||
- Unset "removed" flag on items when they get added back to
|
||||
the image from the undo stack
|
||||
- Change item creation to properly use GObject properties and
|
||||
remove item_configure() and drawable_configure()
|
||||
- Refactor tool event handling and move lots of stuff into
|
||||
utility functions
|
||||
- Clean up GimpViewRenderer API
|
||||
- Implement transforms on group layers
|
||||
- Clean up the transform tool a lot, and refactor away old junk
|
||||
- Tool and tool event cleanup: enforce tool activate/halt invariants,
|
||||
consistently shutdown all tools in control(HALT), and many other
|
||||
tool fixes
|
||||
- Remove GimpToolPresets object, this functionality got merged into
|
||||
the new GimpToolPreset system
|
||||
- Rename GimpFilteredContainer to GimpTaggedContainer and add a new
|
||||
GimpFilteredContainer parent class which is a generic filter
|
||||
- Remove the concept of an "offset" from TileManager and instead
|
||||
pass around the offsets explicitly when needed, like when
|
||||
transforming
|
||||
- Move GimpBezier desc from vectors/ to core/ and add API to create
|
||||
one from sorted BoundSegs
|
||||
- Change GimpBrush boundary API to return a GimpBezierDesc
|
||||
- Add GimpBrushCache object and use it to cache a brush's transformed
|
||||
pixels and its outline, remove the caching code from GimpBrushCore
|
||||
- Add GimpBezierDesc based API to GimpScanConvert and use it
|
||||
|
||||
|
||||
GEGL:
|
||||
|
||||
- Add operations and gegl infrastructure for the cage tool
|
||||
- Disable View -> Use GEGL as we will not have time to finish the
|
||||
GEGL projection code for GIMP 2.8
|
||||
|
||||
|
||||
Libgimp:
|
||||
|
||||
- Introduce an "item" type in the PDB and libgimp and deprecate
|
||||
lots of old API in favor of item API
|
||||
- Add procedures to create, traverse and manipulate layer trees
|
||||
- Add more state to the context API, and deprecate functions with
|
||||
too many parameters in favor of simpler ones that use context states,
|
||||
particularly the entire transform and selection API
|
||||
- Move GimpUnitStore and GimpUnitComboBox to libgimpwidgets, and
|
||||
use them in GimpSizeEntry, deprecate GimpUnitMenu.
|
||||
- Deprecate gimp_min_colors() and gimp_install_cmap()
|
||||
- Add API that enables GimpRuler to track motion events by itself
|
||||
- Add new selection API and deprecate all old selection functions
|
||||
- Move around and rename all parasite functions, deprecate the old ones
|
||||
- Add a generated PDB file in the "gimp" namespace and get rid
|
||||
of "gimpmisc"
|
||||
- Add unit conversion functions to libgimpbase
|
||||
- Add function to reset a plug-in's context to default values
|
||||
|
||||
|
||||
Plug-ins:
|
||||
|
||||
- Make script-fu server IPv6 aware
|
||||
- Follow libgimp deprecations in plug-ins and scripts
|
||||
- Add PDF export plugin
|
||||
- Lots of cairo porting here too
|
||||
- UTF-8 fixes in script-fu
|
||||
- Set the progress to 1.0 when done
|
||||
- Merge a lot of upstream fixes into script-fu's Tinyscheme
|
||||
- Add "New Layer" option to MapObject
|
||||
- Support loading of 16-bit raw PPM files
|
||||
- Add web-page, a new plug-in which renders images of web pages
|
||||
- Fix some more plug-ins to not warn if applied on an empty region
|
||||
|
||||
|
||||
Data:
|
||||
|
||||
- Remove "Untitled" from palette names entries
|
||||
|
||||
|
||||
Developer documentation:
|
||||
|
||||
- Move libgimp documentation from templates to inline comments
|
||||
- Generate standard deprecated sections
|
||||
|
||||
|
||||
Source and build system:
|
||||
|
||||
- Add more code documentation
|
||||
- Add more unit tests and refactor existing ones to use global
|
||||
test utility functions
|
||||
- Add a manifest to executables (app and plug-ins, Win32)
|
||||
- Depend on GLib 2.28, GTK+ 2.24, Cairo 1.10
|
||||
- Make WebKit available to all plug-ins, not just the help browser
|
||||
- Run UI tests on Xvfb if available
|
||||
- Check for GdkPixbuf separately because it's now a separate library
|
||||
- Allow tests to use uninstalled plug-ins from the build dir
|
||||
- Remove, comment out, or build for GIMP_UNSTABLE some stuff that
|
||||
should not be in a stable release
|
||||
|
||||
|
||||
General:
|
||||
|
||||
- Improve safety on Win32 by calling SetDllDirectory() and
|
||||
SetProcessDEPPolicy()
|
||||
- Switch from GtkObject::destroy() to GObject::dispose() all over
|
||||
the place
|
||||
- Various changes that make maintaining the gtk3-port branch easier,
|
||||
such as s/GtkAnchorType/GimpHandleAnchor/ and s/GtkObject/GtkAdjustment/
|
||||
- Don't use gtk_container_add() for adding to GtkBoxes
|
||||
- Inherit from GtkBox directly, not from GtkHBox/GtkVBox
|
||||
- Add namespace to the ink blob types and functions
|
||||
- Remove all useless calls to gtk_range_set_update_policy()
|
||||
- Use GObject::constructed() instead of GObject::constructor() all
|
||||
over the place
|
||||
- Move more members to private and add accessors for them
|
||||
- Stop using GdkNativeWindow, use guint32 instead
|
||||
- Plug memory leaks
|
||||
- Remove ps-menurc, we are not a PS clone
|
||||
- Use the new g_[s]list_free_full() instead of foreach() and free()
|
||||
- Don't use newly deprecated GTK+ API
|
||||
- Use the new GDK_KEY_foo key names
|
||||
- Lots of bug fixes and cleanup
|
||||
- Lots of translation updates
|
||||
|
||||
|
||||
Changes in GIMP 2.7.1
|
||||
=====================
|
||||
|
||||
|
||||
UI:
|
||||
|
||||
- Add "lock content" button to the layers, channels and paths dialogs,
|
||||
make the lock buttons more compact
|
||||
- Refuse to edit locked items
|
||||
- Add support for layer groups
|
||||
- Improve internals and GUI of the save/export functionality
|
||||
- Move the shortcut dialog's "clear" button into the entry
|
||||
- Clean up UI code by introducing GimpDockWindow and GimpImageWindow
|
||||
classes
|
||||
- Support multi-column dock windows
|
||||
- Get rid of docking bars, use highlights in existing widget hierarchy instead
|
||||
- Remove toolbox-window-hint gimprc setting and use dock-window-hint
|
||||
for both toolbox and docks instead
|
||||
- Move GimpDock::default-height style property to GimpDockWindow
|
||||
- Polish save+export path-part precedence rules
|
||||
- Merge the GSoC 2009 Advanced GUI for Brush Dynamics project
|
||||
- Default to non-fixed-aspect in Canvas Size dialog
|
||||
- Add a still incomplete and Single-window mode
|
||||
- Have an Export button, not Save, in export dialogs
|
||||
- Improve Free Select Tool handle highlighting
|
||||
- Support changing user interface language from preferences
|
||||
- Update ps-menurc with PS CS4 keyboard shortcuts
|
||||
- Reduce spacing around canvas and use it for the canvas itself
|
||||
- Put name of active dockables in dock window titles
|
||||
- Don't have Toolbox in list of Recently Closed Docks, handle that
|
||||
directly in the Windows menu
|
||||
- Support selecting and tagging multiple objects in resource lists
|
||||
- Improve on-canvas text editing and text attribute setting
|
||||
- Add GimpContainerTreeStore and use it in all GtkTreeStore based views
|
||||
- Add a new default "automatic" tab style that makes sure dockable tabs
|
||||
always show as much detail as possible
|
||||
- Remove the dockable title bar and add the menu arrow button next to the
|
||||
notebook tabs
|
||||
- Add an icon for the desaturate tool
|
||||
- Add 'Rule of fifths' crop guide overlay
|
||||
- Make Alt+Click on layers not affect active layer
|
||||
|
||||
|
||||
Core:
|
||||
|
||||
- Make all GimpItems lockable so their contents can't be changed
|
||||
- Make more sense when naming imported layers
|
||||
- Make group layers work except for layer masks and save them in
|
||||
the XCF
|
||||
- Change GimpProjectable::update to GimpProjectable:invalidate
|
||||
- Make sure we don't mix font backends (and crash) by explicitly
|
||||
asking for FT/Fontconfig backends
|
||||
- Move members of GimpObject to a private struct
|
||||
- gimp_object_get_name() takes a gconstpointer now, remove casts
|
||||
from all callers
|
||||
- Let drawables connect to their floating selection's "update" signal
|
||||
instead of letting the image do this job
|
||||
- Fix brush rotation artifacts at even 90 degree rotation
|
||||
- Don't leak shared tile memory on Solaris
|
||||
- Add a PDB procedure to access a text layer's markup
|
||||
- Remove legacy cruft from pdbgen and make sure number ranges are correct
|
||||
- Move all image creation functions to a common file
|
||||
- Add translation context to all undo descriptions
|
||||
|
||||
|
||||
GEGL:
|
||||
|
||||
- Make sure all nodes are added to their resp. graphs
|
||||
- Use GEGL for layer scaling if use-gegl is TRUE
|
||||
|
||||
|
||||
Plug-ins:
|
||||
|
||||
- Updated script-fu's scheme to latest upstream fixes
|
||||
- Don't store image-specific print settings globally
|
||||
- Add fundamental OpenRaster (.ora) import and export support
|
||||
- Add RGB565 support to the csource plug-in
|
||||
|
||||
|
||||
Data:
|
||||
|
||||
- Add texture/grunge brushes made by Johannes Engelhardt
|
||||
|
||||
|
||||
Developer documentation:
|
||||
|
||||
- Explain GimpContext
|
||||
- Add SVG graphic with GIMP application core module dependencies
|
||||
- Add a schedule for 2.8 development
|
||||
|
||||
|
||||
Source and build system:
|
||||
|
||||
- Add more code documentation
|
||||
- Clean up subsystem linking dependencies in app/
|
||||
- Add unit testing framework in app/tests/ and some basic tests,
|
||||
including basic UI tests and XCF tests
|
||||
- Tentatively introduce usage of using Glade + GtkBuilder
|
||||
- Depend on GLib 2.24.0 and GTK+ 2.20.0
|
||||
- Add git commit hash in --verbose --version output
|
||||
- Don't version control gtk-doc.m4, get it from gtkdocize
|
||||
- Add GimpObject tracking code
|
||||
- Plug memory leaks
|
||||
- Lots of bug fixes and cleanup
|
||||
- Lots of translation updates
|
||||
|
||||
|
||||
Changes in GIMP 2.7.0
|
||||
=====================
|
||||
|
||||
UI:
|
||||
- Change the Text Tool to perform text editing on-canvas (GSoC 2008)
|
||||
and add the ability to mix different text styles in the same layer
|
||||
- Add support for tagging GIMP resources such as brushes and allow
|
||||
filtering based on these tags (GSoC 2008)
|
||||
- Separate the activities of saving an image and exporting it, there is
|
||||
now a 'File->Export...' for example
|
||||
- Port file plug-ins to new export API which gets rid of many
|
||||
annoying export dialogs
|
||||
- Add a simple parser to size entry widgets, images can be scaled
|
||||
to e.g. "50%" or "2 * 37px + 10in"
|
||||
- Arrange layer modes into more logical and useful groups
|
||||
- Added support for rotation of brushes
|
||||
- Make the Pointer dockable show information about selection position
|
||||
and size
|
||||
- Get rid of the Tools dockable and move toolbox configuration to
|
||||
Preferences
|
||||
- Allow closing the toolbox without closing the whole application
|
||||
- Add status bar feedback for keyboard changes to brush parameters
|
||||
- Add diagonal guides to the Crop Tool
|
||||
- New docks are created at the pointer position
|
||||
- Add support for printing crop marks for images
|
||||
- Move 'Text along path' from tool options to text context menu
|
||||
- Change default shortcuts for "Shrink Wrap" and "Fit in Window" to
|
||||
Ctrl+J and Ctrl+Shift+J respectively since the previous shortcuts
|
||||
are now used for the save+export feature
|
||||
- Make Alt+Click on layers in Layers dockable create a selection from
|
||||
the layer
|
||||
- Allow to specify written language in the Text Tool
|
||||
- Support custom mapping curves for input device properties like "Pressure"
|
||||
- New desktop launcher icon
|
||||
- Add 'Windows→Hide docks' menu item that does what 'Tab' does and also displays
|
||||
its state. Make the state persistent across sessions, too.
|
||||
- Make dock window title separators translatable
|
||||
|
||||
|
||||
Plug-ins:
|
||||
|
||||
- Map the 'Linear Dodge' layer mode in PSD files to the 'Addition'
|
||||
layer mode in GIMP
|
||||
- Add JPEG2000 load plug-in
|
||||
- Add X11 mouse cursor plug-in
|
||||
- Add support for loading 16bit (RGB565) raw data
|
||||
- Add palette exporter for CSS, PHP, Python, txt and Java, accessed
|
||||
through palette context menu
|
||||
- Add plug-in API for getting image URI, for manipulating size of
|
||||
text layers, for getting and setting text layer hint, and for
|
||||
unified export dialog appearance
|
||||
- Add an 'As Animation' toggle to the GIF export options
|
||||
- Add 'active_vectors' getsetter to Python 'gimp.Image'
|
||||
|
||||
|
||||
Data:
|
||||
|
||||
- Add large variants of round brushes and remove duplicate and
|
||||
useless brushes
|
||||
- Add "FG to BG (Hardedge)" gradient
|
||||
|
||||
|
||||
GEGL:
|
||||
|
||||
- Port the projection code, the code that composes a single image
|
||||
from a stack of layers, to GEGL
|
||||
- Port layer modes to GEGL
|
||||
- Port the floating selection code to GEGL
|
||||
- Refactor the layer stack code to prepare for layer groups later
|
||||
- Prepare better and more intuitive handling of the floating
|
||||
selection
|
||||
- Add File->Debug->Show Image Graph that show the GEGL graph of an
|
||||
image
|
||||
- Allow to benchmark projection performance with
|
||||
File->Debug->Benchmark Projection
|
||||
- When using GEGL for the projection, use CIELCH instead of HSV/HSL
|
||||
for color based layer modes
|
||||
|
||||
|
||||
Core:
|
||||
|
||||
- Make painting strokes Catmull-Rom Spline interpolated
|
||||
- Add support for arbitrary affine transforms of brushes
|
||||
- Add support for brush dynamics to depend on tilt
|
||||
- Add aspect ratio to brush dynamics
|
||||
- Add infrastructure to soon support vector layers (GSoC 2006)
|
||||
- Rearrange legacy layer mode code to increase maintainability
|
||||
- Drop support for the obsolete GnomeVFS file-uri backend
|
||||
- Allow to dump keyboard shortcuts with File->Debug->Dump Keyboard
|
||||
Shortcuts
|
||||
- Prepare data structures for layer groups
|
||||
- Remove gimprc setting "menu-mnemonics",
|
||||
"GtkSettings:gtk-enable-mnemonics" shall be used instead
|
||||
- Remove "transient-docks" gimprc setting, the 'Utility window' hint
|
||||
and a sane window manager does a better job
|
||||
- Remove "web-browser" gimprc setting and use gtk_show_uri() instead
|
||||
|
||||
|
||||
General:
|
||||
|
||||
- Changed license to (L)GPLv3+
|
||||
- Use the automake 1.11 feature 'silent build rules' by default
|
||||
- Lots of bug fixes and cleanup
|
||||
- Lots of bug fixes
|
||||
- List of translation updates
|
||||
|
@@ -89,8 +89,12 @@ libapp_a_SOURCES = $(libapp_sources) $(libapp_generated_sources)
|
||||
gimp_2_8_SOURCES = $(libapp_sources) main.c
|
||||
|
||||
|
||||
if PLATFORM_OSX
|
||||
framework_carbon = -framework Carbon
|
||||
endif
|
||||
|
||||
if OS_WIN32
|
||||
win32_ldflags = -mwindows $(WIN32_LARGE_ADDRESS_AWARE)
|
||||
win32_ldflags = -mwindows -Wl,--tsaware $(WIN32_LARGE_ADDRESS_AWARE)
|
||||
endif
|
||||
|
||||
if USE_BINRELOC
|
||||
@@ -142,7 +146,6 @@ calm_down_linker = \
|
||||
|
||||
AM_LDFLAGS = \
|
||||
$(munix) \
|
||||
$(CARBON_LDFLAGS) \
|
||||
$(calm_down_linker) \
|
||||
$(workaround_that_core_depends_on_xcf) \
|
||||
$(workaround_that_core_depends_on_pdb) \
|
||||
@@ -180,7 +183,10 @@ gimpconsoleldadd = \
|
||||
$(INTLLIBS) \
|
||||
$(RT_LIBS)
|
||||
|
||||
gimp_2_8_LDFLAGS = $(AM_LDFLAGS) $(win32_ldflags)
|
||||
gimp_2_8_LDFLAGS = \
|
||||
$(AM_LDFLAGS) \
|
||||
$(win32_ldflags) \
|
||||
$(framework_carbon)
|
||||
|
||||
gimp_2_8_LDADD = \
|
||||
gui/libappgui.a \
|
||||
|
@@ -39,8 +39,6 @@
|
||||
#include "core/gimpprojectable.h"
|
||||
#include "core/gimpprojection.h"
|
||||
|
||||
#include "file/file-utils.h"
|
||||
|
||||
#include "gegl/gimp-gegl-utils.h"
|
||||
|
||||
#include "display/gimpdisplay.h"
|
||||
@@ -351,7 +349,7 @@ debug_show_image_graph (GimpImage *source_image)
|
||||
/* Create a new image of the result */
|
||||
tiles = gimp_buffer_to_tiles (buffer);
|
||||
new_name = g_strdup_printf ("%s GEGL graph",
|
||||
file_utils_uri_display_name (gimp_image_get_uri_or_untitled (source_image)));
|
||||
gimp_image_get_display_name (source_image));
|
||||
new_image = gimp_create_image (gimp,
|
||||
tile_manager_width (tiles),
|
||||
tile_manager_height (tiles),
|
||||
|
@@ -261,9 +261,9 @@ file_actions_update (GimpActionGroup *group,
|
||||
|
||||
if (image)
|
||||
{
|
||||
drawable = gimp_image_get_active_drawable (image);
|
||||
source = gimp_image_get_imported_uri (image);
|
||||
export = gimp_image_get_exported_uri (image);
|
||||
drawable = gimp_image_get_active_drawable (image);
|
||||
source = gimp_image_get_imported_uri (image);
|
||||
export = gimp_image_get_exported_uri (image);
|
||||
}
|
||||
|
||||
show_overwrite =
|
||||
@@ -307,7 +307,7 @@ file_actions_update (GimpActionGroup *group,
|
||||
}
|
||||
|
||||
/* needed for the empty display */
|
||||
SET_SENSITIVE ("file-close-all", image);
|
||||
SET_SENSITIVE ("file-close-all", image);
|
||||
|
||||
#undef SET_SENSITIVE
|
||||
}
|
||||
|
@@ -76,7 +76,8 @@ static void file_save_dialog_show (Gimp *gimp,
|
||||
GtkWidget *parent,
|
||||
const gchar *title,
|
||||
gboolean save_a_copy,
|
||||
gboolean close_after_saving);
|
||||
gboolean close_after_saving,
|
||||
GimpDisplay *display);
|
||||
static void file_export_dialog_show (Gimp *gimp,
|
||||
GimpImage *image,
|
||||
GtkWidget *parent);
|
||||
@@ -252,7 +253,7 @@ file_save_cmd_callback (GtkAction *action,
|
||||
gimp, image, uri,
|
||||
save_proc,
|
||||
GIMP_RUN_WITH_LAST_VALS,
|
||||
TRUE, FALSE, TRUE);
|
||||
TRUE, FALSE, FALSE, TRUE);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -270,13 +271,13 @@ file_save_cmd_callback (GtkAction *action,
|
||||
case GIMP_SAVE_MODE_SAVE_AS:
|
||||
file_save_dialog_show (gimp, image, widget,
|
||||
_("Save Image"), FALSE,
|
||||
save_mode == GIMP_SAVE_MODE_SAVE_AND_CLOSE);
|
||||
save_mode == GIMP_SAVE_MODE_SAVE_AND_CLOSE, display);
|
||||
break;
|
||||
|
||||
case GIMP_SAVE_MODE_SAVE_A_COPY:
|
||||
file_save_dialog_show (gimp, image, widget,
|
||||
_("Save a Copy of the Image"), TRUE,
|
||||
FALSE);
|
||||
FALSE, display);
|
||||
break;
|
||||
|
||||
case GIMP_SAVE_MODE_EXPORT:
|
||||
@@ -288,8 +289,9 @@ file_save_cmd_callback (GtkAction *action,
|
||||
{
|
||||
const gchar *uri = NULL;
|
||||
GimpPlugInProcedure *export_proc;
|
||||
gboolean overwrite;
|
||||
|
||||
if (save_mode == GIMP_SAVE_MODE_EXPORT_TO)
|
||||
if (save_mode == GIMP_SAVE_MODE_EXPORT_TO)
|
||||
{
|
||||
uri = gimp_image_get_exported_uri (image);
|
||||
|
||||
@@ -299,10 +301,14 @@ file_save_cmd_callback (GtkAction *action,
|
||||
file_export_dialog_show (gimp, image, widget);
|
||||
break;
|
||||
}
|
||||
|
||||
overwrite = FALSE;
|
||||
}
|
||||
else if (save_mode == GIMP_SAVE_MODE_OVERWRITE)
|
||||
{
|
||||
uri = gimp_image_get_imported_uri (image);
|
||||
|
||||
overwrite = TRUE;
|
||||
}
|
||||
|
||||
if (uri)
|
||||
@@ -327,7 +333,9 @@ file_save_cmd_callback (GtkAction *action,
|
||||
gimp, image, uri_copy,
|
||||
export_proc,
|
||||
GIMP_RUN_WITH_LAST_VALS,
|
||||
FALSE, TRUE, TRUE);
|
||||
FALSE,
|
||||
overwrite, ! overwrite,
|
||||
TRUE);
|
||||
g_free (uri_copy);
|
||||
}
|
||||
}
|
||||
@@ -371,8 +379,7 @@ file_revert_cmd_callback (GtkAction *action,
|
||||
GimpDisplay *display;
|
||||
GimpImage *image;
|
||||
GtkWidget *dialog;
|
||||
const gchar *uri = NULL;
|
||||
const gchar *source = NULL;
|
||||
const gchar *uri;
|
||||
return_if_no_display (display, data);
|
||||
|
||||
image = gimp_display_get_image (display);
|
||||
@@ -380,14 +387,11 @@ file_revert_cmd_callback (GtkAction *action,
|
||||
uri = gimp_image_get_uri (image);
|
||||
|
||||
if (! uri)
|
||||
{
|
||||
uri = gimp_image_get_imported_uri (image);
|
||||
source = uri;
|
||||
}
|
||||
uri = gimp_image_get_imported_uri (image);
|
||||
|
||||
dialog = g_object_get_data (G_OBJECT (image), REVERT_DATA_KEY);
|
||||
|
||||
if (! uri && ! source)
|
||||
if (! uri)
|
||||
{
|
||||
gimp_message_literal (image->gimp,
|
||||
G_OBJECT (display), GIMP_MESSAGE_ERROR,
|
||||
@@ -400,7 +404,6 @@ file_revert_cmd_callback (GtkAction *action,
|
||||
}
|
||||
else
|
||||
{
|
||||
gchar *basename;
|
||||
gchar *filename;
|
||||
|
||||
dialog =
|
||||
@@ -427,18 +430,13 @@ file_revert_cmd_callback (GtkAction *action,
|
||||
G_CALLBACK (file_revert_confirm_response),
|
||||
display);
|
||||
|
||||
if (! source)
|
||||
basename = file_utils_uri_display_basename (uri);
|
||||
else
|
||||
basename = g_strdup (gimp_image_get_uri_or_untitled (image));
|
||||
|
||||
filename = file_utils_uri_display_name (uri);
|
||||
|
||||
gimp_message_box_set_primary_text (GIMP_MESSAGE_DIALOG (dialog)->box,
|
||||
_("Revert '%s' to '%s'?"),
|
||||
basename, filename);
|
||||
gimp_image_get_display_name (image),
|
||||
filename);
|
||||
g_free (filename);
|
||||
g_free (basename);
|
||||
|
||||
gimp_message_box_set_text (GIMP_MESSAGE_DIALOG (dialog)->box,
|
||||
_("By reverting the image to the state saved "
|
||||
@@ -525,11 +523,8 @@ file_open_dialog_show (Gimp *gimp,
|
||||
gimp_file_dialog_set_open_image (GIMP_FILE_DIALOG (dialog),
|
||||
image, open_as_layers);
|
||||
|
||||
parent = gtk_widget_get_toplevel (parent);
|
||||
|
||||
if (GTK_IS_WINDOW (parent))
|
||||
gtk_window_set_transient_for (GTK_WINDOW (dialog),
|
||||
GTK_WINDOW (parent));
|
||||
gtk_window_set_transient_for (GTK_WINDOW (dialog),
|
||||
GTK_WINDOW (gtk_widget_get_toplevel (parent)));
|
||||
|
||||
gtk_window_present (GTK_WINDOW (dialog));
|
||||
}
|
||||
@@ -541,7 +536,8 @@ file_save_dialog_show (Gimp *gimp,
|
||||
GtkWidget *parent,
|
||||
const gchar *title,
|
||||
gboolean save_a_copy,
|
||||
gboolean close_after_saving)
|
||||
gboolean close_after_saving,
|
||||
GimpDisplay *display)
|
||||
{
|
||||
GtkWidget *dialog;
|
||||
|
||||
@@ -558,7 +554,7 @@ file_save_dialog_show (Gimp *gimp,
|
||||
if (dialog)
|
||||
{
|
||||
gtk_window_set_transient_for (GTK_WINDOW (dialog),
|
||||
GTK_WINDOW (parent));
|
||||
GTK_WINDOW (gtk_widget_get_toplevel (parent)));
|
||||
|
||||
g_object_set_data_full (G_OBJECT (image),
|
||||
"gimp-file-save-dialog", dialog,
|
||||
@@ -575,7 +571,7 @@ file_save_dialog_show (Gimp *gimp,
|
||||
|
||||
gimp_file_dialog_set_save_image (GIMP_FILE_DIALOG (dialog),
|
||||
gimp, image, save_a_copy, FALSE,
|
||||
close_after_saving);
|
||||
close_after_saving, GIMP_OBJECT (display));
|
||||
|
||||
gtk_window_present (GTK_WINDOW (dialog));
|
||||
}
|
||||
@@ -609,7 +605,7 @@ file_export_dialog_show (Gimp *gimp,
|
||||
if (dialog)
|
||||
{
|
||||
gtk_window_set_transient_for (GTK_WINDOW (dialog),
|
||||
GTK_WINDOW (parent));
|
||||
GTK_WINDOW (gtk_widget_get_toplevel (parent)));
|
||||
|
||||
g_object_set_data_full (G_OBJECT (image),
|
||||
"gimp-file-export-dialog", dialog,
|
||||
@@ -627,7 +623,8 @@ file_export_dialog_show (Gimp *gimp,
|
||||
image,
|
||||
FALSE,
|
||||
TRUE,
|
||||
FALSE);
|
||||
FALSE,
|
||||
NULL);
|
||||
|
||||
gtk_window_present (GTK_WINDOW (dialog));
|
||||
}
|
||||
|
@@ -33,8 +33,6 @@
|
||||
#include "core/gimpimage.h"
|
||||
#include "core/gimplist.h"
|
||||
|
||||
#include "file/file-utils.h"
|
||||
|
||||
#include "widgets/gimpactiongroup.h"
|
||||
#include "widgets/gimpdialogfactory.h"
|
||||
#include "widgets/gimpdock.h"
|
||||
@@ -295,19 +293,12 @@ windows_actions_image_notify (GimpDisplay *display,
|
||||
}
|
||||
|
||||
{
|
||||
const gchar *uri;
|
||||
gchar *filename;
|
||||
gchar *basename;
|
||||
const gchar *display_name;
|
||||
gchar *escaped;
|
||||
gchar *title;
|
||||
|
||||
uri = gimp_image_get_uri_or_untitled (image);
|
||||
|
||||
filename = file_utils_uri_display_name (uri);
|
||||
basename = file_utils_uri_display_basename (uri);
|
||||
|
||||
escaped = gimp_escape_uline (basename);
|
||||
g_free (basename);
|
||||
display_name = gimp_image_get_display_name (image);
|
||||
escaped = gimp_escape_uline (display_name);
|
||||
|
||||
title = g_strdup_printf ("%s-%d.%d", escaped,
|
||||
gimp_image_get_ID (image),
|
||||
@@ -316,12 +307,11 @@ windows_actions_image_notify (GimpDisplay *display,
|
||||
|
||||
g_object_set (action,
|
||||
"label", title,
|
||||
"tooltip", filename,
|
||||
"tooltip", gimp_image_get_display_path (image),
|
||||
"viewable", image,
|
||||
"context", gimp_get_user_context (group->gimp),
|
||||
NULL);
|
||||
|
||||
g_free (filename);
|
||||
g_free (title);
|
||||
}
|
||||
|
||||
|
@@ -345,6 +345,18 @@ pixel_surround_get_data (PixelSurround *surround,
|
||||
return tile_data_pointer (surround->tile, x, y);
|
||||
}
|
||||
|
||||
if (x < 0)
|
||||
*w = MIN (- x, surround->w);
|
||||
else
|
||||
*w = surround->w;
|
||||
|
||||
if (y < 0)
|
||||
*h = MIN (- y, surround->h);
|
||||
else
|
||||
*h = surround->h;
|
||||
|
||||
*rowstride = surround->rowstride;
|
||||
|
||||
if (surround->mode == PIXEL_SURROUND_SMEAR)
|
||||
{
|
||||
const guchar *edata;
|
||||
@@ -392,28 +404,17 @@ pixel_surround_get_data (PixelSurround *surround,
|
||||
case (TOP):
|
||||
case (BOTTOM):
|
||||
pixel_surround_fill_row (surround, edata, ew);
|
||||
*w = MIN (*w, ew);
|
||||
break;
|
||||
|
||||
case (LEFT):
|
||||
case (RIGHT):
|
||||
pixel_surround_fill_col (surround, edata, estride, eh);
|
||||
*h = MIN (*h, eh);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* return a pointer to the virtual background tile */
|
||||
|
||||
if (x < 0)
|
||||
*w = MIN (- x, surround->w);
|
||||
else
|
||||
*w = surround->w;
|
||||
|
||||
if (y < 0)
|
||||
*h = MIN (- y, surround->h);
|
||||
else
|
||||
*h = surround->h;
|
||||
|
||||
*rowstride = surround->rowstride;
|
||||
|
||||
return surround->bg;
|
||||
}
|
||||
|
@@ -43,6 +43,8 @@
|
||||
#include "gimp-intl.h"
|
||||
|
||||
|
||||
#define GIMP_MAX_MEM_PROCESS (MIN (G_MAXSIZE, GIMP_MAX_MEMSIZE))
|
||||
|
||||
enum
|
||||
{
|
||||
PROP_0,
|
||||
@@ -106,6 +108,7 @@ gimp_base_config_class_init (GimpBaseConfigClass *klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
gint num_processors;
|
||||
guint64 memory_size;
|
||||
|
||||
parent_class = g_type_class_peek_parent (klass);
|
||||
|
||||
@@ -138,10 +141,21 @@ gimp_base_config_class_init (GimpBaseConfigClass *klass)
|
||||
"num-processors", NUM_PROCESSORS_BLURB,
|
||||
1, GIMP_MAX_NUM_THREADS, num_processors,
|
||||
GIMP_PARAM_STATIC_STRINGS);
|
||||
|
||||
memory_size = get_physical_memory_size ();
|
||||
|
||||
/* limit to the amount one process can handle */
|
||||
memory_size = MIN (GIMP_MAX_MEM_PROCESS, memory_size);
|
||||
|
||||
if (memory_size > 0)
|
||||
memory_size = memory_size / 2; /* half the memory */
|
||||
else
|
||||
memory_size = 1 << 30; /* 1GB */
|
||||
|
||||
GIMP_CONFIG_INSTALL_PROP_MEMSIZE (object_class, PROP_TILE_CACHE_SIZE,
|
||||
"tile-cache-size", TILE_CACHE_SIZE_BLURB,
|
||||
0, MIN (G_MAXSIZE, GIMP_MAX_MEMSIZE),
|
||||
1 << 30, /* 1GB */
|
||||
0, GIMP_MAX_MEM_PROCESS,
|
||||
memory_size,
|
||||
GIMP_PARAM_STATIC_STRINGS |
|
||||
GIMP_CONFIG_PARAM_CONFIRM);
|
||||
|
||||
|
@@ -115,7 +115,11 @@ gimp_rc_add_unknown_token (GimpConfig *config,
|
||||
token->key = g_strdup (key);
|
||||
token->value = g_strdup (value);
|
||||
|
||||
if (!last)
|
||||
if (last)
|
||||
{
|
||||
last = g_slist_last (g_slist_append (last, token));
|
||||
}
|
||||
else
|
||||
{
|
||||
unknown_tokens = g_slist_append (NULL, token);
|
||||
|
||||
|
@@ -941,6 +941,7 @@ gimp_dirty_mask_get_type (void)
|
||||
{ GIMP_DIRTY_DRAWABLE, "GIMP_DIRTY_DRAWABLE", "drawable" },
|
||||
{ GIMP_DIRTY_VECTORS, "GIMP_DIRTY_VECTORS", "vectors" },
|
||||
{ GIMP_DIRTY_SELECTION, "GIMP_DIRTY_SELECTION", "selection" },
|
||||
{ GIMP_DIRTY_ACTIVE_DRAWABLE, "GIMP_DIRTY_ACTIVE_DRAWABLE", "active-drawable" },
|
||||
{ GIMP_DIRTY_ALL, "GIMP_DIRTY_ALL", "all" },
|
||||
{ 0, NULL, NULL }
|
||||
};
|
||||
@@ -957,6 +958,7 @@ gimp_dirty_mask_get_type (void)
|
||||
{ GIMP_DIRTY_DRAWABLE, "GIMP_DIRTY_DRAWABLE", NULL },
|
||||
{ GIMP_DIRTY_VECTORS, "GIMP_DIRTY_VECTORS", NULL },
|
||||
{ GIMP_DIRTY_SELECTION, "GIMP_DIRTY_SELECTION", NULL },
|
||||
{ GIMP_DIRTY_ACTIVE_DRAWABLE, "GIMP_DIRTY_ACTIVE_DRAWABLE", NULL },
|
||||
{ GIMP_DIRTY_ALL, "GIMP_DIRTY_ALL", NULL },
|
||||
{ 0, NULL, NULL }
|
||||
};
|
||||
|
@@ -449,6 +449,7 @@ typedef enum /*< pdb-skip >*/
|
||||
GIMP_DIRTY_DRAWABLE = 1 << 6,
|
||||
GIMP_DIRTY_VECTORS = 1 << 7,
|
||||
GIMP_DIRTY_SELECTION = 1 << 8,
|
||||
GIMP_DIRTY_ACTIVE_DRAWABLE = 1 << 9,
|
||||
|
||||
GIMP_DIRTY_ALL = 0xffff
|
||||
} GimpDirtyMask;
|
||||
|
@@ -163,12 +163,13 @@ gimp_edit_paste (GimpImage *image,
|
||||
{
|
||||
GimpLayer *layer;
|
||||
GimpImageType type;
|
||||
gint center_x;
|
||||
gint center_y;
|
||||
gint offset_x;
|
||||
gint offset_y;
|
||||
gint image_width;
|
||||
gint image_height;
|
||||
gint width;
|
||||
gint height;
|
||||
gint offset_x;
|
||||
gint offset_y;
|
||||
gboolean clamp_to_image = TRUE;
|
||||
|
||||
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
|
||||
g_return_val_if_fail (drawable == NULL || GIMP_IS_DRAWABLE (drawable), NULL);
|
||||
@@ -192,6 +193,23 @@ gimp_edit_paste (GimpImage *image,
|
||||
if (! layer)
|
||||
return NULL;
|
||||
|
||||
image_width = gimp_image_get_width (image);
|
||||
image_height = gimp_image_get_height (image);
|
||||
|
||||
width = gimp_item_get_width (GIMP_ITEM (layer));
|
||||
height = gimp_item_get_height (GIMP_ITEM (layer));
|
||||
|
||||
if (viewport_width == image_width &&
|
||||
viewport_height == image_height)
|
||||
{
|
||||
/* if the whole image is visible, act as if there was no viewport */
|
||||
|
||||
viewport_x = 0;
|
||||
viewport_y = 0;
|
||||
viewport_width = 0;
|
||||
viewport_height = 0;
|
||||
}
|
||||
|
||||
if (drawable)
|
||||
{
|
||||
/* if pasting to a drawable */
|
||||
@@ -206,9 +224,13 @@ gimp_edit_paste (GimpImage *image,
|
||||
have_mask = gimp_item_mask_bounds (GIMP_ITEM (drawable),
|
||||
&x1, &y1, &x2, &y2);
|
||||
|
||||
if (! have_mask &&
|
||||
viewport_width > 0 &&
|
||||
if (! have_mask && /* if we have no mask */
|
||||
viewport_width > 0 && /* and we have a viewport */
|
||||
viewport_height > 0 &&
|
||||
(width < (x2 - x1) || /* and the paste is smaller than the target */
|
||||
height < (y2 - y1)) &&
|
||||
|
||||
/* and the viewport intersects with the target */
|
||||
gimp_rectangle_intersect (viewport_x, viewport_y,
|
||||
viewport_width, viewport_height,
|
||||
off_x, off_y,
|
||||
@@ -216,43 +238,53 @@ gimp_edit_paste (GimpImage *image,
|
||||
&paste_x, &paste_y,
|
||||
&paste_width, &paste_height))
|
||||
{
|
||||
center_x = paste_x + paste_width / 2;
|
||||
center_y = paste_y + paste_height / 2;
|
||||
/* center on the viewport */
|
||||
|
||||
offset_x = paste_x + (paste_width - width) / 2;
|
||||
offset_y = paste_y + (paste_height- height) / 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
center_x = off_x + (x1 + x2) / 2;
|
||||
center_y = off_y + (y1 + y2) / 2;
|
||||
/* otherwise center on the target */
|
||||
|
||||
offset_x = off_x + ((x1 + x2) - width) / 2;
|
||||
offset_y = off_y + ((y1 + y2) - height) / 2;
|
||||
|
||||
/* and keep it that way */
|
||||
clamp_to_image = FALSE;
|
||||
}
|
||||
}
|
||||
else if (viewport_width > 0 && viewport_height > 0)
|
||||
else if (viewport_width > 0 && /* if we have a viewport */
|
||||
viewport_height > 0 &&
|
||||
(width < image_width || /* and the paste is */
|
||||
height < image_height)) /* smaller than the image */
|
||||
{
|
||||
/* if we got a viewport set the offsets to the center of the viewport */
|
||||
/* center on the viewport */
|
||||
|
||||
center_x = viewport_x + viewport_width / 2;
|
||||
center_y = viewport_y + viewport_height / 2;
|
||||
offset_x = viewport_x + (viewport_width - width) / 2;
|
||||
offset_y = viewport_y + (viewport_height - height) / 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* otherwise the offsets to the center of the image */
|
||||
/* otherwise center on the image */
|
||||
|
||||
center_x = gimp_image_get_width (image) / 2;
|
||||
center_y = gimp_image_get_height (image) / 2;
|
||||
offset_x = (image_width - width) / 2;
|
||||
offset_y = (image_height - height) / 2;
|
||||
|
||||
/* and keep it that way */
|
||||
clamp_to_image = FALSE;
|
||||
}
|
||||
|
||||
width = gimp_item_get_width (GIMP_ITEM (layer));
|
||||
height = gimp_item_get_height (GIMP_ITEM (layer));
|
||||
|
||||
offset_x = center_x - width / 2;
|
||||
offset_y = center_y - height / 2;
|
||||
|
||||
/* Ensure that the pasted layer is always within the image, if it
|
||||
* fits and aligned at top left if it doesn't. (See bug #142944).
|
||||
*/
|
||||
offset_x = MIN (offset_x, gimp_image_get_width (image) - width);
|
||||
offset_y = MIN (offset_y, gimp_image_get_height (image) - height);
|
||||
offset_x = MAX (offset_x, 0);
|
||||
offset_y = MAX (offset_y, 0);
|
||||
if (clamp_to_image)
|
||||
{
|
||||
/* Ensure that the pasted layer is always within the image, if it
|
||||
* fits and aligned at top left if it doesn't. (See bug #142944).
|
||||
*/
|
||||
offset_x = MIN (offset_x, image_width - width);
|
||||
offset_y = MIN (offset_y, image_height - height);
|
||||
offset_x = MAX (offset_x, 0);
|
||||
offset_y = MAX (offset_y, 0);
|
||||
}
|
||||
|
||||
gimp_item_set_offset (GIMP_ITEM (layer), offset_x, offset_y);
|
||||
|
||||
|
@@ -73,6 +73,9 @@ gimp_modules_load (Gimp *gimp)
|
||||
if (gimp->no_interface)
|
||||
return;
|
||||
|
||||
/* FIXME, gimp->be_verbose is not yet initialized in init() */
|
||||
gimp->module_db->verbose = gimp->be_verbose;
|
||||
|
||||
filename = gimp_personal_rc_file ("modulerc");
|
||||
|
||||
if (gimp->be_verbose)
|
||||
@@ -201,7 +204,7 @@ gimp_modules_unload (Gimp *gimp)
|
||||
if (writer)
|
||||
{
|
||||
gimp_config_writer_open (writer, "module-load-inhibit");
|
||||
gimp_config_writer_printf (writer, "\"%s\"", p);
|
||||
gimp_config_writer_string (writer, p);
|
||||
gimp_config_writer_close (writer);
|
||||
|
||||
gimp_config_writer_finish (writer, "end of modulerc", &error);
|
||||
|
@@ -319,9 +319,9 @@ gimp_transform_region_nearest (TileManager *orig_tiles,
|
||||
gdouble tu, tv, tw; /* undivided source coordinates and divisor */
|
||||
|
||||
/* set up inverse transform steps */
|
||||
tu = uinc * x + m->coeff[0][1] * (dest_y1 + y) + m->coeff[0][2];
|
||||
tv = vinc * x + m->coeff[1][1] * (dest_y1 + y) + m->coeff[1][2];
|
||||
tw = winc * x + m->coeff[2][1] * (dest_y1 + y) + m->coeff[2][2];
|
||||
tu = uinc * (x + .5) + m->coeff[0][1] * (dest_y1 + y + .5) + m->coeff[0][2];
|
||||
tv = vinc * (x + .5) + m->coeff[1][1] * (dest_y1 + y + .5) + m->coeff[1][2];
|
||||
tw = winc * (x + .5) + m->coeff[2][1] * (dest_y1 + y + .5) + m->coeff[2][2];
|
||||
|
||||
while (width--)
|
||||
{
|
||||
@@ -331,8 +331,8 @@ gimp_transform_region_nearest (TileManager *orig_tiles,
|
||||
/* normalize homogeneous coords */
|
||||
normalize_coords (1, &tu, &tv, &tw, &u, &v);
|
||||
|
||||
iu = (gint) u;
|
||||
iv = (gint) v;
|
||||
iu = RINT (u);
|
||||
iv = RINT (v);
|
||||
|
||||
/* Set the destination pixels */
|
||||
if (iu >= u1 && iu < u2 &&
|
||||
@@ -689,12 +689,14 @@ gimp_transform_region_lanczos (TileManager *orig_tiles,
|
||||
|
||||
static inline void
|
||||
untransform_coords (const GimpMatrix3 *m,
|
||||
const gint x,
|
||||
const gint y,
|
||||
const gint ix,
|
||||
const gint iy,
|
||||
gdouble *tu,
|
||||
gdouble *tv,
|
||||
gdouble *tw)
|
||||
{
|
||||
gdouble x = ix + .5;
|
||||
gdouble y = iy + .5;
|
||||
tu[0] = m->coeff[0][0] * (x ) + m->coeff[0][1] * (y ) + m->coeff[0][2];
|
||||
tv[0] = m->coeff[1][0] * (x ) + m->coeff[1][1] * (y ) + m->coeff[1][2];
|
||||
tw[0] = m->coeff[2][0] * (x ) + m->coeff[2][1] * (y ) + m->coeff[2][2];
|
||||
@@ -730,8 +732,8 @@ normalize_coords (const gint coords,
|
||||
{
|
||||
if (G_LIKELY (tw[i] != 0.0))
|
||||
{
|
||||
u[i] = tu[i] / tw[i];
|
||||
v[i] = tv[i] / tw[i];
|
||||
u[i] = tu[i] / tw[i] - .5;
|
||||
v[i] = tv[i] / tw[i] - .5;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@@ -109,7 +109,8 @@ gimp_user_install_items[] =
|
||||
};
|
||||
|
||||
|
||||
static gboolean gimp_user_install_detect_old (GimpUserInstall *install);
|
||||
static gboolean gimp_user_install_detect_old (GimpUserInstall *install,
|
||||
const gchar *gimp_dir);
|
||||
static void user_install_log (GimpUserInstall *install,
|
||||
const gchar *format,
|
||||
...) G_GNUC_PRINTF (2, 3);
|
||||
@@ -140,7 +141,20 @@ gimp_user_install_new (gboolean verbose)
|
||||
|
||||
install->verbose = verbose;
|
||||
|
||||
gimp_user_install_detect_old (install);
|
||||
gimp_user_install_detect_old (install, gimp_directory ());
|
||||
|
||||
#ifdef PLATFORM_OSX
|
||||
if (! install->old_dir)
|
||||
{
|
||||
/* if the default old gimpdir was not found, try the "classic" one
|
||||
* in the home folder
|
||||
*/
|
||||
gchar *dir = g_strdup_printf ("%s/.gimp-%s",
|
||||
g_get_home_dir (), GIMP_APP_VERSION);
|
||||
gimp_user_install_detect_old (install, dir);
|
||||
g_free (dir);
|
||||
}
|
||||
#endif
|
||||
|
||||
return install;
|
||||
}
|
||||
@@ -205,14 +219,13 @@ gimp_user_install_set_log_handler (GimpUserInstall *install,
|
||||
/* Local functions */
|
||||
|
||||
static gboolean
|
||||
gimp_user_install_detect_old (GimpUserInstall *install)
|
||||
gimp_user_install_detect_old (GimpUserInstall *install,
|
||||
const gchar *gimp_dir)
|
||||
{
|
||||
gchar *dir;
|
||||
gchar *dir = g_strdup (gimp_dir);
|
||||
gchar *version;
|
||||
gboolean migrate = FALSE;
|
||||
|
||||
dir = g_strdup (gimp_directory ());
|
||||
|
||||
version = strstr (dir, GIMP_APP_VERSION);
|
||||
|
||||
if (version)
|
||||
|
@@ -111,7 +111,9 @@ static gchar abr_read_char (FILE *file);
|
||||
static gint16 abr_read_short (FILE *file);
|
||||
static gint32 abr_read_long (FILE *file);
|
||||
static gchar * abr_read_ucs2_text (FILE *file);
|
||||
static gboolean abr_supported (AbrHeader *abr_hdr);
|
||||
static gboolean abr_supported (AbrHeader *abr_hdr,
|
||||
const gchar *filename,
|
||||
GError **error);
|
||||
static gboolean abr_reach_8bim_section (FILE *abr,
|
||||
const gchar *name);
|
||||
static gint32 abr_rle_decode (FILE *file,
|
||||
@@ -429,7 +431,7 @@ gimp_brush_load_abr (GimpContext *context,
|
||||
abr_hdr.version = abr_read_short (file);
|
||||
abr_hdr.count = abr_read_short (file); /* sub-version for ABR v6 */
|
||||
|
||||
if (abr_supported (&abr_hdr))
|
||||
if (abr_supported (&abr_hdr, filename, error))
|
||||
{
|
||||
switch (abr_hdr.version)
|
||||
{
|
||||
@@ -831,7 +833,9 @@ abr_read_ucs2_text (FILE *file)
|
||||
}
|
||||
|
||||
static gboolean
|
||||
abr_supported (AbrHeader *abr_hdr)
|
||||
abr_supported (AbrHeader *abr_hdr,
|
||||
const gchar *filename,
|
||||
GError **error)
|
||||
{
|
||||
switch (abr_hdr->version)
|
||||
{
|
||||
@@ -844,6 +848,18 @@ abr_supported (AbrHeader *abr_hdr)
|
||||
/* in this case, count contains format sub-version */
|
||||
if (abr_hdr->count == 1 || abr_hdr->count == 2)
|
||||
return TRUE;
|
||||
|
||||
if (error && ! (*error))
|
||||
g_set_error (error, GIMP_DATA_ERROR, GIMP_DATA_ERROR_READ,
|
||||
_("Fatal parse error in brush file '%s': "
|
||||
"unable to decode abr format version %d."),
|
||||
gimp_filename_to_utf8 (filename),
|
||||
|
||||
/* horrid subversion display, but better than
|
||||
* having yet another translatable string for
|
||||
* this
|
||||
*/
|
||||
abr_hdr->version * 10 + abr_hdr->count);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@@ -3172,7 +3172,7 @@ gimp_context_get_font_name (GimpContext *context)
|
||||
{
|
||||
g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
|
||||
|
||||
return (context->font ? gimp_object_get_name (context->font) : NULL);
|
||||
return context->font_name;
|
||||
}
|
||||
|
||||
void
|
||||
@@ -3185,7 +3185,20 @@ gimp_context_set_font_name (GimpContext *context,
|
||||
|
||||
font = gimp_container_get_child_by_name (context->gimp->fonts, name);
|
||||
|
||||
gimp_context_set_font (context, GIMP_FONT (font));
|
||||
if (font)
|
||||
{
|
||||
gimp_context_set_font (context, GIMP_FONT (font));
|
||||
}
|
||||
else
|
||||
{
|
||||
/* No font with this name exists, use the standard font, but
|
||||
* keep the intended name around
|
||||
*/
|
||||
gimp_context_set_font (context, gimp_font_get_standard ());
|
||||
|
||||
g_free (context->font_name);
|
||||
context->font_name = g_strdup (name);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
@@ -29,6 +29,17 @@
|
||||
#include "gimpcurve-map.h"
|
||||
|
||||
|
||||
#if defined (HAVE_FINITE)
|
||||
#define FINITE(x) finite(x)
|
||||
#elif defined (HAVE_ISFINITE)
|
||||
#define FINITE(x) isfinite(x)
|
||||
#elif defined (G_OS_WIN32)
|
||||
#define FINITE(x) _finite(x)
|
||||
#else
|
||||
#error "no FINITE() implementation available?!"
|
||||
#endif
|
||||
|
||||
|
||||
enum
|
||||
{
|
||||
CURVE_NONE = 0,
|
||||
@@ -204,18 +215,17 @@ gimp_curve_map_value_inline (GimpCurve *curve,
|
||||
{
|
||||
if (curve->identity)
|
||||
{
|
||||
return value;
|
||||
if (FINITE (value))
|
||||
return CLAMP (value, 0.0, 1.0);
|
||||
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
if (value < 0.0)
|
||||
{
|
||||
return curve->samples[0];
|
||||
}
|
||||
else if (value >= 1.0)
|
||||
{
|
||||
return curve->samples[curve->n_samples - 1];
|
||||
}
|
||||
else /* interpolate the curve */
|
||||
/* check for known values first, so broken values like NaN
|
||||
* delivered by broken drivers don't run into the interpolation
|
||||
* code
|
||||
*/
|
||||
if (value > 0.0 && value < 1.0) /* interpolate the curve */
|
||||
{
|
||||
gdouble f;
|
||||
gint index;
|
||||
@@ -231,4 +241,12 @@ gimp_curve_map_value_inline (GimpCurve *curve,
|
||||
|
||||
return (1.0 - f) * curve->samples[index] + f * curve->samples[index + 1];
|
||||
}
|
||||
else if (value >= 1.0)
|
||||
{
|
||||
return curve->samples[curve->n_samples - 1];
|
||||
}
|
||||
else
|
||||
{
|
||||
return curve->samples[0];
|
||||
}
|
||||
}
|
||||
|
@@ -345,7 +345,7 @@ gimp_data_factory_data_load (GimpDataFactory *factory,
|
||||
g_free (writable_path);
|
||||
writable_path = tmp;
|
||||
|
||||
writable_list = gimp_path_parse (writable_path, 16, TRUE, NULL);
|
||||
writable_list = gimp_path_parse (writable_path, 256, TRUE, NULL);
|
||||
|
||||
g_object_set_data (G_OBJECT (factory),
|
||||
WRITABLE_PATH_KEY, writable_list);
|
||||
@@ -711,8 +711,8 @@ gimp_data_factory_get_save_dir (GimpDataFactory *factory,
|
||||
g_free (writable_path);
|
||||
writable_path = tmp;
|
||||
|
||||
path_list = gimp_path_parse (path, 16, FALSE, NULL);
|
||||
writable_list = gimp_path_parse (writable_path, 16, FALSE, NULL);
|
||||
path_list = gimp_path_parse (path, 256, FALSE, NULL);
|
||||
writable_list = gimp_path_parse (writable_path, 256, FALSE, NULL);
|
||||
|
||||
g_free (path);
|
||||
g_free (writable_path);
|
||||
|
@@ -78,7 +78,7 @@ gimp_image_pick_layer_by_bounds (const GimpImage *image,
|
||||
{
|
||||
GimpLayer *layer = list->data;
|
||||
|
||||
if (gimp_item_get_visible (GIMP_ITEM (layer)))
|
||||
if (gimp_item_is_visible (GIMP_ITEM (layer)))
|
||||
{
|
||||
gint off_x, off_y;
|
||||
gint width, height;
|
||||
@@ -127,7 +127,8 @@ gimp_image_pick_text_layer (const GimpImage *image,
|
||||
x >= off_x &&
|
||||
y >= off_y &&
|
||||
x < off_x + gimp_item_get_width (GIMP_ITEM (layer)) &&
|
||||
y < off_y + gimp_item_get_height (GIMP_ITEM (layer)))
|
||||
y < off_y + gimp_item_get_height (GIMP_ITEM (layer)) &&
|
||||
gimp_item_is_visible (GIMP_ITEM (layer)))
|
||||
{
|
||||
g_list_free (all_layers);
|
||||
|
||||
|
@@ -40,6 +40,7 @@ struct _GimpImagePrivate
|
||||
GimpPlugInProcedure *save_proc; /* last save procedure used */
|
||||
|
||||
gchar *display_name; /* display basename */
|
||||
gchar *display_path; /* display full path */
|
||||
gint width; /* width in pixels */
|
||||
gint height; /* height in pixels */
|
||||
gdouble xresolution; /* image x-res, in dpi */
|
||||
@@ -109,5 +110,8 @@ struct _GimpImagePrivate
|
||||
GIMP_TYPE_IMAGE, \
|
||||
GimpImagePrivate)
|
||||
|
||||
void gimp_image_take_mask (GimpImage *image,
|
||||
GimpChannel *mask);
|
||||
|
||||
|
||||
#endif /* __GIMP_IMAGE_PRIVATE_H__ */
|
||||
|
@@ -740,6 +740,7 @@ gimp_image_constructed (GObject *object)
|
||||
{
|
||||
GimpImage *image = GIMP_IMAGE (object);
|
||||
GimpImagePrivate *private = GIMP_IMAGE_GET_PRIVATE (image);
|
||||
GimpChannel *selection;
|
||||
GimpCoreConfig *config;
|
||||
GimpTemplate *template;
|
||||
|
||||
@@ -765,15 +766,10 @@ gimp_image_constructed (GObject *object)
|
||||
if (private->base_type == GIMP_INDEXED)
|
||||
gimp_image_colormap_init (image);
|
||||
|
||||
/* create the selection mask */
|
||||
private->selection_mask = gimp_selection_new (image,
|
||||
gimp_image_get_width (image),
|
||||
gimp_image_get_height (image));
|
||||
g_object_ref_sink (private->selection_mask);
|
||||
|
||||
g_signal_connect (private->selection_mask, "update",
|
||||
G_CALLBACK (gimp_image_mask_update),
|
||||
image);
|
||||
selection = gimp_selection_new (image,
|
||||
gimp_image_get_width (image),
|
||||
gimp_image_get_height (image));
|
||||
gimp_image_take_mask (image, selection);
|
||||
|
||||
g_signal_connect_object (config, "notify::transparency-type",
|
||||
G_CALLBACK (gimp_item_stack_invalidate_previews),
|
||||
@@ -998,6 +994,12 @@ gimp_image_finalize (GObject *object)
|
||||
private->display_name = NULL;
|
||||
}
|
||||
|
||||
if (private->display_path)
|
||||
{
|
||||
g_free (private->display_path);
|
||||
private->display_path = NULL;
|
||||
}
|
||||
|
||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
@@ -1017,6 +1019,12 @@ gimp_image_name_changed (GimpObject *object)
|
||||
private->display_name = NULL;
|
||||
}
|
||||
|
||||
if (private->display_path)
|
||||
{
|
||||
g_free (private->display_path);
|
||||
private->display_path = NULL;
|
||||
}
|
||||
|
||||
/* We never want the empty string as a name, so change empty strings
|
||||
* to NULL strings (without emitting the "name-changed" signal
|
||||
* again)
|
||||
@@ -1144,9 +1152,7 @@ gimp_image_get_description (GimpViewable *viewable,
|
||||
GimpImage *image = GIMP_IMAGE (viewable);
|
||||
|
||||
if (tooltip)
|
||||
{
|
||||
*tooltip = file_utils_uri_display_name (gimp_image_get_uri_or_untitled (image));
|
||||
}
|
||||
*tooltip = g_strdup (gimp_image_get_display_path (image));
|
||||
|
||||
return g_strdup_printf ("%s-%d",
|
||||
gimp_image_get_display_name (image),
|
||||
@@ -1630,8 +1636,7 @@ gimp_image_get_save_a_copy_uri (const GimpImage *image)
|
||||
* @image: A #GimpImage.
|
||||
*
|
||||
* Returns: The XCF file URI, the imported file URI, or the exported
|
||||
* file URI, in that order of precedence. Only to help implement
|
||||
* backwards compatibility with GIMP 2.6 API.
|
||||
* file URI, in that order of precedence.
|
||||
**/
|
||||
const gchar *
|
||||
gimp_image_get_any_uri (const GimpImage *image)
|
||||
@@ -1671,6 +1676,8 @@ gimp_image_set_imported_uri (GimpImage *image,
|
||||
|
||||
g_object_set_data_full (G_OBJECT (image), GIMP_FILE_IMPORT_SOURCE_URI_KEY,
|
||||
g_strdup (uri), (GDestroyNotify) g_free);
|
||||
|
||||
gimp_object_name_changed (GIMP_OBJECT (image));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1693,6 +1700,8 @@ gimp_image_set_exported_uri (GimpImage *image,
|
||||
g_object_set_data_full (G_OBJECT (image),
|
||||
GIMP_FILE_EXPORT_URI_KEY,
|
||||
g_strdup (uri), (GDestroyNotify) g_free);
|
||||
|
||||
gimp_object_name_changed (GIMP_OBJECT (image));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1732,6 +1741,100 @@ gimp_image_get_filename (const GimpImage *image)
|
||||
return g_filename_from_uri (uri, NULL, NULL);
|
||||
}
|
||||
|
||||
static gchar *
|
||||
gimp_image_format_display_uri (GimpImage *image,
|
||||
gboolean basename)
|
||||
{
|
||||
const gchar *uri_format = NULL;
|
||||
const gchar *export_status = NULL;
|
||||
const gchar *uri;
|
||||
const gchar *source;
|
||||
const gchar *dest;
|
||||
gboolean is_imported;
|
||||
gboolean is_exported;
|
||||
gchar *display_uri = NULL;
|
||||
gchar *format_string;
|
||||
gchar *tmp;
|
||||
|
||||
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
|
||||
|
||||
uri = gimp_image_get_uri (image);
|
||||
source = gimp_image_get_imported_uri (image);
|
||||
dest = gimp_image_get_exported_uri (image);
|
||||
|
||||
is_imported = (source != NULL);
|
||||
is_exported = (dest != NULL);
|
||||
|
||||
if (uri)
|
||||
{
|
||||
display_uri = g_strdup (uri);
|
||||
uri_format = "%s";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (is_imported)
|
||||
display_uri = g_strdup (source);
|
||||
|
||||
/* Calculate filename suffix */
|
||||
if (! gimp_image_is_export_dirty (image))
|
||||
{
|
||||
if (is_exported)
|
||||
{
|
||||
display_uri = g_strdup (dest);
|
||||
export_status = _(" (exported)");
|
||||
}
|
||||
else if (is_imported)
|
||||
{
|
||||
export_status = _(" (overwritten)");
|
||||
}
|
||||
else
|
||||
{
|
||||
g_warning ("Unexpected code path, Save+export implementation is buggy!");
|
||||
}
|
||||
}
|
||||
else if (is_imported)
|
||||
{
|
||||
export_status = _(" (imported)");
|
||||
}
|
||||
|
||||
if (display_uri)
|
||||
{
|
||||
gchar *tmp = file_utils_uri_with_new_ext (display_uri, NULL);
|
||||
g_free (display_uri);
|
||||
display_uri = tmp;
|
||||
}
|
||||
|
||||
uri_format = "[%s]";
|
||||
}
|
||||
|
||||
if (! display_uri)
|
||||
{
|
||||
display_uri = g_strdup (gimp_image_get_string_untitled ());
|
||||
}
|
||||
else if (basename)
|
||||
{
|
||||
tmp = file_utils_uri_display_basename (display_uri);
|
||||
g_free (display_uri);
|
||||
display_uri = tmp;
|
||||
}
|
||||
else
|
||||
{
|
||||
tmp = file_utils_uri_display_name (display_uri);
|
||||
g_free (display_uri);
|
||||
display_uri = tmp;
|
||||
}
|
||||
|
||||
format_string = g_strconcat (uri_format, export_status, NULL);
|
||||
|
||||
tmp = g_strdup_printf (format_string, display_uri);
|
||||
g_free (display_uri);
|
||||
display_uri = tmp;
|
||||
|
||||
g_free (format_string);
|
||||
|
||||
return display_uri;
|
||||
}
|
||||
|
||||
const gchar *
|
||||
gimp_image_get_display_name (GimpImage *image)
|
||||
{
|
||||
@@ -1742,15 +1845,26 @@ gimp_image_get_display_name (GimpImage *image)
|
||||
private = GIMP_IMAGE_GET_PRIVATE (image);
|
||||
|
||||
if (! private->display_name)
|
||||
{
|
||||
const gchar *uri = gimp_image_get_uri_or_untitled (image);
|
||||
|
||||
private->display_name = file_utils_uri_display_basename (uri);
|
||||
}
|
||||
private->display_name = gimp_image_format_display_uri (image, TRUE);
|
||||
|
||||
return private->display_name;
|
||||
}
|
||||
|
||||
const gchar *
|
||||
gimp_image_get_display_path (GimpImage *image)
|
||||
{
|
||||
GimpImagePrivate *private;
|
||||
|
||||
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
|
||||
|
||||
private = GIMP_IMAGE_GET_PRIVATE (image);
|
||||
|
||||
if (! private->display_path)
|
||||
private->display_path = gimp_image_format_display_uri (image, FALSE);
|
||||
|
||||
return private->display_path;
|
||||
}
|
||||
|
||||
void
|
||||
gimp_image_set_load_proc (GimpImage *image,
|
||||
GimpPlugInProcedure *proc)
|
||||
@@ -1971,6 +2085,27 @@ gimp_image_mask_changed (GimpImage *image)
|
||||
g_signal_emit (image, gimp_image_signals[MASK_CHANGED], 0);
|
||||
}
|
||||
|
||||
void
|
||||
gimp_image_take_mask (GimpImage *image,
|
||||
GimpChannel *mask)
|
||||
{
|
||||
GimpImagePrivate *private;
|
||||
|
||||
g_return_if_fail (GIMP_IS_IMAGE (image));
|
||||
g_return_if_fail (GIMP_IS_SELECTION (mask));
|
||||
|
||||
private = GIMP_IMAGE_GET_PRIVATE (image);
|
||||
|
||||
if (private->selection_mask)
|
||||
g_object_unref (private->selection_mask);
|
||||
|
||||
private->selection_mask = g_object_ref_sink (mask);
|
||||
|
||||
g_signal_connect (private->selection_mask, "update",
|
||||
G_CALLBACK (gimp_image_mask_update),
|
||||
image);
|
||||
}
|
||||
|
||||
|
||||
/* image components */
|
||||
|
||||
|
@@ -191,6 +191,7 @@ void gimp_image_set_filename (GimpImage *image,
|
||||
gchar * gimp_image_get_filename (const GimpImage *image);
|
||||
|
||||
const gchar * gimp_image_get_display_name (GimpImage *image);
|
||||
const gchar * gimp_image_get_display_path (GimpImage *image);
|
||||
|
||||
void gimp_image_set_load_proc (GimpImage *image,
|
||||
GimpPlugInProcedure *proc);
|
||||
|
@@ -70,7 +70,7 @@ gimp_item_toggle_exclusive_visible (GimpItem *item,
|
||||
undo = gimp_image_undo_can_compress (image, GIMP_TYPE_UNDO_STACK,
|
||||
GIMP_UNDO_GROUP_ITEM_VISIBILITY);
|
||||
|
||||
if (undo && (g_object_get_data (G_OBJECT (undo), "exclusive-item") ==
|
||||
if (undo && (g_object_get_data (G_OBJECT (undo), "exclusive-visible-item") ==
|
||||
(gpointer) item))
|
||||
push_undo = FALSE;
|
||||
|
||||
@@ -84,7 +84,7 @@ gimp_item_toggle_exclusive_visible (GimpItem *item,
|
||||
GIMP_UNDO_GROUP_ITEM_VISIBILITY);
|
||||
|
||||
if (undo)
|
||||
g_object_set_data (G_OBJECT (undo), "exclusive-item",
|
||||
g_object_set_data (G_OBJECT (undo), "exclusive-visible-item",
|
||||
(gpointer) item);
|
||||
}
|
||||
|
||||
@@ -125,6 +125,93 @@ gimp_item_toggle_exclusive_visible (GimpItem *item,
|
||||
g_list_free (ancestry);
|
||||
}
|
||||
|
||||
void
|
||||
gimp_item_toggle_exclusive_linked (GimpItem *item,
|
||||
GimpContext *context)
|
||||
{
|
||||
GList *on = NULL;
|
||||
GList *off = NULL;
|
||||
GList *list;
|
||||
|
||||
g_return_if_fail (GIMP_IS_ITEM (item));
|
||||
g_return_if_fail (gimp_item_is_attached (item));
|
||||
g_return_if_fail (GIMP_IS_CONTEXT (context));
|
||||
|
||||
for (list = gimp_item_get_container_iter (item);
|
||||
list;
|
||||
list = g_list_next (list))
|
||||
{
|
||||
GimpItem *other = list->data;
|
||||
|
||||
if (other != item)
|
||||
{
|
||||
if (gimp_item_get_linked (other))
|
||||
on = g_list_prepend (on, other);
|
||||
else
|
||||
off = g_list_prepend (off, other);
|
||||
}
|
||||
}
|
||||
|
||||
if (on || off || ! gimp_item_get_linked (item))
|
||||
{
|
||||
GimpImage *image = gimp_item_get_image (item);
|
||||
GimpUndo *undo;
|
||||
gboolean push_undo = TRUE;
|
||||
|
||||
undo = gimp_image_undo_can_compress (image, GIMP_TYPE_UNDO_STACK,
|
||||
GIMP_UNDO_GROUP_ITEM_LINKED);
|
||||
|
||||
if (undo && (g_object_get_data (G_OBJECT (undo), "exclusive-linked-item") ==
|
||||
(gpointer) item))
|
||||
push_undo = FALSE;
|
||||
|
||||
if (push_undo)
|
||||
{
|
||||
if (gimp_image_undo_group_start (image,
|
||||
GIMP_UNDO_GROUP_ITEM_LINKED,
|
||||
_("Set Item Exclusive Linked")))
|
||||
{
|
||||
undo = gimp_image_undo_can_compress (image, GIMP_TYPE_UNDO_STACK,
|
||||
GIMP_UNDO_GROUP_ITEM_LINKED);
|
||||
|
||||
if (undo)
|
||||
g_object_set_data (G_OBJECT (undo), "exclusive-linked-item",
|
||||
(gpointer) item);
|
||||
}
|
||||
|
||||
gimp_image_undo_push_item_linked (image, NULL, item);
|
||||
|
||||
for (list = on; list; list = g_list_next (list))
|
||||
gimp_image_undo_push_item_linked (image, NULL, list->data);
|
||||
|
||||
for (list = off; list; list = g_list_next (list))
|
||||
gimp_image_undo_push_item_linked (image, NULL, list->data);
|
||||
|
||||
gimp_image_undo_group_end (image);
|
||||
}
|
||||
else
|
||||
{
|
||||
gimp_undo_refresh_preview (undo, context);
|
||||
}
|
||||
|
||||
if (off || ! gimp_item_get_linked (item))
|
||||
{
|
||||
gimp_item_set_linked (item, TRUE, FALSE);
|
||||
|
||||
for (list = off; list; list = g_list_next (list))
|
||||
gimp_item_set_linked (list->data, TRUE, FALSE);
|
||||
}
|
||||
else
|
||||
{
|
||||
for (list = on; list; list = g_list_next (list))
|
||||
gimp_item_set_linked (list->data, FALSE, FALSE);
|
||||
}
|
||||
|
||||
g_list_free (on);
|
||||
g_list_free (off);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* private functions */
|
||||
|
||||
|
@@ -24,6 +24,8 @@
|
||||
|
||||
void gimp_item_toggle_exclusive_visible (GimpItem *item,
|
||||
GimpContext *context);
|
||||
void gimp_item_toggle_exclusive_linked (GimpItem *item,
|
||||
GimpContext *context);
|
||||
|
||||
|
||||
#endif /* __GIMP_ITEM_EXCLUSIVE_H__ */
|
||||
|
@@ -988,7 +988,7 @@ gimp_layer_get_opacity_at (GimpPickable *pickable,
|
||||
|
||||
if (x >= 0 && x < gimp_item_get_width (GIMP_ITEM (layer)) &&
|
||||
y >= 0 && y < gimp_item_get_height (GIMP_ITEM (layer)) &&
|
||||
gimp_item_get_visible (GIMP_ITEM (layer)))
|
||||
gimp_item_is_visible (GIMP_ITEM (layer)))
|
||||
{
|
||||
/* If the point is inside, and the layer has no
|
||||
* alpha channel, success!
|
||||
|
@@ -246,7 +246,7 @@ gimp_tag_compare_func (const void *p1,
|
||||
/**
|
||||
* gimp_tag_compare_with_string:
|
||||
* @tag: a #GimpTag object.
|
||||
* @tag_string: pointer to right-hand #GimpTag object.
|
||||
* @tag_string: the string to compare to.
|
||||
*
|
||||
* Compares tag and a string according to tag comparison rules. Similar to
|
||||
* gimp_tag_compare_func(), but can be used without creating temporary tag
|
||||
@@ -276,6 +276,42 @@ gimp_tag_compare_with_string (GimpTag *tag,
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_tag_has_prefix:
|
||||
* @tag: a #GimpTag object.
|
||||
* @prefix_string: the prefix to compare to.
|
||||
*
|
||||
* Compares tag and a prefix according to tag comparison rules. Similar to
|
||||
* gimp_tag_compare_with_string(), but does not work on the collate key
|
||||
* because that can't be matched partially.
|
||||
*
|
||||
* Return value: wheher #tag starts with @prefix_string.
|
||||
**/
|
||||
gboolean
|
||||
gimp_tag_has_prefix (GimpTag *tag,
|
||||
const gchar *prefix_string)
|
||||
{
|
||||
gchar *case_folded1;
|
||||
gchar *case_folded2;
|
||||
gboolean has_prefix;
|
||||
|
||||
g_return_val_if_fail (GIMP_IS_TAG (tag), FALSE);
|
||||
g_return_val_if_fail (prefix_string != NULL, FALSE);
|
||||
|
||||
case_folded1 = g_utf8_casefold (g_quark_to_string (tag->tag), -1);
|
||||
case_folded2 = g_utf8_casefold (prefix_string, -1);
|
||||
|
||||
has_prefix = g_str_has_prefix (case_folded1, case_folded2);
|
||||
|
||||
g_free (case_folded1);
|
||||
g_free (case_folded2);
|
||||
|
||||
g_printerr ("'%s' has prefix '%s': %d\n",
|
||||
g_quark_to_string (tag->tag), prefix_string, has_prefix);
|
||||
|
||||
return has_prefix;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_tag_string_make_valid:
|
||||
* @tag_string: a text string.
|
||||
|
@@ -68,6 +68,8 @@ gint gimp_tag_compare_func (const void *p1,
|
||||
const void *p2);
|
||||
gint gimp_tag_compare_with_string (GimpTag *tag,
|
||||
const gchar *tag_string);
|
||||
gboolean gimp_tag_has_prefix (GimpTag *tag,
|
||||
const gchar *prefix_string);
|
||||
gchar * gimp_tag_string_make_valid (const gchar *tag_string);
|
||||
gboolean gimp_tag_is_tag_separator (gunichar c);
|
||||
|
||||
|
@@ -138,7 +138,7 @@ gimp_tool_info_finalize (GObject *object)
|
||||
if (tool_info->help)
|
||||
{
|
||||
g_free (tool_info->help);
|
||||
tool_info->blurb = NULL;
|
||||
tool_info->help = NULL;
|
||||
}
|
||||
|
||||
if (tool_info->menu_label)
|
||||
|
@@ -900,7 +900,7 @@ gimp_viewable_get_pixbuf (GimpViewable *viewable,
|
||||
if (gdk_pixbuf_get_width (private->preview_pixbuf) == width &&
|
||||
gdk_pixbuf_get_height (private->preview_pixbuf) == height)
|
||||
{
|
||||
return pixbuf;
|
||||
return private->preview_pixbuf;
|
||||
}
|
||||
|
||||
g_object_unref (private->preview_pixbuf);
|
||||
|
@@ -191,6 +191,7 @@ file_save_dialog_response (GtkWidget *save_dialog,
|
||||
save_proc,
|
||||
GIMP_RUN_INTERACTIVE,
|
||||
! dialog->save_a_copy && ! dialog->export,
|
||||
FALSE,
|
||||
dialog->export,
|
||||
FALSE))
|
||||
{
|
||||
@@ -214,28 +215,15 @@ file_save_dialog_response (GtkWidget *save_dialog,
|
||||
/* make sure the menus are updated with the keys we've just set */
|
||||
gimp_image_flush (dialog->image);
|
||||
|
||||
/* Handle close-after-saing */
|
||||
if (dialog)
|
||||
/* Handle close-after-saving */
|
||||
if (dialog->close_after_saving && dialog->display_to_close)
|
||||
{
|
||||
GtkWindow *parent;
|
||||
|
||||
parent = gtk_window_get_transient_for (GTK_WINDOW (dialog));
|
||||
|
||||
if (dialog->close_after_saving)
|
||||
{
|
||||
if (GIMP_IS_DISPLAY_SHELL (parent))
|
||||
{
|
||||
GimpDisplay *display;
|
||||
|
||||
display = GIMP_DISPLAY_SHELL (parent)->display;
|
||||
|
||||
if (! gimp_image_is_dirty (gimp_display_get_image (display)))
|
||||
gimp_display_close (display);
|
||||
}
|
||||
}
|
||||
|
||||
gtk_widget_destroy (save_dialog);
|
||||
GimpDisplay *display = GIMP_DISPLAY (dialog->display_to_close);
|
||||
if (display && ! gimp_image_is_dirty (gimp_display_get_image (display)))
|
||||
gimp_display_close (display);
|
||||
}
|
||||
|
||||
gtk_widget_destroy (save_dialog);
|
||||
}
|
||||
|
||||
g_free (uri);
|
||||
@@ -304,11 +292,11 @@ file_save_dialog_check_uri (GtkWidget *save_dialog,
|
||||
|
||||
GIMP_LOG (SAVE_DIALOG, "basename has no '.', trying to add extension");
|
||||
|
||||
if (! save_proc)
|
||||
if (! save_proc && ! dialog->export)
|
||||
{
|
||||
ext = "xcf";
|
||||
}
|
||||
else if (save_proc->extensions_list)
|
||||
else if (save_proc && save_proc->extensions_list)
|
||||
{
|
||||
ext = save_proc->extensions_list->data;
|
||||
}
|
||||
@@ -629,7 +617,8 @@ file_save_dialog_save_image (GimpProgress *progress,
|
||||
GimpPlugInProcedure *save_proc,
|
||||
GimpRunMode run_mode,
|
||||
gboolean change_saved_state,
|
||||
gboolean export,
|
||||
gboolean export_backward,
|
||||
gboolean export_forward,
|
||||
gboolean verbose_cancel)
|
||||
{
|
||||
GimpPDBStatusType status;
|
||||
@@ -645,7 +634,9 @@ file_save_dialog_save_image (GimpProgress *progress,
|
||||
}
|
||||
|
||||
status = file_save (gimp, image, progress, uri,
|
||||
save_proc, run_mode, change_saved_state, export, &error);
|
||||
save_proc, run_mode,
|
||||
change_saved_state, export_backward, export_forward,
|
||||
&error);
|
||||
|
||||
switch (status)
|
||||
{
|
||||
|
@@ -29,7 +29,8 @@ gboolean file_save_dialog_save_image (GimpProgress *progress_and_handl
|
||||
GimpPlugInProcedure *write_proc,
|
||||
GimpRunMode run_mode,
|
||||
gboolean save_a_copy,
|
||||
gboolean export,
|
||||
gboolean export_backward,
|
||||
gboolean export_forward,
|
||||
gboolean verbose_cancel);
|
||||
|
||||
|
||||
|
@@ -128,7 +128,7 @@ module_dialog_new (Gimp *gimp)
|
||||
gimp_standard_help_func, GIMP_HELP_MODULE_DIALOG,
|
||||
|
||||
GTK_STOCK_REFRESH, RESPONSE_REFRESH,
|
||||
GTK_STOCK_CLOSE, GTK_STOCK_CLOSE,
|
||||
GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,
|
||||
|
||||
NULL);
|
||||
|
||||
@@ -282,22 +282,25 @@ static void
|
||||
dialog_select_callback (GtkTreeSelection *sel,
|
||||
ModuleDialog *dialog)
|
||||
{
|
||||
GimpModule *module;
|
||||
GtkTreeIter iter;
|
||||
GtkTreeIter iter;
|
||||
|
||||
gtk_tree_selection_get_selected (sel, NULL, &iter);
|
||||
gtk_tree_model_get (GTK_TREE_MODEL (dialog->list), &iter,
|
||||
COLUMN_MODULE, &module, -1);
|
||||
if (gtk_tree_selection_get_selected (sel, NULL, &iter))
|
||||
{
|
||||
GimpModule *module;
|
||||
|
||||
if (module)
|
||||
g_object_unref (module);
|
||||
gtk_tree_model_get (GTK_TREE_MODEL (dialog->list), &iter,
|
||||
COLUMN_MODULE, &module, -1);
|
||||
|
||||
if (dialog->selected == module)
|
||||
return;
|
||||
if (module)
|
||||
g_object_unref (module);
|
||||
|
||||
dialog->selected = module;
|
||||
if (dialog->selected == module)
|
||||
return;
|
||||
|
||||
dialog_info_update (dialog->gimp->module_db, dialog->selected, dialog);
|
||||
dialog->selected = module;
|
||||
|
||||
dialog_info_update (dialog->gimp->module_db, dialog->selected, dialog);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
@@ -24,7 +24,6 @@
|
||||
|
||||
#define GIMP_CANVAS_EVENT_MASK (GDK_EXPOSURE_MASK | \
|
||||
GDK_POINTER_MOTION_MASK | \
|
||||
GDK_POINTER_MOTION_HINT_MASK | \
|
||||
GDK_BUTTON_PRESS_MASK | \
|
||||
GDK_BUTTON_RELEASE_MASK | \
|
||||
GDK_STRUCTURE_MASK | \
|
||||
|
@@ -292,9 +292,11 @@ static cairo_region_t *
|
||||
gimp_canvas_arc_get_extents (GimpCanvasItem *item,
|
||||
GimpDisplayShell *shell)
|
||||
{
|
||||
cairo_rectangle_int_t rectangle;
|
||||
gdouble center_x, center_y;
|
||||
gdouble radius_x, radius_y;
|
||||
GimpCanvasArcPrivate *private = GET_PRIVATE (item);
|
||||
cairo_region_t *region;
|
||||
cairo_rectangle_int_t rectangle;
|
||||
gdouble center_x, center_y;
|
||||
gdouble radius_x, radius_y;
|
||||
|
||||
gimp_canvas_arc_transform (item, shell,
|
||||
¢er_x, ¢er_y,
|
||||
@@ -305,7 +307,24 @@ gimp_canvas_arc_get_extents (GimpCanvasItem *item,
|
||||
rectangle.width = ceil (center_x + radius_x + 1.5) - rectangle.x;
|
||||
rectangle.height = ceil (center_y + radius_y + 1.5) - rectangle.y;
|
||||
|
||||
return cairo_region_create_rectangle (&rectangle);
|
||||
region = cairo_region_create_rectangle (&rectangle);
|
||||
|
||||
if (! private->filled &&
|
||||
rectangle.width > 64 * 1.43 &&
|
||||
rectangle.height > 64 * 1.43)
|
||||
{
|
||||
radius_x *= 0.7;
|
||||
radius_y *= 0.7;
|
||||
|
||||
rectangle.x = ceil (center_x - radius_x + 1.5);
|
||||
rectangle.y = ceil (center_y - radius_y + 1.5);
|
||||
rectangle.width = floor (center_x + radius_x - 1.5) - rectangle.x;
|
||||
rectangle.height = floor (center_y + radius_y - 1.5) - rectangle.y;
|
||||
|
||||
cairo_region_subtract_rectangle (region, &rectangle);
|
||||
}
|
||||
|
||||
return region;
|
||||
}
|
||||
|
||||
GimpCanvasItem *
|
||||
|
@@ -75,7 +75,7 @@ struct _GimpDisplayPrivate
|
||||
GtkWidget *shell;
|
||||
GSList *update_areas;
|
||||
|
||||
GTimeVal last_flush_now;
|
||||
guint64 last_flush_now;
|
||||
};
|
||||
|
||||
#define GIMP_DISPLAY_GET_PRIVATE(display) \
|
||||
@@ -838,21 +838,13 @@ gimp_display_flush_whenever (GimpDisplay *display,
|
||||
|
||||
if (now)
|
||||
{
|
||||
GTimeVal time_now;
|
||||
gint diff_usec;
|
||||
guint64 now = g_get_monotonic_time ();
|
||||
|
||||
g_get_current_time (&time_now);
|
||||
|
||||
diff_usec = (((guint64) time_now.tv_sec * G_USEC_PER_SEC +
|
||||
(guint64) time_now.tv_usec) -
|
||||
((guint64) private->last_flush_now.tv_sec * G_USEC_PER_SEC +
|
||||
(guint64) private->last_flush_now.tv_usec));
|
||||
|
||||
if (diff_usec > FLUSH_NOW_INTERVAL)
|
||||
if ((now - private->last_flush_now) > FLUSH_NOW_INTERVAL)
|
||||
{
|
||||
gimp_display_shell_flush (gimp_display_get_shell (display), now);
|
||||
|
||||
g_get_current_time (&private->last_flush_now);
|
||||
private->last_flush_now = now;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@@ -54,6 +54,9 @@ static void gimp_display_shell_close_dialog (GimpDisplayShell *shell,
|
||||
GimpImage *image);
|
||||
static void gimp_display_shell_close_name_changed (GimpImage *image,
|
||||
GimpMessageBox *box);
|
||||
static void gimp_display_shell_close_exported (GimpImage *image,
|
||||
const gchar *uri,
|
||||
GimpMessageBox *box);
|
||||
static gboolean gimp_display_shell_close_time_changed (GimpMessageBox *box);
|
||||
static void gimp_display_shell_close_response (GtkWidget *widget,
|
||||
gboolean close,
|
||||
@@ -189,6 +192,9 @@ gimp_display_shell_close_dialog (GimpDisplayShell *shell,
|
||||
g_signal_connect_object (image, "name-changed",
|
||||
G_CALLBACK (gimp_display_shell_close_name_changed),
|
||||
box, 0);
|
||||
g_signal_connect_object (image, "exported",
|
||||
G_CALLBACK (gimp_display_shell_close_exported),
|
||||
box, 0);
|
||||
|
||||
gimp_display_shell_close_name_changed (image, box);
|
||||
|
||||
@@ -233,12 +239,21 @@ gimp_display_shell_close_name_changed (GimpImage *image,
|
||||
gimp_image_get_display_name (image));
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_display_shell_close_exported (GimpImage *image,
|
||||
const gchar *uri,
|
||||
GimpMessageBox *box)
|
||||
{
|
||||
gimp_display_shell_close_time_changed (box);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gimp_display_shell_close_time_changed (GimpMessageBox *box)
|
||||
{
|
||||
GimpImage *image = g_object_get_data (G_OBJECT (box), "gimp-image");
|
||||
gint dirty_time = gimp_image_get_dirty_time (image);
|
||||
GimpImage *image = g_object_get_data (G_OBJECT (box), "gimp-image");
|
||||
gint dirty_time = gimp_image_get_dirty_time (image);
|
||||
gchar *time_text = NULL;
|
||||
gchar *export_text = NULL;
|
||||
|
||||
if (dirty_time)
|
||||
{
|
||||
@@ -250,42 +265,63 @@ gimp_display_shell_close_time_changed (GimpMessageBox *box)
|
||||
if (hours > 0)
|
||||
{
|
||||
if (hours > 1 || minutes == 0)
|
||||
gimp_message_box_set_text (box,
|
||||
ngettext ("If you don't save the image, "
|
||||
"changes from the last hour "
|
||||
"will be lost.",
|
||||
"If you don't save the image, "
|
||||
"changes from the last %d "
|
||||
"hours will be lost.",
|
||||
hours), hours);
|
||||
|
||||
{
|
||||
time_text =
|
||||
g_strdup_printf (ngettext ("If you don't save the image, "
|
||||
"changes from the last hour "
|
||||
"will be lost.",
|
||||
"If you don't save the image, "
|
||||
"changes from the last %d "
|
||||
"hours will be lost.",
|
||||
hours), hours);
|
||||
}
|
||||
else
|
||||
gimp_message_box_set_text (box,
|
||||
ngettext ("If you don't save the image, "
|
||||
"changes from the last hour "
|
||||
"and %d minute will be lost.",
|
||||
"If you don't save the image, "
|
||||
"changes from the last hour "
|
||||
"and %d minutes will be lost.",
|
||||
minutes), minutes);
|
||||
{
|
||||
time_text =
|
||||
g_strdup_printf (ngettext ("If you don't save the image, "
|
||||
"changes from the last hour "
|
||||
"and %d minute will be lost.",
|
||||
"If you don't save the image, "
|
||||
"changes from the last hour "
|
||||
"and %d minutes will be lost.",
|
||||
minutes), minutes);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
gimp_message_box_set_text (box,
|
||||
ngettext ("If you don't save the image, "
|
||||
"changes from the last minute "
|
||||
"will be lost.",
|
||||
"If you don't save the image, "
|
||||
"changes from the last %d "
|
||||
"minutes will be lost.",
|
||||
minutes), minutes);
|
||||
time_text =
|
||||
g_strdup_printf (ngettext ("If you don't save the image, "
|
||||
"changes from the last minute "
|
||||
"will be lost.",
|
||||
"If you don't save the image, "
|
||||
"changes from the last %d "
|
||||
"minutes will be lost.",
|
||||
minutes), minutes);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
if (! gimp_image_is_export_dirty (image))
|
||||
{
|
||||
gimp_message_box_set_text (box, NULL);
|
||||
const gchar *exported_uri = gimp_image_get_exported_uri (image);
|
||||
|
||||
if (! exported_uri)
|
||||
exported_uri = gimp_image_get_imported_uri (image);
|
||||
|
||||
export_text =
|
||||
g_strdup_printf (_("The image has been exported to '%s'."),
|
||||
exported_uri);
|
||||
}
|
||||
|
||||
if (time_text && export_text)
|
||||
gimp_message_box_set_text (box, "%s\n\n%s", time_text, export_text);
|
||||
else if (time_text || export_text)
|
||||
gimp_message_box_set_text (box, "%s", time_text ? time_text : export_text);
|
||||
else
|
||||
gimp_message_box_set_text (box, "%s", time_text);
|
||||
|
||||
g_free (time_text);
|
||||
g_free (export_text);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -310,7 +346,7 @@ gimp_display_shell_close_response (GtkWidget *widget,
|
||||
{
|
||||
GimpUIManager *manager = gimp_image_window_get_ui_manager (window);
|
||||
|
||||
/* FIXME image window: set this display active */
|
||||
gimp_image_window_set_active_shell (window, shell);
|
||||
|
||||
gimp_ui_manager_activate_action (manager,
|
||||
"file", "file-save-and-close");
|
||||
|
@@ -140,18 +140,18 @@ gimp_display_shell_dnd_init (GimpDisplayShell *shell)
|
||||
gimp_dnd_color_dest_add (shell->canvas,
|
||||
gimp_display_shell_drop_color,
|
||||
shell);
|
||||
gimp_dnd_svg_dest_add (shell->canvas,
|
||||
gimp_display_shell_drop_svg,
|
||||
shell);
|
||||
gimp_dnd_component_dest_add (shell->canvas,
|
||||
gimp_display_shell_drop_component,
|
||||
shell);
|
||||
gimp_dnd_pixbuf_dest_add (shell->canvas,
|
||||
gimp_display_shell_drop_pixbuf,
|
||||
shell);
|
||||
gimp_dnd_uri_list_dest_add (shell->canvas,
|
||||
gimp_display_shell_drop_uri_list,
|
||||
shell);
|
||||
gimp_dnd_svg_dest_add (shell->canvas,
|
||||
gimp_display_shell_drop_svg,
|
||||
shell);
|
||||
gimp_dnd_pixbuf_dest_add (shell->canvas,
|
||||
gimp_display_shell_drop_pixbuf,
|
||||
shell);
|
||||
}
|
||||
|
||||
|
||||
@@ -162,20 +162,34 @@ gimp_display_shell_dnd_init (GimpDisplayShell *shell)
|
||||
*/
|
||||
static void
|
||||
gimp_display_shell_dnd_position_item (GimpDisplayShell *shell,
|
||||
GimpImage *image,
|
||||
GimpItem *item)
|
||||
{
|
||||
gint x, y;
|
||||
gint width, height;
|
||||
gint item_width = gimp_item_get_width (item);
|
||||
gint item_height = gimp_item_get_height (item);
|
||||
gint off_x, off_y;
|
||||
|
||||
gimp_display_shell_untransform_viewport (shell, &x, &y, &width, &height);
|
||||
if (item_width >= gimp_image_get_width (image) &&
|
||||
item_height >= gimp_image_get_height (image))
|
||||
{
|
||||
off_x = (gimp_image_get_width (image) - item_width) / 2;
|
||||
off_y = (gimp_image_get_height (image) - item_height) / 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
gint x, y;
|
||||
gint width, height;
|
||||
|
||||
gimp_item_get_offset (item, &off_x, &off_y);
|
||||
gimp_display_shell_untransform_viewport (shell, &x, &y, &width, &height);
|
||||
|
||||
off_x = x + (width - gimp_item_get_width (item)) / 2 - off_x;
|
||||
off_y = y + (height - gimp_item_get_height (item)) / 2 - off_y;
|
||||
off_x = x + (width - item_width) / 2;
|
||||
off_y = y + (height - item_height) / 2;
|
||||
}
|
||||
|
||||
gimp_item_translate (item, off_x, off_y, FALSE);
|
||||
gimp_item_translate (item,
|
||||
off_x - gimp_item_get_offset_x (item),
|
||||
off_y - gimp_item_get_offset_y (item),
|
||||
FALSE);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -231,7 +245,7 @@ gimp_display_shell_drop_drawable (GtkWidget *widget,
|
||||
gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_EDIT_PASTE,
|
||||
_("Drop New Layer"));
|
||||
|
||||
gimp_display_shell_dnd_position_item (shell, new_item);
|
||||
gimp_display_shell_dnd_position_item (shell, image, new_item);
|
||||
|
||||
gimp_item_set_visible (new_item, TRUE, FALSE);
|
||||
gimp_item_set_linked (new_item, FALSE, FALSE);
|
||||
@@ -634,7 +648,7 @@ gimp_display_shell_drop_component (GtkWidget *widget,
|
||||
gimp_image_undo_group_start (dest_image, GIMP_UNDO_GROUP_EDIT_PASTE,
|
||||
_("Drop New Layer"));
|
||||
|
||||
gimp_display_shell_dnd_position_item (shell, new_item);
|
||||
gimp_display_shell_dnd_position_item (shell, image, new_item);
|
||||
|
||||
gimp_image_add_layer (dest_image, new_layer,
|
||||
GIMP_IMAGE_ACTIVE_PARENT, -1, TRUE);
|
||||
@@ -692,7 +706,7 @@ gimp_display_shell_drop_pixbuf (GtkWidget *widget,
|
||||
gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_EDIT_PASTE,
|
||||
_("Drop New Layer"));
|
||||
|
||||
gimp_display_shell_dnd_position_item (shell, new_item);
|
||||
gimp_display_shell_dnd_position_item (shell, image, new_item);
|
||||
|
||||
gimp_image_add_layer (image, new_layer,
|
||||
GIMP_IMAGE_ACTIVE_PARENT, -1, TRUE);
|
||||
|
@@ -172,12 +172,24 @@ gimp_display_shell_render (GimpDisplayShell *shell,
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
|
||||
cairo_surface_mark_dirty (shell->render_surface);
|
||||
|
||||
/* apply filters to the rendered projection */
|
||||
if (shell->filter_stack)
|
||||
gimp_color_display_stack_convert_surface (shell->filter_stack,
|
||||
shell->render_surface);
|
||||
{
|
||||
cairo_surface_t *sub = shell->render_surface;
|
||||
|
||||
if (w != GIMP_DISPLAY_RENDER_BUF_WIDTH ||
|
||||
h != GIMP_DISPLAY_RENDER_BUF_HEIGHT)
|
||||
sub = cairo_image_surface_create_for_data (cairo_image_surface_get_data (sub),
|
||||
CAIRO_FORMAT_ARGB32, w, h,
|
||||
GIMP_DISPLAY_RENDER_BUF_WIDTH * 4);
|
||||
|
||||
gimp_color_display_stack_convert_surface (shell->filter_stack, sub);
|
||||
|
||||
if (sub != shell->render_surface)
|
||||
cairo_surface_destroy (sub);
|
||||
}
|
||||
|
||||
cairo_surface_mark_dirty_rectangle (shell->render_surface, 0, 0, w, h);
|
||||
|
||||
if (shell->mask)
|
||||
{
|
||||
@@ -516,7 +528,7 @@ box_filter_premult (const guint left_weight,
|
||||
|
||||
for (i = 0; i < ALPHA; i++)
|
||||
{
|
||||
dest[i] = ((center_weight * (factors[0] * src[1][i] +
|
||||
dest[i] = (center_weight * (factors[0] * src[1][i] +
|
||||
factors[1] * src[4][i] +
|
||||
factors[2] * src[7][i]) +
|
||||
|
||||
@@ -526,7 +538,7 @@ box_filter_premult (const guint left_weight,
|
||||
|
||||
left_weight * (factors[6] * src[0][i] +
|
||||
factors[7] * src[3][i] +
|
||||
factors[8] * src[6][i])) / sum) >> 8;
|
||||
factors[8] * src[6][i]) + ((255 * sum) >> 1)) / (255 * sum);
|
||||
}
|
||||
|
||||
dest[ALPHA] = (a + (sum >> 1)) / sum;
|
||||
@@ -563,7 +575,7 @@ box_filter_premult (const guint left_weight,
|
||||
|
||||
for (i = 0; i < ALPHA; i++)
|
||||
{
|
||||
dest[i] = ((center_weight * (factors[0] * src[1][i] +
|
||||
dest[i] = (center_weight * (factors[0] * src[1][i] +
|
||||
factors[1] * src[4][i] +
|
||||
factors[2] * src[7][i]) +
|
||||
|
||||
@@ -573,7 +585,7 @@ box_filter_premult (const guint left_weight,
|
||||
|
||||
left_weight * (factors[6] * src[0][i] +
|
||||
factors[7] * src[3][i] +
|
||||
factors[8] * src[6][i])) / sum) >> 8;
|
||||
factors[8] * src[6][i]) + ((255 * sum) >> 1)) / (sum * 255);
|
||||
}
|
||||
|
||||
dest[ALPHA] = (a + (sum >> 1)) / sum;
|
||||
|
@@ -36,9 +36,6 @@
|
||||
#include "core/gimpimage.h"
|
||||
#include "core/gimpitem.h"
|
||||
|
||||
#include "file/file-utils.h"
|
||||
#include "file/gimp-file.h"
|
||||
|
||||
#include "gimpdisplay.h"
|
||||
#include "gimpdisplayshell.h"
|
||||
#include "gimpdisplayshell-title.h"
|
||||
@@ -57,11 +54,6 @@ static gint gimp_display_shell_format_title (GimpDisplayShell *display,
|
||||
gchar *title,
|
||||
gint title_len,
|
||||
const gchar *format);
|
||||
static gint gimp_display_shell_format_filename (gchar *buf,
|
||||
gint len,
|
||||
gint start,
|
||||
GimpImage *image,
|
||||
const gchar *filename);
|
||||
|
||||
|
||||
/* public functions */
|
||||
@@ -211,24 +203,13 @@ gimp_display_shell_format_title (GimpDisplayShell *shell,
|
||||
break;
|
||||
|
||||
case 'f': /* base filename */
|
||||
{
|
||||
const gchar *name = gimp_image_get_display_name (image);
|
||||
|
||||
i += gimp_display_shell_format_filename (title, title_len, i, image, name);
|
||||
}
|
||||
i += print (title, title_len, i, "%s",
|
||||
gimp_image_get_display_name (image));
|
||||
break;
|
||||
|
||||
case 'F': /* full filename */
|
||||
{
|
||||
gchar *filename;
|
||||
const gchar *uri = gimp_image_get_uri_or_untitled (image);
|
||||
|
||||
filename = file_utils_uri_display_name (uri);
|
||||
|
||||
i += gimp_display_shell_format_filename (title, title_len, i, image, filename);
|
||||
|
||||
g_free (filename);
|
||||
}
|
||||
i += print (title, title_len, i, "%s",
|
||||
gimp_image_get_display_path (image));
|
||||
break;
|
||||
|
||||
case 'p': /* PDB id */
|
||||
@@ -451,69 +432,3 @@ gimp_display_shell_format_title (GimpDisplayShell *shell,
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
static gint
|
||||
gimp_display_shell_format_filename (gchar *buf,
|
||||
gint len,
|
||||
gint start,
|
||||
GimpImage *image,
|
||||
const gchar *filename)
|
||||
{
|
||||
const gchar *source = NULL;
|
||||
const gchar *name_format = NULL;
|
||||
const gchar *export_status = NULL;
|
||||
gchar *format_string = NULL;
|
||||
gchar *name = NULL;
|
||||
gboolean is_imported = FALSE;
|
||||
gint incr = 0;
|
||||
|
||||
source = gimp_image_get_imported_uri (image);
|
||||
|
||||
/* Note that as soon as the image is saved, it is not considered
|
||||
* imported any longer (gimp_image_set_imported_uri (image, NULL) is
|
||||
* called)
|
||||
*/
|
||||
is_imported = (source != NULL);
|
||||
|
||||
/* Calculate filename and format */
|
||||
if (! is_imported)
|
||||
{
|
||||
name = g_strdup (filename);
|
||||
name_format = "%s";
|
||||
}
|
||||
else
|
||||
{
|
||||
gchar *source_no_ext = file_utils_uri_with_new_ext (source, NULL);
|
||||
name = file_utils_uri_display_basename (source_no_ext);
|
||||
g_free (source_no_ext);
|
||||
|
||||
name_format = "[%s]";
|
||||
}
|
||||
|
||||
/* Calculate filename suffix */
|
||||
if (! gimp_image_is_export_dirty (image))
|
||||
{
|
||||
gboolean is_exported;
|
||||
is_exported = (gimp_image_get_exported_uri (image) != NULL);
|
||||
if (is_exported)
|
||||
export_status = _(" (exported)");
|
||||
else if (is_imported)
|
||||
export_status = _(" (overwritten)");
|
||||
else
|
||||
g_warning ("Unexpected code path, Save+export implementation is buggy!");
|
||||
}
|
||||
else if (is_imported)
|
||||
{
|
||||
export_status = _(" (imported)");
|
||||
}
|
||||
|
||||
/* Merge strings and print the result */
|
||||
format_string = g_strconcat (name_format, export_status, NULL);
|
||||
incr = print (buf, len, start, format_string, name);
|
||||
g_free (format_string);
|
||||
|
||||
/* Cleanup */
|
||||
g_free (name);
|
||||
|
||||
return incr;
|
||||
}
|
||||
|
@@ -439,13 +439,16 @@ gimp_display_shell_canvas_tool_events (GtkWidget *canvas,
|
||||
|
||||
case GDK_BUTTON_PRESS:
|
||||
{
|
||||
GdkEventButton *bevent = (GdkEventButton *) event;
|
||||
GdkEventButton *bevent = (GdkEventButton *) event;
|
||||
GdkModifierType button_state;
|
||||
|
||||
/* ignore new mouse events */
|
||||
if (gimp->busy || shell->scrolling || shell->pointer_grabbed)
|
||||
return TRUE;
|
||||
|
||||
state |= gimp_display_shell_button_to_state (bevent->button);
|
||||
button_state = gimp_display_shell_button_to_state (bevent->button);
|
||||
|
||||
state |= button_state;
|
||||
|
||||
/* ignore new buttons while another button is down */
|
||||
if (((state & (GDK_BUTTON1_MASK)) && (state & (GDK_BUTTON2_MASK |
|
||||
@@ -473,7 +476,8 @@ gimp_display_shell_canvas_tool_events (GtkWidget *canvas,
|
||||
gimp_display_shell_update_focus (shell, TRUE,
|
||||
&image_coords, state);
|
||||
gimp_display_shell_update_cursor (shell, &display_coords,
|
||||
&image_coords, state, FALSE);
|
||||
&image_coords, state & ~button_state,
|
||||
FALSE);
|
||||
|
||||
if (gdk_event_triggers_context_menu (event))
|
||||
{
|
||||
@@ -944,6 +948,9 @@ gimp_display_shell_canvas_tool_events (GtkWidget *canvas,
|
||||
}
|
||||
}
|
||||
|
||||
if (compressed_motion)
|
||||
gdk_event_free (compressed_motion);
|
||||
|
||||
return_val = TRUE;
|
||||
}
|
||||
break;
|
||||
@@ -998,28 +1005,37 @@ gimp_display_shell_canvas_tool_events (GtkWidget *canvas,
|
||||
|
||||
switch (kevent->keyval)
|
||||
{
|
||||
gboolean arrow_key = FALSE;
|
||||
|
||||
case GDK_KEY_Left:
|
||||
case GDK_KEY_Right:
|
||||
case GDK_KEY_Up:
|
||||
case GDK_KEY_Down:
|
||||
arrow_key = TRUE;
|
||||
|
||||
case GDK_KEY_Return:
|
||||
case GDK_KEY_KP_Enter:
|
||||
case GDK_KEY_ISO_Enter:
|
||||
case GDK_KEY_BackSpace:
|
||||
case GDK_KEY_Escape:
|
||||
case GDK_KEY_Left:
|
||||
case GDK_KEY_Right:
|
||||
case GDK_KEY_Up:
|
||||
case GDK_KEY_Down:
|
||||
if (gimp_image_is_empty (image) ||
|
||||
! tool_manager_key_press_active (gimp,
|
||||
kevent,
|
||||
display))
|
||||
if (! gimp_image_is_empty (image))
|
||||
return_val = tool_manager_key_press_active (gimp,
|
||||
kevent,
|
||||
display);
|
||||
|
||||
if (! return_val)
|
||||
{
|
||||
GimpController *keyboard = gimp_controllers_get_keyboard (gimp);
|
||||
|
||||
if (keyboard)
|
||||
gimp_controller_keyboard_key_press (GIMP_CONTROLLER_KEYBOARD (keyboard),
|
||||
kevent);
|
||||
return_val =
|
||||
gimp_controller_keyboard_key_press (GIMP_CONTROLLER_KEYBOARD (keyboard),
|
||||
kevent);
|
||||
}
|
||||
|
||||
return_val = TRUE;
|
||||
/* always swallow arrow keys, we don't want focus keynav */
|
||||
if (! return_val)
|
||||
return_val = arrow_key;
|
||||
break;
|
||||
|
||||
case GDK_KEY_space:
|
||||
@@ -1048,7 +1064,6 @@ gimp_display_shell_canvas_tool_events (GtkWidget *canvas,
|
||||
if (! gimp_image_is_empty (image))
|
||||
tool_manager_modifier_state_active (gimp, state, display);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1135,7 +1150,6 @@ gimp_display_shell_canvas_tool_events (GtkWidget *canvas,
|
||||
if (! gimp_image_is_empty (image))
|
||||
tool_manager_modifier_state_active (gimp, state, display);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1676,7 +1690,9 @@ gimp_display_shell_initialize_tool (GimpDisplayShell *shell,
|
||||
}
|
||||
else if ((active_tool->drawable !=
|
||||
gimp_image_get_active_drawable (image)) &&
|
||||
! gimp_tool_control_get_preserve (active_tool->control))
|
||||
(! gimp_tool_control_get_preserve (active_tool->control) &&
|
||||
(gimp_tool_control_get_dirty_mask (active_tool->control) &
|
||||
GIMP_DIRTY_ACTIVE_DRAWABLE)))
|
||||
{
|
||||
/* create a new one, deleting the current */
|
||||
gimp_context_tool_changed (gimp_get_user_context (gimp));
|
||||
@@ -1787,6 +1803,17 @@ gimp_display_shell_compress_motion (GimpDisplayShell *shell)
|
||||
|
||||
last_motion = event;
|
||||
}
|
||||
else if ((gtk_get_event_widget (event) == shell->canvas) &&
|
||||
(event->any.type == GDK_BUTTON_RELEASE))
|
||||
{
|
||||
requeued_events = g_list_prepend (requeued_events, event);
|
||||
|
||||
while (gdk_events_pending ())
|
||||
if ((event = gdk_event_get ()))
|
||||
requeued_events = g_list_prepend (requeued_events, event);
|
||||
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
requeued_events = g_list_prepend (requeued_events, event);
|
||||
|
@@ -738,9 +738,14 @@ gimp_display_shell_constructed (GObject *object)
|
||||
}
|
||||
else
|
||||
{
|
||||
#if 0
|
||||
/* Disabled because it sets GDK_POINTER_MOTION_HINT on
|
||||
* shell->canvas. For info see Bug 677375
|
||||
*/
|
||||
gimp_help_set_help_data (shell->canvas,
|
||||
_("Drop image files here to open them"),
|
||||
NULL);
|
||||
#endif
|
||||
|
||||
gimp_statusbar_empty (GIMP_STATUSBAR (shell->statusbar));
|
||||
}
|
||||
@@ -1314,10 +1319,13 @@ gimp_display_shell_empty (GimpDisplayShell *shell)
|
||||
|
||||
gimp_display_shell_unset_cursor (shell);
|
||||
|
||||
gimp_display_shell_appearance_update (shell);
|
||||
gimp_display_shell_sync_config (shell, shell->display->config);
|
||||
|
||||
gimp_display_shell_appearance_update (shell);
|
||||
#if 0
|
||||
gimp_help_set_help_data (shell->canvas,
|
||||
_("Drop image files here to open them"), NULL);
|
||||
#endif
|
||||
|
||||
gimp_statusbar_empty (GIMP_STATUSBAR (shell->statusbar));
|
||||
|
||||
@@ -1366,8 +1374,9 @@ gimp_display_shell_fill (GimpDisplayShell *shell,
|
||||
gimp_display_shell_sync_config (shell, shell->display->config);
|
||||
|
||||
gimp_display_shell_appearance_update (shell);
|
||||
|
||||
#if 0
|
||||
gimp_help_set_help_data (shell->canvas, NULL, NULL);
|
||||
#endif
|
||||
|
||||
gimp_statusbar_fill (GIMP_STATUSBAR (shell->statusbar));
|
||||
|
||||
|
@@ -74,6 +74,9 @@
|
||||
/* GtkPaned position of the right docks area */
|
||||
#define GIMP_IMAGE_WINDOW_RIGHT_DOCKS_POS "right-docks-position"
|
||||
|
||||
/* Whether the window's maximized or not */
|
||||
#define GIMP_IMAGE_WINDOW_MAXIMIZED "maximized"
|
||||
|
||||
|
||||
enum
|
||||
{
|
||||
@@ -589,7 +592,7 @@ gimp_image_window_window_state_event (GtkWidget *widget,
|
||||
GIMP_LOG (WM, "Image window '%s' [%p] set fullscreen %s",
|
||||
gtk_window_get_title (GTK_WINDOW (widget)),
|
||||
widget,
|
||||
fullscreen ? "TURE" : "FALSE");
|
||||
fullscreen ? "TRUE" : "FALSE");
|
||||
|
||||
if (private->menubar)
|
||||
gtk_widget_set_name (private->menubar,
|
||||
@@ -805,8 +808,8 @@ gimp_image_window_get_aux_info (GimpSessionManaged *session_managed)
|
||||
if (config->single_window_mode)
|
||||
{
|
||||
GimpSessionInfoAux *aux;
|
||||
char widthbuf[128];
|
||||
|
||||
gchar widthbuf[128];
|
||||
|
||||
g_snprintf (widthbuf, sizeof (widthbuf), "%d",
|
||||
gtk_paned_get_position (GTK_PANED (private->left_hpane)));
|
||||
aux = gimp_session_info_aux_new (GIMP_IMAGE_WINDOW_LEFT_DOCKS_WIDTH, widthbuf);
|
||||
@@ -816,6 +819,11 @@ gimp_image_window_get_aux_info (GimpSessionManaged *session_managed)
|
||||
gtk_paned_get_position (GTK_PANED (private->right_hpane)));
|
||||
aux = gimp_session_info_aux_new (GIMP_IMAGE_WINDOW_RIGHT_DOCKS_POS, widthbuf);
|
||||
aux_info = g_list_append (aux_info, aux);
|
||||
|
||||
aux = gimp_session_info_aux_new (GIMP_IMAGE_WINDOW_MAXIMIZED,
|
||||
gimp_image_window_is_maximized (GIMP_IMAGE_WINDOW (session_managed)) ?
|
||||
"yes" : "no");
|
||||
aux_info = g_list_append (aux_info, aux);
|
||||
}
|
||||
|
||||
return aux_info;
|
||||
@@ -846,6 +854,7 @@ gimp_image_window_set_aux_info (GimpSessionManaged *session_managed,
|
||||
gint left_docks_width = -1;
|
||||
gint right_docks_pos = -1;
|
||||
gboolean wait_with_right_docks = FALSE;
|
||||
gboolean maximized = FALSE;
|
||||
|
||||
g_return_if_fail (GIMP_IS_IMAGE_WINDOW (session_managed));
|
||||
|
||||
@@ -860,6 +869,9 @@ gimp_image_window_set_aux_info (GimpSessionManaged *session_managed,
|
||||
width = &left_docks_width;
|
||||
else if (! strcmp (aux->name, GIMP_IMAGE_WINDOW_RIGHT_DOCKS_POS))
|
||||
width = &right_docks_pos;
|
||||
else if (! strcmp (aux->name, GIMP_IMAGE_WINDOW_MAXIMIZED))
|
||||
if (! g_ascii_strcasecmp (aux->value, "yes"))
|
||||
maximized = TRUE;
|
||||
|
||||
if (width)
|
||||
sscanf (aux->value, "%d", width);
|
||||
@@ -899,6 +911,11 @@ gimp_image_window_set_aux_info (GimpSessionManaged *session_managed,
|
||||
right_docks_pos);
|
||||
}
|
||||
}
|
||||
|
||||
if (maximized)
|
||||
gtk_window_maximize (GTK_WINDOW (session_managed));
|
||||
else
|
||||
gtk_window_unmaximize (GTK_WINDOW (session_managed));
|
||||
}
|
||||
|
||||
|
||||
@@ -1165,6 +1182,18 @@ gimp_image_window_is_iconified (GimpImageWindow *window)
|
||||
return (private->window_state & GDK_WINDOW_STATE_ICONIFIED) != 0;
|
||||
}
|
||||
|
||||
gboolean
|
||||
gimp_image_window_is_maximized (GimpImageWindow *window)
|
||||
{
|
||||
GimpImageWindowPrivate *private;
|
||||
|
||||
g_return_val_if_fail (GIMP_IS_IMAGE_WINDOW (window), FALSE);
|
||||
|
||||
private = GIMP_IMAGE_WINDOW_GET_PRIVATE (window);
|
||||
|
||||
return (private->window_state & GDK_WINDOW_STATE_MAXIMIZED) != 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_image_window_has_toolbox:
|
||||
* @window:
|
||||
@@ -1606,6 +1635,9 @@ gimp_image_window_switch_page (GtkNotebook *notebook,
|
||||
active_display,
|
||||
NULL /*new_entry_id*/);
|
||||
|
||||
gimp_context_set_display (gimp_get_user_context (private->gimp),
|
||||
active_display);
|
||||
|
||||
gimp_ui_manager_update (private->menubar_manager, active_display);
|
||||
}
|
||||
|
||||
@@ -1872,6 +1904,7 @@ gimp_image_window_create_tab_label (GimpImageWindow *window,
|
||||
view = gimp_view_new_by_types (gimp_get_user_context (shell->display->gimp),
|
||||
GIMP_TYPE_VIEW, GIMP_TYPE_IMAGE,
|
||||
GIMP_VIEW_SIZE_LARGE, 0, FALSE);
|
||||
gtk_widget_set_size_request (view, GIMP_VIEW_SIZE_LARGE, -1);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), view, FALSE, FALSE, 0);
|
||||
gtk_widget_show (view);
|
||||
|
||||
|
@@ -81,6 +81,7 @@ void gimp_image_window_set_show_statusbar (GimpImageWindow *win
|
||||
gboolean gimp_image_window_get_show_statusbar (GimpImageWindow *window);
|
||||
|
||||
gboolean gimp_image_window_is_iconified (GimpImageWindow *window);
|
||||
gboolean gimp_image_window_is_maximized (GimpImageWindow *window);
|
||||
|
||||
gboolean gimp_image_window_has_toolbox (GimpImageWindow *window);
|
||||
|
||||
|
@@ -53,10 +53,26 @@ static void gimp_tool_dialog_shell_unmap (GimpDisplayShell *shell,
|
||||
|
||||
G_DEFINE_TYPE (GimpToolDialog, gimp_tool_dialog, GIMP_TYPE_VIEWABLE_DIALOG)
|
||||
|
||||
static void
|
||||
gimp_tool_dialog_dispose (GObject *object)
|
||||
{
|
||||
GimpToolDialogPrivate *private = GET_PRIVATE (object);
|
||||
|
||||
if (private->shell)
|
||||
{
|
||||
g_object_remove_weak_pointer (G_OBJECT (private->shell),
|
||||
(gpointer) &private->shell);
|
||||
private->shell = NULL;
|
||||
}
|
||||
|
||||
G_OBJECT_CLASS (gimp_tool_dialog_parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_tool_dialog_class_init (GimpToolDialogClass *klass)
|
||||
{
|
||||
G_OBJECT_CLASS (klass)->dispose = gimp_tool_dialog_dispose;
|
||||
|
||||
g_type_class_add_private (klass, sizeof (GimpToolDialogPrivate));
|
||||
}
|
||||
|
||||
@@ -137,6 +153,8 @@ gimp_tool_dialog_set_shell (GimpToolDialog *tool_dialog,
|
||||
|
||||
if (private->shell)
|
||||
{
|
||||
g_object_remove_weak_pointer (G_OBJECT (private->shell),
|
||||
(gpointer) &private->shell);
|
||||
g_signal_handlers_disconnect_by_func (private->shell,
|
||||
gimp_tool_dialog_shell_unmap,
|
||||
tool_dialog);
|
||||
@@ -153,6 +171,8 @@ gimp_tool_dialog_set_shell (GimpToolDialog *tool_dialog,
|
||||
G_CALLBACK (gimp_tool_dialog_shell_unmap),
|
||||
tool_dialog, 0);
|
||||
|
||||
g_object_add_weak_pointer (G_OBJECT (private->shell),
|
||||
(gpointer) &private->shell);
|
||||
toplevel = gtk_widget_get_toplevel (GTK_WIDGET (shell));
|
||||
|
||||
gtk_window_set_transient_for (GTK_WINDOW (tool_dialog),
|
||||
|
@@ -436,13 +436,17 @@ file_open_with_proc_and_display (Gimp *gimp,
|
||||
{
|
||||
GimpDocumentList *documents = GIMP_DOCUMENT_LIST (gimp->documents);
|
||||
GimpImagefile *imagefile;
|
||||
const gchar *any_uri;
|
||||
|
||||
imagefile = gimp_document_list_add_uri (documents, uri, mime_type);
|
||||
|
||||
/* can only create a thumbnail if the passed uri and the
|
||||
* resulting image's uri match.
|
||||
* resulting image's uri match. Use any_uri() here so we
|
||||
* create thumbnails for both XCF and imported images.
|
||||
*/
|
||||
if (strcmp (uri, gimp_image_get_uri_or_untitled (image)) == 0)
|
||||
any_uri = gimp_image_get_any_uri (image);
|
||||
|
||||
if (any_uri && ! strcmp (uri, any_uri))
|
||||
{
|
||||
/* no need to save a thumbnail if there's a good one already */
|
||||
if (! gimp_imagefile_check_thumbnail (imagefile))
|
||||
|
@@ -74,7 +74,8 @@ file_save (Gimp *gimp,
|
||||
GimpPlugInProcedure *file_proc,
|
||||
GimpRunMode run_mode,
|
||||
gboolean change_saved_state,
|
||||
gboolean export,
|
||||
gboolean export_backward,
|
||||
gboolean export_forward,
|
||||
GError **error)
|
||||
{
|
||||
GimpDrawable *drawable;
|
||||
@@ -91,6 +92,8 @@ file_save (Gimp *gimp,
|
||||
g_return_val_if_fail (uri != NULL, GIMP_PDB_CALLING_ERROR);
|
||||
g_return_val_if_fail (GIMP_IS_PLUG_IN_PROCEDURE (file_proc),
|
||||
GIMP_PDB_CALLING_ERROR);
|
||||
g_return_val_if_fail ((export_backward && export_forward) == FALSE,
|
||||
GIMP_PDB_CALLING_ERROR);
|
||||
g_return_val_if_fail (error == NULL || *error == NULL,
|
||||
GIMP_PDB_CALLING_ERROR);
|
||||
|
||||
@@ -168,7 +171,17 @@ file_save (Gimp *gimp,
|
||||
|
||||
gimp_image_clean_all (image);
|
||||
}
|
||||
else if (export)
|
||||
else if (export_backward)
|
||||
{
|
||||
/* We exported the image back to its imported source,
|
||||
* change nothing about export/import flags, only set
|
||||
* the export state to clean
|
||||
*/
|
||||
gimp_image_export_clean_all (image);
|
||||
|
||||
gimp_object_name_changed (GIMP_OBJECT (image));
|
||||
}
|
||||
else if (export_forward)
|
||||
{
|
||||
/* Remeber the last entered Export URI for the image. We
|
||||
* only need to do this explicitly when exporting. It
|
||||
@@ -186,7 +199,7 @@ file_save (Gimp *gimp,
|
||||
gimp_image_export_clean_all (image);
|
||||
}
|
||||
|
||||
if (export)
|
||||
if (export_backward || export_forward)
|
||||
gimp_image_exported (image, uri);
|
||||
else
|
||||
gimp_image_saved (image, uri);
|
||||
|
@@ -28,7 +28,8 @@ GimpPDBStatusType file_save (Gimp *gimp,
|
||||
GimpPlugInProcedure *file_proc,
|
||||
GimpRunMode run_mode,
|
||||
gboolean change_saved_state,
|
||||
gboolean export,
|
||||
gboolean export_backward,
|
||||
gboolean export_forward,
|
||||
GError **error);
|
||||
|
||||
|
||||
|
@@ -32,7 +32,6 @@
|
||||
|
||||
/*#define DEBUG_CAGE */
|
||||
|
||||
#define N_ITEMS_PER_ALLOC 10
|
||||
/* This DELTA is aimed to not have handle on exact pixel during computation,
|
||||
* to avoid particular case. It shouldn't be so usefull, but it's a double
|
||||
* safety. */
|
||||
|
@@ -23,6 +23,11 @@
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#ifdef GDK_WINDOWING_QUARTZ
|
||||
#include <Carbon/Carbon.h>
|
||||
#include <sys/param.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_DBUS_GLIB
|
||||
#define DBUS_API_SUBJECT_TO_CHANGE
|
||||
#include <dbus/dbus-glib.h>
|
||||
@@ -36,6 +41,8 @@
|
||||
|
||||
#include "display/gimpdisplay.h"
|
||||
|
||||
#include "file/file-open.h"
|
||||
|
||||
#include "gimpdbusservice.h"
|
||||
#include "gui-unique.h"
|
||||
|
||||
@@ -48,8 +55,6 @@ static DBusGConnection *dbus_connection = NULL;
|
||||
#endif
|
||||
|
||||
#ifdef G_OS_WIN32
|
||||
#include "file/file-open.h"
|
||||
|
||||
static void gui_unique_win32_init (Gimp *gimp);
|
||||
static void gui_unique_win32_exit (void);
|
||||
|
||||
@@ -57,6 +62,14 @@ static Gimp *unique_gimp = NULL;
|
||||
static HWND proxy_window = NULL;
|
||||
#endif
|
||||
|
||||
#ifdef GDK_WINDOWING_QUARTZ
|
||||
static void gui_unique_mac_init (Gimp *gimp);
|
||||
static void gui_unique_mac_exit (void);
|
||||
|
||||
static Gimp *unique_gimp = NULL;
|
||||
AEEventHandlerUPP open_document_callback_proc;
|
||||
#endif
|
||||
|
||||
|
||||
void
|
||||
gui_unique_init (Gimp *gimp)
|
||||
@@ -66,6 +79,10 @@ gui_unique_init (Gimp *gimp)
|
||||
#elif HAVE_DBUS_GLIB
|
||||
gui_dbus_service_init (gimp);
|
||||
#endif
|
||||
|
||||
#ifdef GDK_WINDOWING_QUARTZ
|
||||
gui_unique_mac_init (gimp);
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
@@ -76,6 +93,10 @@ gui_unique_exit (void)
|
||||
#elif HAVE_DBUS_GLIB
|
||||
gui_dbus_service_exit ();
|
||||
#endif
|
||||
|
||||
#ifdef GDK_WINDOWING_QUARTZ
|
||||
gui_unique_mac_exit ();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -179,7 +200,6 @@ gui_unique_win32_idle_open (IdleOpenData *data)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
static LRESULT CALLBACK
|
||||
gui_unique_win32_message_handler (HWND hWnd,
|
||||
UINT uMsg,
|
||||
@@ -254,5 +274,108 @@ gui_unique_win32_exit (void)
|
||||
DestroyWindow (proxy_window);
|
||||
}
|
||||
|
||||
|
||||
#endif /* G_OS_WIN32 */
|
||||
|
||||
|
||||
#ifdef GDK_WINDOWING_QUARTZ
|
||||
|
||||
static gboolean
|
||||
gui_unique_mac_idle_open (gchar *data)
|
||||
{
|
||||
/* We want to be called again later in case that GIMP is not fully
|
||||
* started yet.
|
||||
*/
|
||||
if (! gimp_is_restored (unique_gimp))
|
||||
return TRUE;
|
||||
|
||||
if (data)
|
||||
{
|
||||
file_open_from_command_line (unique_gimp, data, FALSE);
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Handle the kAEOpenDocuments Apple events. This will register
|
||||
* an idle source callback for each filename in the event.
|
||||
*/
|
||||
static pascal OSErr
|
||||
gui_unique_mac_open_documents (const AppleEvent *inAppleEvent,
|
||||
AppleEvent *outAppleEvent,
|
||||
long handlerRefcon)
|
||||
{
|
||||
OSStatus status;
|
||||
AEDescList documents;
|
||||
gchar path[MAXPATHLEN];
|
||||
|
||||
status = AEGetParamDesc (inAppleEvent,
|
||||
keyDirectObject, typeAEList,
|
||||
&documents);
|
||||
if (status == noErr)
|
||||
{
|
||||
long count = 0;
|
||||
int i;
|
||||
|
||||
AECountItems (&documents, &count);
|
||||
|
||||
for (i = 0; i < count; i++)
|
||||
{
|
||||
FSRef ref;
|
||||
gchar *callback_path;
|
||||
GSource *source;
|
||||
GClosure *closure;
|
||||
|
||||
status = AEGetNthPtr (&documents, i + 1, typeFSRef,
|
||||
0, 0, &ref, sizeof (ref),
|
||||
0);
|
||||
if (status != noErr)
|
||||
continue;
|
||||
|
||||
FSRefMakePath (&ref, (UInt8 *) path, MAXPATHLEN);
|
||||
|
||||
callback_path = g_strdup (path);
|
||||
|
||||
closure = g_cclosure_new (G_CALLBACK (gui_unique_mac_idle_open),
|
||||
(gpointer) callback_path,
|
||||
(GClosureNotify) g_free);
|
||||
|
||||
g_object_watch_closure (G_OBJECT (unique_gimp), closure);
|
||||
|
||||
source = g_idle_source_new ();
|
||||
g_source_set_priority (source, G_PRIORITY_LOW);
|
||||
g_source_set_closure (source, closure);
|
||||
g_source_attach (source, NULL);
|
||||
g_source_unref (source);
|
||||
}
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
static void
|
||||
gui_unique_mac_init (Gimp *gimp)
|
||||
{
|
||||
g_return_if_fail (GIMP_IS_GIMP (gimp));
|
||||
g_return_if_fail (unique_gimp == NULL);
|
||||
|
||||
unique_gimp = gimp;
|
||||
|
||||
open_document_callback_proc = NewAEEventHandlerUPP(gui_unique_mac_open_documents);
|
||||
|
||||
AEInstallEventHandler (kCoreEventClass, kAEOpenDocuments,
|
||||
open_document_callback_proc,
|
||||
0L, TRUE);
|
||||
}
|
||||
|
||||
static void
|
||||
gui_unique_mac_exit (void)
|
||||
{
|
||||
unique_gimp = NULL;
|
||||
|
||||
AERemoveEventHandler (kCoreEventClass, kAEOpenDocuments,
|
||||
open_document_callback_proc, TRUE);
|
||||
|
||||
DisposeAEEventHandlerUPP(open_document_callback_proc);
|
||||
}
|
||||
|
||||
#endif /* GDK_WINDOWING_QUARTZ */
|
||||
|
@@ -502,6 +502,13 @@ carbon_menu_item_connect (GtkWidget *menu_item,
|
||||
return carbon_item;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
menu_event_activate_callback (GtkMenuItem *widget)
|
||||
{
|
||||
gtk_menu_item_activate (GTK_MENU_ITEM (widget));
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* carbon event handler
|
||||
@@ -545,7 +552,20 @@ menu_event_handler_func (EventHandlerCallRef event_handler_call_ref,
|
||||
sizeof (widget), 0, &widget);
|
||||
if (err == noErr && GTK_IS_WIDGET (widget))
|
||||
{
|
||||
gtk_menu_item_activate (GTK_MENU_ITEM (widget));
|
||||
GSource *source;
|
||||
GClosure *closure;
|
||||
|
||||
closure = g_cclosure_new (G_CALLBACK (menu_event_activate_callback),
|
||||
widget, NULL);
|
||||
|
||||
g_object_watch_closure (G_OBJECT (widget), closure);
|
||||
|
||||
source = g_idle_source_new ();
|
||||
g_source_set_priority (source, G_PRIORITY_HIGH);
|
||||
g_source_set_closure (source, closure);
|
||||
g_source_attach (source, NULL);
|
||||
g_source_unref (source);
|
||||
|
||||
return noErr;
|
||||
}
|
||||
}
|
||||
|
@@ -138,18 +138,7 @@ splash_create (gboolean be_verbose)
|
||||
gtk_container_add (GTK_CONTAINER (frame), vbox);
|
||||
gtk_widget_show (vbox);
|
||||
|
||||
/* If the splash image is static, we use a drawing area and set the
|
||||
* image as back pixmap, otherwise a GtkImage is being used.
|
||||
*/
|
||||
if (gdk_pixbuf_animation_is_static_image (pixbuf))
|
||||
{
|
||||
splash->area = gtk_drawing_area_new ();
|
||||
}
|
||||
else
|
||||
{
|
||||
splash->area = gtk_image_new_from_animation (pixbuf);
|
||||
}
|
||||
|
||||
splash->area = gtk_image_new_from_animation (pixbuf);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), splash->area, TRUE, TRUE, 0);
|
||||
gtk_widget_show (splash->area);
|
||||
|
||||
@@ -167,27 +156,6 @@ splash_create (gboolean be_verbose)
|
||||
gdk_pixbuf_animation_get_static_image (pixbuf),
|
||||
&splash->color);
|
||||
|
||||
gtk_widget_realize (splash->area);
|
||||
|
||||
if (gdk_pixbuf_animation_is_static_image (pixbuf))
|
||||
{
|
||||
GdkPixbuf *static_pixbuf = gdk_pixbuf_animation_get_static_image (pixbuf);
|
||||
GdkPixmap *pixmap;
|
||||
cairo_t *cr;
|
||||
|
||||
pixmap = gdk_pixmap_new (gtk_widget_get_window (splash->area),
|
||||
splash->width, splash->height, -1);
|
||||
|
||||
cr = gdk_cairo_create (pixmap);
|
||||
gdk_cairo_set_source_pixbuf (cr, static_pixbuf, 0.0, 0.0);
|
||||
cairo_paint (cr);
|
||||
cairo_destroy (cr);
|
||||
|
||||
gdk_window_set_back_pixmap (gtk_widget_get_window (splash->area),
|
||||
pixmap, FALSE);
|
||||
g_object_unref (pixmap);
|
||||
}
|
||||
|
||||
g_object_unref (pixbuf);
|
||||
|
||||
g_signal_connect_after (splash->area, "expose-event",
|
||||
|
446
app/language.c
446
app/language.c
@@ -50,673 +50,673 @@ language_init (const gchar *language)
|
||||
switch (GetUserDefaultUILanguage())
|
||||
{
|
||||
case 1078:
|
||||
language = "af"; /* Afrikaans - South Africa */
|
||||
language = "af"; /* Afrikaans - South Africa */
|
||||
break;
|
||||
case 1052:
|
||||
language = "sq"; /* Albanian - Albania */
|
||||
language = "sq"; /* Albanian - Albania */
|
||||
break;
|
||||
case 1118:
|
||||
language = "am"; /* Amharic - Ethiopia */
|
||||
language = "am"; /* Amharic - Ethiopia */
|
||||
break;
|
||||
case 1025:
|
||||
language = "ar"; /* Arabic - Saudi Arabia */
|
||||
language = "ar_SA"; /* Arabic - Saudi Arabia */
|
||||
break;
|
||||
case 5121:
|
||||
language = "ar"; /* Arabic - Algeria */
|
||||
language = "ar_DZ"; /* Arabic - Algeria */
|
||||
break;
|
||||
case 15361:
|
||||
language = "ar"; /* Arabic - Bahrain */
|
||||
language = "ar_BH"; /* Arabic - Bahrain */
|
||||
break;
|
||||
case 3073:
|
||||
language = "ar"; /* Arabic - Egypt */
|
||||
language = "ar_EG"; /* Arabic - Egypt */
|
||||
break;
|
||||
case 2049:
|
||||
language = "ar"; /* Arabic - Iraq */
|
||||
language = "ar_IQ"; /* Arabic - Iraq */
|
||||
break;
|
||||
case 11265:
|
||||
language = "ar"; /* Arabic - Jordan */
|
||||
language = "ar_JO"; /* Arabic - Jordan */
|
||||
break;
|
||||
case 13313:
|
||||
language = "ar"; /* Arabic - Kuwait */
|
||||
language = "ar_KW"; /* Arabic - Kuwait */
|
||||
break;
|
||||
case 12289:
|
||||
language = "ar"; /* Arabic - Lebanon */
|
||||
language = "ar_LB"; /* Arabic - Lebanon */
|
||||
break;
|
||||
case 4097:
|
||||
language = "ar"; /* Arabic - Libya */
|
||||
language = "ar_LY"; /* Arabic - Libya */
|
||||
break;
|
||||
case 6145:
|
||||
language = "ar"; /* Arabic - Morocco */
|
||||
language = "ar_MO"; /* Arabic - Morocco */
|
||||
break;
|
||||
case 8193:
|
||||
language = "ar"; /* Arabic - Oman */
|
||||
language = "ar_OM"; /* Arabic - Oman */
|
||||
break;
|
||||
case 16385:
|
||||
language = "ar"; /* Arabic - Qatar */
|
||||
language = "ar_QA"; /* Arabic - Qatar */
|
||||
break;
|
||||
case 10241:
|
||||
language = "ar"; /* Arabic - Syria */
|
||||
language = "ar_SY"; /* Arabic - Syria */
|
||||
break;
|
||||
case 7169:
|
||||
language = "ar"; /* Arabic - Tunisia */
|
||||
language = "ar_TN"; /* Arabic - Tunisia */
|
||||
break;
|
||||
case 14337:
|
||||
language = "ar"; /* Arabic - U.A.E. */
|
||||
language = "ar_AE"; /* Arabic - U.A.E. */
|
||||
break;
|
||||
case 9217:
|
||||
language = "ar"; /* Arabic - Yemen */
|
||||
language = "ar_YE"; /* Arabic - Yemen */
|
||||
break;
|
||||
case 1067:
|
||||
language = "hy"; /* Armenian - Armenia */
|
||||
language = "hy"; /* Armenian - Armenia */
|
||||
break;
|
||||
case 1101:
|
||||
language = "as"; /* Assamese */
|
||||
language = "as"; /* Assamese */
|
||||
break;
|
||||
case 2092:
|
||||
language = NULL; /* Azeri (Cyrillic) */
|
||||
language = NULL; /* Azeri (Cyrillic) */
|
||||
break;
|
||||
case 1068:
|
||||
language = NULL; /* Azeri (Latin) */
|
||||
language = NULL; /* Azeri (Latin) */
|
||||
break;
|
||||
case 1069:
|
||||
language = "eu"; /* Basque */
|
||||
language = "eu"; /* Basque */
|
||||
break;
|
||||
case 1059:
|
||||
language = "be"; /* Belarusian */
|
||||
language = "be"; /* Belarusian */
|
||||
break;
|
||||
case 1093:
|
||||
language = "bn"; /* Bengali (India) */
|
||||
language = "bn_IN"; /* Bengali (India) */
|
||||
break;
|
||||
case 2117:
|
||||
language = "bn"; /* Bengali (Bangladesh) */
|
||||
language = "bn_BD"; /* Bengali (Bangladesh) */
|
||||
break;
|
||||
case 5146:
|
||||
language = "bs"; /* Bosnian (Bosnia/Herzegovina) */
|
||||
language = "bs"; /* Bosnian (Bosnia/Herzegovina) */
|
||||
break;
|
||||
case 1026:
|
||||
language = "bg"; /* Bulgarian */
|
||||
language = "bg"; /* Bulgarian */
|
||||
break;
|
||||
case 1109:
|
||||
language = "my"; /* Burmese */
|
||||
language = "my"; /* Burmese */
|
||||
break;
|
||||
case 1027:
|
||||
language = "ca"; /* Catalan */
|
||||
language = "ca"; /* Catalan */
|
||||
break;
|
||||
case 1116:
|
||||
language = NULL; /* Cherokee - United States */
|
||||
language = NULL; /* Cherokee - United States */
|
||||
break;
|
||||
case 2052:
|
||||
language = "zh"; /* Chinese - People"s Republic of China */
|
||||
language = "zh_CN"; /* Chinese - People"s Republic of China */
|
||||
break;
|
||||
case 4100:
|
||||
language = "zh"; /* Chinese - Singapore */
|
||||
language = "zh_SG"; /* Chinese - Singapore */
|
||||
break;
|
||||
case 1028:
|
||||
language = "zh"; /* Chinese - Taiwan */
|
||||
language = "zh_TW"; /* Chinese - Taiwan */
|
||||
break;
|
||||
case 3076:
|
||||
language = "zh"; /* Chinese - Hong Kong SAR */
|
||||
language = "zh_HK"; /* Chinese - Hong Kong SAR */
|
||||
break;
|
||||
case 5124:
|
||||
language = "zh"; /* Chinese - Macao SAR */
|
||||
language = "zh_MO"; /* Chinese - Macao SAR */
|
||||
break;
|
||||
case 1050:
|
||||
language = "hr"; /* Croatian */
|
||||
language = "hr_HR"; /* Croatian */
|
||||
break;
|
||||
case 4122:
|
||||
language = "hr"; /* Croatian (Bosnia/Herzegovina) */
|
||||
language = "hr_BA"; /* Croatian (Bosnia/Herzegovina) */
|
||||
break;
|
||||
case 1029:
|
||||
language = "cs"; /* Czech */
|
||||
language = "cs"; /* Czech */
|
||||
break;
|
||||
case 1030:
|
||||
language = "da"; /* Danish */
|
||||
language = "da"; /* Danish */
|
||||
break;
|
||||
case 1125:
|
||||
language = "dv"; /* Divehi */
|
||||
language = "dv"; /* Divehi */
|
||||
break;
|
||||
case 1043:
|
||||
language = "nl"; /* Dutch - Netherlands */
|
||||
language = "nl_NL"; /* Dutch - Netherlands */
|
||||
break;
|
||||
case 2067:
|
||||
language = "nl"; /* Dutch - Belgium */
|
||||
language = "nl_BE"; /* Dutch - Belgium */
|
||||
break;
|
||||
case 1126:
|
||||
language = NULL; /* Edo */
|
||||
language = NULL; /* Edo */
|
||||
break;
|
||||
case 1033:
|
||||
language = "en"; /* English - United States */
|
||||
language = "en_US"; /* English - United States */
|
||||
break;
|
||||
case 2057:
|
||||
language = "en"; /* English - United Kingdom */
|
||||
language = "en_UK"; /* English - United Kingdom */
|
||||
break;
|
||||
case 3081:
|
||||
language = "en"; /* English - Australia */
|
||||
language = "en_AU"; /* English - Australia */
|
||||
break;
|
||||
case 10249:
|
||||
language = "en"; /* English - Belize */
|
||||
language = "en_BZ"; /* English - Belize */
|
||||
break;
|
||||
case 4105:
|
||||
language = "en"; /* English - Canada */
|
||||
language = "en_CA"; /* English - Canada */
|
||||
break;
|
||||
case 9225:
|
||||
language = "en"; /* English - Caribbean */
|
||||
language = "en"; /* English - Caribbean */
|
||||
break;
|
||||
case 15369:
|
||||
language = "en"; /* English - Hong Kong SAR */
|
||||
language = "en_HK"; /* English - Hong Kong SAR */
|
||||
break;
|
||||
case 16393:
|
||||
language = "en"; /* English - India */
|
||||
language = "en_IN"; /* English - India */
|
||||
break;
|
||||
case 14345:
|
||||
language = "en"; /* English - Indonesia */
|
||||
language = "en_ID"; /* English - Indonesia */
|
||||
break;
|
||||
case 6153:
|
||||
language = "en"; /* English - Ireland */
|
||||
language = "en_IR"; /* English - Ireland */
|
||||
break;
|
||||
case 8201:
|
||||
language = "en"; /* English - Jamaica */
|
||||
language = "en_JM"; /* English - Jamaica */
|
||||
break;
|
||||
case 17417:
|
||||
language = "en"; /* English - Malaysia */
|
||||
language = "en_MW"; /* English - Malaysia */
|
||||
break;
|
||||
case 5129:
|
||||
language = "en"; /* English - New Zealand */
|
||||
language = "en_NZ"; /* English - New Zealand */
|
||||
break;
|
||||
case 13321:
|
||||
language = "en"; /* English - Philippines */
|
||||
language = "en_PH"; /* English - Philippines */
|
||||
break;
|
||||
case 18441:
|
||||
language = "en"; /* English - Singapore */
|
||||
language = "en_SG"; /* English - Singapore */
|
||||
break;
|
||||
case 7177:
|
||||
language = "en"; /* English - South Africa */
|
||||
language = "en_ZA"; /* English - South Africa */
|
||||
break;
|
||||
case 11273:
|
||||
language = "en"; /* English - Trinidad */
|
||||
language = "en_TT"; /* English - Trinidad */
|
||||
break;
|
||||
case 12297:
|
||||
language = "en"; /* English - Zimbabwe */
|
||||
language = "en_ZW"; /* English - Zimbabwe */
|
||||
break;
|
||||
case 1061:
|
||||
language = "et"; /* Estonian */
|
||||
language = "et"; /* Estonian */
|
||||
break;
|
||||
case 1080:
|
||||
language = "fo"; /* Faroese */
|
||||
language = "fo"; /* Faroese */
|
||||
break;
|
||||
case 1065:
|
||||
language = NULL; /* Farsi */
|
||||
language = "fa"; /* Farsi */
|
||||
break;
|
||||
case 1124:
|
||||
language = NULL; /* Filipino */
|
||||
language = NULL; /* Filipino */
|
||||
break;
|
||||
case 1035:
|
||||
language = "fi"; /* Finnish */
|
||||
language = "fi"; /* Finnish */
|
||||
break;
|
||||
case 1036:
|
||||
language = "fr"; /* French - France */
|
||||
language = "fr_FR"; /* French - France */
|
||||
break;
|
||||
case 2060:
|
||||
language = "fr"; /* French - Belgium */
|
||||
language = "fr_BE"; /* French - Belgium */
|
||||
break;
|
||||
case 11276:
|
||||
language = "fr"; /* French - Cameroon */
|
||||
language = "fr_CM"; /* French - Cameroon */
|
||||
break;
|
||||
case 3084:
|
||||
language = "fr"; /* French - Canada */
|
||||
language = "fr_CA"; /* French - Canada */
|
||||
break;
|
||||
case 9228:
|
||||
language = "fr"; /* French - Democratic Rep. of Congo */
|
||||
language = "fr_CD"; /* French - Democratic Rep. of Congo */
|
||||
break;
|
||||
case 12300:
|
||||
language = "fr"; /* French - Cote d"Ivoire */
|
||||
language = "fr_CI"; /* French - Cote d"Ivoire */
|
||||
break;
|
||||
case 15372:
|
||||
language = "fr"; /* French - Haiti */
|
||||
language = "fr_HT"; /* French - Haiti */
|
||||
break;
|
||||
case 5132:
|
||||
language = "fr"; /* French - Luxembourg */
|
||||
language = "fr_LU"; /* French - Luxembourg */
|
||||
break;
|
||||
case 13324:
|
||||
language = "fr"; /* French - Mali */
|
||||
language = "fr_ML"; /* French - Mali */
|
||||
break;
|
||||
case 6156:
|
||||
language = "fr"; /* French - Monaco */
|
||||
language = "fr_MC"; /* French - Monaco */
|
||||
break;
|
||||
case 14348:
|
||||
language = "fr"; /* French - Morocco */
|
||||
language = "fr_MA"; /* French - Morocco */
|
||||
break;
|
||||
case 58380:
|
||||
language = "fr"; /* French - North Africa */
|
||||
language = "fr"; /* French - North Africa */
|
||||
break;
|
||||
case 8204:
|
||||
language = "fr"; /* French - Reunion */
|
||||
language = "fr_RE"; /* French - Reunion */
|
||||
break;
|
||||
case 10252:
|
||||
language = "fr"; /* French - Senegal */
|
||||
language = "fr_SN"; /* French - Senegal */
|
||||
break;
|
||||
case 4108:
|
||||
language = "fr"; /* French - Switzerland */
|
||||
language = "fr_CH"; /* French - Switzerland */
|
||||
break;
|
||||
case 7180:
|
||||
language = "fr"; /* French - West Indies */
|
||||
language = "fr"; /* French - West Indies */
|
||||
break;
|
||||
case 1122:
|
||||
language = "fy"; /* Frisian - Netherlands */
|
||||
language = "fy"; /* Frisian - Netherlands */
|
||||
break;
|
||||
case 1127:
|
||||
language = NULL; /* Fulfulde - Nigeria */
|
||||
language = NULL; /* Fulfulde - Nigeria */
|
||||
break;
|
||||
case 1071:
|
||||
language = "mk"; /* FYRO Macedonian */
|
||||
language = "mk"; /* FYRO Macedonian */
|
||||
break;
|
||||
case 2108:
|
||||
language = "ga"; /* Gaelic (Ireland) */
|
||||
language = "ga"; /* Gaelic (Ireland) */
|
||||
break;
|
||||
case 1084:
|
||||
language = "gd"; /* Gaelic (Scotland) */
|
||||
language = "gd"; /* Gaelic (Scotland) */
|
||||
break;
|
||||
case 1110:
|
||||
language = "gl"; /* Galician */
|
||||
language = "gl"; /* Galician */
|
||||
break;
|
||||
case 1079:
|
||||
language = "ka"; /* Georgian */
|
||||
language = "ka"; /* Georgian */
|
||||
break;
|
||||
case 1031:
|
||||
language = "de"; /* German - Germany */
|
||||
language = "de_DE"; /* German - Germany */
|
||||
break;
|
||||
case 3079:
|
||||
language = "de"; /* German - Austria */
|
||||
language = "de_AT"; /* German - Austria */
|
||||
break;
|
||||
case 5127:
|
||||
language = "de"; /* German - Liechtenstein */
|
||||
language = "de_LI"; /* German - Liechtenstein */
|
||||
break;
|
||||
case 4103:
|
||||
language = "de"; /* German - Luxembourg */
|
||||
language = "de_LU"; /* German - Luxembourg */
|
||||
break;
|
||||
case 2055:
|
||||
language = "de"; /* German - Switzerland */
|
||||
language = "de_CH"; /* German - Switzerland */
|
||||
break;
|
||||
case 1032:
|
||||
language = "el"; /* Greek */
|
||||
language = "el"; /* Greek */
|
||||
break;
|
||||
case 1140:
|
||||
language = "gn"; /* Guarani - Paraguay */
|
||||
language = "gn"; /* Guarani - Paraguay */
|
||||
break;
|
||||
case 1095:
|
||||
language = "gu"; /* Gujarati */
|
||||
language = "gu"; /* Gujarati */
|
||||
break;
|
||||
case 1128:
|
||||
language = "ha"; /* Hausa - Nigeria */
|
||||
language = "ha"; /* Hausa - Nigeria */
|
||||
break;
|
||||
case 1141:
|
||||
language = NULL; /* Hawaiian - United States */
|
||||
language = NULL; /* Hawaiian - United States */
|
||||
break;
|
||||
case 1037:
|
||||
language = "he"; /* Hebrew */
|
||||
language = "he"; /* Hebrew */
|
||||
break;
|
||||
case 1081:
|
||||
language = "hi"; /* Hindi */
|
||||
language = "hi"; /* Hindi */
|
||||
break;
|
||||
case 1038:
|
||||
language = "hu"; /* Hungarian */
|
||||
language = "hu"; /* Hungarian */
|
||||
break;
|
||||
case 1129:
|
||||
language = NULL; /* Ibibio - Nigeria */
|
||||
language = NULL; /* Ibibio - Nigeria */
|
||||
break;
|
||||
case 1039:
|
||||
language = "is"; /* Icelandic */
|
||||
language = "is"; /* Icelandic */
|
||||
break;
|
||||
case 1136:
|
||||
language = "ig"; /* Igbo - Nigeria */
|
||||
language = "ig"; /* Igbo - Nigeria */
|
||||
break;
|
||||
case 1057:
|
||||
language = "id"; /* Indonesian */
|
||||
language = "id"; /* Indonesian */
|
||||
break;
|
||||
case 1117:
|
||||
language = "iu"; /* Inuktitut */
|
||||
language = "iu"; /* Inuktitut */
|
||||
break;
|
||||
case 1040:
|
||||
language = "it"; /* Italian - Italy */
|
||||
language = "it_IT"; /* Italian - Italy */
|
||||
break;
|
||||
case 2064:
|
||||
language = "it"; /* Italian - Switzerland */
|
||||
language = "it_CH"; /* Italian - Switzerland */
|
||||
break;
|
||||
case 1041:
|
||||
language = "ja"; /* Japanese */
|
||||
language = "ja"; /* Japanese */
|
||||
break;
|
||||
case 1099:
|
||||
language = "kn"; /* Kannada */
|
||||
language = "kn"; /* Kannada */
|
||||
break;
|
||||
case 1137:
|
||||
language = "kr"; /* Kanuri - Nigeria */
|
||||
language = "kr"; /* Kanuri - Nigeria */
|
||||
break;
|
||||
case 2144:
|
||||
language = "ks"; /* Kashmiri */
|
||||
language = "ks"; /* Kashmiri */
|
||||
break;
|
||||
case 1120:
|
||||
language = "ks"; /* Kashmiri (Arabic) */
|
||||
language = "ks"; /* Kashmiri (Arabic) */
|
||||
break;
|
||||
case 1087:
|
||||
language = "kk"; /* Kazakh */
|
||||
language = "kk"; /* Kazakh */
|
||||
break;
|
||||
case 1107:
|
||||
language = "km"; /* Khmer */
|
||||
language = "km"; /* Khmer */
|
||||
break;
|
||||
case 1111:
|
||||
language = NULL; /* Konkani */
|
||||
language = NULL; /* Konkani */
|
||||
break;
|
||||
case 1042:
|
||||
language = "ko"; /* Korean */
|
||||
language = "ko"; /* Korean */
|
||||
break;
|
||||
case 1088:
|
||||
language = "ky"; /* Kyrgyz (Cyrillic) */
|
||||
language = "ky"; /* Kyrgyz (Cyrillic) */
|
||||
break;
|
||||
case 1108:
|
||||
language = "lo"; /* Lao */
|
||||
language = "lo"; /* Lao */
|
||||
break;
|
||||
case 1142:
|
||||
language = "la"; /* Latin */
|
||||
language = "la"; /* Latin */
|
||||
break;
|
||||
case 1062:
|
||||
language = "lv"; /* Latvian */
|
||||
language = "lv"; /* Latvian */
|
||||
break;
|
||||
case 1063:
|
||||
language = "lt"; /* Lithuanian */
|
||||
language = "lt"; /* Lithuanian */
|
||||
break;
|
||||
case 1086:
|
||||
language = "ms"; /* Malay - Malaysia */
|
||||
language = "ms_MY"; /* Malay - Malaysia */
|
||||
break;
|
||||
case 2110:
|
||||
language = "ms"; /* Malay - Brunei Darussalam */
|
||||
language = "ms_BN"; /* Malay - Brunei Darussalam */
|
||||
break;
|
||||
case 1100:
|
||||
language = "ml"; /* Malayalam */
|
||||
language = "ml"; /* Malayalam */
|
||||
break;
|
||||
case 1082:
|
||||
language = "mt"; /* Maltese */
|
||||
language = "mt"; /* Maltese */
|
||||
break;
|
||||
case 1112:
|
||||
language = NULL; /* Manipuri */
|
||||
language = NULL; /* Manipuri */
|
||||
break;
|
||||
case 1153:
|
||||
language = "mi"; /* Maori - New Zealand */
|
||||
language = "mi"; /* Maori - New Zealand */
|
||||
break;
|
||||
case 1102:
|
||||
language = "mr"; /* Marathi */
|
||||
language = "mr"; /* Marathi */
|
||||
break;
|
||||
case 1104:
|
||||
language = "mn"; /* Mongolian (Cyrillic) */
|
||||
language = "mn"; /* Mongolian (Cyrillic) */
|
||||
break;
|
||||
case 2128:
|
||||
language = "mn"; /* Mongolian (Mongolian) */
|
||||
language = "mn"; /* Mongolian (Mongolian) */
|
||||
break;
|
||||
case 1121:
|
||||
language = "ne"; /* Nepali */
|
||||
language = "ne_NP"; /* Nepali */
|
||||
break;
|
||||
case 2145:
|
||||
language = "ne"; /* Nepali - India */
|
||||
language = "ne_IN"; /* Nepali - India */
|
||||
break;
|
||||
case 1044:
|
||||
language = "no"; /* Norwegian (Bokmᅢᆬl) */
|
||||
language = "no"; /* Norwegian (Bokmᅢᆬl) */
|
||||
break;
|
||||
case 2068:
|
||||
language = "no"; /* Norwegian (Nynorsk) */
|
||||
language = "no"; /* Norwegian (Nynorsk) */
|
||||
break;
|
||||
case 1096:
|
||||
language = "or"; /* Oriya */
|
||||
language = "or"; /* Oriya */
|
||||
break;
|
||||
case 1138:
|
||||
language = "om"; /* Oromo */
|
||||
language = "om"; /* Oromo */
|
||||
break;
|
||||
case 1145:
|
||||
language = NULL; /* Papiamentu */
|
||||
language = NULL; /* Papiamentu */
|
||||
break;
|
||||
case 1123:
|
||||
language = "ps"; /* Pashto */
|
||||
language = "ps"; /* Pashto */
|
||||
break;
|
||||
case 1045:
|
||||
language = "pl"; /* Polish */
|
||||
language = "pl"; /* Polish */
|
||||
break;
|
||||
case 1046:
|
||||
language = "pt"; /* Portuguese - Brazil */
|
||||
language = "pt_BR"; /* Portuguese - Brazil */
|
||||
break;
|
||||
case 2070:
|
||||
language = "pt"; /* Portuguese - Portugal */
|
||||
language = "pt_PT"; /* Portuguese - Portugal */
|
||||
break;
|
||||
case 1094:
|
||||
language = "pa"; /* Punjabi */
|
||||
language = "pa"; /* Punjabi */
|
||||
break;
|
||||
case 2118:
|
||||
language = "pa"; /* Punjabi (Pakistan) */
|
||||
language = "pa_PK"; /* Punjabi (Pakistan) */
|
||||
break;
|
||||
case 1131:
|
||||
language = "qu"; /* Quecha - Bolivia */
|
||||
language = "qu_BO"; /* Quecha - Bolivia */
|
||||
break;
|
||||
case 2155:
|
||||
language = "qu"; /* Quecha - Ecuador */
|
||||
language = "qu_EC"; /* Quecha - Ecuador */
|
||||
break;
|
||||
case 3179:
|
||||
language = "qu"; /* Quecha - Peru */
|
||||
language = "qu_PE"; /* Quecha - Peru */
|
||||
break;
|
||||
case 1047:
|
||||
language = "rm"; /* Rhaeto-Romanic */
|
||||
language = "rm"; /* Rhaeto-Romanic */
|
||||
break;
|
||||
case 1048:
|
||||
language = "ro"; /* Romanian */
|
||||
language = "ro_RO"; /* Romanian */
|
||||
break;
|
||||
case 2072:
|
||||
language = "ro"; /* Romanian - Moldava */
|
||||
language = "ro_MD"; /* Romanian - Moldava */
|
||||
break;
|
||||
case 1049:
|
||||
language = "ru"; /* Russian */
|
||||
language = "ru_RU"; /* Russian */
|
||||
break;
|
||||
case 2073:
|
||||
language = "ru"; /* Russian - Moldava */
|
||||
language = "ru_MD"; /* Russian - Moldava */
|
||||
break;
|
||||
case 1083:
|
||||
language = NULL; /* Sami (Lappish) */
|
||||
language = NULL; /* Sami (Lappish) */
|
||||
break;
|
||||
case 1103:
|
||||
language = "sa"; /* Sanskrit */
|
||||
language = "sa"; /* Sanskrit */
|
||||
break;
|
||||
case 1132:
|
||||
language = NULL; /* Sepedi */
|
||||
language = NULL; /* Sepedi */
|
||||
break;
|
||||
case 3098:
|
||||
language = "sr"; /* Serbian (Cyrillic) */
|
||||
language = "sr"; /* Serbian (Cyrillic) */
|
||||
break;
|
||||
case 2074:
|
||||
language = "sr"; /* Serbian (Latin) */
|
||||
language = "sr@latin"; /* Serbian (Latin) */
|
||||
break;
|
||||
case 1113:
|
||||
language = "sd"; /* Sindhi - India */
|
||||
language = "sd_IN"; /* Sindhi - India */
|
||||
break;
|
||||
case 2137:
|
||||
language = "sd"; /* Sindhi - Pakistan */
|
||||
language = "sd_PK"; /* Sindhi - Pakistan */
|
||||
break;
|
||||
case 1115:
|
||||
language = "si"; /* Sinhalese - Sri Lanka */
|
||||
language = "si"; /* Sinhalese - Sri Lanka */
|
||||
break;
|
||||
case 1051:
|
||||
language = "sk"; /* Slovak */
|
||||
language = "sk"; /* Slovak */
|
||||
break;
|
||||
case 1060:
|
||||
language = "sl"; /* Slovenian */
|
||||
language = "sl"; /* Slovenian */
|
||||
break;
|
||||
case 1143:
|
||||
language = "so"; /* Somali */
|
||||
language = "so"; /* Somali */
|
||||
break;
|
||||
case 1070:
|
||||
language = NULL; /* Sorbian */
|
||||
language = NULL; /* Sorbian */
|
||||
break;
|
||||
case 3082:
|
||||
language = "es"; /* Spanish - Spain (Modern Sort) */
|
||||
language = "es"; /* Spanish - Spain (Modern Sort) */
|
||||
break;
|
||||
case 1034:
|
||||
language = "es"; /* Spanish - Spain (Traditional Sort) */
|
||||
language = "es"; /* Spanish - Spain (Traditional Sort) */
|
||||
break;
|
||||
case 11274:
|
||||
language = "es"; /* Spanish - Argentina */
|
||||
language = "es_AR"; /* Spanish - Argentina */
|
||||
break;
|
||||
case 16394:
|
||||
language = "es"; /* Spanish - Bolivia */
|
||||
language = "es_BO"; /* Spanish - Bolivia */
|
||||
break;
|
||||
case 13322:
|
||||
language = "es"; /* Spanish - Chile */
|
||||
language = "es_CL"; /* Spanish - Chile */
|
||||
break;
|
||||
case 9226:
|
||||
language = "es"; /* Spanish - Colombia */
|
||||
language = "es_CO"; /* Spanish - Colombia */
|
||||
break;
|
||||
case 5130:
|
||||
language = "es"; /* Spanish - Costa Rica */
|
||||
language = "es_CR"; /* Spanish - Costa Rica */
|
||||
break;
|
||||
case 7178:
|
||||
language = "es"; /* Spanish - Dominican Republic */
|
||||
language = "es_DO"; /* Spanish - Dominican Republic */
|
||||
break;
|
||||
case 12298:
|
||||
language = "es"; /* Spanish - Ecuador */
|
||||
language = "es_EC"; /* Spanish - Ecuador */
|
||||
break;
|
||||
case 17418:
|
||||
language = "es"; /* Spanish - El Salvador */
|
||||
language = "es_SV"; /* Spanish - El Salvador */
|
||||
break;
|
||||
case 4106:
|
||||
language = "es"; /* Spanish - Guatemala */
|
||||
language = "es_GT"; /* Spanish - Guatemala */
|
||||
break;
|
||||
case 18442:
|
||||
language = "es"; /* Spanish - Honduras */
|
||||
language = "es_HN"; /* Spanish - Honduras */
|
||||
break;
|
||||
case 58378:
|
||||
language = "es"; /* Spanish - Latin America */
|
||||
language = "es"; /* Spanish - Latin America */
|
||||
break;
|
||||
case 2058:
|
||||
language = "es"; /* Spanish - Mexico */
|
||||
language = "es_MX"; /* Spanish - Mexico */
|
||||
break;
|
||||
case 19466:
|
||||
language = "es"; /* Spanish - Nicaragua */
|
||||
language = "es_NI"; /* Spanish - Nicaragua */
|
||||
break;
|
||||
case 6154:
|
||||
language = "es"; /* Spanish - Panama */
|
||||
language = "es_PA"; /* Spanish - Panama */
|
||||
break;
|
||||
case 15370:
|
||||
language = "es"; /* Spanish - Paraguay */
|
||||
language = "es_PY"; /* Spanish - Paraguay */
|
||||
break;
|
||||
case 10250:
|
||||
language = "es"; /* Spanish - Peru */
|
||||
language = "es_PE"; /* Spanish - Peru */
|
||||
break;
|
||||
case 20490:
|
||||
language = "es"; /* Spanish - Puerto Rico */
|
||||
language = "es_PR"; /* Spanish - Puerto Rico */
|
||||
break;
|
||||
case 21514:
|
||||
language = "es"; /* Spanish - United States */
|
||||
language = "es_US"; /* Spanish - United States */
|
||||
break;
|
||||
case 14346:
|
||||
language = "es"; /* Spanish - Uruguay */
|
||||
language = "es_UY"; /* Spanish - Uruguay */
|
||||
break;
|
||||
case 8202:
|
||||
language = "es"; /* Spanish - Venezuela */
|
||||
language = "es_VE"; /* Spanish - Venezuela */
|
||||
break;
|
||||
case 1072:
|
||||
language = NULL; /* Sutu */
|
||||
language = NULL; /* Sutu */
|
||||
break;
|
||||
case 1089:
|
||||
language = "sw"; /* Swahili */
|
||||
language = "sw"; /* Swahili */
|
||||
break;
|
||||
case 1053:
|
||||
language = "sv"; /* Swedish */
|
||||
language = "sv_SE"; /* Swedish */
|
||||
break;
|
||||
case 2077:
|
||||
language = "sv"; /* Swedish - Finland */
|
||||
language = "sv_FI"; /* Swedish - Finland */
|
||||
break;
|
||||
case 1114:
|
||||
language = NULL; /* Syriac */
|
||||
language = NULL; /* Syriac */
|
||||
break;
|
||||
case 1064:
|
||||
language = "tg"; /* Tajik */
|
||||
language = "tg"; /* Tajik */
|
||||
break;
|
||||
case 1119:
|
||||
language = NULL; /* Tamazight (Arabic) */
|
||||
language = NULL; /* Tamazight (Arabic) */
|
||||
break;
|
||||
case 2143:
|
||||
language = NULL; /* Tamazight (Latin) */
|
||||
language = NULL; /* Tamazight (Latin) */
|
||||
break;
|
||||
case 1097:
|
||||
language = "ta"; /* Tamil */
|
||||
language = "ta"; /* Tamil */
|
||||
break;
|
||||
case 1092:
|
||||
language = "tt"; /* Tatar */
|
||||
language = "tt"; /* Tatar */
|
||||
break;
|
||||
case 1098:
|
||||
language = "te"; /* Telugu */
|
||||
language = "te"; /* Telugu */
|
||||
break;
|
||||
case 1054:
|
||||
language = "th"; /* Thai */
|
||||
language = "th"; /* Thai */
|
||||
break;
|
||||
case 2129:
|
||||
language = "bo"; /* Tibetan - Bhutan */
|
||||
language = "bo_BT"; /* Tibetan - Bhutan */
|
||||
break;
|
||||
case 1105:
|
||||
language = "bo"; /* Tibetan - People"s Republic of China */
|
||||
language = "bo_CN"; /* Tibetan - People"s Republic of China */
|
||||
break;
|
||||
case 2163:
|
||||
language = "ti"; /* Tigrigna - Eritrea */
|
||||
language = "ti_ER"; /* Tigrigna - Eritrea */
|
||||
break;
|
||||
case 1139:
|
||||
language = "ti"; /* Tigrigna - Ethiopia */
|
||||
language = "ti_ET"; /* Tigrigna - Ethiopia */
|
||||
break;
|
||||
case 1073:
|
||||
language = "ts"; /* Tsonga */
|
||||
language = "ts"; /* Tsonga */
|
||||
break;
|
||||
case 1074:
|
||||
language = "tn"; /* Tswana */
|
||||
language = "tn"; /* Tswana */
|
||||
break;
|
||||
case 1055:
|
||||
language = "tr"; /* Turkish */
|
||||
language = "tr"; /* Turkish */
|
||||
break;
|
||||
case 1090:
|
||||
language = "tk"; /* Turkmen */
|
||||
language = "tk"; /* Turkmen */
|
||||
break;
|
||||
case 1152:
|
||||
language = "ug"; /* Uighur - China */
|
||||
language = "ug"; /* Uighur - China */
|
||||
break;
|
||||
case 1058:
|
||||
language = "uk"; /* Ukrainian */
|
||||
language = "uk"; /* Ukrainian */
|
||||
break;
|
||||
case 1056:
|
||||
language = "ur"; /* Urdu */
|
||||
language = "ur"; /* Urdu */
|
||||
break;
|
||||
case 2080:
|
||||
language = "ur"; /* Urdu - India */
|
||||
language = "ur_IN"; /* Urdu - India */
|
||||
break;
|
||||
case 2115:
|
||||
language = "uz"; /* Uzbek (Cyrillic) */
|
||||
language = "uz"; /* Uzbek (Cyrillic) */
|
||||
break;
|
||||
case 1091:
|
||||
language = "uz"; /* Uzbek (Latin) */
|
||||
language = "uz@latin"; /* Uzbek (Latin) */
|
||||
break;
|
||||
case 1075:
|
||||
language = "ve"; /* Venda */
|
||||
language = "ve"; /* Venda */
|
||||
break;
|
||||
case 1066:
|
||||
language = "vi"; /* Vietnamese */
|
||||
language = "vi"; /* Vietnamese */
|
||||
break;
|
||||
case 1106:
|
||||
language = "cy"; /* Welsh */
|
||||
language = "cy"; /* Welsh */
|
||||
break;
|
||||
case 1076:
|
||||
language = "xh"; /* Xhosa */
|
||||
language = "xh"; /* Xhosa */
|
||||
break;
|
||||
case 1144:
|
||||
language = NULL; /* Yi */
|
||||
language = NULL; /* Yi */
|
||||
break;
|
||||
case 1085:
|
||||
language = "yi"; /* Yiddish */
|
||||
language = "yi"; /* Yiddish */
|
||||
break;
|
||||
case 1130:
|
||||
language = "yo"; /* Yoruba */
|
||||
language = "yo"; /* Yoruba */
|
||||
break;
|
||||
case 1077:
|
||||
language = "zu"; /* Zulu */
|
||||
language = "zu"; /* Zulu */
|
||||
break;
|
||||
default:
|
||||
language = NULL;
|
||||
|
@@ -62,7 +62,9 @@ static void scale (TileManager *srcTM,
|
||||
GimpProgressFunc progress_callback,
|
||||
gpointer progress_data,
|
||||
gint *progress,
|
||||
gint max_progress);
|
||||
gint max_progress,
|
||||
const gdouble scalex,
|
||||
const gdouble scaley);
|
||||
static void decimate_xy (TileManager *srcTM,
|
||||
TileManager *dstTM,
|
||||
GimpInterpolationType interpolation,
|
||||
@@ -212,14 +214,14 @@ scale_determine_levels (PixelRegion *srcPR,
|
||||
while (scalex < 0.5 && width > 1)
|
||||
{
|
||||
scalex *= 2;
|
||||
width /= 2;
|
||||
width = (width + 1) / 2;
|
||||
*levelx += 1;
|
||||
}
|
||||
|
||||
while (scaley < 0.5 && height > 1)
|
||||
{
|
||||
scaley *= 2;
|
||||
height *= 2;
|
||||
height = (height + 1) / 2;
|
||||
*levely += 1;
|
||||
}
|
||||
}
|
||||
@@ -240,36 +242,10 @@ scale_determine_progress (PixelRegion *srcPR,
|
||||
|
||||
/* The logic here should be kept in sync with scale_region_tile(). */
|
||||
|
||||
while (levelx < 0 && levely < 0)
|
||||
{
|
||||
width <<= 1;
|
||||
height <<= 1;
|
||||
levelx++;
|
||||
levely++;
|
||||
|
||||
tiles += NUM_TILES (width, height);
|
||||
}
|
||||
|
||||
while (levelx < 0)
|
||||
{
|
||||
width <<= 1;
|
||||
levelx++;
|
||||
|
||||
tiles += NUM_TILES (width, height);
|
||||
}
|
||||
|
||||
while (levely < 0)
|
||||
{
|
||||
height <<= 1;
|
||||
levely++;
|
||||
|
||||
tiles += NUM_TILES (width, height);
|
||||
}
|
||||
|
||||
while (levelx > 0 && levely > 0)
|
||||
{
|
||||
width >>= 1;
|
||||
height >>= 1;
|
||||
width = (width + 1) >> 1;
|
||||
height = (height + 1) >> 1;
|
||||
levelx--;
|
||||
levely--;
|
||||
|
||||
@@ -278,7 +254,7 @@ scale_determine_progress (PixelRegion *srcPR,
|
||||
|
||||
while (levelx > 0)
|
||||
{
|
||||
width >>= 1;
|
||||
width = (width + 1) >> 1;
|
||||
levelx--;
|
||||
|
||||
tiles += NUM_TILES (width, height);
|
||||
@@ -286,7 +262,7 @@ scale_determine_progress (PixelRegion *srcPR,
|
||||
|
||||
while (levely > 0)
|
||||
{
|
||||
height >>= 1;
|
||||
height = (height + 1) >> 1;
|
||||
levely--;
|
||||
|
||||
tiles += NUM_TILES (width, height);
|
||||
@@ -314,6 +290,8 @@ scale_region_tile (PixelRegion *srcPR,
|
||||
gint progress = 0;
|
||||
gint levelx = 0;
|
||||
gint levely = 0;
|
||||
gdouble scalex = (gdouble) width / dstPR->w;
|
||||
gdouble scaley = (gdouble) height / dstPR->h;
|
||||
|
||||
/* determine scaling levels */
|
||||
if (interpolation != GIMP_INTERPOLATION_NONE)
|
||||
@@ -326,60 +304,16 @@ scale_region_tile (PixelRegion *srcPR,
|
||||
if (levelx == 0 && levely == 0)
|
||||
{
|
||||
scale (srcTM, dstTM, interpolation,
|
||||
progress_callback, progress_data, &progress, max_progress);
|
||||
}
|
||||
|
||||
while (levelx < 0 && levely < 0)
|
||||
{
|
||||
width <<= 1;
|
||||
height <<= 1;
|
||||
|
||||
tmpTM = tile_manager_new (width, height, bytes);
|
||||
scale (srcTM, tmpTM, interpolation,
|
||||
progress_callback, progress_data, &progress, max_progress);
|
||||
|
||||
if (srcTM != srcPR->tiles)
|
||||
tile_manager_unref (srcTM);
|
||||
|
||||
srcTM = tmpTM;
|
||||
levelx++;
|
||||
levely++;
|
||||
}
|
||||
|
||||
while (levelx < 0)
|
||||
{
|
||||
width <<= 1;
|
||||
|
||||
tmpTM = tile_manager_new (width, height, bytes);
|
||||
scale (srcTM, tmpTM, interpolation,
|
||||
progress_callback, progress_data, &progress, max_progress);
|
||||
|
||||
if (srcTM != srcPR->tiles)
|
||||
tile_manager_unref (srcTM);
|
||||
|
||||
srcTM = tmpTM;
|
||||
levelx++;
|
||||
}
|
||||
|
||||
while (levely < 0)
|
||||
{
|
||||
height <<= 1;
|
||||
|
||||
tmpTM = tile_manager_new (width, height, bytes);
|
||||
scale (srcTM, tmpTM, interpolation,
|
||||
progress_callback, progress_data, &progress, max_progress);
|
||||
|
||||
if (srcTM != srcPR->tiles)
|
||||
tile_manager_unref (srcTM);
|
||||
|
||||
srcTM = tmpTM;
|
||||
levely++;
|
||||
progress_callback, progress_data, &progress, max_progress,
|
||||
scalex, scaley);
|
||||
}
|
||||
|
||||
while (levelx > 0 && levely > 0)
|
||||
{
|
||||
width >>= 1;
|
||||
height >>= 1;
|
||||
width = (width + 1) >> 1;
|
||||
height = (height + 1) >> 1;
|
||||
scalex *= .5;
|
||||
scaley *= .5;
|
||||
|
||||
tmpTM = tile_manager_new (width, height, bytes);
|
||||
decimate_xy (srcTM, tmpTM, interpolation,
|
||||
@@ -395,7 +329,8 @@ scale_region_tile (PixelRegion *srcPR,
|
||||
|
||||
while (levelx > 0)
|
||||
{
|
||||
width >>= 1;
|
||||
width = (width + 1) >> 1;
|
||||
scalex *= .5;
|
||||
|
||||
tmpTM = tile_manager_new (width, height, bytes);
|
||||
decimate_x (srcTM, tmpTM, interpolation,
|
||||
@@ -410,7 +345,8 @@ scale_region_tile (PixelRegion *srcPR,
|
||||
|
||||
while (levely > 0)
|
||||
{
|
||||
height >>= 1;
|
||||
height = (height + 1) >> 1;
|
||||
scaley *= .5;
|
||||
|
||||
tmpTM = tile_manager_new (width, height, bytes);
|
||||
decimate_y (srcTM, tmpTM, interpolation,
|
||||
@@ -426,7 +362,8 @@ scale_region_tile (PixelRegion *srcPR,
|
||||
if (tmpTM != NULL)
|
||||
{
|
||||
scale (tmpTM, dstTM, interpolation,
|
||||
progress_callback, progress_data, &progress, max_progress);
|
||||
progress_callback, progress_data, &progress, max_progress,
|
||||
scalex, scaley);
|
||||
tile_manager_unref (tmpTM);
|
||||
}
|
||||
|
||||
@@ -443,7 +380,9 @@ scale (TileManager *srcTM,
|
||||
GimpProgressFunc progress_callback,
|
||||
gpointer progress_data,
|
||||
gint *progress,
|
||||
gint max_progress)
|
||||
gint max_progress,
|
||||
const gdouble scalex,
|
||||
const gdouble scaley)
|
||||
{
|
||||
PixelRegion region;
|
||||
PixelSurround *surround = NULL;
|
||||
@@ -452,8 +391,6 @@ scale (TileManager *srcTM,
|
||||
const guint bytes = tile_manager_bpp (dstTM);
|
||||
const guint dst_width = tile_manager_width (dstTM);
|
||||
const guint dst_height = tile_manager_height (dstTM);
|
||||
const gdouble scaley = (gdouble) src_height / (gdouble) dst_height;
|
||||
const gdouble scalex = (gdouble) src_width / (gdouble) dst_width;
|
||||
gpointer pr;
|
||||
gfloat *kernel_lookup = NULL;
|
||||
|
||||
@@ -509,7 +446,7 @@ scale (TileManager *srcTM,
|
||||
{
|
||||
guchar *pixel = row;
|
||||
gdouble yfrac = (y + 0.5) * scaley - 0.5;
|
||||
gint sy = (gint) yfrac;
|
||||
gint sy = floor (yfrac);
|
||||
gint x;
|
||||
|
||||
yfrac = yfrac - sy;
|
||||
@@ -517,7 +454,7 @@ scale (TileManager *srcTM,
|
||||
for (x = region.x; x < x1; x++)
|
||||
{
|
||||
gdouble xfrac = (x + 0.5) * scalex - 0.5;
|
||||
gint sx = (gint) xfrac;
|
||||
gint sx = floor (xfrac);
|
||||
|
||||
xfrac = xfrac - sx;
|
||||
|
||||
@@ -965,7 +902,7 @@ sinc (const gdouble x)
|
||||
gfloat *
|
||||
create_lanczos_lookup (void)
|
||||
{
|
||||
const gdouble dx = LANCZOS_WIDTH / (gdouble) (LANCZOS_SAMPLES - 1);
|
||||
const gdouble dx = LANCZOS_MIN;
|
||||
|
||||
gfloat *lookup = g_new (gfloat, LANCZOS_SAMPLES);
|
||||
gdouble x = 0.0;
|
||||
@@ -984,7 +921,7 @@ create_lanczos_lookup (void)
|
||||
static gfloat *
|
||||
create_lanczos3_lookup (void)
|
||||
{
|
||||
const gdouble dx = 3.0 / (gdouble) (LANCZOS_SAMPLES - 1);
|
||||
const gdouble dx = LANCZOS_MIN;
|
||||
|
||||
gfloat *lookup = g_new (gfloat, LANCZOS_SAMPLES);
|
||||
gdouble x = 0.0;
|
||||
@@ -1051,7 +988,7 @@ interpolate_bilinear (PixelSurround *surround,
|
||||
switch (bytes)
|
||||
{
|
||||
case 1:
|
||||
sum = weighted_sum (xfrac, yfrac, p1[0], p2[0], p3[0], p4[0]);
|
||||
sum = RINT (weighted_sum (xfrac, yfrac, p1[0], p2[0], p3[0], p4[0]));
|
||||
|
||||
pixel[0] = CLAMP (sum, 0, 255);
|
||||
break;
|
||||
@@ -1063,7 +1000,8 @@ interpolate_bilinear (PixelSurround *surround,
|
||||
sum = weighted_sum (xfrac, yfrac,
|
||||
p1[0] * p1[1], p2[0] * p2[1],
|
||||
p3[0] * p3[1], p4[0] * p4[1]);
|
||||
sum /= alphasum;
|
||||
sum = RINT (sum / alphasum);
|
||||
alphasum = RINT (alphasum);
|
||||
|
||||
pixel[0] = CLAMP (sum, 0, 255);
|
||||
pixel[1] = CLAMP (alphasum, 0, 255);
|
||||
@@ -1077,7 +1015,7 @@ interpolate_bilinear (PixelSurround *surround,
|
||||
case 3:
|
||||
for (b = 0; b < 3; b++)
|
||||
{
|
||||
sum = weighted_sum (xfrac, yfrac, p1[b], p2[b], p3[b], p4[b]);
|
||||
sum = RINT (weighted_sum (xfrac, yfrac, p1[b], p2[b], p3[b], p4[b]));
|
||||
|
||||
pixel[b] = CLAMP (sum, 0, 255);
|
||||
}
|
||||
@@ -1092,11 +1030,12 @@ interpolate_bilinear (PixelSurround *surround,
|
||||
sum = weighted_sum (xfrac, yfrac,
|
||||
p1[b] * p1[3], p2[b] * p2[3],
|
||||
p3[b] * p3[3], p4[b] * p4[3]);
|
||||
sum /= alphasum;
|
||||
sum = RINT (sum / alphasum);
|
||||
|
||||
pixel[b] = CLAMP (sum, 0, 255);
|
||||
}
|
||||
|
||||
alphasum = RINT (alphasum);
|
||||
pixel[3] = CLAMP (alphasum, 0, 255);
|
||||
}
|
||||
else
|
||||
@@ -1152,7 +1091,7 @@ interpolate_cubic (PixelSurround *surround,
|
||||
p2 = cubic_spline_fit (xfrac, s2[0], s2[1], s2[2], s2[3]);
|
||||
p3 = cubic_spline_fit (xfrac, s3[0], s3[1], s3[2], s3[3]);
|
||||
|
||||
sum = cubic_spline_fit (yfrac, p0, p1, p2, p3);
|
||||
sum = RINT (cubic_spline_fit (yfrac, p0, p1, p2, p3));
|
||||
|
||||
pixel[0]= CLAMP (sum, 0, 255);
|
||||
break;
|
||||
@@ -1180,10 +1119,11 @@ interpolate_cubic (PixelSurround *surround,
|
||||
s3[0] * s3[1], s3[2] * s3[3],
|
||||
s3[4] * s3[5], s3[6] * s3[7]);
|
||||
|
||||
sum = cubic_spline_fit (yfrac, p0, p1, p2, p3);
|
||||
sum /= alphasum;
|
||||
|
||||
sum = cubic_spline_fit (yfrac, p0, p1, p2, p3);
|
||||
sum = RINT (sum / alphasum);
|
||||
pixel[0] = CLAMP (sum, 0, 255);
|
||||
|
||||
alphasum = RINT (alphasum);
|
||||
pixel[1] = CLAMP (alphasum, 0, 255);
|
||||
}
|
||||
else
|
||||
@@ -1200,7 +1140,7 @@ interpolate_cubic (PixelSurround *surround,
|
||||
p2 = cubic_spline_fit (xfrac, s2[b], s2[3 + b], s2[6 + b], s2[9 + b]);
|
||||
p3 = cubic_spline_fit (xfrac, s3[b], s3[3 + b], s3[6 + b], s3[9 + b]);
|
||||
|
||||
sum = cubic_spline_fit (yfrac, p0, p1, p2, p3);
|
||||
sum = RINT (cubic_spline_fit (yfrac, p0, p1, p2, p3));
|
||||
|
||||
pixel[b] = CLAMP (sum, 0, 255);
|
||||
}
|
||||
@@ -1231,12 +1171,13 @@ interpolate_cubic (PixelSurround *surround,
|
||||
s3[0 + b] * s3[ 3], s3[ 4 + b] * s3[7],
|
||||
s3[8 + b] * s3[11], s3[12 + b] * s3[15]);
|
||||
|
||||
sum = cubic_spline_fit (yfrac, p0, p1, p2, p3);
|
||||
sum /= alphasum;
|
||||
sum = cubic_spline_fit (yfrac, p0, p1, p2, p3);
|
||||
sum = RINT (sum / alphasum);
|
||||
|
||||
pixel[b] = CLAMP (sum, 0, 255);
|
||||
}
|
||||
|
||||
alphasum = RINT (alphasum);
|
||||
pixel[3] = CLAMP (alphasum, 0, 255);
|
||||
}
|
||||
else
|
||||
@@ -1346,7 +1287,7 @@ interpolate_lanczos3 (PixelSurround *surround,
|
||||
switch (bytes)
|
||||
{
|
||||
case 1:
|
||||
sum = lanczos3_mul (src, x_kernel, y_kernel, stride, 1, 0);
|
||||
sum = RINT (lanczos3_mul (src, x_kernel, y_kernel, stride, 1, 0));
|
||||
|
||||
pixel[0] = CLAMP (sum, 0, 255);
|
||||
break;
|
||||
@@ -1356,9 +1297,10 @@ interpolate_lanczos3 (PixelSurround *surround,
|
||||
if (alphasum > 0)
|
||||
{
|
||||
sum = lanczos3_mul_alpha (src, x_kernel, y_kernel, stride, 2, 0);
|
||||
sum /= alphasum;
|
||||
|
||||
sum = RINT (sum / alphasum);
|
||||
pixel[0] = CLAMP (sum, 0, 255);
|
||||
|
||||
alphasum = RINT (alphasum);
|
||||
pixel[1] = CLAMP (alphasum, 0, 255);
|
||||
}
|
||||
else
|
||||
@@ -1370,7 +1312,7 @@ interpolate_lanczos3 (PixelSurround *surround,
|
||||
case 3:
|
||||
for (b = 0; b < 3; b++)
|
||||
{
|
||||
sum = lanczos3_mul (src, x_kernel, y_kernel, stride, 3, b);
|
||||
sum = RINT (lanczos3_mul (src, x_kernel, y_kernel, stride, 3, b));
|
||||
|
||||
pixel[b] = CLAMP (sum, 0, 255);
|
||||
}
|
||||
@@ -1383,11 +1325,12 @@ interpolate_lanczos3 (PixelSurround *surround,
|
||||
for (b = 0; b < 3; b++)
|
||||
{
|
||||
sum = lanczos3_mul_alpha (src, x_kernel, y_kernel, stride, 4, b);
|
||||
sum /= alphasum;
|
||||
sum = RINT (sum / alphasum);
|
||||
|
||||
pixel[b] = CLAMP (sum, 0, 255);
|
||||
}
|
||||
|
||||
alphasum = RINT (alphasum);
|
||||
pixel[3] = CLAMP (alphasum, 0, 255);
|
||||
}
|
||||
else
|
||||
|
@@ -83,18 +83,21 @@ static gdouble gimp_heal_laplace_iteration (gdouble *matrix,
|
||||
gint depth,
|
||||
gint width,
|
||||
gdouble *solution,
|
||||
guchar *mask);
|
||||
guchar *mask,
|
||||
gint mask_stride,
|
||||
gint mask_offx,
|
||||
gint mask_offy);
|
||||
|
||||
static void gimp_heal_laplace_loop (gdouble *matrix,
|
||||
gint height,
|
||||
gint depth,
|
||||
gint width,
|
||||
gdouble *solution,
|
||||
guchar *mask);
|
||||
PixelRegion *maskPR);
|
||||
|
||||
static PixelRegion *gimp_heal_region (PixelRegion *tempPR,
|
||||
PixelRegion *srcPR,
|
||||
const TempBuf *mask_buf);
|
||||
PixelRegion *maskPR);
|
||||
|
||||
static void gimp_heal_motion (GimpSourceCore *source_core,
|
||||
GimpDrawable *drawable,
|
||||
@@ -269,7 +272,10 @@ gimp_heal_laplace_iteration (gdouble *matrix,
|
||||
gint depth,
|
||||
gint width,
|
||||
gdouble *solution,
|
||||
guchar *mask)
|
||||
guchar *mask,
|
||||
gint mask_stride,
|
||||
gint mask_offx,
|
||||
gint mask_offy)
|
||||
{
|
||||
const gint rowstride = width * depth;
|
||||
gint i, j, k, off, offm, offm0, off0;
|
||||
@@ -283,12 +289,12 @@ gimp_heal_laplace_iteration (gdouble *matrix,
|
||||
for (i = 0; i < height; i++)
|
||||
{
|
||||
off0 = i * rowstride;
|
||||
offm0 = i * width;
|
||||
offm0 = (i + mask_offy) * mask_stride;
|
||||
|
||||
for (j = i % 2; j < width; j += 2)
|
||||
{
|
||||
off = off0 + j * depth;
|
||||
offm = offm0 + j;
|
||||
offm = offm0 + j + mask_offx;
|
||||
|
||||
if ((0 == mask[offm]) ||
|
||||
(i == 0) || (i == (height - 1)) ||
|
||||
@@ -330,13 +336,13 @@ gimp_heal_laplace_iteration (gdouble *matrix,
|
||||
*/
|
||||
for (i = 0; i < height; i++)
|
||||
{
|
||||
off0 = i * rowstride;
|
||||
offm0 = i * width;
|
||||
off0 = i * rowstride;
|
||||
offm0 = (i + mask_offy) * mask_stride;
|
||||
|
||||
for (j = (i % 2) ? 0 : 1; j < width; j += 2)
|
||||
{
|
||||
off = off0 + j * depth;
|
||||
offm = offm0 + j;
|
||||
offm = offm0 + j + mask_offx;
|
||||
|
||||
if ((0 == mask[offm]) ||
|
||||
(i == 0) || (i == (height - 1)) ||
|
||||
@@ -375,12 +381,12 @@ gimp_heal_laplace_iteration (gdouble *matrix,
|
||||
/* Solve the laplace equation for matrix and store the result in solution.
|
||||
*/
|
||||
static void
|
||||
gimp_heal_laplace_loop (gdouble *matrix,
|
||||
gint height,
|
||||
gint depth,
|
||||
gint width,
|
||||
gdouble *solution,
|
||||
guchar *mask)
|
||||
gimp_heal_laplace_loop (gdouble *matrix,
|
||||
gint height,
|
||||
gint depth,
|
||||
gint width,
|
||||
gdouble *solution,
|
||||
PixelRegion *maskPR)
|
||||
{
|
||||
#define EPSILON 0.001
|
||||
#define MAX_ITER 500
|
||||
@@ -393,7 +399,8 @@ gimp_heal_laplace_loop (gdouble *matrix,
|
||||
|
||||
/* do one iteration and store the amount of error */
|
||||
sqr_err = gimp_heal_laplace_iteration (matrix, height, depth, width,
|
||||
solution, mask);
|
||||
solution, maskPR->data, maskPR->rowstride,
|
||||
maskPR->x, maskPR->y);
|
||||
|
||||
/* copy solution to matrix */
|
||||
memcpy (matrix, solution, width * height * depth * sizeof (double));
|
||||
@@ -411,17 +418,16 @@ gimp_heal_laplace_loop (gdouble *matrix,
|
||||
static PixelRegion *
|
||||
gimp_heal_region (PixelRegion *tempPR,
|
||||
PixelRegion *srcPR,
|
||||
const TempBuf *mask_buf)
|
||||
PixelRegion *maskPR)
|
||||
{
|
||||
gdouble *i_1 = g_new (gdouble, tempPR->h * tempPR->bytes * tempPR->w);
|
||||
gdouble *i_2 = g_new (gdouble, tempPR->h * tempPR->bytes * tempPR->w);
|
||||
guchar *mask = temp_buf_get_data (mask_buf);
|
||||
|
||||
/* substract pattern to image and store the result as a double in i_1 */
|
||||
gimp_heal_sub (tempPR, srcPR, i_1);
|
||||
|
||||
/* FIXME: is a faster implementation needed? */
|
||||
gimp_heal_laplace_loop (i_1, tempPR->h, tempPR->bytes, tempPR->w, i_2, mask);
|
||||
gimp_heal_laplace_loop (i_1, tempPR->h, tempPR->bytes, tempPR->w, i_2, maskPR);
|
||||
|
||||
/* add solution to original image and store in tempPR */
|
||||
gimp_heal_add (i_2, srcPR, tempPR);
|
||||
@@ -459,6 +465,7 @@ gimp_heal_motion (GimpSourceCore *source_core,
|
||||
PixelRegion origPR;
|
||||
PixelRegion tempPR;
|
||||
PixelRegion destPR;
|
||||
PixelRegion maskPR;
|
||||
GimpImageType src_type;
|
||||
const TempBuf *mask_buf;
|
||||
gdouble fade_point;
|
||||
@@ -569,8 +576,20 @@ gimp_heal_motion (GimpSourceCore *source_core,
|
||||
return;
|
||||
}
|
||||
|
||||
/* find the offset of the brush mask's rect */
|
||||
{
|
||||
gint x = (gint) floor (coords->x) - (mask_buf->width >> 1);
|
||||
gint y = (gint) floor (coords->y) - (mask_buf->height >> 1);
|
||||
|
||||
gint off_x = (x < 0) ? -x : 0;
|
||||
gint off_y = (y < 0) ? -y : 0;
|
||||
|
||||
pixel_region_init_temp_buf (&maskPR, mask_buf, off_x, off_y,
|
||||
paint_area_width, paint_area_height);
|
||||
}
|
||||
|
||||
/* heal tempPR using srcPR */
|
||||
gimp_heal_region (&tempPR, srcPR, mask_buf);
|
||||
gimp_heal_region (&tempPR, srcPR, &maskPR);
|
||||
|
||||
temp_buf_free (src);
|
||||
|
||||
|
@@ -434,27 +434,28 @@ context_get_brush_size_invoker (GimpProcedure *procedure,
|
||||
GError **error)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
gdouble size;
|
||||
GValueArray *return_vals;
|
||||
gdouble size = 0.0;
|
||||
|
||||
size = g_value_get_double (&args->values[0]);
|
||||
/* all options should have the same value, so pick a random one */
|
||||
GimpPaintOptions *options =
|
||||
gimp_pdb_context_get_paint_options (GIMP_PDB_CONTEXT (context),
|
||||
"gimp-paintbrush");
|
||||
|
||||
if (options)
|
||||
g_object_get (options,
|
||||
"brush-size", &size,
|
||||
NULL);
|
||||
else
|
||||
success = FALSE;
|
||||
|
||||
return_vals = gimp_procedure_get_return_values (procedure, success,
|
||||
error ? *error : NULL);
|
||||
|
||||
if (success)
|
||||
{
|
||||
/* all options should have the same value, so pick a random one */
|
||||
GimpPaintOptions *options =
|
||||
gimp_pdb_context_get_paint_options (GIMP_PDB_CONTEXT (context),
|
||||
"gimp-paintbrush");
|
||||
g_value_set_double (&return_vals->values[1], size);
|
||||
|
||||
if (options)
|
||||
g_object_get (options,
|
||||
"brush-size", &size,
|
||||
NULL);
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
|
||||
return gimp_procedure_get_return_values (procedure, success,
|
||||
error ? *error : NULL);
|
||||
return return_vals;
|
||||
}
|
||||
|
||||
static GValueArray *
|
||||
@@ -533,27 +534,28 @@ context_get_brush_aspect_ratio_invoker (GimpProcedure *procedure,
|
||||
GError **error)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
gdouble aspect;
|
||||
GValueArray *return_vals;
|
||||
gdouble aspect = 0.0;
|
||||
|
||||
aspect = g_value_get_double (&args->values[0]);
|
||||
/* all options should have the same value, so pick a random one */
|
||||
GimpPaintOptions *options =
|
||||
gimp_pdb_context_get_paint_options (GIMP_PDB_CONTEXT (context),
|
||||
"gimp-paintbrush");
|
||||
|
||||
if (options)
|
||||
g_object_get (options,
|
||||
"brush-aspect-ratio", &aspect,
|
||||
NULL);
|
||||
else
|
||||
success = FALSE;
|
||||
|
||||
return_vals = gimp_procedure_get_return_values (procedure, success,
|
||||
error ? *error : NULL);
|
||||
|
||||
if (success)
|
||||
{
|
||||
/* all options should have the same value, so pick a random one */
|
||||
GimpPaintOptions *options =
|
||||
gimp_pdb_context_get_paint_options (GIMP_PDB_CONTEXT (context),
|
||||
"gimp-paintbrush");
|
||||
g_value_set_double (&return_vals->values[1], aspect);
|
||||
|
||||
if (options)
|
||||
g_object_get (options,
|
||||
"brush-aspect-ratio", &aspect,
|
||||
NULL);
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
|
||||
return gimp_procedure_get_return_values (procedure, success,
|
||||
error ? *error : NULL);
|
||||
return return_vals;
|
||||
}
|
||||
|
||||
static GValueArray *
|
||||
@@ -597,27 +599,28 @@ context_get_brush_angle_invoker (GimpProcedure *procedure,
|
||||
GError **error)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
gdouble angle;
|
||||
GValueArray *return_vals;
|
||||
gdouble angle = 0.0;
|
||||
|
||||
angle = g_value_get_double (&args->values[0]);
|
||||
/* all options should have the same value, so pick a random one */
|
||||
GimpPaintOptions *options =
|
||||
gimp_pdb_context_get_paint_options (GIMP_PDB_CONTEXT (context),
|
||||
"gimp-paintbrush");
|
||||
|
||||
if (options)
|
||||
g_object_get (options,
|
||||
"brush-angle", &angle,
|
||||
NULL);
|
||||
else
|
||||
success = FALSE;
|
||||
|
||||
return_vals = gimp_procedure_get_return_values (procedure, success,
|
||||
error ? *error : NULL);
|
||||
|
||||
if (success)
|
||||
{
|
||||
/* all options should have the same value, so pick a random one */
|
||||
GimpPaintOptions *options =
|
||||
gimp_pdb_context_get_paint_options (GIMP_PDB_CONTEXT (context),
|
||||
"gimp-paintbrush");
|
||||
g_value_set_double (&return_vals->values[1], angle);
|
||||
|
||||
if (options)
|
||||
g_object_get (options,
|
||||
"brush-angle", &angle,
|
||||
NULL);
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
|
||||
return gimp_procedure_get_return_values (procedure, success,
|
||||
error ? *error : NULL);
|
||||
return return_vals;
|
||||
}
|
||||
|
||||
static GValueArray *
|
||||
@@ -2403,12 +2406,12 @@ register_context_procs (GimpPDB *pdb)
|
||||
"Ed Swartz",
|
||||
"2012",
|
||||
NULL);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("size",
|
||||
"size",
|
||||
"brush size in pixels",
|
||||
0, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
g_param_spec_double ("size",
|
||||
"size",
|
||||
"brush size in pixels",
|
||||
0, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
|
||||
@@ -2466,12 +2469,12 @@ register_context_procs (GimpPDB *pdb)
|
||||
"Ed Swartz",
|
||||
"2012",
|
||||
NULL);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("aspect",
|
||||
"aspect",
|
||||
"aspect ratio",
|
||||
-20, 20, -20,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
g_param_spec_double ("aspect",
|
||||
"aspect",
|
||||
"aspect ratio",
|
||||
-20, 20, -20,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
|
||||
@@ -2512,12 +2515,12 @@ register_context_procs (GimpPDB *pdb)
|
||||
"Ed Swartz",
|
||||
"2012",
|
||||
NULL);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("angle",
|
||||
"angle",
|
||||
"angle in degrees",
|
||||
-180, 180, -180,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
g_param_spec_double ("angle",
|
||||
"angle",
|
||||
"angle in degrees",
|
||||
-180, 180, -180,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
|
||||
|
@@ -53,6 +53,7 @@
|
||||
#include "core/gimpprogress.h"
|
||||
#include "core/gimpselection.h"
|
||||
#include "core/gimpunit.h"
|
||||
#include "file/file-utils.h"
|
||||
#include "vectors/gimpvectors.h"
|
||||
|
||||
#include "gimppdb.h"
|
||||
@@ -2286,7 +2287,11 @@ image_get_name_invoker (GimpProcedure *procedure,
|
||||
|
||||
if (success)
|
||||
{
|
||||
name = g_strdup (gimp_image_get_display_name (image));
|
||||
/* XXX do we really want to return this, or the name as in the title? */
|
||||
|
||||
const gchar *uri = gimp_image_get_uri_or_untitled (image);
|
||||
|
||||
name = file_utils_uri_display_basename (uri);
|
||||
}
|
||||
|
||||
return_vals = gimp_procedure_get_return_values (procedure, success,
|
||||
@@ -3664,7 +3669,7 @@ register_image_procs (GimpPDB *pdb)
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-image-insert-layer",
|
||||
"Add the specified layer to the image.",
|
||||
"This procedure adds the specified layer to the image at the given position. If the specified parent is a valid layer group (See 'gimp-item-is-group' and 'gimp-layer-group-new') then the layer is added inside the group. If the parent is 0, the layer is added inside the main stack, outside of any group. The position argument specifies the location of the layer inside the stack (or the group, if a valid parent was supplied), starting from the top (0) and increasing. If the position is specified as -1 and the parent is specified as 0, then the layer is inserted above the active layer. The layer type must be compatible with the image base type.",
|
||||
"This procedure adds the specified layer to the image at the given position. If the specified parent is a valid layer group (See 'gimp-item-is-group' and 'gimp-layer-group-new') then the layer is added inside the group. If the parent is 0, the layer is added inside the main stack, outside of any group. The position argument specifies the location of the layer inside the stack (or the group, if a valid parent was supplied), starting from the top (0) and increasing. If the position is specified as -1 and the parent is specified as 0, then the layer is inserted above the active layer, or inside the group if the active layer is a layer group. The layer type must be compatible with the image base type.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
|
@@ -420,8 +420,6 @@ void
|
||||
gimp_plug_in_close (GimpPlugIn *plug_in,
|
||||
gboolean kill_it)
|
||||
{
|
||||
GList *list;
|
||||
|
||||
g_return_if_fail (GIMP_IS_PLUG_IN (plug_in));
|
||||
g_return_if_fail (plug_in->open);
|
||||
|
||||
@@ -533,9 +531,9 @@ gimp_plug_in_close (GimpPlugIn *plug_in,
|
||||
|
||||
gimp_wire_clear_error ();
|
||||
|
||||
for (list = plug_in->temp_proc_frames; list; list = g_list_next (list))
|
||||
while (plug_in->temp_proc_frames)
|
||||
{
|
||||
GimpPlugInProcFrame *proc_frame = list->data;
|
||||
GimpPlugInProcFrame *proc_frame = plug_in->temp_proc_frames->data;
|
||||
|
||||
#ifdef GIMP_UNSTABLE
|
||||
g_printerr ("plug-in '%s' aborted before sending its "
|
||||
@@ -548,6 +546,12 @@ gimp_plug_in_close (GimpPlugIn *plug_in,
|
||||
{
|
||||
g_main_loop_quit (proc_frame->main_loop);
|
||||
}
|
||||
|
||||
/* pop the frame here, because normally this only happens in
|
||||
* gimp_plug_in_handle_temp_proc_return(), which can't
|
||||
* be called after plug_in_close()
|
||||
*/
|
||||
gimp_plug_in_proc_frame_pop (plug_in);
|
||||
}
|
||||
|
||||
if (plug_in->main_proc_frame.main_loop &&
|
||||
|
@@ -930,8 +930,6 @@ gimp_plug_in_procedure_set_mime_type (GimpPlugInProcedure *proc,
|
||||
{
|
||||
g_return_if_fail (GIMP_IS_PLUG_IN_PROCEDURE (proc));
|
||||
|
||||
proc->file_proc = TRUE;
|
||||
|
||||
if (proc->mime_type)
|
||||
g_free (proc->mime_type);
|
||||
|
||||
@@ -944,8 +942,6 @@ gimp_plug_in_procedure_set_thumb_loader (GimpPlugInProcedure *proc,
|
||||
{
|
||||
g_return_if_fail (GIMP_IS_PLUG_IN_PROCEDURE (proc));
|
||||
|
||||
proc->file_proc = TRUE;
|
||||
|
||||
if (proc->thumb_loader)
|
||||
g_free (proc->thumb_loader);
|
||||
|
||||
|
@@ -23,7 +23,8 @@
|
||||
(open-on-exit)
|
||||
(aux-info
|
||||
(left-docks-width "80")
|
||||
(right-docks-position "200"))
|
||||
(right-docks-position "200")
|
||||
(maximized "no"))
|
||||
(gimp-toolbox
|
||||
(side left))
|
||||
(gimp-dock
|
||||
|
@@ -23,7 +23,8 @@
|
||||
(open-on-exit)
|
||||
(aux-info
|
||||
(left-docks-width "80")
|
||||
(right-docks-position "200"))
|
||||
(right-docks-position "200")
|
||||
(maximized "no"))
|
||||
(gimp-toolbox
|
||||
(side left))
|
||||
(gimp-dock
|
||||
|
@@ -219,7 +219,8 @@ saved_imported_file_uris (gconstpointer data)
|
||||
proc,
|
||||
GIMP_RUN_NONINTERACTIVE,
|
||||
TRUE /*change_saved_state*/,
|
||||
FALSE /*export*/,
|
||||
FALSE /*export_backward*/,
|
||||
FALSE /*export_forward*/,
|
||||
NULL /*error*/);
|
||||
|
||||
/* Assert */
|
||||
@@ -259,7 +260,8 @@ exported_file_uris (gconstpointer data)
|
||||
proc,
|
||||
GIMP_RUN_NONINTERACTIVE,
|
||||
FALSE /*change_saved_state*/,
|
||||
TRUE /*export*/,
|
||||
FALSE /*export_backward*/,
|
||||
TRUE /*export_forward*/,
|
||||
NULL /*error*/);
|
||||
|
||||
g_assert (gimp_image_get_uri (image) == NULL);
|
||||
@@ -323,7 +325,8 @@ clear_import_uri_after_export (gconstpointer data)
|
||||
proc,
|
||||
GIMP_RUN_NONINTERACTIVE,
|
||||
FALSE /*change_saved_state*/,
|
||||
TRUE /*export*/,
|
||||
FALSE /*export_backward*/,
|
||||
TRUE /*export_forward*/,
|
||||
NULL /*error*/);
|
||||
|
||||
g_assert (gimp_image_get_uri (image) == NULL);
|
||||
|
@@ -43,6 +43,8 @@
|
||||
#include "widgets/gimpdockwindow.h"
|
||||
#include "widgets/gimphelp-ids.h"
|
||||
#include "widgets/gimpsessioninfo.h"
|
||||
#include "widgets/gimpsessioninfo-aux.h"
|
||||
#include "widgets/gimpsessionmanaged.h"
|
||||
#include "widgets/gimptoolbox.h"
|
||||
#include "widgets/gimptooloptionseditor.h"
|
||||
#include "widgets/gimpuimanager.h"
|
||||
@@ -89,6 +91,8 @@ static GtkWidget * gimp_ui_find_window (GimpDialogFacto
|
||||
static gboolean gimp_ui_not_toolbox_window (GObject *object);
|
||||
static gboolean gimp_ui_multicolumn_not_toolbox_window (GObject *object);
|
||||
static gboolean gimp_ui_is_gimp_layer_list (GObject *object);
|
||||
static int gimp_ui_aux_data_eqiuvalent (gconstpointer _a,
|
||||
gconstpointer _b);
|
||||
static void gimp_ui_switch_window_mode (Gimp *gimp);
|
||||
|
||||
|
||||
@@ -570,6 +574,55 @@ show_docks_in_single_window_mode (gconstpointer data)
|
||||
gimp_ui_toggle_docks_in_single_window_mode (gimp);
|
||||
}
|
||||
|
||||
static void
|
||||
maximize_state_in_aux_data (gconstpointer data)
|
||||
{
|
||||
Gimp *gimp = GIMP (data);
|
||||
GimpDisplay *display = GIMP_DISPLAY (gimp_get_display_iter (gimp)->data);
|
||||
GimpDisplayShell *shell = gimp_display_get_shell (display);
|
||||
GimpImageWindow *window = gimp_display_shell_get_window (shell);
|
||||
gint i;
|
||||
|
||||
for (i = 0; i < 2; i++)
|
||||
{
|
||||
GList *aux_info = NULL;
|
||||
GimpSessionInfoAux *target_info;
|
||||
gboolean target_max_state;
|
||||
|
||||
if (i == 0)
|
||||
{
|
||||
target_info = gimp_session_info_aux_new ("maximized" , "yes");
|
||||
target_max_state = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
target_info = gimp_session_info_aux_new ("maximized", "no");
|
||||
target_max_state = FALSE;
|
||||
}
|
||||
|
||||
/* Set the aux info to out target data */
|
||||
aux_info = g_list_append (aux_info, target_info);
|
||||
gimp_session_managed_set_aux_info (GIMP_SESSION_MANAGED (window), aux_info);
|
||||
g_list_free (aux_info);
|
||||
|
||||
/* Give the WM a chance to maximize/unmaximize us */
|
||||
gimp_test_run_mainloop_until_idle ();
|
||||
g_usleep (500 * 1000);
|
||||
gimp_test_run_mainloop_until_idle ();
|
||||
|
||||
/* Make sure the maximize/unmaximize happened */
|
||||
g_assert (gimp_image_window_is_maximized (window) == target_max_state);
|
||||
|
||||
/* Make sure we can read out the window state again */
|
||||
aux_info = gimp_session_managed_get_aux_info (GIMP_SESSION_MANAGED (window));
|
||||
g_assert (g_list_find_custom (aux_info, target_info, gimp_ui_aux_data_eqiuvalent));
|
||||
g_list_free_full (aux_info,
|
||||
(GDestroyNotify) gimp_session_info_aux_free);
|
||||
|
||||
gimp_session_info_aux_free (target_info);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
switch_back_to_multi_window_mode (gconstpointer data)
|
||||
{
|
||||
@@ -831,6 +884,14 @@ gimp_ui_is_gimp_layer_list (GObject *object)
|
||||
return strcmp (entry->identifier, "gimp-layer-list") == 0;
|
||||
}
|
||||
|
||||
static int
|
||||
gimp_ui_aux_data_eqiuvalent (gconstpointer _a, gconstpointer _b)
|
||||
{
|
||||
GimpSessionInfoAux *a = (GimpSessionInfoAux*) _a;
|
||||
GimpSessionInfoAux *b = (GimpSessionInfoAux*) _b;
|
||||
return (strcmp (a->name, b->name) || strcmp (a->value, b->value));
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_ui_switch_window_mode (Gimp *gimp)
|
||||
{
|
||||
@@ -875,6 +936,10 @@ int main(int argc, char **argv)
|
||||
ADD_TEST (switch_to_single_window_mode);
|
||||
ADD_TEST (hide_docks_in_single_window_mode);
|
||||
ADD_TEST (show_docks_in_single_window_mode);
|
||||
#warning FIXME: maximize_state_in_aux_data doesn't work without WM
|
||||
#if 0
|
||||
ADD_TEST (maximize_state_in_aux_data);
|
||||
#endif
|
||||
ADD_TEST (switch_back_to_multi_window_mode);
|
||||
ADD_TEST (close_image);
|
||||
ADD_TEST (repeatedly_switch_window_mode);
|
||||
|
@@ -312,7 +312,8 @@ gimp_write_and_read_file (Gimp *gimp,
|
||||
proc,
|
||||
GIMP_RUN_NONINTERACTIVE,
|
||||
FALSE /*change_saved_state*/,
|
||||
FALSE /*export*/,
|
||||
FALSE /*export_backward*/,
|
||||
FALSE /*export_forward*/,
|
||||
NULL /*error*/);
|
||||
|
||||
/* Load from file */
|
||||
|
@@ -116,10 +116,8 @@ gimp_fonts_reset (Gimp *gimp)
|
||||
if (gimp->no_fonts)
|
||||
return;
|
||||
|
||||
/* We clear the default config here, so any subsequent fontconfig use will
|
||||
* reinit the library with defaults. (Maybe we should call FcFini here too?)
|
||||
*/
|
||||
FcConfigSetCurrent (NULL);
|
||||
/* Reinit the library with defaults. */
|
||||
FcInitReinitialize ();
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
@@ -75,13 +75,7 @@ gimp_text_vectors_new (GimpImage *image,
|
||||
|
||||
context.vectors = vectors;
|
||||
|
||||
/* A cairo_t needs an image surface to function, so "surface" is
|
||||
* created temporarily for this purpose. Nothing is drawn to
|
||||
* "surface", but it is still needed to be connected to "cr" for
|
||||
* "cr" to execute cr_glyph_path(). The size of surface is
|
||||
* therefore irrelevant.
|
||||
*/
|
||||
surface = cairo_image_surface_create (CAIRO_FORMAT_A8, 2, 2);
|
||||
surface = cairo_recording_surface_create (CAIRO_CONTENT_ALPHA, NULL);
|
||||
cr = cairo_create (surface);
|
||||
|
||||
gimp_image_get_resolution (image, &xres, &yres);
|
||||
|
@@ -184,7 +184,8 @@ gimp_cage_tool_init (GimpCageTool *self)
|
||||
GIMP_DIRTY_IMAGE |
|
||||
GIMP_DIRTY_IMAGE_STRUCTURE |
|
||||
GIMP_DIRTY_DRAWABLE |
|
||||
GIMP_DIRTY_SELECTION);
|
||||
GIMP_DIRTY_SELECTION |
|
||||
GIMP_DIRTY_ACTIVE_DRAWABLE);
|
||||
gimp_tool_control_set_wants_click (tool->control, TRUE);
|
||||
gimp_tool_control_set_tool_cursor (tool->control,
|
||||
GIMP_TOOL_CURSOR_PERSPECTIVE);
|
||||
@@ -237,13 +238,13 @@ gimp_cage_tool_control (GimpTool *tool,
|
||||
|
||||
if (ct->image_map)
|
||||
{
|
||||
gimp_tool_control_set_preserve (tool->control, TRUE);
|
||||
gimp_tool_control_push_preserve (tool->control, TRUE);
|
||||
|
||||
gimp_image_map_abort (ct->image_map);
|
||||
g_object_unref (ct->image_map);
|
||||
ct->image_map = NULL;
|
||||
|
||||
gimp_tool_control_set_preserve (tool->control, FALSE);
|
||||
gimp_tool_control_pop_preserve (tool->control);
|
||||
|
||||
gimp_image_flush (gimp_display_get_image (tool->display));
|
||||
}
|
||||
@@ -418,7 +419,7 @@ gimp_cage_tool_key_press (GimpTool *tool,
|
||||
case GDK_KEY_Return:
|
||||
case GDK_KEY_KP_Enter:
|
||||
case GDK_KEY_ISO_Enter:
|
||||
if (! ct->cage_complete)
|
||||
if (ct->cage_complete == FALSE && gimp_cage_config_get_n_points (ct->config) > 2)
|
||||
{
|
||||
g_object_set (gimp_tool_get_options (tool),
|
||||
"cage-mode", GIMP_CAGE_MODE_DEFORM,
|
||||
@@ -426,13 +427,13 @@ gimp_cage_tool_key_press (GimpTool *tool,
|
||||
}
|
||||
else if (ct->tool_state == DEFORM_STATE_WAIT)
|
||||
{
|
||||
gimp_tool_control_set_preserve (tool->control, TRUE);
|
||||
gimp_tool_control_push_preserve (tool->control, TRUE);
|
||||
|
||||
gimp_image_map_commit (ct->image_map);
|
||||
g_object_unref (ct->image_map);
|
||||
ct->image_map = NULL;
|
||||
|
||||
gimp_tool_control_set_preserve (tool->control, FALSE);
|
||||
gimp_tool_control_pop_preserve (tool->control);
|
||||
|
||||
gimp_image_flush (gimp_display_get_image (display));
|
||||
|
||||
@@ -565,7 +566,7 @@ gimp_cage_tool_button_press (GimpTool *tool,
|
||||
case CAGE_STATE_WAIT:
|
||||
if (ct->cage_complete == FALSE)
|
||||
{
|
||||
if (handle == -1 && edge == -1)
|
||||
if (handle == -1 && edge <= 0)
|
||||
{
|
||||
/* User clicked on the background, we add a new handle
|
||||
* and move it
|
||||
@@ -608,7 +609,7 @@ gimp_cage_tool_button_press (GimpTool *tool,
|
||||
|
||||
ct->tool_state = CAGE_STATE_MOVE_HANDLE;
|
||||
}
|
||||
else if (edge >= 0)
|
||||
else if (edge > 0)
|
||||
{
|
||||
/* User clicked on an edge, we add a new handle here and select it */
|
||||
|
||||
|
@@ -313,7 +313,7 @@ gimp_curves_tool_key_press (GimpTool *tool,
|
||||
{
|
||||
GimpCurvesTool *c_tool = GIMP_CURVES_TOOL (tool);
|
||||
|
||||
if (gtk_widget_event (c_tool->graph, (GdkEvent *) kevent))
|
||||
if (c_tool->graph && gtk_widget_event (c_tool->graph, (GdkEvent *) kevent))
|
||||
return TRUE;
|
||||
|
||||
return GIMP_TOOL_CLASS (parent_class)->key_press (tool, kevent, display);
|
||||
|
@@ -59,8 +59,9 @@
|
||||
#include "gimpdrawtool.h"
|
||||
|
||||
|
||||
#define DRAW_TIMEOUT 4
|
||||
#define USE_TIMEOUT 1
|
||||
#define DRAW_TIMEOUT 4
|
||||
#define USE_TIMEOUT 1
|
||||
#define MINIMUM_DRAW_INTERVAL 50000 /* 50000 microseconds == 20 fps */
|
||||
|
||||
|
||||
static void gimp_draw_tool_dispose (GObject *object);
|
||||
@@ -179,6 +180,12 @@ gimp_draw_tool_control (GimpTool *tool,
|
||||
static gboolean
|
||||
gimp_draw_tool_draw_timeout (GimpDrawTool *draw_tool)
|
||||
{
|
||||
guint64 now = g_get_monotonic_time ();
|
||||
|
||||
/* keep the timeout running if the last drawing just happened */
|
||||
if ((now - draw_tool->last_draw_time) <= MINIMUM_DRAW_INTERVAL)
|
||||
return FALSE;
|
||||
|
||||
draw_tool->draw_timeout = 0;
|
||||
|
||||
gimp_draw_tool_draw (draw_tool);
|
||||
@@ -190,12 +197,21 @@ gimp_draw_tool_draw_timeout (GimpDrawTool *draw_tool)
|
||||
static void
|
||||
gimp_draw_tool_draw (GimpDrawTool *draw_tool)
|
||||
{
|
||||
guint64 now = g_get_monotonic_time ();
|
||||
|
||||
if (draw_tool->display &&
|
||||
draw_tool->paused_count == 0 &&
|
||||
! draw_tool->draw_timeout)
|
||||
(! draw_tool->draw_timeout ||
|
||||
(now - draw_tool->last_draw_time) > MINIMUM_DRAW_INTERVAL))
|
||||
{
|
||||
GimpDisplayShell *shell = gimp_display_get_shell (draw_tool->display);
|
||||
|
||||
if (draw_tool->draw_timeout)
|
||||
{
|
||||
g_source_remove (draw_tool->draw_timeout);
|
||||
draw_tool->draw_timeout = 0;
|
||||
}
|
||||
|
||||
gimp_draw_tool_undraw (draw_tool);
|
||||
|
||||
GIMP_DRAW_TOOL_GET_CLASS (draw_tool)->draw (draw_tool);
|
||||
@@ -216,6 +232,8 @@ gimp_draw_tool_draw (GimpDrawTool *draw_tool)
|
||||
|
||||
if (draw_tool->item)
|
||||
gimp_display_shell_add_tool_item (shell, draw_tool->item);
|
||||
|
||||
draw_tool->last_draw_time = now;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -275,6 +293,8 @@ gimp_draw_tool_stop (GimpDrawTool *draw_tool)
|
||||
draw_tool->draw_timeout = 0;
|
||||
}
|
||||
|
||||
draw_tool->last_draw_time = 0;
|
||||
|
||||
draw_tool->display = NULL;
|
||||
}
|
||||
|
||||
@@ -308,16 +328,29 @@ gimp_draw_tool_resume (GimpDrawTool *draw_tool)
|
||||
|
||||
draw_tool->paused_count--;
|
||||
|
||||
if (draw_tool->paused_count == 0)
|
||||
{
|
||||
#ifdef USE_TIMEOUT
|
||||
if (draw_tool->paused_count == 0 && ! draw_tool->draw_timeout)
|
||||
draw_tool->draw_timeout =
|
||||
gdk_threads_add_timeout_full (G_PRIORITY_HIGH_IDLE,
|
||||
DRAW_TIMEOUT,
|
||||
(GSourceFunc) gimp_draw_tool_draw_timeout,
|
||||
draw_tool, NULL);
|
||||
#else
|
||||
gimp_draw_tool_draw (draw_tool);
|
||||
/* Don't install the timeout if the draw tool isn't active, so
|
||||
* suspend()/resume() can always be called, and have no side
|
||||
* effect on an inactive tool. See bug #687851.
|
||||
*/
|
||||
if (gimp_draw_tool_is_active (draw_tool) && ! draw_tool->draw_timeout)
|
||||
{
|
||||
draw_tool->draw_timeout =
|
||||
gdk_threads_add_timeout_full (G_PRIORITY_HIGH_IDLE,
|
||||
DRAW_TIMEOUT,
|
||||
(GSourceFunc) gimp_draw_tool_draw_timeout,
|
||||
draw_tool, NULL);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* call draw() anyway, it will do nothing if the timeout is
|
||||
* running, but will additionally check the drawing times to
|
||||
* ensure the minimum framerate
|
||||
*/
|
||||
gimp_draw_tool_draw (draw_tool);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -42,12 +42,13 @@ struct _GimpDrawTool
|
||||
{
|
||||
GimpTool parent_instance;
|
||||
|
||||
GimpDisplay *display; /* The display we are drawing to (may be
|
||||
* a different one than tool->display)
|
||||
*/
|
||||
GimpDisplay *display; /* The display we are drawing to (may be
|
||||
* a different one than tool->display)
|
||||
*/
|
||||
|
||||
gint paused_count; /* count to keep track of multiple pauses */
|
||||
guint draw_timeout; /* draw delay timeout ID */
|
||||
gint paused_count; /* count to keep track of multiple pauses */
|
||||
guint draw_timeout; /* draw delay timeout ID */
|
||||
guint64 last_draw_time; /* time of last draw(), monotonically */
|
||||
|
||||
GimpCanvasItem *preview;
|
||||
GimpCanvasItem *item;
|
||||
|
@@ -183,7 +183,9 @@ gimp_foreground_select_tool_init (GimpForegroundSelectTool *fg_select)
|
||||
|
||||
gimp_tool_control_set_scroll_lock (tool->control, FALSE);
|
||||
gimp_tool_control_set_preserve (tool->control, FALSE);
|
||||
gimp_tool_control_set_dirty_mask (tool->control, GIMP_DIRTY_IMAGE_SIZE);
|
||||
gimp_tool_control_set_dirty_mask (tool->control,
|
||||
GIMP_DIRTY_IMAGE_SIZE |
|
||||
GIMP_DIRTY_ACTIVE_DRAWABLE);
|
||||
gimp_tool_control_set_precision (tool->control,
|
||||
GIMP_CURSOR_PRECISION_PIXEL_CENTER);
|
||||
gimp_tool_control_set_tool_cursor (tool->control,
|
||||
|
@@ -1385,8 +1385,8 @@ gimp_free_select_tool_modifier_key (GimpTool *tool,
|
||||
{
|
||||
gimp_draw_tool_pause (draw_tool);
|
||||
|
||||
priv->constrain_angle = state & (gimp_get_constrain_behavior_mask () ?
|
||||
TRUE : FALSE);
|
||||
priv->constrain_angle = ((state & gimp_get_constrain_behavior_mask ()) ?
|
||||
TRUE : FALSE);
|
||||
|
||||
priv->supress_handles = state & GDK_SHIFT_MASK ? TRUE : FALSE;
|
||||
|
||||
@@ -1415,8 +1415,8 @@ gimp_free_select_tool_active_modifier_key (GimpTool *tool,
|
||||
|
||||
gimp_draw_tool_pause (draw_tool);
|
||||
|
||||
priv->constrain_angle = state & (gimp_get_constrain_behavior_mask () ?
|
||||
TRUE : FALSE);
|
||||
priv->constrain_angle = ((state & gimp_get_constrain_behavior_mask ()) ?
|
||||
TRUE : FALSE);
|
||||
|
||||
/* If we didn't came here due to a mouse release, immediately update
|
||||
* the position of the thing we move.
|
||||
|
@@ -201,7 +201,8 @@ gimp_image_map_tool_init (GimpImageMapTool *image_map_tool)
|
||||
GIMP_DIRTY_IMAGE |
|
||||
GIMP_DIRTY_IMAGE_STRUCTURE |
|
||||
GIMP_DIRTY_DRAWABLE |
|
||||
GIMP_DIRTY_SELECTION);
|
||||
GIMP_DIRTY_SELECTION |
|
||||
GIMP_DIRTY_ACTIVE_DRAWABLE);
|
||||
|
||||
image_map_tool->drawable = NULL;
|
||||
image_map_tool->operation = NULL;
|
||||
@@ -419,15 +420,29 @@ gimp_image_map_tool_control (GimpTool *tool,
|
||||
|
||||
if (image_map_tool->image_map)
|
||||
{
|
||||
gimp_tool_control_set_preserve (tool->control, TRUE);
|
||||
GimpImage *image;
|
||||
|
||||
gimp_tool_control_push_preserve (tool->control, TRUE);
|
||||
|
||||
gimp_image_map_abort (image_map_tool->image_map);
|
||||
g_object_unref (image_map_tool->image_map);
|
||||
image_map_tool->image_map = NULL;
|
||||
|
||||
gimp_tool_control_set_preserve (tool->control, FALSE);
|
||||
gimp_tool_control_pop_preserve (tool->control);
|
||||
|
||||
gimp_image_flush (gimp_display_get_image (tool->display));
|
||||
/* don't call gimp_image_flush() here, because the tool
|
||||
* might be cancelled from some other place opening an undo
|
||||
* group, so flushing the image would update menus and
|
||||
* whatnot while that other operation is running, with
|
||||
* unforeseeable side effects. Also, flusing the image here
|
||||
* is not needed because we didn't change anything in the
|
||||
* image. Instead, make sure manually that the display is
|
||||
* updated correctly after restoring GimpImageMapTool's
|
||||
* temporary editing.
|
||||
*/
|
||||
image = gimp_display_get_image (tool->display);
|
||||
gimp_projection_flush_now (gimp_image_get_projection (image));
|
||||
gimp_display_flush_now (tool->display);
|
||||
}
|
||||
|
||||
tool->drawable = NULL;
|
||||
@@ -487,19 +502,19 @@ gimp_image_map_tool_options_notify (GimpTool *tool,
|
||||
|
||||
if (im_options->preview)
|
||||
{
|
||||
gimp_tool_control_set_preserve (tool->control, TRUE);
|
||||
gimp_tool_control_push_preserve (tool->control, TRUE);
|
||||
|
||||
gimp_image_map_tool_map (image_map_tool);
|
||||
|
||||
gimp_tool_control_set_preserve (tool->control, FALSE);
|
||||
gimp_tool_control_pop_preserve (tool->control);
|
||||
}
|
||||
else
|
||||
{
|
||||
gimp_tool_control_set_preserve (tool->control, TRUE);
|
||||
gimp_tool_control_push_preserve (tool->control, TRUE);
|
||||
|
||||
gimp_image_map_clear (image_map_tool->image_map);
|
||||
|
||||
gimp_tool_control_set_preserve (tool->control, FALSE);
|
||||
gimp_tool_control_pop_preserve (tool->control);
|
||||
|
||||
gimp_image_map_tool_flush (image_map_tool->image_map,
|
||||
image_map_tool);
|
||||
@@ -653,7 +668,7 @@ gimp_image_map_tool_response (GtkWidget *widget,
|
||||
{
|
||||
GimpImageMapOptions *options = GIMP_IMAGE_MAP_TOOL_GET_OPTIONS (tool);
|
||||
|
||||
gimp_tool_control_set_preserve (tool->control, TRUE);
|
||||
gimp_tool_control_push_preserve (tool->control, TRUE);
|
||||
|
||||
if (! options->preview)
|
||||
gimp_image_map_tool_map (image_map_tool);
|
||||
@@ -662,7 +677,7 @@ gimp_image_map_tool_response (GtkWidget *widget,
|
||||
g_object_unref (image_map_tool->image_map);
|
||||
image_map_tool->image_map = NULL;
|
||||
|
||||
gimp_tool_control_set_preserve (tool->control, FALSE);
|
||||
gimp_tool_control_pop_preserve (tool->control);
|
||||
|
||||
gimp_image_flush (gimp_display_get_image (tool->display));
|
||||
|
||||
@@ -726,11 +741,11 @@ gimp_image_map_tool_preview (GimpImageMapTool *image_map_tool)
|
||||
|
||||
if (image_map_tool->image_map && options->preview)
|
||||
{
|
||||
gimp_tool_control_set_preserve (tool->control, TRUE);
|
||||
gimp_tool_control_push_preserve (tool->control, TRUE);
|
||||
|
||||
gimp_image_map_tool_map (image_map_tool);
|
||||
|
||||
gimp_tool_control_set_preserve (tool->control, FALSE);
|
||||
gimp_tool_control_pop_preserve (tool->control);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -741,11 +756,11 @@ gimp_image_map_tool_gegl_notify (GObject *config,
|
||||
{
|
||||
if (im_tool->image_map)
|
||||
{
|
||||
gimp_tool_control_set_preserve (GIMP_TOOL (im_tool)->control, TRUE);
|
||||
gimp_tool_control_push_preserve (GIMP_TOOL (im_tool)->control, TRUE);
|
||||
|
||||
gimp_image_map_tool_create_map (im_tool);
|
||||
|
||||
gimp_tool_control_set_preserve (GIMP_TOOL (im_tool)->control, FALSE);
|
||||
gimp_tool_control_pop_preserve (GIMP_TOOL (im_tool)->control);
|
||||
|
||||
gimp_image_map_tool_preview (im_tool);
|
||||
}
|
||||
|
@@ -328,7 +328,9 @@ gimp_iscissors_tool_init (GimpIscissorsTool *iscissors)
|
||||
gimp_tool_control_set_scroll_lock (tool->control, TRUE);
|
||||
gimp_tool_control_set_snap_to (tool->control, FALSE);
|
||||
gimp_tool_control_set_preserve (tool->control, FALSE);
|
||||
gimp_tool_control_set_dirty_mask (tool->control, GIMP_DIRTY_IMAGE_SIZE);
|
||||
gimp_tool_control_set_dirty_mask (tool->control,
|
||||
GIMP_DIRTY_IMAGE_SIZE |
|
||||
GIMP_DIRTY_ACTIVE_DRAWABLE);
|
||||
gimp_tool_control_set_tool_cursor (tool->control, GIMP_TOOL_CURSOR_ISCISSORS);
|
||||
|
||||
iscissors->op = ISCISSORS_OP_NONE;
|
||||
|
@@ -132,7 +132,7 @@ gimp_paint_options_gui (GimpToolOptions *tool_options)
|
||||
|
||||
scale = gimp_prop_spin_scale_new (config, "brush-size",
|
||||
_("Size"),
|
||||
0.01, 1.0, 2);
|
||||
1.0, 10.0, 2);
|
||||
gimp_spin_scale_set_scale_limits (GIMP_SPIN_SCALE (scale), 1.0, 1000.0);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), scale, TRUE, TRUE, 0);
|
||||
gtk_widget_show (scale);
|
||||
@@ -157,7 +157,7 @@ gimp_paint_options_gui (GimpToolOptions *tool_options)
|
||||
|
||||
scale = gimp_prop_spin_scale_new (config, "brush-aspect-ratio",
|
||||
_("Aspect Ratio"),
|
||||
0.01, 0.1, 2);
|
||||
0.1, 1.0, 2);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), scale, TRUE, TRUE, 0);
|
||||
gtk_widget_show (scale);
|
||||
|
||||
|
@@ -229,6 +229,7 @@ gimp_rectangle_select_tool_init (GimpRectangleSelectTool *rect_sel_tool)
|
||||
GIMP_CURSOR_PRECISION_PIXEL_BORDER);
|
||||
gimp_tool_control_set_tool_cursor (tool->control,
|
||||
GIMP_TOOL_CURSOR_RECT_SELECT);
|
||||
gimp_tool_control_set_preserve (tool->control, FALSE);
|
||||
gimp_tool_control_set_dirty_mask (tool->control,
|
||||
GIMP_DIRTY_IMAGE_SIZE |
|
||||
GIMP_DIRTY_SELECTION);
|
||||
@@ -421,11 +422,11 @@ gimp_rectangle_select_tool_button_press (GimpTool *tool,
|
||||
if (undo && priv->undo == undo)
|
||||
{
|
||||
/* prevent this change from halting the tool */
|
||||
gimp_tool_control_set_preserve (tool->control, TRUE);
|
||||
gimp_tool_control_push_preserve (tool->control, TRUE);
|
||||
|
||||
gimp_image_undo (image);
|
||||
|
||||
gimp_tool_control_set_preserve (tool->control, FALSE);
|
||||
gimp_tool_control_pop_preserve (tool->control);
|
||||
|
||||
/* we will need to redo if the user cancels or executes */
|
||||
priv->redo = gimp_undo_stack_peek (redo_stack);
|
||||
@@ -477,12 +478,12 @@ gimp_rectangle_select_tool_button_release (GimpTool *tool,
|
||||
if (redo && priv->redo == redo)
|
||||
{
|
||||
/* prevent this from halting the tool */
|
||||
gimp_tool_control_set_preserve (tool->control, TRUE);
|
||||
gimp_tool_control_push_preserve (tool->control, TRUE);
|
||||
|
||||
gimp_image_redo (image);
|
||||
priv->redo = NULL;
|
||||
|
||||
gimp_tool_control_set_preserve (tool->control, FALSE);
|
||||
gimp_tool_control_pop_preserve (tool->control);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -494,11 +495,11 @@ gimp_rectangle_select_tool_button_release (GimpTool *tool,
|
||||
if (priv->redo)
|
||||
{
|
||||
/* prevent this from halting the tool */
|
||||
gimp_tool_control_set_preserve (tool->control, TRUE);
|
||||
gimp_tool_control_push_preserve (tool->control, TRUE);
|
||||
|
||||
gimp_image_redo (image);
|
||||
|
||||
gimp_tool_control_set_preserve (tool->control, FALSE);
|
||||
gimp_tool_control_pop_preserve (tool->control);
|
||||
}
|
||||
|
||||
priv->use_saved_op = TRUE; /* is this correct? */
|
||||
@@ -784,7 +785,7 @@ gimp_rectangle_select_tool_execute (GimpRectangleTool *rectangle,
|
||||
GimpChannelOps operation;
|
||||
|
||||
/* prevent this change from halting the tool */
|
||||
gimp_tool_control_set_preserve (tool->control, TRUE);
|
||||
gimp_tool_control_push_preserve (tool->control, TRUE);
|
||||
|
||||
/* We can conceptually think of a click outside of the
|
||||
* selection as adding a 0px selection. Behave intuitivly
|
||||
@@ -806,7 +807,7 @@ gimp_rectangle_select_tool_execute (GimpRectangleTool *rectangle,
|
||||
break;
|
||||
}
|
||||
|
||||
gimp_tool_control_set_preserve (tool->control, FALSE);
|
||||
gimp_tool_control_pop_preserve (tool->control);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -843,12 +844,12 @@ gimp_rectangle_select_tool_cancel (GimpRectangleTool *rectangle)
|
||||
if (undo && priv->undo == undo)
|
||||
{
|
||||
/* prevent this change from halting the tool */
|
||||
gimp_tool_control_set_preserve (tool->control, TRUE);
|
||||
gimp_tool_control_push_preserve (tool->control, TRUE);
|
||||
|
||||
gimp_image_undo (image);
|
||||
gimp_image_flush (image);
|
||||
|
||||
gimp_tool_control_set_preserve (tool->control, FALSE);
|
||||
gimp_tool_control_pop_preserve (tool->control);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -870,7 +871,7 @@ gimp_rectangle_select_tool_rectangle_change_complete (GimpRectangleTool *rectang
|
||||
priv = GIMP_RECTANGLE_SELECT_TOOL_GET_PRIVATE (rect_sel_tool);
|
||||
|
||||
/* prevent change in selection from halting the tool */
|
||||
gimp_tool_control_set_preserve (tool->control, TRUE);
|
||||
gimp_tool_control_push_preserve (tool->control, TRUE);
|
||||
|
||||
if (tool->display && ! gimp_tool_control_is_active (tool->control))
|
||||
{
|
||||
@@ -919,7 +920,7 @@ gimp_rectangle_select_tool_rectangle_change_complete (GimpRectangleTool *rectang
|
||||
gimp_image_flush (image);
|
||||
}
|
||||
|
||||
gimp_tool_control_set_preserve (tool->control, FALSE);
|
||||
gimp_tool_control_pop_preserve (tool->control);
|
||||
|
||||
gimp_rectangle_select_tool_update_option_defaults (rect_sel_tool, FALSE);
|
||||
|
||||
|
@@ -133,8 +133,13 @@ gimp_selection_tool_modifier_key (GimpTool *tool,
|
||||
*/
|
||||
button_op = selection_tool->saved_operation;
|
||||
}
|
||||
else
|
||||
else if (state & (extend_mask |
|
||||
modify_mask))
|
||||
{
|
||||
/* else get the operation from the modifier state, but only
|
||||
* if there is actually a modifier pressed, so we don't
|
||||
* override the "last modifier released" assignment above
|
||||
*/
|
||||
button_op = gimp_modifiers_to_channel_op (state);
|
||||
}
|
||||
|
||||
@@ -411,15 +416,36 @@ gimp_selection_tool_start_edit (GimpSelectionTool *sel_tool,
|
||||
return TRUE;
|
||||
|
||||
case SELECTION_MOVE:
|
||||
gimp_edit_selection_tool_start (tool, display, coords,
|
||||
GIMP_TRANSLATE_MODE_MASK_TO_LAYER, FALSE);
|
||||
return TRUE;
|
||||
|
||||
case SELECTION_MOVE_COPY:
|
||||
gimp_edit_selection_tool_start (tool, display, coords,
|
||||
GIMP_TRANSLATE_MODE_MASK_COPY_TO_LAYER,
|
||||
FALSE);
|
||||
return TRUE;
|
||||
{
|
||||
GimpImage *image = gimp_display_get_image (display);
|
||||
GimpDrawable *drawable = gimp_image_get_active_drawable (image);
|
||||
|
||||
if (gimp_viewable_get_children (GIMP_VIEWABLE (drawable)))
|
||||
{
|
||||
gimp_tool_message_literal (tool, display,
|
||||
_("Cannot modify the pixels of layer groups."));
|
||||
}
|
||||
else if (gimp_item_is_content_locked (GIMP_ITEM (drawable)))
|
||||
{
|
||||
gimp_tool_message_literal (tool, display,
|
||||
_("The active layer's pixels are locked."));
|
||||
}
|
||||
else
|
||||
{
|
||||
GimpTranslateMode edit_mode;
|
||||
|
||||
if (sel_tool->function == SELECTION_MOVE)
|
||||
edit_mode = GIMP_TRANSLATE_MODE_MASK_TO_LAYER;
|
||||
else
|
||||
edit_mode = GIMP_TRANSLATE_MODE_MASK_COPY_TO_LAYER;
|
||||
|
||||
gimp_edit_selection_tool_start (tool, display, coords,
|
||||
edit_mode, FALSE);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
default:
|
||||
break;
|
||||
|
@@ -415,18 +415,38 @@ gboolean
|
||||
gimp_text_tool_editor_key_press (GimpTextTool *text_tool,
|
||||
GdkEventKey *kevent)
|
||||
{
|
||||
GtkTextBuffer *buffer = GTK_TEXT_BUFFER (text_tool->buffer);
|
||||
GtkTextIter cursor;
|
||||
GtkTextIter selection;
|
||||
gint x_pos = -1;
|
||||
gboolean retval = TRUE;
|
||||
GimpTool *tool = GIMP_TOOL (text_tool);
|
||||
GimpDisplayShell *shell = gimp_display_get_shell (tool->display);
|
||||
GtkTextBuffer *buffer = GTK_TEXT_BUFFER (text_tool->buffer);
|
||||
GtkTextIter cursor;
|
||||
GtkTextIter selection;
|
||||
gboolean retval = TRUE;
|
||||
|
||||
if (! gtk_widget_has_focus (shell->canvas))
|
||||
{
|
||||
/* The focus is in the floating style editor, and the event
|
||||
* was not handled there, focus the canvas.
|
||||
*/
|
||||
switch (kevent->keyval)
|
||||
{
|
||||
case GDK_KEY_Tab:
|
||||
case GDK_KEY_KP_Tab:
|
||||
case GDK_KEY_ISO_Left_Tab:
|
||||
case GDK_KEY_Escape:
|
||||
gtk_widget_grab_focus (shell->canvas);
|
||||
return TRUE;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (gtk_im_context_filter_keypress (text_tool->im_context, kevent))
|
||||
{
|
||||
text_tool->needs_im_reset = TRUE;
|
||||
text_tool->x_pos = -1;
|
||||
|
||||
return TRUE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
gimp_text_tool_ensure_proxy (text_tool);
|
||||
@@ -470,7 +490,7 @@ gimp_text_tool_editor_key_press (GimpTextTool *text_tool,
|
||||
retval = FALSE;
|
||||
}
|
||||
|
||||
text_tool->x_pos = x_pos;
|
||||
text_tool->x_pos = -1;
|
||||
|
||||
return retval;
|
||||
}
|
||||
@@ -698,23 +718,31 @@ gimp_text_tool_move_cursor (GimpTextTool *text_tool,
|
||||
if (count > 0)
|
||||
{
|
||||
if (g_utf8_get_char (text + index) == word_joiner)
|
||||
pango_layout_move_cursor_visually (layout, TRUE, index, 0, 1,
|
||||
pango_layout_move_cursor_visually (layout, TRUE,
|
||||
index, 0, 1,
|
||||
&new_index, &trailing);
|
||||
else
|
||||
new_index = index;
|
||||
|
||||
pango_layout_move_cursor_visually (layout, TRUE, new_index, trailing, 1,
|
||||
pango_layout_move_cursor_visually (layout, TRUE,
|
||||
new_index, trailing, 1,
|
||||
&new_index, &trailing);
|
||||
count--;
|
||||
}
|
||||
else
|
||||
{
|
||||
pango_layout_move_cursor_visually (layout, TRUE, index, 0, -1,
|
||||
pango_layout_move_cursor_visually (layout, TRUE,
|
||||
index, 0, -1,
|
||||
&new_index, &trailing);
|
||||
|
||||
if (new_index != -1 && g_utf8_get_char (text + new_index) == word_joiner)
|
||||
pango_layout_move_cursor_visually (layout, TRUE, new_index, trailing, -1,
|
||||
&new_index, &trailing);
|
||||
if (new_index != -1 && new_index != G_MAXINT &&
|
||||
g_utf8_get_char (text + new_index) == word_joiner)
|
||||
{
|
||||
pango_layout_move_cursor_visually (layout, TRUE,
|
||||
new_index, trailing, -1,
|
||||
&new_index, &trailing);
|
||||
}
|
||||
|
||||
count++;
|
||||
}
|
||||
|
||||
@@ -1127,8 +1155,7 @@ gimp_text_tool_options_notify (GimpTextOptions *options,
|
||||
{
|
||||
if (options->use_editor)
|
||||
{
|
||||
if (text_tool->text)
|
||||
gimp_text_tool_editor_dialog (text_tool);
|
||||
gimp_text_tool_editor_dialog (text_tool);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@@ -259,6 +259,7 @@ gimp_text_tool_init (GimpTextTool *text_tool)
|
||||
gimp_text_tool_editor_init (text_tool);
|
||||
|
||||
gimp_tool_control_set_scroll_lock (tool->control, TRUE);
|
||||
gimp_tool_control_set_handle_empty_image (tool->control, TRUE);
|
||||
gimp_tool_control_set_wants_click (tool->control, TRUE);
|
||||
gimp_tool_control_set_wants_double_click (tool->control, TRUE);
|
||||
gimp_tool_control_set_wants_triple_click (tool->control, TRUE);
|
||||
@@ -1167,11 +1168,10 @@ gimp_text_tool_text_notify (GimpText *text,
|
||||
g_signal_handlers_block_by_func (text_tool->buffer,
|
||||
gimp_text_tool_buffer_end_edit,
|
||||
text_tool);
|
||||
|
||||
if (pspec->name[0] == 't')
|
||||
gimp_text_buffer_set_text (text_tool->buffer, text->text);
|
||||
else
|
||||
if (text->markup)
|
||||
gimp_text_buffer_set_markup (text_tool->buffer, text->markup);
|
||||
else
|
||||
gimp_text_buffer_set_text (text_tool->buffer, text->text);
|
||||
|
||||
g_signal_handlers_unblock_by_func (text_tool->buffer,
|
||||
gimp_text_tool_buffer_end_edit,
|
||||
|
@@ -90,6 +90,8 @@ gimp_tool_control_finalize (GObject *object)
|
||||
{
|
||||
GimpToolControl *control = GIMP_TOOL_CONTROL (object);
|
||||
|
||||
g_slist_free (control->preserve_stack);
|
||||
|
||||
g_free (control->action_value_1);
|
||||
g_free (control->action_value_2);
|
||||
g_free (control->action_value_3);
|
||||
@@ -171,6 +173,31 @@ gimp_tool_control_get_preserve (GimpToolControl *control)
|
||||
return control->preserve;
|
||||
}
|
||||
|
||||
void
|
||||
gimp_tool_control_push_preserve (GimpToolControl *control,
|
||||
gboolean preserve)
|
||||
{
|
||||
g_return_if_fail (GIMP_IS_TOOL_CONTROL (control));
|
||||
|
||||
control->preserve_stack =
|
||||
g_slist_prepend (control->preserve_stack,
|
||||
GINT_TO_POINTER (control->preserve));
|
||||
|
||||
control->preserve = preserve ? TRUE : FALSE;
|
||||
}
|
||||
|
||||
void
|
||||
gimp_tool_control_pop_preserve (GimpToolControl *control)
|
||||
{
|
||||
g_return_if_fail (GIMP_IS_TOOL_CONTROL (control));
|
||||
g_return_if_fail (control->preserve_stack != NULL);
|
||||
|
||||
control->preserve = GPOINTER_TO_INT (control->preserve_stack->data);
|
||||
|
||||
control->preserve_stack = g_slist_delete_link (control->preserve_stack,
|
||||
control->preserve_stack);
|
||||
}
|
||||
|
||||
void
|
||||
gimp_tool_control_set_scroll_lock (GimpToolControl *control,
|
||||
gboolean scroll_lock)
|
||||
|
@@ -42,6 +42,8 @@ struct _GimpToolControl
|
||||
|
||||
gboolean preserve; /* Preserve this tool across *
|
||||
* drawable changes */
|
||||
GSList *preserve_stack; /* for push/pop preserve */
|
||||
|
||||
gboolean scroll_lock; /* allow scrolling or not */
|
||||
gboolean handle_empty_image; /* invoke the tool on images *
|
||||
* without active drawable */
|
||||
@@ -100,6 +102,10 @@ void gimp_tool_control_set_preserve (GimpToolControl *control,
|
||||
gboolean preserve);
|
||||
gboolean gimp_tool_control_get_preserve (GimpToolControl *control);
|
||||
|
||||
void gimp_tool_control_push_preserve (GimpToolControl *control,
|
||||
gboolean preserve);
|
||||
void gimp_tool_control_pop_preserve (GimpToolControl *control);
|
||||
|
||||
void gimp_tool_control_set_scroll_lock (GimpToolControl *control,
|
||||
gboolean scroll_lock);
|
||||
gboolean gimp_tool_control_get_scroll_lock (GimpToolControl *control);
|
||||
|
@@ -201,7 +201,8 @@ gimp_transform_tool_init (GimpTransformTool *tr_tool)
|
||||
gimp_tool_control_set_dirty_mask (tool->control,
|
||||
GIMP_DIRTY_IMAGE_SIZE |
|
||||
GIMP_DIRTY_DRAWABLE |
|
||||
GIMP_DIRTY_SELECTION);
|
||||
GIMP_DIRTY_SELECTION |
|
||||
GIMP_DIRTY_ACTIVE_DRAWABLE);
|
||||
gimp_tool_control_set_precision (tool->control,
|
||||
GIMP_CURSOR_PRECISION_SUBPIXEL);
|
||||
|
||||
@@ -1103,7 +1104,7 @@ gimp_transform_tool_transform (GimpTransformTool *tr_tool,
|
||||
gimp_draw_tool_stop (GIMP_DRAW_TOOL (tr_tool));
|
||||
|
||||
/* We're going to dirty this image, but we want to keep the tool around */
|
||||
gimp_tool_control_set_preserve (tool->control, TRUE);
|
||||
gimp_tool_control_push_preserve (tool->control, TRUE);
|
||||
|
||||
undo_desc = GIMP_TRANSFORM_TOOL_GET_CLASS (tr_tool)->get_undo_desc (tr_tool);
|
||||
gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_TRANSFORM, undo_desc);
|
||||
@@ -1190,7 +1191,7 @@ gimp_transform_tool_transform (GimpTransformTool *tr_tool,
|
||||
/* We're done dirtying the image, and would like to be restarted if
|
||||
* the image gets dirty while the tool exists
|
||||
*/
|
||||
gimp_tool_control_set_preserve (tool->control, FALSE);
|
||||
gimp_tool_control_pop_preserve (tool->control);
|
||||
|
||||
gimp_tool_control (tool, GIMP_TOOL_ACTION_HALT, display);
|
||||
|
||||
|
@@ -23,6 +23,7 @@
|
||||
#include <string.h>
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
#include <gdk/gdkkeysyms.h>
|
||||
|
||||
#include "libgimpbase/gimpbase.h"
|
||||
#include "libgimpwidgets/gimpwidgets.h"
|
||||
@@ -760,7 +761,17 @@ gimp_action_view_accel_edited (GtkCellRendererAccel *accel,
|
||||
if (! accel_path)
|
||||
return;
|
||||
|
||||
if (! accel_key)
|
||||
if (! accel_key ||
|
||||
|
||||
/* Don't allow arrow keys, they are all swallowed by the canvas
|
||||
* and cannot be invoked anyway, the same applies to space.
|
||||
*/
|
||||
accel_key == GDK_KEY_Left ||
|
||||
accel_key == GDK_KEY_Right ||
|
||||
accel_key == GDK_KEY_Up ||
|
||||
accel_key == GDK_KEY_Down ||
|
||||
accel_key == GDK_KEY_space ||
|
||||
accel_key == GDK_KEY_KP_Space)
|
||||
{
|
||||
gimp_message_literal (view->manager->gimp,
|
||||
G_OBJECT (view), GIMP_MESSAGE_ERROR,
|
||||
|
@@ -514,7 +514,8 @@ gimp_clipboard_set_buffer (Gimp *gimp,
|
||||
G_OBJECT (gimp));
|
||||
|
||||
/* mark the first entry (image/png) as suitable for storing */
|
||||
gtk_clipboard_set_can_store (clipboard, gimp_clip->target_entries, 1);
|
||||
if (gimp_clip->n_target_entries > 0)
|
||||
gtk_clipboard_set_can_store (clipboard, gimp_clip->target_entries, 1);
|
||||
}
|
||||
else if (gtk_clipboard_get_owner (clipboard) == G_OBJECT (gimp))
|
||||
{
|
||||
|
@@ -334,6 +334,13 @@ gimp_color_display_editor_dispose (GObject *object)
|
||||
{
|
||||
GimpColorDisplayEditor *editor = GIMP_COLOR_DISPLAY_EDITOR (object);
|
||||
|
||||
if (editor->selected)
|
||||
{
|
||||
g_object_remove_weak_pointer (G_OBJECT (editor->selected),
|
||||
(gpointer) &editor->selected);
|
||||
editor->selected = NULL;
|
||||
}
|
||||
|
||||
if (editor->stack)
|
||||
{
|
||||
g_object_unref (editor->stack);
|
||||
|
@@ -477,6 +477,10 @@ gimp_container_popup_show (GimpContainerPopup *popup,
|
||||
if (y + requisition.height > rect.y + rect.height)
|
||||
y = orig_y - requisition.height;
|
||||
|
||||
gtk_window_set_screen (GTK_WINDOW (popup), screen);
|
||||
gtk_window_set_transient_for (GTK_WINDOW (popup),
|
||||
GTK_WINDOW (gtk_widget_get_toplevel (widget)));
|
||||
|
||||
gtk_window_move (GTK_WINDOW (popup), x, y);
|
||||
gtk_widget_show (GTK_WIDGET (popup));
|
||||
}
|
||||
|
@@ -142,6 +142,31 @@ gimp_container_tree_view_drop_status (GimpContainerTreeView *tree_view,
|
||||
drop_pos = GTK_TREE_VIEW_DROP_BEFORE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
GtkTreeIter iter;
|
||||
gint n_children;
|
||||
|
||||
n_children = gtk_tree_model_iter_n_children (tree_view->model, NULL);
|
||||
|
||||
if (n_children > 0 &&
|
||||
gtk_tree_model_iter_nth_child (tree_view->model, &iter,
|
||||
NULL, n_children - 1))
|
||||
{
|
||||
GimpViewRenderer *renderer;
|
||||
|
||||
gtk_tree_model_get (tree_view->model, &iter,
|
||||
GIMP_CONTAINER_TREE_STORE_COLUMN_RENDERER,
|
||||
&renderer,
|
||||
-1);
|
||||
|
||||
drop_path = gtk_tree_model_get_path (tree_view->model, &iter);
|
||||
dest_viewable = renderer->viewable;
|
||||
drop_pos = GTK_TREE_VIEW_DROP_AFTER;
|
||||
|
||||
g_object_unref (renderer);
|
||||
}
|
||||
}
|
||||
|
||||
if (dest_viewable || tree_view->priv->dnd_drop_to_empty)
|
||||
{
|
||||
|
@@ -522,6 +522,8 @@ gimp_container_tree_view_set_container (GimpContainerView *view,
|
||||
|
||||
if (old_container)
|
||||
{
|
||||
tree_view->priv->dnd_renderer = NULL;
|
||||
|
||||
g_signal_handlers_disconnect_by_func (tree_view->view,
|
||||
gimp_container_tree_view_row_expanded,
|
||||
tree_view);
|
||||
|
@@ -111,7 +111,7 @@ gimp_device_info_get_device_coords (GimpDeviceInfo *info,
|
||||
GdkWindow *window,
|
||||
GimpCoords *coords)
|
||||
{
|
||||
gdouble axes[GDK_AXIS_LAST];
|
||||
gdouble axes[GDK_AXIS_LAST] = { 0, };
|
||||
|
||||
*coords = default_coords;
|
||||
|
||||
|
@@ -34,6 +34,7 @@
|
||||
#include "core/gimpcurve-map.h"
|
||||
#include "core/gimpdatafactory.h"
|
||||
#include "core/gimpmarshal.h"
|
||||
#include "core/gimptoolinfo.h"
|
||||
|
||||
#include "gimpdeviceinfo.h"
|
||||
|
||||
@@ -630,6 +631,26 @@ gimp_device_info_set_device (GimpDeviceInfo *info,
|
||||
gimp_device_info_changed (info);
|
||||
}
|
||||
|
||||
void
|
||||
gimp_device_info_set_default_tool (GimpDeviceInfo *info)
|
||||
{
|
||||
g_return_if_fail (GIMP_IS_DEVICE_INFO (info));
|
||||
|
||||
if (info->device &&
|
||||
gdk_device_get_source (info->device) == GDK_SOURCE_ERASER)
|
||||
{
|
||||
GimpContainer *tools = GIMP_CONTEXT (info)->gimp->tool_info_list;
|
||||
GimpToolInfo *eraser;
|
||||
|
||||
eraser =
|
||||
GIMP_TOOL_INFO (gimp_container_get_child_by_name (tools,
|
||||
"gimp-eraser-tool"));
|
||||
|
||||
if (eraser)
|
||||
gimp_context_set_tool (GIMP_CONTEXT (info), eraser);
|
||||
}
|
||||
}
|
||||
|
||||
GdkInputMode
|
||||
gimp_device_info_get_mode (GimpDeviceInfo *info)
|
||||
{
|
||||
|
@@ -85,6 +85,8 @@ void gimp_device_info_set_device (GimpDeviceInfo *info,
|
||||
GdkDevice *device,
|
||||
GdkDisplay *display);
|
||||
|
||||
void gimp_device_info_set_default_tool (GimpDeviceInfo *info);
|
||||
|
||||
GdkInputMode gimp_device_info_get_mode (GimpDeviceInfo *info);
|
||||
void gimp_device_info_set_mode (GimpDeviceInfo *info,
|
||||
GdkInputMode mode);
|
||||
|
@@ -140,6 +140,7 @@ static const gchar *const axis_use_strings[] =
|
||||
N_("Pressure"),
|
||||
N_("X tilt"),
|
||||
N_("Y tilt"),
|
||||
/* Wheel as in mouse or input device wheel */
|
||||
N_("Wheel")
|
||||
};
|
||||
|
||||
@@ -190,6 +191,7 @@ gimp_device_info_editor_init (GimpDeviceInfoEditor *editor)
|
||||
|
||||
/* the axes */
|
||||
|
||||
/* The axes of an input device */
|
||||
frame = gimp_frame_new (_("Axes"));
|
||||
gtk_box_pack_start (GTK_BOX (private->vbox), frame, FALSE, FALSE, 0);
|
||||
gtk_widget_show (frame);
|
||||
@@ -409,6 +411,7 @@ gimp_device_info_editor_constructed (GObject *object)
|
||||
GimpCurve *curve;
|
||||
gchar *title;
|
||||
|
||||
/* e.g. "Pressure Curve" for mapping input device axes */
|
||||
title = g_strdup_printf (_("%s Curve"), axis_use_strings[i - 1]);
|
||||
|
||||
frame = gimp_frame_new (title);
|
||||
|
@@ -329,6 +329,8 @@ gimp_device_manager_device_added (GdkDisplay *gdk_display,
|
||||
{
|
||||
device_info = gimp_device_info_new (private->gimp, device, gdk_display);
|
||||
|
||||
gimp_device_info_set_default_tool (device_info);
|
||||
|
||||
gimp_container_add (GIMP_CONTAINER (manager), GIMP_OBJECT (device_info));
|
||||
g_object_unref (device_info);
|
||||
}
|
||||
|
@@ -118,6 +118,8 @@ gimp_devices_restore (Gimp *gimp)
|
||||
|
||||
gimp_context_copy_properties (user_context, GIMP_CONTEXT (device_info),
|
||||
GIMP_DEVICE_INFO_CONTEXT_MASK);
|
||||
|
||||
gimp_device_info_set_default_tool (device_info);
|
||||
}
|
||||
|
||||
filename = gimp_personal_rc_file ("devicerc");
|
||||
|
@@ -657,7 +657,14 @@ gimp_dialog_factory_dialog_new_internal (GimpDialogFactory *factory,
|
||||
}
|
||||
|
||||
if (present && GTK_IS_WINDOW (toplevel))
|
||||
gtk_window_present (GTK_WINDOW (toplevel));
|
||||
{
|
||||
/* Work around focus-stealing protection, or whatever makes the
|
||||
* dock appear below the one where we clicked a button to open
|
||||
* it. See bug #630173.
|
||||
*/
|
||||
gtk_widget_show_now (toplevel);
|
||||
gdk_window_raise (gtk_widget_get_window (toplevel));
|
||||
}
|
||||
|
||||
return dialog;
|
||||
}
|
||||
|
@@ -164,7 +164,8 @@ gimp_dnd_xds_save_image (GdkDragContext *context,
|
||||
{
|
||||
if (file_save (image->gimp,
|
||||
image, NULL,
|
||||
uri, proc, GIMP_RUN_INTERACTIVE, TRUE, export,
|
||||
uri, proc, GIMP_RUN_INTERACTIVE,
|
||||
! export, FALSE, export,
|
||||
&error) == GIMP_PDB_SUCCESS)
|
||||
{
|
||||
gtk_selection_data_set (selection,
|
||||
|
@@ -652,6 +652,7 @@ gimp_editor_add_action_button (GimpEditor *editor,
|
||||
|
||||
stock_id = gtk_action_get_stock_id (action);
|
||||
tooltip = g_strdup (gtk_action_get_tooltip (action));
|
||||
help_id = g_object_get_qdata (G_OBJECT (action), GIMP_HELP_ID);
|
||||
|
||||
old_child = gtk_bin_get_child (GTK_BIN (button));
|
||||
|
||||
@@ -719,8 +720,6 @@ gimp_editor_add_action_button (GimpEditor *editor,
|
||||
NULL);
|
||||
}
|
||||
|
||||
help_id = g_object_get_qdata (G_OBJECT (action), GIMP_HELP_ID);
|
||||
|
||||
if (tooltip || help_id)
|
||||
gimp_help_set_help_data_with_markup (button, tooltip, help_id);
|
||||
|
||||
|
@@ -167,6 +167,10 @@ gimp_error_dialog_add (GimpErrorDialog *dialog,
|
||||
gimp_message_box_set_primary_text (GIMP_MESSAGE_BOX (box), "%s", domain);
|
||||
else
|
||||
gimp_message_box_set_primary_text (GIMP_MESSAGE_BOX (box),
|
||||
/* %s is a message domain,
|
||||
* like "GIMP Message" or
|
||||
* "PNG Message"
|
||||
*/
|
||||
_("%s Message"), domain);
|
||||
|
||||
gimp_message_box_set_text (GIMP_MESSAGE_BOX (box), "%s", message);
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user