mirror of
https://gitlab.gnome.org/GNOME/gimp.git
synced 2025-10-06 01:12:40 +02:00
Compare commits
264 Commits
142b79b728
...
GIMP_2_6_6
Author | SHA1 | Date | |
---|---|---|---|
|
05c925bfa9 | ||
|
1929803fc0 | ||
|
0c9b215b9b | ||
|
380a8f4dab | ||
|
0151c3ef8a | ||
|
653871c6de | ||
|
913b80ab55 | ||
|
dc3bdebb58 | ||
|
a2cb430485 | ||
|
5a0f260b11 | ||
|
e1c19076af | ||
|
587a949345 | ||
|
70c434fda6 | ||
|
737c4b3353 | ||
|
c02e5c73bf | ||
|
4fd1b03970 | ||
|
74efbd78cd | ||
|
0ca8d7c831 | ||
|
b2c92a2e0d | ||
|
b514712c7c | ||
|
16f9e12e0f | ||
|
1d0035af72 | ||
|
dc90c5f9da | ||
|
84fbaa5a33 | ||
|
4f5be99c70 | ||
|
4dae966e42 | ||
|
b0c6aa2a3f | ||
|
0e2d7a4a0e | ||
|
3ec2daf08a | ||
|
5284a26797 | ||
|
ae84d8b503 | ||
|
65d06a82a4 | ||
|
d4b044f512 | ||
|
eabf706b5f | ||
|
252210e43b | ||
|
34499e896e | ||
|
15fc16a251 | ||
|
0c2d85f92f | ||
|
314d55876a | ||
|
4d61209fbd | ||
|
0be09b1ca4 | ||
|
b08c9ebc48 | ||
|
35b2c982d5 | ||
|
fd6577c8e9 | ||
|
c3ec6c150f | ||
|
19b413179b | ||
|
6004b79f6f | ||
|
820706dfff | ||
|
11ab81cf79 | ||
|
0415626dcc | ||
|
5f82368f2e | ||
|
0c288325b8 | ||
|
c3eb7614ad | ||
|
b589cc6507 | ||
|
8235bb5c74 | ||
|
573e19a537 | ||
|
eceaa5324f | ||
|
bec9fec249 | ||
|
dfaa0750ae | ||
|
b1d1e412e8 | ||
|
c15e63a8f1 | ||
|
8362b7417e | ||
|
c6c036ba56 | ||
|
20f49f6e40 | ||
|
62f7444fde | ||
|
60d1b65fd9 | ||
|
cd94a2b71b | ||
|
8039fe5865 | ||
|
2e42394adb | ||
|
5b0bb5a28f | ||
|
7b27e7dce5 | ||
|
4ded95bcb5 | ||
|
1b540417a5 | ||
|
50dac2d667 | ||
|
0660dabfd6 | ||
|
47060bab7a | ||
|
582f0d5455 | ||
|
443ba5aee9 | ||
|
6fb62f7688 | ||
|
c52492818c | ||
|
eb75e1a7dc | ||
|
a9cee72400 | ||
|
3b65308404 | ||
|
f40a196707 | ||
|
3f932d338a | ||
|
5f0e5ab5c6 | ||
|
1a3cf63b8b | ||
|
029dd34c00 | ||
|
5f493b06c8 | ||
|
3cef306d30 | ||
|
a753356a2c | ||
|
effd83be85 | ||
|
c4596bf7d8 | ||
|
496ff36bba | ||
|
92412d87a5 | ||
|
d5ad17cb67 | ||
|
54765ea504 | ||
|
3e26f4c0e6 | ||
|
860a8c461c | ||
|
f9e8fb9991 | ||
|
c295f28c4d | ||
|
487e416c42 | ||
|
efd5c8f4bc | ||
|
0d669e76f6 | ||
|
815c8c6af6 | ||
|
a988981c8f | ||
|
0bd92c01ac | ||
|
76d43759b6 | ||
|
f9d0c373d1 | ||
|
2f8cf85eeb | ||
|
72ef363094 | ||
|
0dbac3183b | ||
|
9d0e60e1bf | ||
|
1eada4e802 | ||
|
1dec860bd1 | ||
|
502458b5d2 | ||
|
5cde3344f5 | ||
|
952efd1fc2 | ||
|
00532e4c68 | ||
|
8cb2399a6d | ||
|
c7519202cc | ||
|
4ef9010e25 | ||
|
c805ee969a | ||
|
0098ac4fbd | ||
|
e9f606917e | ||
|
05cc3ef351 | ||
|
72a27966aa | ||
|
ba6ccc8e16 | ||
|
1a996fa051 | ||
|
216b0f2e76 | ||
|
bcbd2fb9ea | ||
|
eca52e47ba | ||
|
6b7134cc16 | ||
|
e74df7b28d | ||
|
627736b8d1 | ||
|
9a3e7c5557 | ||
|
30130874e9 | ||
|
beaca73f41 | ||
|
71fe89d878 | ||
|
420ff86aa2 | ||
|
9dfd140dc2 | ||
|
dcc79eec24 | ||
|
b4459bb65b | ||
|
95438acb2e | ||
|
50bf14ad79 | ||
|
87a36289f6 | ||
|
bb701a93ce | ||
|
12a1ab7e11 | ||
|
323b5c63f4 | ||
|
a9afbf144f | ||
|
bb5288edb2 | ||
|
9c1a56ca48 | ||
|
ddeaefad21 | ||
|
1cf264c333 | ||
|
9b77a17ab1 | ||
|
231478f87e | ||
|
e88b920e95 | ||
|
59e86cd7f7 | ||
|
da51068265 | ||
|
bf06538f08 | ||
|
f589f79dad | ||
|
4d960c813c | ||
|
5e7fea1fa0 | ||
|
7b16775970 | ||
|
4a69180038 | ||
|
deeb37611d | ||
|
7e613cb725 | ||
|
579196d85f | ||
|
f7a24e615a | ||
|
46df773a7c | ||
|
b9f26b0878 | ||
|
39bc923949 | ||
|
97090b5e83 | ||
|
d0f8b82b49 | ||
|
3bde105cc6 | ||
|
8e76c83094 | ||
|
22ca0ca2ec | ||
|
2363b9da61 | ||
|
ce84deadad | ||
|
822c75a811 | ||
|
bdd117f7a3 | ||
|
1adaf5d4bb | ||
|
e0569162a7 | ||
|
6793220b35 | ||
|
c962de9995 | ||
|
734d303422 | ||
|
18271766d8 | ||
|
4b331aa251 | ||
|
862570bb91 | ||
|
6d9b3ce298 | ||
|
392935c9fe | ||
|
d939fcb1e4 | ||
|
bf73252534 | ||
|
ca80cf72b4 | ||
|
a4bd329270 | ||
|
28ba204bb5 | ||
|
f9b8861f17 | ||
|
e3a95e0625 | ||
|
b9a232a130 | ||
|
c7062fbe13 | ||
|
ff3915faad | ||
|
c49a888f90 | ||
|
da52731c61 | ||
|
9b6b2150f3 | ||
|
c7da31ff67 | ||
|
f141af3118 | ||
|
e116ec86f6 | ||
|
22df4530dd | ||
|
b431ad5b7c | ||
|
546bad8d6c | ||
|
5c4e7329cc | ||
|
3f3b0629f2 | ||
|
b3fc164e3a | ||
|
5fec7a5fec | ||
|
05f306be9a | ||
|
c827e2f876 | ||
|
506c041b6c | ||
|
8e0eec5e24 | ||
|
61fce9da50 | ||
|
7eddc7067e | ||
|
f40d14687e | ||
|
74099ec043 | ||
|
8ea8575729 | ||
|
66878a5596 | ||
|
48bb457d2d | ||
|
01f7d36fb7 | ||
|
98d91c753c | ||
|
8635688949 | ||
|
e74d529b5b | ||
|
d748c9b6e0 | ||
|
c9bd78cd16 | ||
|
1dedf9dd93 | ||
|
fd440511ec | ||
|
d1ece07d46 | ||
|
fd794dcd81 | ||
|
0f1c045e6e | ||
|
1509ad199a | ||
|
ee0700eab4 | ||
|
1f964d809b | ||
|
295aaddec6 | ||
|
3cb4decc3e | ||
|
a1dba13e8b | ||
|
d1605dff42 | ||
|
6462994811 | ||
|
eea2cb805a | ||
|
74b9c377d1 | ||
|
1054e1f3dc | ||
|
2145d1b848 | ||
|
2e55bbad69 | ||
|
49095c2b72 | ||
|
a057214ad6 | ||
|
fdfff5d785 | ||
|
c77ab8f021 | ||
|
bb8427568c | ||
|
69f584c215 | ||
|
8ab4012d0b | ||
|
8e607bf30c | ||
|
cae04603dd | ||
|
4e35289b4b | ||
|
fb58d98168 | ||
|
e97a0a1900 | ||
|
d8a1a39157 | ||
|
27967223ef | ||
|
3c261c36db |
2
INSTALL
2
INSTALL
@@ -30,7 +30,7 @@ header files installed.
|
||||
1. You need to have installed a recent version of pkg-config available
|
||||
from http://www.freedesktop.org/software/pkgconfig/.
|
||||
|
||||
2. You need intltool (at least 0.35.5, but preferably a newer version).
|
||||
2. You need intltool (at least 0.36.3, but preferably a newer version).
|
||||
Intltool can be downloaded from
|
||||
http://ftp.gnome.org/pub/gnome/sources/intltool/
|
||||
|
||||
|
166
NEWS
166
NEWS
@@ -7,6 +7,172 @@ This is the stable branch of GIMP. No new features are being added
|
||||
here, just bug-fixes.
|
||||
|
||||
|
||||
Overview of Changes from GIMP 2.6.5 to GIMP 2.6.6
|
||||
=================================================
|
||||
|
||||
* Bugs fixed:
|
||||
|
||||
571117 – lcms plug-in crashes on broken profile
|
||||
575154 – changing the help browser preference may not work
|
||||
573542 – blur plugin: bug in the first line
|
||||
572403 – gimp-2.6 crashed with SIGSEGV in IA__g_object_get()
|
||||
573695 – 1-bit white background saved as PBM becomes all black
|
||||
573488 – Small bug in Filter>Distorts>Ripple
|
||||
572156 – top left pixel position/coordinate is not 0,0 but 1,1
|
||||
472644 – Rotate with clipping crops the whole layer
|
||||
|
||||
* Updated translations:
|
||||
|
||||
German (de)
|
||||
Spanish (es)
|
||||
Estonian (et)
|
||||
Basque (eu)
|
||||
French (fr)
|
||||
Italian (it)
|
||||
Portuguese (pt)
|
||||
Simplified Chinese (zh_CN)
|
||||
|
||||
|
||||
Overview of Changes from GIMP 2.6.4 to GIMP 2.6.5
|
||||
=================================================
|
||||
|
||||
* Bugs fixed:
|
||||
|
||||
571628 – Scaling image to 25% turn background from white to grey
|
||||
567840 – GIMP's GtkScaleButton conflicts with GTK's
|
||||
569043 – GEGL tool - missing Operation Settings for all sub-tools
|
||||
568890 – don't rely on GtkAction implementation details
|
||||
568909 – wrong RGB values for color names in libgimpcolor/gimprgb-parse.c
|
||||
568839 – wrong hex RGB value for the color names slategrey and slategray
|
||||
559408 - Brushes dragged to the image window look strange
|
||||
563337 – Rectangle Select Tool does not allow 1:1 fixed ratio
|
||||
568016 – Black pullout parameter of plug-in-newsprint has no effect
|
||||
562818 – First image opened in GIMP offset
|
||||
562213 – Align Tool doesn't work properly if it is the active tool
|
||||
at startup
|
||||
|
||||
* Updated translations:
|
||||
|
||||
Spanish (es)
|
||||
Estonian (et)
|
||||
Hindi (hi)
|
||||
Italian (it)
|
||||
Brazilian Portuguese (pt_BR)
|
||||
Romanian (ro)
|
||||
Russian (ru)
|
||||
Serbian (sr)
|
||||
Tamil (ta)
|
||||
Simplified Chinese (zh_CN)
|
||||
|
||||
|
||||
Overview of Changes from GIMP 2.6.3 to GIMP 2.6.4
|
||||
=================================================
|
||||
|
||||
* Bugs fixed:
|
||||
|
||||
565223 – Perspective transformation jagged edges / comb effect
|
||||
563985 – jpg save dialog: "cancel" is treated like "commit"
|
||||
for settings
|
||||
564087 – Using clone tool on a layer with a part out of canvas
|
||||
causes crashes
|
||||
564593 – crash when the drawable is changed while a color tool
|
||||
is active
|
||||
564869 – GIMP crashes on selecting Tools->GEGL operation
|
||||
565138 – python-fu-foggify does not check if image is in rgb mode
|
||||
563130 – Hue selection mode does not cross the 0-360 degrees line
|
||||
563179 – Scrollbars not resized when we extend the canvas size
|
||||
562459 – PF_PALETTE: 'TypeError' when used in a plugin that is
|
||||
registered in <Image>
|
||||
562427 – Compilation with --as-needed
|
||||
562386 – PF_SLIDER and PF_SPINNER 'Step' values do not change
|
||||
consistently...
|
||||
562366 – Default image dimensions are not correctly
|
||||
transferred in the file/new dialog box
|
||||
561899 – GIMP can't save to mounted filesystem if file exists
|
||||
|
||||
* Updated translations:
|
||||
|
||||
Greek (el)
|
||||
Hindi (hi)
|
||||
Hungarian (hu)
|
||||
Italian (it)
|
||||
Japanese (ja)
|
||||
Korean (ko)
|
||||
Slovenian (sl)
|
||||
Swedish (sv)
|
||||
Tamil (ta)
|
||||
Simplified Chinese (zh_CN)
|
||||
|
||||
|
||||
Overview of Changes from GIMP 2.6.2 to GIMP 2.6.3
|
||||
=================================================
|
||||
|
||||
* Bugs fixed:
|
||||
|
||||
558454 – Plugin Map Color Range disappears from GIMP
|
||||
559239 – Error while loading psd-data
|
||||
560903 – Explicit zooming with e.g. '1' should handle
|
||||
zoom-focus better
|
||||
560245 – Zoom selection always centered in the Navigation tab
|
||||
559490 – Wrong lang tags for 'no'
|
||||
559292 – SOTA Chrome cannot accept different textures
|
||||
560375 – Clearing an already empty document history crashes GIMP
|
||||
559580 – Image windows need better default locations
|
||||
560283 – "Scale image..." causes distortion around edges
|
||||
559716 – Changing crop size in Crop Tool Options can make UI
|
||||
unresponsive
|
||||
558549 – Stroking a single-point path with a paint tool
|
||||
crashes GIMP
|
||||
559015 – Move tool gives bad information about px moved
|
||||
558660 – help behavior for locales without manual translation
|
||||
|
||||
* Updated translations:
|
||||
|
||||
Belarusian (be)
|
||||
Dutch (nl)
|
||||
German (de)
|
||||
Japanese (ja)
|
||||
Lithuanian (lt)
|
||||
Norwegian Bokmål (nb)
|
||||
Norwegian Nynorsk (nn)
|
||||
Polish (pl)
|
||||
Romanian (ro)
|
||||
|
||||
|
||||
Overview of Changes from GIMP 2.6.1 to GIMP 2.6.2
|
||||
=================================================
|
||||
|
||||
* Bugs fixed:
|
||||
|
||||
557950 – Scaling in Gimp 2.6 is much slower than in Gimp 2.4
|
||||
558215 – unit and zoom entries in Statusbar not visible
|
||||
558451 – Cannot build GIMP using Sun CC on Solaris 2.8
|
||||
558420 – projection incorrect with alpha-less layers
|
||||
556603 – Zoom region always zooms in center of image
|
||||
557870 – "Qmask" message popping up here and there
|
||||
557705 – compatibility with GEGL > 0.0.20
|
||||
556248 – Scaling gives 'jagged' edges
|
||||
556804 – Zoom drop down doesn't update
|
||||
524615 – Print not to scale
|
||||
555246 – gimp crashes when a file is opened while a preview is generating
|
||||
556741 – Alpha layer automatically added (in psd format)
|
||||
556182 – Could you please explain a few strings [I18N]
|
||||
555697 – build fails if configured with --without-libjpeg
|
||||
134956 – Curves tool doesn't save free curves
|
||||
|
||||
* Updated translations:
|
||||
|
||||
Czech (cs)
|
||||
Danish (da)
|
||||
Finnish (fi)
|
||||
French (fr)
|
||||
Japanese (ja)
|
||||
Polish (pl)
|
||||
Brazilian Portuguese (pt_BR)
|
||||
Swedish (sv)
|
||||
Simplified Chinese (zh_CN)
|
||||
|
||||
|
||||
Overview of Changes from GIMP 2.6.0 to GIMP 2.6.1
|
||||
=================================================
|
||||
|
||||
|
@@ -182,6 +182,7 @@ gimp_console_2_6_LDADD = \
|
||||
$(FONTCONFIG_LIBS) \
|
||||
$(FREETYPE_LIBS) \
|
||||
$(GEGL_LIBS) \
|
||||
$(GLIB_LIBS) \
|
||||
$(RT_LIBS) \
|
||||
$(INTLLIBS) \
|
||||
$(GIMPICONRC)
|
||||
|
@@ -232,8 +232,10 @@ documents_clear_cmd_callback (GtkAction *action,
|
||||
|
||||
gimp_container_clear (gimp->documents);
|
||||
|
||||
if (! gtk_recent_manager_purge_items (gtk_recent_manager_get_default (),
|
||||
&error))
|
||||
gtk_recent_manager_purge_items (gtk_recent_manager_get_default (),
|
||||
&error);
|
||||
|
||||
if (error)
|
||||
{
|
||||
gimp_message (gimp, G_OBJECT (dialog), GIMP_MESSAGE_ERROR,
|
||||
"%s", error->message);
|
||||
|
@@ -165,6 +165,9 @@ file_open_recent_cmd_callback (GtkAction *action,
|
||||
GError *error = NULL;
|
||||
return_if_no_display (display, data);
|
||||
|
||||
g_object_ref (display);
|
||||
g_object_ref (imagefile);
|
||||
|
||||
progress = display->image ? NULL : GIMP_PROGRESS (display);
|
||||
|
||||
image = file_open_with_display (gimp, action_data_get_context (data),
|
||||
@@ -184,6 +187,9 @@ file_open_recent_cmd_callback (GtkAction *action,
|
||||
|
||||
g_free (filename);
|
||||
}
|
||||
|
||||
g_object_unref (imagefile);
|
||||
g_object_unref (display);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -218,7 +218,7 @@ view_zoom_explicit_cmd_callback (GtkAction *action,
|
||||
gimp_display_shell_scale (shell,
|
||||
GIMP_ZOOM_TO,
|
||||
(gdouble) value / 10000,
|
||||
GIMP_ZOOM_FOCUS_IMAGE_CENTER);
|
||||
GIMP_ZOOM_FOCUS_RETAIN_CENTERING_ELSE_BEST_GUESS);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -42,7 +42,7 @@
|
||||
|
||||
#ifdef G_OS_WIN32
|
||||
# define DEFAULT_WEB_BROWSER "not used on Windows"
|
||||
#elif HAVE_CARBON
|
||||
#elif PLATFORM_OSX
|
||||
# define DEFAULT_WEB_BROWSER "open %s"
|
||||
#else
|
||||
# define DEFAULT_WEB_BROWSER "firefox %s"
|
||||
|
@@ -206,7 +206,7 @@ struct _GimpCoords
|
||||
};
|
||||
|
||||
|
||||
#include "gegl/gegl-types.h"
|
||||
#include "gegl/gimp-gegl-types.h"
|
||||
#include "paint/paint-types.h"
|
||||
#include "text/text-types.h"
|
||||
#include "vectors/vectors-types.h"
|
||||
|
@@ -105,8 +105,8 @@ static void gimp_transform_region_lanczos (TileManager *orig_tiles,
|
||||
GimpProgress *progress);
|
||||
|
||||
static inline void untransform_coords (const GimpMatrix3 *m,
|
||||
gint x,
|
||||
gint y,
|
||||
const gint x,
|
||||
const gint y,
|
||||
gdouble *tu,
|
||||
gdouble *tv,
|
||||
gdouble *tw);
|
||||
@@ -126,21 +126,22 @@ static inline gboolean supersample_dtest (const gdouble u0,
|
||||
const gdouble u3,
|
||||
const gdouble v3);
|
||||
|
||||
static void sample_adapt (PixelSurround *surround,
|
||||
const gdouble uc,
|
||||
const gdouble vc,
|
||||
const gdouble u0,
|
||||
const gdouble v0,
|
||||
const gdouble u1,
|
||||
const gdouble v1,
|
||||
const gdouble u2,
|
||||
const gdouble v2,
|
||||
const gdouble u3,
|
||||
const gdouble v3,
|
||||
const gint level,
|
||||
static void sample_adapt (TileManager *tm,
|
||||
const gdouble xc,
|
||||
const gdouble yc,
|
||||
const gdouble x0,
|
||||
const gdouble y0,
|
||||
const gdouble x1,
|
||||
const gdouble y1,
|
||||
const gdouble x2,
|
||||
const gdouble y2,
|
||||
const gdouble x3,
|
||||
const gdouble y3,
|
||||
const gint level,
|
||||
guchar *color,
|
||||
const gint bpp,
|
||||
const gint alpha);
|
||||
const guchar *bg_color,
|
||||
gint bpp,
|
||||
gint alpha);
|
||||
|
||||
static void sample_linear (PixelSurround *surround,
|
||||
const gdouble u,
|
||||
@@ -431,14 +432,14 @@ gimp_transform_region_linear (TileManager *orig_tiles,
|
||||
if (supersample_dtest (u[1], v[1], u[2], v[2],
|
||||
u[3], v[3], u[4], v[4]))
|
||||
{
|
||||
sample_adapt (surround,
|
||||
sample_adapt (orig_tiles,
|
||||
u[0] - u1, v[0] - v1,
|
||||
u[1] - u1, v[1] - v1,
|
||||
u[2] - u1, v[2] - v1,
|
||||
u[3] - u1, v[3] - v1,
|
||||
u[4] - u1, v[4] - v1,
|
||||
recursion_level,
|
||||
d, destPR->bytes, alpha);
|
||||
d, bg_color, destPR->bytes, alpha);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -533,14 +534,14 @@ gimp_transform_region_cubic (TileManager *orig_tiles,
|
||||
if (supersample_dtest (u[1], v[1], u[2], v[2],
|
||||
u[3], v[3], u[4], v[4]))
|
||||
{
|
||||
sample_adapt (surround,
|
||||
sample_adapt (orig_tiles,
|
||||
u[0] - u1, v[0] - v1,
|
||||
u[1] - u1, v[1] - v1,
|
||||
u[2] - u1, v[2] - v1,
|
||||
u[3] - u1, v[3] - v1,
|
||||
u[4] - u1, v[4] - v1,
|
||||
recursion_level,
|
||||
d, destPR->bytes, alpha);
|
||||
d, bg_color, destPR->bytes, alpha);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -641,14 +642,14 @@ gimp_transform_region_lanczos (TileManager *orig_tiles,
|
||||
if (supersample_dtest (u[1], v[1], u[2], v[2],
|
||||
u[3], v[3], u[4], v[4]))
|
||||
{
|
||||
sample_adapt (surround,
|
||||
sample_adapt (orig_tiles,
|
||||
u[0] - u1, v[0] - v1,
|
||||
u[1] - u1, v[1] - v1,
|
||||
u[2] - u1, v[2] - v1,
|
||||
u[3] - u1, v[3] - v1,
|
||||
u[4] - u1, v[4] - v1,
|
||||
recursion_level,
|
||||
d, destPR->bytes, alpha);
|
||||
d, bg_color, destPR->bytes, alpha);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -838,42 +839,49 @@ sample_linear (PixelSurround *surround,
|
||||
bilinear interpolation of a fixed point pixel
|
||||
*/
|
||||
static void
|
||||
sample_bi (PixelSurround *surround,
|
||||
const gint x,
|
||||
const gint y,
|
||||
guchar *color,
|
||||
const gint bpp,
|
||||
const gint alpha)
|
||||
sample_bi (TileManager *tm,
|
||||
const gint x,
|
||||
const gint y,
|
||||
guchar *color,
|
||||
const guchar *bg_color,
|
||||
const gint bpp,
|
||||
const gint alpha)
|
||||
{
|
||||
const gint xscale = x & (FIXED_UNIT - 1);
|
||||
const gint yscale = y & (FIXED_UNIT - 1);
|
||||
const gint x0 = x >> FIXED_SHIFT;
|
||||
const gint y0 = y >> FIXED_SHIFT;
|
||||
gint rowstride;
|
||||
const guchar *src = pixel_surround_lock (surround, x0, y0, &rowstride);
|
||||
const guchar *s0 = src;
|
||||
const guchar *s1 = src + bpp;
|
||||
const guchar *s2 = src + rowstride;
|
||||
const guchar *s3 = src + rowstride + bpp;
|
||||
gint i;
|
||||
const gint xscale = (x & (FIXED_UNIT-1));
|
||||
const gint yscale = (y & (FIXED_UNIT-1));
|
||||
const gint x0 = x >> FIXED_SHIFT;
|
||||
const gint y0 = y >> FIXED_SHIFT;
|
||||
const gint x1 = x0 + 1;
|
||||
const gint y1 = y0 + 1;
|
||||
guchar C[4][4];
|
||||
gint i;
|
||||
|
||||
/* fill the color with default values, since read_pixel_data_1
|
||||
* does nothing, when accesses are out of bounds.
|
||||
*/
|
||||
for (i = 0; i < 4; i++)
|
||||
*(guint*) (&C[i]) = *(guint*) (bg_color);
|
||||
|
||||
read_pixel_data_1 (tm, x0, y0, C[0]);
|
||||
read_pixel_data_1 (tm, x1, y0, C[2]);
|
||||
read_pixel_data_1 (tm, x0, y1, C[1]);
|
||||
read_pixel_data_1 (tm, x1, y1, C[3]);
|
||||
|
||||
#define lerp(v1, v2, r) \
|
||||
(((guint)(v1) * (FIXED_UNIT - (guint)(r)) + \
|
||||
(guint)(v2) * (guint)(r)) >> FIXED_SHIFT)
|
||||
|
||||
color[alpha]= lerp (lerp (s0[alpha], s1[alpha], yscale),
|
||||
lerp (s2[alpha], s3[alpha], yscale), xscale);
|
||||
color[alpha]= lerp (lerp (C[0][alpha], C[1][alpha], yscale),
|
||||
lerp (C[2][alpha], C[3][alpha], yscale), xscale);
|
||||
|
||||
if (color[alpha])
|
||||
{
|
||||
/* to avoid problems, calculate with premultiplied alpha */
|
||||
for (i = 0; i < alpha; i++)
|
||||
{
|
||||
color[i] = lerp (lerp (s0[i] * s0[alpha] / 255,
|
||||
s1[i] * s1[alpha] / 255, yscale),
|
||||
lerp (s2[i] * s2[alpha] / 255,
|
||||
s3[i] * s3[alpha] / 255, yscale), xscale);
|
||||
}
|
||||
color[i] = lerp (lerp (C[0][i] * C[0][alpha] / 255,
|
||||
C[1][i] * C[1][alpha] / 255, yscale),
|
||||
lerp (C[2][i] * C[2][alpha] / 255,
|
||||
C[3][i] * C[3][alpha] / 255, yscale), xscale);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -936,29 +944,30 @@ supersample_dtest (const gdouble x0, const gdouble y0,
|
||||
0..3 is a cycle around the quad
|
||||
*/
|
||||
static void
|
||||
get_sample (PixelSurround *surround,
|
||||
const gint xc,
|
||||
const gint yc,
|
||||
const gint x0,
|
||||
const gint y0,
|
||||
const gint x1,
|
||||
const gint y1,
|
||||
const gint x2,
|
||||
const gint y2,
|
||||
const gint x3,
|
||||
const gint y3,
|
||||
gint *cc,
|
||||
const gint level,
|
||||
guint *color,
|
||||
const gint bpp,
|
||||
const gint alpha)
|
||||
get_sample (TileManager *tm,
|
||||
const gint xc,
|
||||
const gint yc,
|
||||
const gint x0,
|
||||
const gint y0,
|
||||
const gint x1,
|
||||
const gint y1,
|
||||
const gint x2,
|
||||
const gint y2,
|
||||
const gint x3,
|
||||
const gint y3,
|
||||
gint *cc,
|
||||
const gint level,
|
||||
guint *color,
|
||||
const guchar *bg_color,
|
||||
const gint bpp,
|
||||
const gint alpha)
|
||||
{
|
||||
if (!level || !supersample_test (x0, y0, x1, y1, x2, y2, x3, y3))
|
||||
{
|
||||
gint i;
|
||||
guchar C[4];
|
||||
|
||||
sample_bi (surround, xc, yc, C, bpp, alpha);
|
||||
sample_bi (tm, xc, yc, C, bg_color, bpp, alpha);
|
||||
|
||||
for (i = 0; i < bpp; i++)
|
||||
color[i]+= C[i];
|
||||
@@ -992,30 +1001,30 @@ get_sample (PixelSurround *surround,
|
||||
bry = (y2 + yc) / 2;
|
||||
by = (y3 + y2) / 2;
|
||||
|
||||
get_sample (surround,
|
||||
get_sample (tm,
|
||||
tlx,tly,
|
||||
x0,y0, tx,ty, xc,yc, lx,ly,
|
||||
cc, level-1, color, bpp, alpha);
|
||||
cc, level-1, color, bg_color, bpp, alpha);
|
||||
|
||||
get_sample (surround,
|
||||
get_sample (tm,
|
||||
trx,try,
|
||||
tx,ty, x1,y1, rx,ry, xc,yc,
|
||||
cc, level-1, color, bpp, alpha);
|
||||
cc, level-1, color, bg_color, bpp, alpha);
|
||||
|
||||
get_sample (surround,
|
||||
get_sample (tm,
|
||||
brx,bry,
|
||||
xc,yc, rx,ry, x2,y2, bx,by,
|
||||
cc, level-1, color, bpp, alpha);
|
||||
cc, level-1, color, bg_color, bpp, alpha);
|
||||
|
||||
get_sample (surround,
|
||||
get_sample (tm,
|
||||
blx,bly,
|
||||
lx,ly, xc,yc, bx,by, x3,y3,
|
||||
cc, level-1, color, bpp, alpha);
|
||||
cc, level-1, color, bg_color, bpp, alpha);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
sample_adapt (PixelSurround *surround,
|
||||
sample_adapt (TileManager *tm,
|
||||
const gdouble xc,
|
||||
const gdouble yc,
|
||||
const gdouble x0,
|
||||
@@ -1028,6 +1037,7 @@ sample_adapt (PixelSurround *surround,
|
||||
const gdouble y3,
|
||||
const gint level,
|
||||
guchar *color,
|
||||
const guchar *bg_color,
|
||||
const gint bpp,
|
||||
const gint alpha)
|
||||
{
|
||||
@@ -1037,13 +1047,13 @@ sample_adapt (PixelSurround *surround,
|
||||
|
||||
C[0] = C[1] = C[2] = C[3] = 0;
|
||||
|
||||
get_sample (surround,
|
||||
get_sample (tm,
|
||||
DOUBLE2FIXED (xc), DOUBLE2FIXED (yc),
|
||||
DOUBLE2FIXED (x0), DOUBLE2FIXED (y0),
|
||||
DOUBLE2FIXED (x1), DOUBLE2FIXED (y1),
|
||||
DOUBLE2FIXED (x2), DOUBLE2FIXED (y2),
|
||||
DOUBLE2FIXED (x3), DOUBLE2FIXED (y3),
|
||||
&cc, level, C, bpp, alpha);
|
||||
&cc, level, C, bg_color, bpp, alpha);
|
||||
|
||||
if (!cc)
|
||||
cc=1;
|
||||
@@ -1124,8 +1134,8 @@ sample_cubic (PixelSurround *surround,
|
||||
gint i;
|
||||
const gint iu = floor(u);
|
||||
const gint iv = floor(v);
|
||||
gdouble du, dv;
|
||||
gint rowstride;
|
||||
gdouble du, dv;
|
||||
const guchar *data;
|
||||
|
||||
/* lock the pixel surround */
|
||||
|
@@ -235,38 +235,38 @@ gimp_transform_resize_crop (gdouble dx1,
|
||||
{
|
||||
Point points[4];
|
||||
Rectangle r;
|
||||
gint ax, ay, tx, ty;
|
||||
Point t,a;
|
||||
gint i, j;
|
||||
gint min;
|
||||
|
||||
/* fill in the points array */
|
||||
points[0].x = floor (dx1);
|
||||
points[0].y = floor (dy1);
|
||||
points[1].x = floor (dx2);
|
||||
points[1].y = floor (dy2);
|
||||
points[2].x = floor (dx3);
|
||||
points[2].y = floor (dy3);
|
||||
points[3].x = floor (dx4);
|
||||
points[3].y = floor (dy4);
|
||||
points[0].x = dx1;
|
||||
points[0].y = dy1;
|
||||
points[1].x = dx2;
|
||||
points[1].y = dy2;
|
||||
points[2].x = dx3;
|
||||
points[2].y = dy3;
|
||||
points[3].x = dx4;
|
||||
points[3].y = dy4;
|
||||
|
||||
/* first, translate the vertices into the first quadrant */
|
||||
|
||||
ax = 0;
|
||||
ay = 0;
|
||||
a.x = 0;
|
||||
a.y = 0;
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
if (points[i].x < ax)
|
||||
ax = points[i].x;
|
||||
if (points[i].x < a.x)
|
||||
a.x = points[i].x;
|
||||
|
||||
if (points[i].y < ay)
|
||||
ay = points[i].y;
|
||||
if (points[i].y < a.y)
|
||||
a.y = points[i].y;
|
||||
}
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
points[i].x += (-ax) * 2;
|
||||
points[i].y += (-ay) * 2;
|
||||
points[i].x += (-a.x) * 2;
|
||||
points[i].y += (-a.y) * 2;
|
||||
}
|
||||
|
||||
|
||||
@@ -281,14 +281,9 @@ gimp_transform_resize_crop (gdouble dx1,
|
||||
min = i;
|
||||
}
|
||||
|
||||
tx = points[0].x;
|
||||
ty = points[0].y;
|
||||
|
||||
points[0].x = points[min].x;
|
||||
points[0].y = points[min].y;
|
||||
|
||||
points[min].x = tx;
|
||||
points[min].y = ty;
|
||||
t = points[0];
|
||||
points[0] = points[min];
|
||||
points[min] = t;
|
||||
|
||||
for (i = 1; i < 4; i++)
|
||||
{
|
||||
@@ -314,35 +309,22 @@ gimp_transform_resize_crop (gdouble dx1,
|
||||
|
||||
theta_v = theta_m;
|
||||
|
||||
tx = points[i].x;
|
||||
ty = points[i].y;
|
||||
|
||||
points[i].x = points[min].x;
|
||||
points[i].y = points[min].y;
|
||||
|
||||
points[min].x = tx;
|
||||
points[min].y = ty;
|
||||
t = points[i];
|
||||
points[i] = points[min];
|
||||
points[min] = t;
|
||||
}
|
||||
|
||||
/* reverse the order of points */
|
||||
|
||||
tx = points[0].x;
|
||||
ty = points[0].y;
|
||||
t = points[0];
|
||||
points[0] = points[3];
|
||||
points[3] = t;
|
||||
|
||||
points[0].x = points[3].x;
|
||||
points[0].y = points[3].y;
|
||||
points[3].x = tx;
|
||||
points[3].y = ty;
|
||||
t = points[1];
|
||||
points[1] = points[2];
|
||||
points[2] = t;
|
||||
|
||||
tx = points[1].x;
|
||||
ty = points[1].y;
|
||||
|
||||
points[1].x = points[2].x;
|
||||
points[1].y = points[2].y;
|
||||
points[2].x = tx;
|
||||
points[2].y = ty;
|
||||
|
||||
r.a.x = r.a.y = r.b.x = r.b.y = r.c.x = r.c.x = r.d.x = r.d.x = r.area = 0;
|
||||
r.a.x = r.a.y = r.b.x = r.b.y = r.c.x = r.c.y = r.d.x = r.d.y = r.area = 0;
|
||||
r.aspect = aspect;
|
||||
|
||||
if (aspect != 0)
|
||||
@@ -366,10 +348,10 @@ gimp_transform_resize_crop (gdouble dx1,
|
||||
*x2 = ceil (r.c.x - 0.5);
|
||||
*y2 = ceil (r.c.y - 0.5);
|
||||
|
||||
*x1 = *x1 - ((-ax) * 2);
|
||||
*y1 = *y1 - ((-ay) * 2);
|
||||
*x2 = *x2 - ((-ax) * 2);
|
||||
*y2 = *y2 - ((-ay) * 2);
|
||||
*x1 = *x1 - ((-a.x) * 2);
|
||||
*y1 = *y1 - ((-a.y) * 2);
|
||||
*x2 = *x2 - ((-a.x) * 2);
|
||||
*y2 = *y2 - ((-a.y) * 2);
|
||||
|
||||
}
|
||||
|
||||
@@ -380,31 +362,31 @@ find_three_point_rectangle (Rectangle *r,
|
||||
{
|
||||
Point a = points[p % 4]; /* 0 1 2 3 */
|
||||
Point b = points[(p + 1) % 4]; /* 1 2 3 0 */
|
||||
Point c = points[(p + 2) % 4]; /* 2 3 0 2 */
|
||||
Point d = points[(p + 3) % 4]; /* 3 0 1 1 */
|
||||
Point c = points[(p + 2) % 4]; /* 2 3 0 1 */
|
||||
Point d = points[(p + 3) % 4]; /* 3 0 1 2 */
|
||||
Point i1; /* intersection point */
|
||||
Point i2; /* intersection point */
|
||||
Point i3; /* intersection point */
|
||||
|
||||
if (intersect_x (b, c, a, &i1) &&
|
||||
intersect_y (c, d, i1, &i2) &&
|
||||
intersect_x (d, a, i2, &i3))
|
||||
if (intersect_x (b, c, a, &i1) &&
|
||||
intersect_y (c, d, i1, &i2) &&
|
||||
intersect_x (d, a, i2, &i3))
|
||||
add_rectangle (points, r, i3, i3, i1, i1);
|
||||
|
||||
if (intersect_y (b, c, a, &i1) &&
|
||||
intersect_x (c, d, i1, &i2) &&
|
||||
intersect_y (a, i1, i2, &i3))
|
||||
add_rectangle (points, r, i3, i3, i1, i2);
|
||||
if (intersect_y (b, c, a, &i1) &&
|
||||
intersect_x (c, d, i1, &i2) &&
|
||||
intersect_y (d, a, i2, &i3))
|
||||
add_rectangle (points, r, i3, i3, i1, i1);
|
||||
|
||||
if (intersect_x (c, d, a, &i1) &&
|
||||
intersect_y (b, c, i1, &i2) &&
|
||||
intersect_x (a, i1, i2, &i3))
|
||||
add_rectangle (points, r, i3, i3, i1, i2);
|
||||
if (intersect_x (d, c, a, &i1) &&
|
||||
intersect_y (c, b, i1, &i2) &&
|
||||
intersect_x (b, a, i2, &i3))
|
||||
add_rectangle (points, r, i3, i3, i1, i1);
|
||||
|
||||
if (intersect_y (c, d, a, &i1) &&
|
||||
intersect_x (b, c, i1, &i2) &&
|
||||
intersect_y (a, i1, i2, &i3))
|
||||
add_rectangle (points, r, i3, i3, i1, i2);
|
||||
if (intersect_y (d, c, a, &i1) &&
|
||||
intersect_x (c, b, i1, &i2) &&
|
||||
intersect_y (b, a, i2, &i3))
|
||||
add_rectangle (points, r, i3, i3, i1, i1);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@@ -84,6 +84,7 @@ enum
|
||||
RESTORE,
|
||||
EXIT,
|
||||
BUFFER_CHANGED,
|
||||
IMAGE_OPENED,
|
||||
LAST_SIGNAL
|
||||
};
|
||||
|
||||
@@ -161,6 +162,15 @@ gimp_class_init (GimpClass *klass)
|
||||
gimp_marshal_VOID__VOID,
|
||||
G_TYPE_NONE, 0);
|
||||
|
||||
gimp_signals[IMAGE_OPENED] =
|
||||
g_signal_new ("image-opened",
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (GimpClass, image_opened),
|
||||
NULL, NULL,
|
||||
gimp_marshal_VOID__STRING,
|
||||
G_TYPE_NONE, 1, G_TYPE_STRING);
|
||||
|
||||
object_class->dispose = gimp_dispose;
|
||||
object_class->finalize = gimp_finalize;
|
||||
|
||||
@@ -1072,6 +1082,16 @@ gimp_message_valist (Gimp *gimp,
|
||||
g_free (message);
|
||||
}
|
||||
|
||||
void
|
||||
gimp_image_opened (Gimp *gimp,
|
||||
const gchar *uri)
|
||||
{
|
||||
g_return_if_fail (GIMP_IS_GIMP (gimp));
|
||||
g_return_if_fail (uri != NULL);
|
||||
|
||||
g_signal_emit (gimp, gimp_signals[IMAGE_OPENED], 0, uri);
|
||||
}
|
||||
|
||||
gboolean
|
||||
gimp_use_gegl (Gimp *gimp)
|
||||
{
|
||||
|
@@ -129,6 +129,10 @@ struct _GimpClass
|
||||
gboolean force);
|
||||
|
||||
void (* buffer_changed) (Gimp *gimp);
|
||||
|
||||
/* emitted if an image is loaded and opened with a display */
|
||||
void (* image_opened) (Gimp *gimp,
|
||||
const gchar *uri);
|
||||
};
|
||||
|
||||
|
||||
@@ -188,6 +192,9 @@ void gimp_message_valist (Gimp *gimp,
|
||||
const gchar *format,
|
||||
va_list args);
|
||||
|
||||
void gimp_image_opened (Gimp *gimp,
|
||||
const gchar *uri);
|
||||
|
||||
gboolean gimp_use_gegl (Gimp *gimp);
|
||||
|
||||
|
||||
|
@@ -394,16 +394,17 @@ gimp_channel_combine_ellipse_rect (GimpChannel *mask,
|
||||
xj = ABS (cur_x + 0.5 - ellipse_center_x);
|
||||
|
||||
if (yi < b)
|
||||
xdist = xj - a * sqrt (1 - yi * yi / b_sqr);
|
||||
xdist = xj - a * sqrt (1 - SQR (yi) / b_sqr);
|
||||
else
|
||||
xdist = 100.0; /* anything large will work */
|
||||
xdist = 1000.0; /* anything large will work */
|
||||
|
||||
if (xj < a)
|
||||
ydist = yi - b * sqrt (1 - xj * xj / a_sqr);
|
||||
ydist = yi - b * sqrt (1 - SQR (xj) / a_sqr);
|
||||
else
|
||||
ydist = 100.0; /* anything large will work */
|
||||
ydist = 1000.0; /* anything large will work */
|
||||
|
||||
r = hypot (xdist, ydist);
|
||||
|
||||
if (r < 0.001)
|
||||
dist = 0.;
|
||||
else
|
||||
@@ -430,19 +431,21 @@ gimp_channel_combine_ellipse_rect (GimpChannel *mask,
|
||||
{
|
||||
x_start = cur_x;
|
||||
last_val = val;
|
||||
}
|
||||
|
||||
/* because we are symetric accross the y axis we can
|
||||
* skip ahead a bit if we are inside. Do this if we
|
||||
* have reached a value of 255 OR if we have passed
|
||||
* the center of the leftmost ellipse.
|
||||
*/
|
||||
if ((val == 255 || cur_x >= x + a) && cur_x < x + w / 2)
|
||||
{
|
||||
last_val = val = 255;
|
||||
cur_x = (ellipse_center_x +
|
||||
(ellipse_center_x - cur_x) - 1 +
|
||||
floor (straight_width));
|
||||
}
|
||||
/* because we are symetric accross the y axis we can
|
||||
* skip ahead a bit if we are inside. Do this if we
|
||||
* have reached a value of 255 OR if we have passed
|
||||
* the center of the leftmost ellipse.
|
||||
*/
|
||||
if ((val == 255 || cur_x >= x + a) && cur_x < x + w / 2)
|
||||
{
|
||||
x_start = cur_x;
|
||||
last_val = val = 255;
|
||||
|
||||
cur_x = (ellipse_center_x +
|
||||
(ellipse_center_x - cur_x) - 1 +
|
||||
floor (straight_width));
|
||||
}
|
||||
|
||||
/* Time to change center? */
|
||||
@@ -450,7 +453,6 @@ gimp_channel_combine_ellipse_rect (GimpChannel *mask,
|
||||
{
|
||||
ellipse_center_x = x + a + straight_width;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
gimp_channel_combine_segment (mask, op, x_start,
|
||||
|
@@ -809,7 +809,12 @@ gimp_curve_get_point (GimpCurve *curve,
|
||||
g_return_if_fail (point >= 0 && point < curve->n_points);
|
||||
|
||||
if (curve->curve_type == GIMP_CURVE_FREE)
|
||||
return;
|
||||
{
|
||||
if (x) *x = -1.0;
|
||||
if (y) *y = -1.0;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (x) *x = curve->points[point].x;
|
||||
if (y) *y = curve->points[point].y;
|
||||
|
@@ -25,9 +25,10 @@
|
||||
#include "base/gimplut.h"
|
||||
#include "base/lut-funcs.h"
|
||||
|
||||
#include "gegl/gimp-gegl-utils.h"
|
||||
#include "gegl/gimpbrightnesscontrastconfig.h"
|
||||
|
||||
/* temp */
|
||||
/* temporary */
|
||||
#include "gimp.h"
|
||||
#include "gimpimage.h"
|
||||
|
||||
@@ -60,10 +61,14 @@ gimp_drawable_brightness_contrast (GimpDrawable *drawable,
|
||||
|
||||
if (gimp_use_gegl (GIMP_ITEM (drawable)->image->gimp))
|
||||
{
|
||||
GeglNode *node;
|
||||
GeglNode *node;
|
||||
const gchar *name;
|
||||
|
||||
name = (gimp_gegl_check_version (0, 0, 21) ?
|
||||
"gegl:brightness-contrast" : "brightness-contrast");
|
||||
|
||||
node = g_object_new (GEGL_TYPE_NODE,
|
||||
"operation", "brightness-contrast",
|
||||
"operation", name,
|
||||
NULL);
|
||||
gimp_brightness_contrast_config_set_node (config, node);
|
||||
|
||||
|
@@ -129,7 +129,7 @@ gimp_drawable_curves_explicit (GimpDrawable *drawable,
|
||||
|
||||
gimp_data_freeze (GIMP_DATA (curve));
|
||||
|
||||
gimp_curve_set_curve_type (curve, GIMP_CURVE_SMOOTH);
|
||||
gimp_curve_set_curve_type (curve, GIMP_CURVE_FREE);
|
||||
|
||||
for (i = 0; i < 256; i++)
|
||||
gimp_curve_set_curve (curve,
|
||||
|
@@ -25,7 +25,9 @@
|
||||
#include "base/gimplut.h"
|
||||
#include "base/lut-funcs.h"
|
||||
|
||||
/* temp */
|
||||
#include "gegl/gimp-gegl-utils.h"
|
||||
|
||||
/* temporary */
|
||||
#include "gimp.h"
|
||||
#include "gimpimage.h"
|
||||
|
||||
@@ -48,9 +50,12 @@ gimp_drawable_invert (GimpDrawable *drawable,
|
||||
|
||||
if (gimp_use_gegl (GIMP_ITEM (drawable)->image->gimp))
|
||||
{
|
||||
GeglNode *invert;
|
||||
GeglNode *invert;
|
||||
const gchar *name;
|
||||
|
||||
invert = g_object_new (GEGL_TYPE_NODE, "operation", "invert", NULL);
|
||||
name = gimp_gegl_check_version (0, 0, 21) ? "gegl:invert" : "invert";
|
||||
|
||||
invert = g_object_new (GEGL_TYPE_NODE, "operation", name, NULL);
|
||||
|
||||
gimp_drawable_apply_operation (drawable, progress, _("Invert"),
|
||||
invert, TRUE);
|
||||
|
@@ -89,14 +89,16 @@ gimp_drawable_merge_shadow_tiles (GimpDrawable *drawable,
|
||||
*/
|
||||
if (gimp_drawable_mask_intersect (drawable, &x, &y, &width, &height))
|
||||
{
|
||||
PixelRegion shadowPR;
|
||||
TileManager *tiles = tile_manager_ref (drawable->shadow);
|
||||
PixelRegion shadowPR;
|
||||
|
||||
pixel_region_init (&shadowPR, drawable->shadow,
|
||||
x, y, width, height, FALSE);
|
||||
pixel_region_init (&shadowPR, tiles, x, y, width, height, FALSE);
|
||||
|
||||
gimp_drawable_apply_region (drawable, &shadowPR,
|
||||
push_undo, undo_desc,
|
||||
GIMP_OPACITY_OPAQUE, GIMP_REPLACE_MODE,
|
||||
NULL, x, y);
|
||||
|
||||
tile_manager_unref (tiles);
|
||||
}
|
||||
}
|
||||
|
@@ -379,36 +379,44 @@ pixel_difference (const guchar *col1,
|
||||
break;
|
||||
|
||||
case GIMP_SELECT_CRITERION_H:
|
||||
av0 = (gint)col1[0];
|
||||
av1 = (gint)col1[1];
|
||||
av2 = (gint)col1[2];
|
||||
bv0 = (gint)col2[0];
|
||||
bv1 = (gint)col2[1];
|
||||
bv2 = (gint)col2[2];
|
||||
av0 = (gint) col1[0];
|
||||
av1 = (gint) col1[1];
|
||||
av2 = (gint) col1[2];
|
||||
bv0 = (gint) col2[0];
|
||||
bv1 = (gint) col2[1];
|
||||
bv2 = (gint) col2[2];
|
||||
gimp_rgb_to_hsv_int (&av0, &av1, &av2);
|
||||
gimp_rgb_to_hsv_int (&bv0, &bv1, &bv2);
|
||||
max = abs (av0 - bv0);
|
||||
/* wrap around candidates for the actual distance */
|
||||
{
|
||||
gint dist1 = abs (av0 - bv0);
|
||||
gint dist2 = abs (av0 - 360 - bv0);
|
||||
gint dist3 = abs (av0 - bv0 + 360);
|
||||
max = MIN (dist1, dist2);
|
||||
if (max > dist3)
|
||||
max = dist3;
|
||||
}
|
||||
break;
|
||||
|
||||
case GIMP_SELECT_CRITERION_S:
|
||||
av0 = (gint)col1[0];
|
||||
av1 = (gint)col1[1];
|
||||
av2 = (gint)col1[2];
|
||||
bv0 = (gint)col2[0];
|
||||
bv1 = (gint)col2[1];
|
||||
bv2 = (gint)col2[2];
|
||||
av0 = (gint) col1[0];
|
||||
av1 = (gint) col1[1];
|
||||
av2 = (gint) col1[2];
|
||||
bv0 = (gint) col2[0];
|
||||
bv1 = (gint) col2[1];
|
||||
bv2 = (gint) col2[2];
|
||||
gimp_rgb_to_hsv_int (&av0, &av1, &av2);
|
||||
gimp_rgb_to_hsv_int (&bv0, &bv1, &bv2);
|
||||
max = abs (av1 - bv1);
|
||||
break;
|
||||
|
||||
case GIMP_SELECT_CRITERION_V:
|
||||
av0 = (gint)col1[0];
|
||||
av1 = (gint)col1[1];
|
||||
av2 = (gint)col1[2];
|
||||
bv0 = (gint)col2[0];
|
||||
bv1 = (gint)col2[1];
|
||||
bv2 = (gint)col2[2];
|
||||
av0 = (gint) col1[0];
|
||||
av1 = (gint) col1[1];
|
||||
av2 = (gint) col1[2];
|
||||
bv0 = (gint) col2[0];
|
||||
bv1 = (gint) col2[1];
|
||||
bv2 = (gint) col2[2];
|
||||
gimp_rgb_to_hsv_int (&av0, &av1, &av2);
|
||||
gimp_rgb_to_hsv_int (&bv0, &bv1, &bv2);
|
||||
max = abs (av2 - bv2);
|
||||
|
@@ -29,6 +29,8 @@
|
||||
|
||||
#include "paint-funcs/paint-funcs.h"
|
||||
|
||||
#include "gegl/gimp-gegl-utils.h"
|
||||
|
||||
#include "gimpdrawable.h"
|
||||
#include "gimpdrawable-shadow.h"
|
||||
#include "gimpimage.h"
|
||||
@@ -455,6 +457,8 @@ gimp_image_map_apply (GimpImageMap *image_map,
|
||||
{
|
||||
if (! image_map->gegl)
|
||||
{
|
||||
const gchar *shift_name;
|
||||
|
||||
image_map->gegl = gegl_node_new ();
|
||||
|
||||
if (g_object_class_find_property (
|
||||
@@ -466,9 +470,12 @@ gimp_image_map_apply (GimpImageMap *image_map,
|
||||
"operation", "gimp-tilemanager-source",
|
||||
NULL);
|
||||
|
||||
shift_name =
|
||||
gimp_gegl_check_version (0, 0, 21) ? "gegl:translate" : "shift";
|
||||
|
||||
image_map->shift =
|
||||
gegl_node_new_child (image_map->gegl,
|
||||
"operation", "shift",
|
||||
"operation", shift_name,
|
||||
NULL);
|
||||
|
||||
gegl_node_add_child (image_map->gegl, image_map->operation);
|
||||
@@ -510,9 +517,15 @@ gimp_image_map_apply (GimpImageMap *image_map,
|
||||
* source OP, blend its result on top of the original
|
||||
* pixels.
|
||||
*/
|
||||
GeglNode *over = gegl_node_new_child (image_map->gegl,
|
||||
"operation", "over",
|
||||
NULL);
|
||||
const gchar *over_name;
|
||||
GeglNode *over;
|
||||
|
||||
over_name =
|
||||
gimp_gegl_check_version (0, 0, 21) ? "gegl:over" : "over";
|
||||
|
||||
over = gegl_node_new_child (image_map->gegl,
|
||||
"operation", over_name,
|
||||
NULL);
|
||||
|
||||
gegl_node_link_many (image_map->input,
|
||||
image_map->shift,
|
||||
|
@@ -44,6 +44,7 @@ VOID: INT
|
||||
VOID: INT, INT
|
||||
VOID: INT, INT, INT, INT
|
||||
VOID: OBJECT
|
||||
VOID: OBJECT, BOOLEAN
|
||||
VOID: OBJECT, INT
|
||||
VOID: OBJECT, OBJECT
|
||||
VOID: OBJECT, POINTER
|
||||
|
@@ -361,13 +361,14 @@ gimp_projection_initialize (GimpProjection *proj,
|
||||
|
||||
gimp_item_offsets (item, &off_x, &off_y);
|
||||
|
||||
if (gimp_item_get_visible (item) &&
|
||||
! gimp_drawable_has_alpha (GIMP_DRAWABLE (item)) &&
|
||||
! gimp_layer_get_mask (GIMP_LAYER (item)) &&
|
||||
gimp_layer_get_mode (GIMP_LAYER (item)) == GIMP_NORMAL_MODE &&
|
||||
(off_x <= x) &&
|
||||
(off_y <= y) &&
|
||||
(off_x + gimp_item_width (item) >= x + w) &&
|
||||
if (gimp_item_get_visible (item) &&
|
||||
! gimp_drawable_has_alpha (GIMP_DRAWABLE (item)) &&
|
||||
! gimp_layer_get_mask (GIMP_LAYER (item)) &&
|
||||
gimp_layer_get_mode (GIMP_LAYER (item)) == GIMP_NORMAL_MODE &&
|
||||
gimp_layer_get_opacity (GIMP_LAYER (item)) == GIMP_OPACITY_OPAQUE &&
|
||||
(off_x <= x) &&
|
||||
(off_y <= y) &&
|
||||
(off_x + gimp_item_width (item) >= x + w) &&
|
||||
(off_y + gimp_item_height (item) >= y + h))
|
||||
{
|
||||
coverage = TRUE;
|
||||
|
@@ -187,7 +187,11 @@ image_new_dialog_set (GtkWidget *widget,
|
||||
template = gimp_image_new_get_last_template (dialog->context->gimp,
|
||||
image);
|
||||
|
||||
gimp_config_sync (G_OBJECT (template), G_OBJECT (dialog->template), 0);
|
||||
/* make sure the resolution values are copied first (see bug #546924) */
|
||||
gimp_config_sync (G_OBJECT (template), G_OBJECT (dialog->template),
|
||||
GIMP_TEMPLATE_PARAM_COPY_FIRST);
|
||||
gimp_config_sync (G_OBJECT (template), G_OBJECT (dialog->template),
|
||||
0);
|
||||
|
||||
g_object_unref (template);
|
||||
}
|
||||
|
@@ -425,7 +425,13 @@ prefs_template_select_callback (GimpContainerView *view,
|
||||
GimpTemplate *edit_template)
|
||||
{
|
||||
if (template)
|
||||
gimp_config_sync (G_OBJECT (template), G_OBJECT (edit_template), 0);
|
||||
{
|
||||
/* make sure the resolution values are copied first (see bug #546924) */
|
||||
gimp_config_sync (G_OBJECT (template), G_OBJECT (edit_template),
|
||||
GIMP_TEMPLATE_PARAM_COPY_FIRST);
|
||||
gimp_config_sync (G_OBJECT (template), G_OBJECT (edit_template),
|
||||
0);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
@@ -318,9 +318,10 @@ stroke_dialog_response (GtkWidget *widget,
|
||||
if (! gimp_item_stroke (item, drawable, context, desc, FALSE, NULL,
|
||||
&error))
|
||||
{
|
||||
gimp_message (context->gimp, G_OBJECT (widget),
|
||||
gimp_message (context->gimp,
|
||||
G_OBJECT (widget),
|
||||
GIMP_MESSAGE_WARNING,
|
||||
error->message);
|
||||
error ? error->message : "NULL");
|
||||
g_clear_error (&error);
|
||||
return;
|
||||
}
|
||||
|
@@ -166,6 +166,7 @@ gimp_zoom_focus_get_type (void)
|
||||
{ GIMP_ZOOM_FOCUS_BEST_GUESS, "GIMP_ZOOM_FOCUS_BEST_GUESS", "best-guess" },
|
||||
{ GIMP_ZOOM_FOCUS_POINTER, "GIMP_ZOOM_FOCUS_POINTER", "pointer" },
|
||||
{ GIMP_ZOOM_FOCUS_IMAGE_CENTER, "GIMP_ZOOM_FOCUS_IMAGE_CENTER", "image-center" },
|
||||
{ GIMP_ZOOM_FOCUS_RETAIN_CENTERING_ELSE_BEST_GUESS, "GIMP_ZOOM_FOCUS_RETAIN_CENTERING_ELSE_BEST_GUESS", "retain-centering-else-best-guess" },
|
||||
{ 0, NULL, NULL }
|
||||
};
|
||||
|
||||
@@ -174,6 +175,7 @@ gimp_zoom_focus_get_type (void)
|
||||
{ GIMP_ZOOM_FOCUS_BEST_GUESS, "GIMP_ZOOM_FOCUS_BEST_GUESS", NULL },
|
||||
{ GIMP_ZOOM_FOCUS_POINTER, "GIMP_ZOOM_FOCUS_POINTER", NULL },
|
||||
{ GIMP_ZOOM_FOCUS_IMAGE_CENTER, "GIMP_ZOOM_FOCUS_IMAGE_CENTER", NULL },
|
||||
{ GIMP_ZOOM_FOCUS_RETAIN_CENTERING_ELSE_BEST_GUESS, "GIMP_ZOOM_FOCUS_RETAIN_CENTERING_ELSE_BEST_GUESS", NULL },
|
||||
{ 0, NULL, NULL }
|
||||
};
|
||||
|
||||
|
@@ -87,9 +87,20 @@ GType gimp_zoom_focus_get_type (void) G_GNUC_CONST;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
GIMP_ZOOM_FOCUS_BEST_GUESS, /* Make a best guess */
|
||||
GIMP_ZOOM_FOCUS_POINTER, /* Use the mouse cursor (if within canvas) */
|
||||
GIMP_ZOOM_FOCUS_IMAGE_CENTER /* Use the image center */
|
||||
/* Make a best guess */
|
||||
GIMP_ZOOM_FOCUS_BEST_GUESS,
|
||||
|
||||
/* Use the mouse cursor (if within canvas) */
|
||||
GIMP_ZOOM_FOCUS_POINTER,
|
||||
|
||||
/* Use the image center */
|
||||
GIMP_ZOOM_FOCUS_IMAGE_CENTER,
|
||||
|
||||
/* If the image is centered, retain the centering. Else use
|
||||
* _BEST_GUESS
|
||||
*/
|
||||
GIMP_ZOOM_FOCUS_RETAIN_CENTERING_ELSE_BEST_GUESS
|
||||
|
||||
} GimpZoomFocus;
|
||||
|
||||
|
||||
|
@@ -350,7 +350,6 @@ gimp_display_shell_canvas_size_allocate (GtkWidget *widget,
|
||||
}
|
||||
|
||||
gimp_display_shell_scroll_clamp_and_update (shell);
|
||||
|
||||
gimp_display_shell_scaled (shell);
|
||||
|
||||
/* Reset */
|
||||
|
@@ -461,9 +461,12 @@ gimp_display_shell_drop_uri_list (GtkWidget *widget,
|
||||
GimpImage *image = shell->display->image;
|
||||
GimpContext *context = gimp_get_user_context (shell->display->gimp);
|
||||
GList *list;
|
||||
gboolean open_as_layers;
|
||||
|
||||
GIMP_LOG (DND, NULL);
|
||||
|
||||
open_as_layers = (shell->display->image != NULL);
|
||||
|
||||
for (list = uri_list; list; list = g_list_next (list))
|
||||
{
|
||||
const gchar *uri = list->data;
|
||||
@@ -471,17 +474,7 @@ gimp_display_shell_drop_uri_list (GtkWidget *widget,
|
||||
GError *error = NULL;
|
||||
gboolean warn = FALSE;
|
||||
|
||||
if (! shell->display->image)
|
||||
{
|
||||
image = file_open_with_display (shell->display->gimp, context,
|
||||
GIMP_PROGRESS (shell->display),
|
||||
uri, FALSE,
|
||||
&status, &error);
|
||||
|
||||
if (! image && status != GIMP_PDB_CANCEL)
|
||||
warn = TRUE;
|
||||
}
|
||||
else
|
||||
if (open_as_layers)
|
||||
{
|
||||
GList *new_layers;
|
||||
|
||||
@@ -510,6 +503,30 @@ gimp_display_shell_drop_uri_list (GtkWidget *widget,
|
||||
warn = TRUE;
|
||||
}
|
||||
}
|
||||
else if (shell->display->image)
|
||||
{
|
||||
/* open any subsequent images in a new display */
|
||||
GimpImage *new_image;
|
||||
|
||||
new_image = file_open_with_display (shell->display->gimp, context,
|
||||
NULL,
|
||||
uri, FALSE,
|
||||
&status, &error);
|
||||
|
||||
if (! new_image && status != GIMP_PDB_CANCEL)
|
||||
warn = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* open the first image in the empty display */
|
||||
image = file_open_with_display (shell->display->gimp, context,
|
||||
GIMP_PROGRESS (shell->display),
|
||||
uri, FALSE,
|
||||
&status, &error);
|
||||
|
||||
if (! image && status != GIMP_PDB_CANCEL)
|
||||
warn = TRUE;
|
||||
}
|
||||
|
||||
if (warn)
|
||||
{
|
||||
|
@@ -573,7 +573,9 @@ gimp_display_shell_draw_area (const GimpDisplayShell *shell,
|
||||
if (! shell->display->image)
|
||||
return;
|
||||
|
||||
gimp_display_shell_scroll_get_scaled_viewport_offset (shell, &sx, &sy);
|
||||
sx = - shell->offset_x;
|
||||
sy = - shell->offset_y;
|
||||
|
||||
gimp_display_shell_draw_get_scaled_image_size (shell, &sw, &sh);
|
||||
|
||||
/* check if the passed in area intersects with
|
||||
|
@@ -538,6 +538,13 @@ gimp_display_shell_size_changed_detailed_handler (GimpImage *image,
|
||||
shell->offset_y + scaled_previous_origin_y);
|
||||
|
||||
gimp_display_shell_scroll_center_image (shell, horizontally, vertically);
|
||||
|
||||
/* The above calls might not lead to a call to
|
||||
* gimp_display_shell_scroll_clamp_and_update() in all cases we
|
||||
* need it to be called, so simply call it explicitly here at
|
||||
* the end
|
||||
*/
|
||||
gimp_display_shell_scroll_clamp_and_update (shell);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -349,14 +349,13 @@ gimp_display_shell_draw_quad (GimpDrawable *texture,
|
||||
gfloat *v,
|
||||
guchar opacity)
|
||||
{
|
||||
gint x2[3], y2[3];
|
||||
gfloat u2[3], v2[3];
|
||||
gint minx, maxx, miny, maxy; /* screen bounds of the quad */
|
||||
gint dwidth, dheight; /* dimensions of dest */
|
||||
GdkPixbuf *area; /* quad sized area with dest pixels */
|
||||
gint c;
|
||||
gint x2[3], y2[3];
|
||||
gfloat u2[3], v2[3];
|
||||
gint minx, maxx, miny, maxy; /* screen bounds of the quad */
|
||||
gint dwidth, dheight; /* dimensions of dest */
|
||||
gint c;
|
||||
|
||||
g_return_if_fail(GDK_IS_DRAWABLE (dest));
|
||||
g_return_if_fail (GDK_IS_DRAWABLE (dest));
|
||||
|
||||
x2[0] = x[3]; y2[0] = y[3]; u2[0] = u[3]; v2[0] = v[3];
|
||||
x2[1] = x[2]; y2[1] = y[2]; u2[1] = u[2]; v2[1] = v[2];
|
||||
@@ -382,21 +381,27 @@ gimp_display_shell_draw_quad (GimpDrawable *texture,
|
||||
}
|
||||
if (minx < 0) minx = 0;
|
||||
if (miny < 0) miny = 0;
|
||||
if (maxx > dwidth - 1) maxx=dwidth - 1;
|
||||
if (maxy > dheight - 1) maxy=dheight - 1;
|
||||
if (maxx > dwidth - 1) maxx = dwidth - 1;
|
||||
if (maxy > dheight - 1) maxy = dheight - 1;
|
||||
|
||||
area = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, 8,
|
||||
maxx - minx + 1, maxy - miny + 1);
|
||||
g_return_if_fail (area != NULL);
|
||||
if (minx <= maxx && miny <= maxy)
|
||||
{
|
||||
GdkPixbuf *area;
|
||||
|
||||
gimp_display_shell_draw_tri (texture, dest, area, minx, miny,
|
||||
mask, mask_offx, mask_offy,
|
||||
x, y, u, v, opacity);
|
||||
gimp_display_shell_draw_tri (texture, dest, area, minx, miny,
|
||||
mask, mask_offx, mask_offy,
|
||||
x2, y2, u2, v2, opacity);
|
||||
area = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, 8,
|
||||
maxx - minx + 1, maxy - miny + 1);
|
||||
|
||||
g_object_unref (area);
|
||||
g_return_if_fail (area != NULL);
|
||||
|
||||
gimp_display_shell_draw_tri (texture, dest, area, minx, miny,
|
||||
mask, mask_offx, mask_offy,
|
||||
x, y, u, v, opacity);
|
||||
gimp_display_shell_draw_tri (texture, dest, area, minx, miny,
|
||||
mask, mask_offx, mask_offy,
|
||||
x2, y2, u2, v2, opacity);
|
||||
|
||||
g_object_unref (area);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -59,13 +59,19 @@ static gboolean gimp_display_shell_scale_image_starts_to_fit
|
||||
gdouble current_scale,
|
||||
gboolean *vertically,
|
||||
gboolean *horizontally);
|
||||
static void gimp_display_shell_scale_viewport_coord_almost_centered
|
||||
static gboolean gimp_display_shell_scale_viewport_coord_almost_centered
|
||||
(GimpDisplayShell *shell,
|
||||
gint x,
|
||||
gint y,
|
||||
gboolean *horizontally,
|
||||
gboolean *vertically);
|
||||
|
||||
static void gimp_display_shell_scale_get_image_center_viewport
|
||||
(GimpDisplayShell *shell,
|
||||
gint *image_center_x,
|
||||
gint *image_center_y);
|
||||
|
||||
|
||||
static void gimp_display_shell_scale_get_zoom_focus (GimpDisplayShell *shell,
|
||||
gdouble new_scale,
|
||||
gdouble current_scale,
|
||||
@@ -162,8 +168,6 @@ gimp_display_shell_scale_update_rulers (GimpDisplayShell *shell)
|
||||
gdouble vertical_lower;
|
||||
gdouble vertical_upper;
|
||||
gdouble vertical_max_size;
|
||||
gint scaled_viewport_offset_x;
|
||||
gint scaled_viewport_offset_y;
|
||||
|
||||
if (! shell->display)
|
||||
return;
|
||||
@@ -211,24 +215,22 @@ gimp_display_shell_scale_update_rulers (GimpDisplayShell *shell)
|
||||
|
||||
/* Adjust due to scrolling */
|
||||
|
||||
gimp_display_shell_scroll_get_scaled_viewport_offset (shell,
|
||||
&scaled_viewport_offset_x,
|
||||
&scaled_viewport_offset_y);
|
||||
|
||||
horizontal_lower -= img2real (shell, TRUE,
|
||||
FUNSCALEX (shell,
|
||||
(gdouble) scaled_viewport_offset_x));
|
||||
horizontal_upper -= img2real (shell, TRUE,
|
||||
FUNSCALEX (shell,
|
||||
(gdouble) scaled_viewport_offset_x));
|
||||
|
||||
vertical_lower -= img2real (shell, FALSE,
|
||||
FUNSCALEY (shell,
|
||||
(gdouble) scaled_viewport_offset_y));
|
||||
vertical_upper -= img2real (shell, FALSE,
|
||||
FUNSCALEY (shell,
|
||||
(gdouble) scaled_viewport_offset_y));
|
||||
if (image)
|
||||
{
|
||||
horizontal_lower += img2real (shell, TRUE,
|
||||
FUNSCALEX (shell,
|
||||
(gdouble) shell->offset_x));
|
||||
horizontal_upper += img2real (shell, TRUE,
|
||||
FUNSCALEX (shell,
|
||||
(gdouble) shell->offset_x));
|
||||
|
||||
vertical_lower += img2real (shell, FALSE,
|
||||
FUNSCALEY (shell,
|
||||
(gdouble) shell->offset_y));
|
||||
vertical_upper += img2real (shell, FALSE,
|
||||
FUNSCALEY (shell,
|
||||
(gdouble) shell->offset_y));
|
||||
}
|
||||
|
||||
/* Finally setup the actual rulers */
|
||||
|
||||
@@ -367,14 +369,20 @@ gimp_display_shell_scale (GimpDisplayShell *shell,
|
||||
* get things rolling
|
||||
*/
|
||||
gimp_zoom_model_zoom (shell->zoom, GIMP_ZOOM_TO, real_new_scale);
|
||||
gimp_display_shell_scaled (shell);
|
||||
|
||||
gimp_display_shell_shrink_wrap (shell, FALSE);
|
||||
}
|
||||
else
|
||||
{
|
||||
gboolean starts_fitting_horizontally;
|
||||
gboolean starts_fitting_vertically;
|
||||
gboolean almost_centered_horizontally;
|
||||
gboolean almost_centered_vertically;
|
||||
gboolean starts_fitting_horiz;
|
||||
gboolean starts_fitting_vert;
|
||||
gboolean zoom_focus_almost_centered_horiz;
|
||||
gboolean zoom_focus_almost_centered_vert;
|
||||
gboolean image_center_almost_centered_horiz;
|
||||
gboolean image_center_almost_centered_vert;
|
||||
gint image_center_x;
|
||||
gint image_center_y;
|
||||
|
||||
gimp_display_shell_scale_get_zoom_focus (shell,
|
||||
real_new_scale,
|
||||
@@ -382,6 +390,9 @@ gimp_display_shell_scale (GimpDisplayShell *shell,
|
||||
&x,
|
||||
&y,
|
||||
zoom_focus);
|
||||
gimp_display_shell_scale_get_image_center_viewport (shell,
|
||||
&image_center_x,
|
||||
&image_center_y);
|
||||
|
||||
gimp_display_shell_scale_to (shell, real_new_scale, x, y);
|
||||
|
||||
@@ -393,18 +404,27 @@ gimp_display_shell_scale (GimpDisplayShell *shell,
|
||||
gimp_display_shell_scale_image_starts_to_fit (shell,
|
||||
real_new_scale,
|
||||
current_scale,
|
||||
&starts_fitting_horizontally,
|
||||
&starts_fitting_vertically);
|
||||
&starts_fitting_horiz,
|
||||
&starts_fitting_vert);
|
||||
|
||||
gimp_display_shell_scale_viewport_coord_almost_centered (shell,
|
||||
x,
|
||||
y,
|
||||
&almost_centered_horizontally,
|
||||
&almost_centered_vertically);
|
||||
&zoom_focus_almost_centered_horiz,
|
||||
&zoom_focus_almost_centered_vert);
|
||||
gimp_display_shell_scale_viewport_coord_almost_centered (shell,
|
||||
image_center_x,
|
||||
image_center_y,
|
||||
&image_center_almost_centered_horiz,
|
||||
&image_center_almost_centered_vert);
|
||||
|
||||
gimp_display_shell_scroll_center_image (shell,
|
||||
starts_fitting_horizontally ||
|
||||
almost_centered_horizontally,
|
||||
starts_fitting_vertically ||
|
||||
almost_centered_vertically);
|
||||
starts_fitting_horiz ||
|
||||
(zoom_focus_almost_centered_horiz &&
|
||||
image_center_almost_centered_horiz),
|
||||
starts_fitting_vert ||
|
||||
(zoom_focus_almost_centered_vert &&
|
||||
image_center_almost_centered_vert));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -448,7 +468,7 @@ gimp_display_shell_scale_fit_in (GimpDisplayShell *shell)
|
||||
GIMP_ZOOM_TO,
|
||||
zoom_factor,
|
||||
GIMP_ZOOM_FOCUS_BEST_GUESS);
|
||||
|
||||
|
||||
gimp_display_shell_scroll_center_image (shell, TRUE, TRUE);
|
||||
}
|
||||
|
||||
@@ -865,21 +885,43 @@ gimp_display_shell_scale_image_stops_to_fit (GimpDisplayShell *shell,
|
||||
* @vertically:
|
||||
*
|
||||
**/
|
||||
static void
|
||||
static gboolean
|
||||
gimp_display_shell_scale_viewport_coord_almost_centered (GimpDisplayShell *shell,
|
||||
gint x,
|
||||
gint y,
|
||||
gboolean *horizontally,
|
||||
gboolean *vertically)
|
||||
{
|
||||
gint center_x = shell->disp_width / 2;
|
||||
gint center_y = shell->disp_height / 2;
|
||||
gboolean local_horizontally;
|
||||
gboolean local_vertically;
|
||||
gint center_x = shell->disp_width / 2;
|
||||
gint center_y = shell->disp_height / 2;
|
||||
|
||||
*horizontally = x > center_x - ALMOST_CENTERED_THRESHOLD &&
|
||||
x < center_x + ALMOST_CENTERED_THRESHOLD;
|
||||
local_horizontally = (x > center_x - ALMOST_CENTERED_THRESHOLD &&
|
||||
x < center_x + ALMOST_CENTERED_THRESHOLD);
|
||||
|
||||
*vertically = y > center_y - ALMOST_CENTERED_THRESHOLD &&
|
||||
y < center_y + ALMOST_CENTERED_THRESHOLD;
|
||||
local_vertically = (y > center_y - ALMOST_CENTERED_THRESHOLD &&
|
||||
y < center_y + ALMOST_CENTERED_THRESHOLD);
|
||||
|
||||
if (horizontally) *horizontally = local_horizontally;
|
||||
if (vertically) *vertically = local_vertically;
|
||||
|
||||
return local_horizontally && local_vertically;
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_display_shell_scale_get_image_center_viewport (GimpDisplayShell *shell,
|
||||
gint *image_center_x,
|
||||
gint *image_center_y)
|
||||
{
|
||||
gint sw, sh;
|
||||
|
||||
gimp_display_shell_draw_get_scaled_image_size (shell,
|
||||
&sw,
|
||||
&sh);
|
||||
|
||||
if (image_center_x) *image_center_x = -shell->offset_x + sw / 2;
|
||||
if (image_center_y) *image_center_y = -shell->offset_y + sh / 2;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -900,19 +942,14 @@ gimp_display_shell_scale_get_zoom_focus (GimpDisplayShell *shell,
|
||||
gint *y,
|
||||
GimpZoomFocus zoom_focus)
|
||||
{
|
||||
gint image_center_x, image_center_y;
|
||||
gint other_x, other_y;
|
||||
GimpZoomFocus real_zoom_focus = zoom_focus;
|
||||
gint image_center_x, image_center_y;
|
||||
gint other_x, other_y;
|
||||
|
||||
/* Calculate stops-to-fit focus point */
|
||||
{
|
||||
gint sw, sh;
|
||||
|
||||
gimp_display_shell_draw_get_scaled_image_size (shell,
|
||||
&sw,
|
||||
&sh);
|
||||
image_center_x = -shell->offset_x + sw / 2;
|
||||
image_center_y = -shell->offset_y + sh / 2;
|
||||
}
|
||||
gimp_display_shell_scale_get_image_center_viewport (shell,
|
||||
&image_center_x,
|
||||
&image_center_y);
|
||||
|
||||
/* Calculate other focus point */
|
||||
{
|
||||
@@ -964,7 +1001,25 @@ gimp_display_shell_scale_get_zoom_focus (GimpDisplayShell *shell,
|
||||
}
|
||||
|
||||
/* Decide which one to use for each axis */
|
||||
switch (zoom_focus)
|
||||
if (zoom_focus == GIMP_ZOOM_FOCUS_RETAIN_CENTERING_ELSE_BEST_GUESS)
|
||||
{
|
||||
gboolean centered;
|
||||
|
||||
centered = gimp_display_shell_scale_viewport_coord_almost_centered (shell,
|
||||
image_center_x,
|
||||
image_center_y,
|
||||
NULL,
|
||||
NULL);
|
||||
real_zoom_focus = (centered ?
|
||||
GIMP_ZOOM_FOCUS_IMAGE_CENTER :
|
||||
GIMP_ZOOM_FOCUS_BEST_GUESS);
|
||||
}
|
||||
else
|
||||
{
|
||||
real_zoom_focus = zoom_focus;
|
||||
}
|
||||
|
||||
switch (real_zoom_focus)
|
||||
{
|
||||
case GIMP_ZOOM_FOCUS_POINTER:
|
||||
*x = other_x;
|
||||
|
@@ -432,18 +432,12 @@ gimp_display_shell_scroll_get_scaled_viewport (const GimpDisplayShell *shell,
|
||||
gint *w,
|
||||
gint *h)
|
||||
{
|
||||
gint scaled_viewport_offset_x;
|
||||
gint scaled_viewport_offset_y;
|
||||
|
||||
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
|
||||
|
||||
gimp_display_shell_scroll_get_scaled_viewport_offset (shell,
|
||||
&scaled_viewport_offset_x,
|
||||
&scaled_viewport_offset_y);
|
||||
if (x) *x = -scaled_viewport_offset_x;
|
||||
if (y) *y = -scaled_viewport_offset_y;
|
||||
if (w) *w = shell->disp_width;
|
||||
if (h) *h = shell->disp_height;
|
||||
*x = shell->offset_x;
|
||||
*y = shell->offset_y;
|
||||
*w = shell->disp_width;
|
||||
*h = shell->disp_height;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -466,30 +460,10 @@ gimp_display_shell_scroll_get_viewport (const GimpDisplayShell *shell,
|
||||
{
|
||||
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
|
||||
|
||||
if (x) *x = shell->offset_x / shell->scale_x;
|
||||
if (y) *y = shell->offset_y / shell->scale_y;
|
||||
if (w) *w = shell->disp_width / shell->scale_x;
|
||||
if (h) *h = shell->disp_height / shell->scale_y;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_display_shell_scroll_get_scaled_viewport_offset:
|
||||
* @shell:
|
||||
* @x:
|
||||
* @y:
|
||||
*
|
||||
* Gets the scaled image offset in viewport coordinates
|
||||
*
|
||||
**/
|
||||
void
|
||||
gimp_display_shell_scroll_get_scaled_viewport_offset (const GimpDisplayShell *shell,
|
||||
gint *x,
|
||||
gint *y)
|
||||
{
|
||||
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
|
||||
|
||||
if (x) *x = -shell->offset_x;
|
||||
if (y) *y = -shell->offset_y;
|
||||
*x = shell->offset_x / shell->scale_x;
|
||||
*y = shell->offset_y / shell->scale_y;
|
||||
*w = shell->disp_width / shell->scale_x;
|
||||
*h = shell->disp_height / shell->scale_y;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -551,8 +525,8 @@ gimp_display_shell_scroll_get_render_start_offset (const GimpDisplayShell *shell
|
||||
{
|
||||
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
|
||||
|
||||
if (offset_x) *offset_x = MAX (0, shell->offset_x);
|
||||
if (offset_y) *offset_y = MAX (0, shell->offset_y);
|
||||
*offset_x = MAX (0, shell->offset_x);
|
||||
*offset_y = MAX (0, shell->offset_y);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -53,9 +53,6 @@ void gimp_display_shell_scroll_get_viewport (const GimpDisplaySh
|
||||
gdouble *y,
|
||||
gdouble *w,
|
||||
gdouble *h);
|
||||
void gimp_display_shell_scroll_get_scaled_viewport_offset (const GimpDisplayShell *shell,
|
||||
gint *x,
|
||||
gint *y);
|
||||
void gimp_display_shell_scroll_get_disp_offset (const GimpDisplayShell *shell,
|
||||
gint *disp_xoffset,
|
||||
gint *disp_yoffset);
|
||||
|
@@ -331,10 +331,20 @@ gimp_display_shell_format_title (GimpDisplayShell *shell,
|
||||
GimpDrawable *drawable = gimp_image_get_active_drawable (image);
|
||||
|
||||
if (drawable)
|
||||
i += print (title, title_len, i, "%s",
|
||||
gimp_object_get_name (GIMP_OBJECT (drawable)));
|
||||
{
|
||||
gchar *desc;
|
||||
|
||||
desc = gimp_viewable_get_description (GIMP_VIEWABLE (drawable),
|
||||
NULL);
|
||||
|
||||
i += print (title, title_len, i, "%s", desc);
|
||||
|
||||
g_free (desc);
|
||||
}
|
||||
else
|
||||
i += print (title, title_len, i, "%s", _("(none)"));
|
||||
{
|
||||
i += print (title, title_len, i, "%s", _("(none)"));
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
|
@@ -49,9 +49,6 @@ gimp_display_shell_transform_coordinate (const GimpDisplayShell *shell,
|
||||
GimpCoords *image_coords,
|
||||
GimpCoords *display_coords)
|
||||
{
|
||||
gint scaled_viewport_offset_x;
|
||||
gint scaled_viewport_offset_y;
|
||||
|
||||
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
|
||||
g_return_if_fail (image_coords != NULL);
|
||||
g_return_if_fail (display_coords != NULL);
|
||||
@@ -61,12 +58,8 @@ gimp_display_shell_transform_coordinate (const GimpDisplayShell *shell,
|
||||
display_coords->x = SCALEX (shell, image_coords->x);
|
||||
display_coords->y = SCALEY (shell, image_coords->y);
|
||||
|
||||
gimp_display_shell_scroll_get_scaled_viewport_offset (shell,
|
||||
&scaled_viewport_offset_x,
|
||||
&scaled_viewport_offset_y);
|
||||
|
||||
display_coords->x += scaled_viewport_offset_x;
|
||||
display_coords->y += scaled_viewport_offset_y;
|
||||
display_coords->x -= shell->offset_x;
|
||||
display_coords->y -= shell->offset_y;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -83,21 +76,14 @@ gimp_display_shell_untransform_coordinate (const GimpDisplayShell *shell,
|
||||
GimpCoords *display_coords,
|
||||
GimpCoords *image_coords)
|
||||
{
|
||||
gint scaled_viewport_offset_x;
|
||||
gint scaled_viewport_offset_y;
|
||||
|
||||
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
|
||||
g_return_if_fail (display_coords != NULL);
|
||||
g_return_if_fail (image_coords != NULL);
|
||||
|
||||
*image_coords = *display_coords;
|
||||
|
||||
gimp_display_shell_scroll_get_scaled_viewport_offset (shell,
|
||||
&scaled_viewport_offset_x,
|
||||
&scaled_viewport_offset_y);
|
||||
|
||||
image_coords->x = display_coords->x - scaled_viewport_offset_x;
|
||||
image_coords->y = display_coords->y - scaled_viewport_offset_y;
|
||||
image_coords->x = display_coords->x + shell->offset_x;
|
||||
image_coords->y = display_coords->y + shell->offset_y;
|
||||
|
||||
image_coords->x /= shell->scale_x;
|
||||
image_coords->y /= shell->scale_y;
|
||||
@@ -111,8 +97,6 @@ gimp_display_shell_transform_xy (const GimpDisplayShell *shell,
|
||||
gint *ny,
|
||||
gboolean use_offsets)
|
||||
{
|
||||
gint scaled_viewport_offset_x;
|
||||
gint scaled_viewport_offset_y;
|
||||
gint offset_x = 0;
|
||||
gint offset_y = 0;
|
||||
gint64 tx;
|
||||
@@ -136,11 +120,8 @@ gimp_display_shell_transform_xy (const GimpDisplayShell *shell,
|
||||
tx = ((gint64) x * shell->x_src_dec) / shell->x_dest_inc;
|
||||
ty = ((gint64) y * shell->y_src_dec) / shell->y_dest_inc;
|
||||
|
||||
gimp_display_shell_scroll_get_scaled_viewport_offset (shell,
|
||||
&scaled_viewport_offset_x,
|
||||
&scaled_viewport_offset_y);
|
||||
tx += scaled_viewport_offset_x;
|
||||
ty += scaled_viewport_offset_y;
|
||||
tx -= shell->offset_x;
|
||||
ty -= shell->offset_y;
|
||||
|
||||
/* The projected coordinates might overflow a gint in the case of big
|
||||
images at high zoom levels, so we clamp them here to avoid problems. */
|
||||
@@ -173,8 +154,6 @@ gimp_display_shell_untransform_xy (const GimpDisplayShell *shell,
|
||||
gboolean round,
|
||||
gboolean use_offsets)
|
||||
{
|
||||
gint scaled_viewport_offset_x;
|
||||
gint scaled_viewport_offset_y;
|
||||
gint offset_x = 0;
|
||||
gint offset_y = 0;
|
||||
gint64 tx;
|
||||
@@ -192,11 +171,8 @@ gimp_display_shell_untransform_xy (const GimpDisplayShell *shell,
|
||||
gimp_item_offsets (item, &offset_x, &offset_y);
|
||||
}
|
||||
|
||||
gimp_display_shell_scroll_get_scaled_viewport_offset (shell,
|
||||
&scaled_viewport_offset_x,
|
||||
&scaled_viewport_offset_y);
|
||||
tx = (gint64) x - scaled_viewport_offset_x;
|
||||
ty = (gint64) y - scaled_viewport_offset_y;
|
||||
tx = (gint64) x + shell->offset_x;
|
||||
ty = (gint64) y + shell->offset_y;
|
||||
|
||||
tx *= shell->x_dest_inc;
|
||||
ty *= shell->y_dest_inc;
|
||||
@@ -232,8 +208,6 @@ gimp_display_shell_transform_xy_f (const GimpDisplayShell *shell,
|
||||
gdouble *ny,
|
||||
gboolean use_offsets)
|
||||
{
|
||||
gint scaled_viewport_offset_x;
|
||||
gint scaled_viewport_offset_y;
|
||||
gint offset_x = 0;
|
||||
gint offset_y = 0;
|
||||
|
||||
@@ -249,12 +223,8 @@ gimp_display_shell_transform_xy_f (const GimpDisplayShell *shell,
|
||||
gimp_item_offsets (item, &offset_x, &offset_y);
|
||||
}
|
||||
|
||||
gimp_display_shell_scroll_get_scaled_viewport_offset (shell,
|
||||
&scaled_viewport_offset_x,
|
||||
&scaled_viewport_offset_y);
|
||||
|
||||
*nx = SCALEX (shell, x + offset_x) + scaled_viewport_offset_x;
|
||||
*ny = SCALEY (shell, y + offset_y) + scaled_viewport_offset_y;
|
||||
*nx = SCALEX (shell, x + offset_x) - shell->offset_x;
|
||||
*ny = SCALEY (shell, y + offset_y) - shell->offset_y;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -279,8 +249,6 @@ gimp_display_shell_untransform_xy_f (const GimpDisplayShell *shell,
|
||||
gdouble *ny,
|
||||
gboolean use_offsets)
|
||||
{
|
||||
gint scaled_viewport_offset_x;
|
||||
gint scaled_viewport_offset_y;
|
||||
gint offset_x = 0;
|
||||
gint offset_y = 0;
|
||||
|
||||
@@ -296,12 +264,8 @@ gimp_display_shell_untransform_xy_f (const GimpDisplayShell *shell,
|
||||
gimp_item_offsets (item, &offset_x, &offset_y);
|
||||
}
|
||||
|
||||
gimp_display_shell_scroll_get_scaled_viewport_offset (shell,
|
||||
&scaled_viewport_offset_x,
|
||||
&scaled_viewport_offset_y);
|
||||
|
||||
*nx = (x - scaled_viewport_offset_x) / shell->scale_x - offset_x;
|
||||
*ny = (y - scaled_viewport_offset_y) / shell->scale_y - offset_y;
|
||||
*nx = (x + shell->offset_x) / shell->scale_x - offset_x;
|
||||
*ny = (y + shell->offset_y) / shell->scale_y - offset_y;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -339,21 +303,15 @@ gimp_display_shell_transform_points (const GimpDisplayShell *shell,
|
||||
|
||||
for (i = 0; i < n_points ; i++)
|
||||
{
|
||||
gint scaled_viewport_offset_x;
|
||||
gint scaled_viewport_offset_y;
|
||||
gdouble x = points[i].x + offset_x;
|
||||
gdouble y = points[i].y + offset_y;
|
||||
|
||||
x = x * shell->x_src_dec / shell->x_dest_inc;
|
||||
y = y * shell->y_src_dec / shell->y_dest_inc;
|
||||
|
||||
gimp_display_shell_scroll_get_scaled_viewport_offset (shell,
|
||||
&scaled_viewport_offset_x,
|
||||
&scaled_viewport_offset_y);
|
||||
|
||||
coords[i].x = CLAMP (PROJ_ROUND64 (x) + scaled_viewport_offset_x,
|
||||
coords[i].x = CLAMP (PROJ_ROUND64 (x) - shell->offset_x,
|
||||
G_MININT, G_MAXINT);
|
||||
coords[i].y = CLAMP (PROJ_ROUND64 (y) + scaled_viewport_offset_y,
|
||||
coords[i].y = CLAMP (PROJ_ROUND64 (y) - shell->offset_y,
|
||||
G_MININT, G_MAXINT);
|
||||
}
|
||||
}
|
||||
@@ -393,21 +351,15 @@ gimp_display_shell_transform_coords (const GimpDisplayShell *shell,
|
||||
|
||||
for (i = 0; i < n_coords ; i++)
|
||||
{
|
||||
gint scaled_viewport_offset_x;
|
||||
gint scaled_viewport_offset_y;
|
||||
gdouble x = image_coords[i].x + offset_x;
|
||||
gdouble y = image_coords[i].y + offset_y;
|
||||
|
||||
x = x * shell->x_src_dec / shell->x_dest_inc;
|
||||
y = y * shell->y_src_dec / shell->y_dest_inc;
|
||||
|
||||
gimp_display_shell_scroll_get_scaled_viewport_offset (shell,
|
||||
&scaled_viewport_offset_x,
|
||||
&scaled_viewport_offset_y);
|
||||
|
||||
disp_coords[i].x = CLAMP (PROJ_ROUND64 (x) + scaled_viewport_offset_x,
|
||||
disp_coords[i].x = CLAMP (PROJ_ROUND64 (x) - shell->offset_x,
|
||||
G_MININT, G_MAXINT);
|
||||
disp_coords[i].y = CLAMP (PROJ_ROUND64 (y) + scaled_viewport_offset_y,
|
||||
disp_coords[i].y = CLAMP (PROJ_ROUND64 (y) - shell->offset_y,
|
||||
G_MININT, G_MAXINT);
|
||||
}
|
||||
}
|
||||
@@ -447,8 +399,6 @@ gimp_display_shell_transform_segments (const GimpDisplayShell *shell,
|
||||
|
||||
for (i = 0; i < n_segs ; i++)
|
||||
{
|
||||
gint scaled_viewport_offset_x;
|
||||
gint scaled_viewport_offset_y;
|
||||
gint64 x1, x2;
|
||||
gint64 y1, y2;
|
||||
|
||||
@@ -462,18 +412,10 @@ gimp_display_shell_transform_segments (const GimpDisplayShell *shell,
|
||||
y1 = (y1 * shell->y_src_dec) / shell->y_dest_inc;
|
||||
y2 = (y2 * shell->y_src_dec) / shell->y_dest_inc;
|
||||
|
||||
gimp_display_shell_scroll_get_scaled_viewport_offset (shell,
|
||||
&scaled_viewport_offset_x,
|
||||
&scaled_viewport_offset_y);
|
||||
|
||||
dest_segs[i].x1 = CLAMP (x1 + scaled_viewport_offset_x,
|
||||
G_MININT, G_MAXINT);
|
||||
dest_segs[i].x2 = CLAMP (x2 + scaled_viewport_offset_x,
|
||||
G_MININT, G_MAXINT);
|
||||
dest_segs[i].y1 = CLAMP (y1 + scaled_viewport_offset_y,
|
||||
G_MININT, G_MAXINT);
|
||||
dest_segs[i].y2 = CLAMP (y2 + scaled_viewport_offset_y,
|
||||
G_MININT, G_MAXINT);
|
||||
dest_segs[i].x1 = CLAMP (x1 - shell->offset_x, G_MININT, G_MAXINT);
|
||||
dest_segs[i].x2 = CLAMP (x2 - shell->offset_x, G_MININT, G_MAXINT);
|
||||
dest_segs[i].y1 = CLAMP (y1 - shell->offset_y, G_MININT, G_MAXINT);
|
||||
dest_segs[i].y2 = CLAMP (y2 - shell->offset_y, G_MININT, G_MAXINT);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -674,6 +674,7 @@ gimp_display_shell_style_set (GtkWidget *widget,
|
||||
GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (widget);
|
||||
GtkRequisition requisition;
|
||||
GdkGeometry geometry;
|
||||
GdkWindowHints geometry_mask;
|
||||
|
||||
GTK_WIDGET_CLASS (parent_class)->style_set (widget, prev_style);
|
||||
|
||||
@@ -691,9 +692,17 @@ gimp_display_shell_style_set (GtkWidget *widget,
|
||||
geometry.min_height += requisition.height;
|
||||
}
|
||||
|
||||
geometry_mask = GDK_HINT_MIN_SIZE;
|
||||
|
||||
/* Only set user pos on the empty display because it gets a pos
|
||||
* set by gimp. All other displays should be placed by the window
|
||||
* manager. See http://bugzilla.gnome.org/show_bug.cgi?id=559580
|
||||
*/
|
||||
if (! shell->display->image)
|
||||
geometry_mask |= GDK_HINT_USER_POS;
|
||||
|
||||
gtk_window_set_geometry_hints (GTK_WINDOW (widget), NULL,
|
||||
&geometry,
|
||||
GDK_HINT_MIN_SIZE | GDK_HINT_USER_POS);
|
||||
&geometry, geometry_mask);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1450,6 +1459,12 @@ gimp_display_shell_scale_changed (GimpDisplayShell *shell)
|
||||
shell->y_dest_inc = gimp_image_get_height (image);
|
||||
shell->x_src_dec = SCALEX (shell, gimp_image_get_width (image));
|
||||
shell->y_src_dec = SCALEY (shell, gimp_image_get_height (image));
|
||||
|
||||
if (shell->x_src_dec < 1)
|
||||
shell->x_src_dec = 1;
|
||||
|
||||
if (shell->y_src_dec < 1)
|
||||
shell->y_src_dec = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1851,8 +1866,25 @@ gimp_display_shell_shrink_wrap (GimpDisplayShell *shell,
|
||||
disp_width = shell->disp_width;
|
||||
disp_height = shell->disp_height;
|
||||
|
||||
border_x = widget->allocation.width - disp_width;
|
||||
border_y = widget->allocation.height - disp_height;
|
||||
|
||||
/* As long as the disp_width/disp_heightheight is larger than 1 we
|
||||
* can reliably depend on it to calculate the
|
||||
* border_width/border_height because that means there is enough
|
||||
* room in the top-level for the canvas as well as the rulers and
|
||||
* scrollbars. If it is 1 or smaller it is likely that the rulers
|
||||
* and scrollbars are overlapping each other and thus we cannot use
|
||||
* the normal approach to border size, so special case that.
|
||||
*/
|
||||
if (disp_width > 1 || !shell->vsb)
|
||||
border_x = widget->allocation.width - disp_width;
|
||||
else
|
||||
border_x = widget->allocation.width - disp_width + shell->vsb->allocation.width;
|
||||
|
||||
if (disp_height > 1 || !shell->hsb)
|
||||
border_y = widget->allocation.height - disp_height;
|
||||
else
|
||||
border_y = widget->allocation.height - disp_height + shell->hsb->allocation.height;
|
||||
|
||||
|
||||
max_auto_width = (rect.width - border_x) * 0.75;
|
||||
max_auto_height = (rect.height - border_y) * 0.75;
|
||||
|
@@ -817,8 +817,8 @@ gimp_statusbar_push_coords (GimpStatusbar *statusbar,
|
||||
switch (precision)
|
||||
{
|
||||
case GIMP_CURSOR_PRECISION_PIXEL_CENTER:
|
||||
x = RINT (x + 0.5);
|
||||
y = RINT (y + 0.5);
|
||||
x = (gint) x;
|
||||
y = (gint) y;
|
||||
break;
|
||||
|
||||
case GIMP_CURSOR_PRECISION_PIXEL_BORDER:
|
||||
@@ -1192,8 +1192,8 @@ gimp_statusbar_update_cursor (GimpStatusbar *statusbar,
|
||||
switch (precision)
|
||||
{
|
||||
case GIMP_CURSOR_PRECISION_PIXEL_CENTER:
|
||||
x = RINT (x + 0.5);
|
||||
y = RINT (y + 0.5);
|
||||
x = (gint) x;
|
||||
y = (gint) y;
|
||||
break;
|
||||
|
||||
case GIMP_CURSOR_PRECISION_PIXEL_BORDER:
|
||||
|
@@ -366,6 +366,9 @@ file_open_with_proc_and_display (Gimp *gimp,
|
||||
|
||||
/* the display owns the image now */
|
||||
g_object_unref (image);
|
||||
|
||||
/* announce that we opened this image */
|
||||
gimp_image_opened (image->gimp, uri);
|
||||
}
|
||||
|
||||
return image;
|
||||
|
@@ -138,7 +138,7 @@ file_procedure_find (GSList *procs,
|
||||
g_set_error (error,
|
||||
G_FILE_ERROR,
|
||||
g_file_error_from_errno (errno),
|
||||
g_strerror (errno));
|
||||
"%s", g_strerror (errno));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -173,7 +173,7 @@ file_procedure_find (GSList *procs,
|
||||
g_set_error (error,
|
||||
G_FILE_ERROR,
|
||||
g_file_error_from_errno (errno),
|
||||
g_strerror (errno));
|
||||
"%s", g_strerror (errno));
|
||||
|
||||
fclose (ifp);
|
||||
}
|
||||
|
@@ -108,7 +108,7 @@ file_save (GimpImage *image,
|
||||
if (! g_file_test (filename, G_FILE_TEST_IS_REGULAR))
|
||||
{
|
||||
g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
|
||||
_("Not a regular file"));
|
||||
"%s", _("Not a regular file"));
|
||||
status = GIMP_PDB_EXECUTION_ERROR;
|
||||
goto out;
|
||||
}
|
||||
@@ -116,7 +116,7 @@ file_save (GimpImage *image,
|
||||
if (g_access (filename, W_OK) != 0)
|
||||
{
|
||||
g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_ACCES,
|
||||
g_strerror (errno));
|
||||
"%s", g_strerror (errno));
|
||||
status = GIMP_PDB_EXECUTION_ERROR;
|
||||
goto out;
|
||||
}
|
||||
|
@@ -15,7 +15,7 @@ INCLUDES = \
|
||||
noinst_LIBRARIES = libappgegl.a
|
||||
|
||||
libappgegl_a_SOURCES = \
|
||||
gegl-types.h \
|
||||
gimp-gegl-types.h \
|
||||
gimp-gegl.c \
|
||||
gimp-gegl.h \
|
||||
gimp-gegl-utils.c \
|
||||
|
@@ -18,8 +18,8 @@
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __GEGL_TYPES_H__
|
||||
#define __GEGL_TYPES_H__
|
||||
#ifndef __GIMP_GEGL_TYPES_H__
|
||||
#define __GIMP_GEGL_TYPES_H__
|
||||
|
||||
|
||||
#include "core/core-types.h"
|
||||
@@ -53,4 +53,4 @@ typedef struct _GimpPosterizeConfig GimpPosterizeConfig;
|
||||
typedef struct _GimpThresholdConfig GimpThresholdConfig;
|
||||
|
||||
|
||||
#endif /* __GEGL_TYPES_H__ */
|
||||
#endif /* __GIMP_GEGL_TYPES_H__ */
|
@@ -23,7 +23,7 @@
|
||||
|
||||
#include <gegl.h>
|
||||
|
||||
#include "gegl-types.h"
|
||||
#include "gimp-gegl-types.h"
|
||||
|
||||
#include "gimp-gegl-utils.h"
|
||||
|
||||
@@ -85,3 +85,27 @@ gimp_bpp_to_babl_format_linear (guint bpp)
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_gegl_check_version:
|
||||
* @required_major: the required major version.
|
||||
* @required_minor: the required minor version.
|
||||
* @required_micro: the required micro version.
|
||||
*
|
||||
* Return value: %TRUE if the GEGL library in use is the given
|
||||
* version or newer, %FALSE otherwise
|
||||
*/
|
||||
gboolean
|
||||
gimp_gegl_check_version (guint required_major,
|
||||
guint required_minor,
|
||||
guint required_micro)
|
||||
{
|
||||
gint major, minor, micro;
|
||||
|
||||
if (required_major != GEGL_MAJOR_VERSION)
|
||||
return FALSE; /* major mismatch */
|
||||
|
||||
gegl_get_version (&major, &minor, µ);
|
||||
|
||||
return (100 * minor + micro >= 100 * required_minor + required_micro);
|
||||
}
|
||||
|
@@ -26,6 +26,9 @@
|
||||
const Babl * gimp_bpp_to_babl_format (guint bpp) G_GNUC_CONST;
|
||||
const Babl * gimp_bpp_to_babl_format_linear (guint bpp) G_GNUC_CONST;
|
||||
|
||||
gboolean gimp_gegl_check_version (guint required_major,
|
||||
guint required_minor,
|
||||
guint required_micro);
|
||||
|
||||
|
||||
#endif /* __GIMP_GEGL_UTILS_H__ */
|
||||
|
@@ -23,7 +23,7 @@
|
||||
|
||||
#include <gegl.h>
|
||||
|
||||
#include "gegl-types.h"
|
||||
#include "gimp-gegl-types.h"
|
||||
|
||||
#include "base/tile.h"
|
||||
|
||||
|
@@ -26,7 +26,7 @@
|
||||
#include "libgimpmath/gimpmath.h"
|
||||
#include "libgimpconfig/gimpconfig.h"
|
||||
|
||||
#include "gegl-types.h"
|
||||
#include "gimp-gegl-types.h"
|
||||
|
||||
#include "gimpbrightnesscontrastconfig.h"
|
||||
#include "gimplevelsconfig.h"
|
||||
|
@@ -27,7 +27,7 @@
|
||||
#include "libgimpmath/gimpmath.h"
|
||||
#include "libgimpconfig/gimpconfig.h"
|
||||
|
||||
#include "gegl-types.h"
|
||||
#include "gimp-gegl-types.h"
|
||||
|
||||
/* temp cruft */
|
||||
#include "base/color-balance.h"
|
||||
|
@@ -25,7 +25,7 @@
|
||||
|
||||
#include "libgimpconfig/gimpconfig.h"
|
||||
|
||||
#include "gegl-types.h"
|
||||
#include "gimp-gegl-types.h"
|
||||
|
||||
/* temp cruft */
|
||||
#include "base/colorize.h"
|
||||
|
@@ -30,7 +30,7 @@
|
||||
#include "libgimpmath/gimpmath.h"
|
||||
#include "libgimpconfig/gimpconfig.h"
|
||||
|
||||
#include "gegl-types.h"
|
||||
#include "gimp-gegl-types.h"
|
||||
|
||||
#include "base/gimphistogram.h"
|
||||
|
||||
@@ -411,10 +411,12 @@ gimp_curves_config_load_cruft (GimpCurvesConfig *config,
|
||||
|
||||
gimp_curve_set_curve_type (curve, GIMP_CURVE_SMOOTH);
|
||||
|
||||
gimp_curve_reset (curve, FALSE);
|
||||
|
||||
for (j = 0; j < GIMP_CURVE_N_CRUFT_POINTS; j++)
|
||||
{
|
||||
if (index[i][j] < 0 || value[i][j] < 0)
|
||||
gimp_curve_set_point (curve, j, -1, -1);
|
||||
gimp_curve_set_point (curve, j, -1.0, -1.0);
|
||||
else
|
||||
gimp_curve_set_point (curve, j,
|
||||
(gdouble) index[i][j] / 255.0,
|
||||
@@ -476,9 +478,11 @@ gimp_curves_config_save_cruft (GimpCurvesConfig *config,
|
||||
|
||||
for (j = 0; j < curve->n_points; j++)
|
||||
{
|
||||
gdouble x, y;
|
||||
|
||||
gimp_curve_get_point (curve, j, &x, &y);
|
||||
/* don't use gimp_curve_get_point() becaue that doesn't
|
||||
* work when the curve type is GIMP_CURVE_FREE
|
||||
*/
|
||||
gdouble x = curve->points[j].x;
|
||||
gdouble y = curve->points[j].y;
|
||||
|
||||
if (x < 0.0 || y < 0.0)
|
||||
{
|
||||
|
@@ -25,7 +25,7 @@
|
||||
|
||||
#include "libgimpconfig/gimpconfig.h"
|
||||
|
||||
#include "gegl-types.h"
|
||||
#include "gimp-gegl-types.h"
|
||||
|
||||
#include "gimpdesaturateconfig.h"
|
||||
|
||||
|
@@ -25,7 +25,7 @@
|
||||
|
||||
#include "libgimpconfig/gimpconfig.h"
|
||||
|
||||
#include "gegl-types.h"
|
||||
#include "gimp-gegl-types.h"
|
||||
|
||||
/* temp cruft */
|
||||
#include "base/hue-saturation.h"
|
||||
|
@@ -31,7 +31,7 @@
|
||||
#include "libgimpmath/gimpmath.h"
|
||||
#include "libgimpconfig/gimpconfig.h"
|
||||
|
||||
#include "gegl-types.h"
|
||||
#include "gimp-gegl-types.h"
|
||||
|
||||
#include "base/gimphistogram.h"
|
||||
|
||||
|
@@ -26,7 +26,7 @@
|
||||
#include "libgimpcolor/gimpcolor.h"
|
||||
#include "libgimpmath/gimpmath.h"
|
||||
|
||||
#include "gegl-types.h"
|
||||
#include "gimp-gegl-types.h"
|
||||
|
||||
#include "gimpcolorbalanceconfig.h"
|
||||
#include "gimpoperationcolorbalance.h"
|
||||
|
@@ -25,7 +25,7 @@
|
||||
|
||||
#include "libgimpcolor/gimpcolor.h"
|
||||
|
||||
#include "gegl-types.h"
|
||||
#include "gimp-gegl-types.h"
|
||||
|
||||
#include "gimpcolorizeconfig.h"
|
||||
#include "gimpoperationcolorize.h"
|
||||
|
@@ -26,7 +26,7 @@
|
||||
#include "libgimpcolor/gimpcolor.h"
|
||||
#include "libgimpmath/gimpmath.h"
|
||||
|
||||
#include "gegl-types.h"
|
||||
#include "gimp-gegl-types.h"
|
||||
|
||||
#include "core/gimpcurve.h"
|
||||
#include "core/gimpcurve-map.h"
|
||||
|
@@ -25,7 +25,7 @@
|
||||
|
||||
#include "libgimpcolor/gimpcolor.h"
|
||||
|
||||
#include "gegl-types.h"
|
||||
#include "gimp-gegl-types.h"
|
||||
|
||||
#include "gimpoperationdesaturate.h"
|
||||
#include "gimpdesaturateconfig.h"
|
||||
|
@@ -26,7 +26,7 @@
|
||||
#include "libgimpcolor/gimpcolor.h"
|
||||
#include "libgimpmath/gimpmath.h"
|
||||
|
||||
#include "gegl-types.h"
|
||||
#include "gimp-gegl-types.h"
|
||||
|
||||
#include "gimphuesaturationconfig.h"
|
||||
#include "gimpoperationhuesaturation.h"
|
||||
|
@@ -26,7 +26,7 @@
|
||||
#include "libgimpcolor/gimpcolor.h"
|
||||
#include "libgimpmath/gimpmath.h"
|
||||
|
||||
#include "gegl-types.h"
|
||||
#include "gimp-gegl-types.h"
|
||||
|
||||
#include "gimplevelsconfig.h"
|
||||
#include "gimpoperationlevels.h"
|
||||
|
@@ -23,7 +23,7 @@
|
||||
|
||||
#include <gegl.h>
|
||||
|
||||
#include "gegl-types.h"
|
||||
#include "gimp-gegl-types.h"
|
||||
|
||||
#include "gimpoperationpointfilter.h"
|
||||
|
||||
|
@@ -26,7 +26,7 @@
|
||||
#include "libgimpcolor/gimpcolor.h"
|
||||
#include "libgimpmath/gimpmath.h"
|
||||
|
||||
#include "gegl-types.h"
|
||||
#include "gimp-gegl-types.h"
|
||||
|
||||
#include "gimpoperationposterize.h"
|
||||
#include "gimpposterizeconfig.h"
|
||||
|
@@ -25,7 +25,7 @@
|
||||
|
||||
#include "libgimpcolor/gimpcolor.h"
|
||||
|
||||
#include "gegl-types.h"
|
||||
#include "gimp-gegl-types.h"
|
||||
|
||||
#include "gimpoperationthreshold.h"
|
||||
#include "gimpthresholdconfig.h"
|
||||
|
@@ -26,7 +26,7 @@
|
||||
#include <gegl.h>
|
||||
#include <gegl-buffer.h>
|
||||
|
||||
#include "gegl-types.h"
|
||||
#include "gimp-gegl-types.h"
|
||||
|
||||
#include "base/base-types.h"
|
||||
#include "base/tile-manager.h"
|
||||
@@ -218,7 +218,7 @@ gimp_operation_tile_sink_process (GeglOperation *operation,
|
||||
pr;
|
||||
pr = pixel_regions_process (pr))
|
||||
{
|
||||
const GeglRectangle rect = { destPR.x, destPR.y, destPR.w, destPR.h };
|
||||
GeglRectangle rect = { destPR.x, destPR.y, destPR.w, destPR.h };
|
||||
|
||||
gegl_buffer_get (input,
|
||||
1.0, &rect, format, destPR.data, destPR.rowstride);
|
||||
|
@@ -26,7 +26,7 @@
|
||||
#include <gegl.h>
|
||||
#include <gegl-buffer.h>
|
||||
|
||||
#include "gegl-types.h"
|
||||
#include "gimp-gegl-types.h"
|
||||
|
||||
#include "base/tile-manager.h"
|
||||
#include "base/pixel-region.h"
|
||||
@@ -238,7 +238,7 @@ gimp_operation_tile_source_process (GeglOperation *operation,
|
||||
pr;
|
||||
pr = pixel_regions_process (pr))
|
||||
{
|
||||
const GeglRectangle rect = { srcPR.x, srcPR.y, srcPR.w, srcPR.h };
|
||||
GeglRectangle rect = { srcPR.x, srcPR.y, srcPR.w, srcPR.h };
|
||||
|
||||
gegl_buffer_set (output, &rect, format, srcPR.data, srcPR.rowstride);
|
||||
}
|
||||
|
@@ -25,7 +25,7 @@
|
||||
|
||||
#include "libgimpconfig/gimpconfig.h"
|
||||
|
||||
#include "gegl-types.h"
|
||||
#include "gimp-gegl-types.h"
|
||||
|
||||
#include "gimpposterizeconfig.h"
|
||||
|
||||
|
@@ -25,7 +25,7 @@
|
||||
|
||||
#include "libgimpconfig/gimpconfig.h"
|
||||
|
||||
#include "gegl-types.h"
|
||||
#include "gimp-gegl-types.h"
|
||||
|
||||
/* temp cruft */
|
||||
#include "base/threshold.h"
|
||||
|
@@ -3,17 +3,26 @@
|
||||
<node name="/org/gimp/GIMP/UI">
|
||||
|
||||
<interface name="org.gimp.GIMP.UI">
|
||||
|
||||
<annotation name="org.freedesktop.DBus.GLib.CSymbol"
|
||||
value="gimp_dbus_service" />
|
||||
|
||||
<method name="Open">
|
||||
<arg type="s" name="uri" direction="in" />
|
||||
<arg type="b" name="success" direction="out" />
|
||||
</method>
|
||||
|
||||
<method name="OpenAsNew">
|
||||
<arg type="s" name="uri" direction="in" />
|
||||
<arg type="b" name="success" direction="out" />
|
||||
</method>
|
||||
|
||||
<method name="Activate" />
|
||||
|
||||
<signal name="Opened">
|
||||
<arg type="s" name="uri" />
|
||||
</signal>
|
||||
|
||||
</interface>
|
||||
|
||||
</node>
|
||||
|
@@ -39,6 +39,12 @@
|
||||
#include "gimpdbusservice-glue.h"
|
||||
|
||||
|
||||
enum
|
||||
{
|
||||
OPENED,
|
||||
LAST_SIGNAL
|
||||
};
|
||||
|
||||
typedef struct
|
||||
{
|
||||
gchar *uri;
|
||||
@@ -52,6 +58,10 @@ static void gimp_dbus_service_init (GimpDBusService *service);
|
||||
static void gimp_dbus_service_dispose (GObject *object);
|
||||
static void gimp_dbus_service_finalize (GObject *object);
|
||||
|
||||
static void gimp_dbus_service_gimp_opened (Gimp *gimp,
|
||||
const gchar *uri,
|
||||
GimpDBusService *service);
|
||||
|
||||
static gboolean gimp_dbus_service_queue_open (GimpDBusService *service,
|
||||
const gchar *uri,
|
||||
gboolean as_new);
|
||||
@@ -67,12 +77,23 @@ G_DEFINE_TYPE (GimpDBusService, gimp_dbus_service, G_TYPE_OBJECT)
|
||||
|
||||
#define parent_class gimp_dbus_service_parent_class
|
||||
|
||||
static guint gimp_dbus_service_signals[LAST_SIGNAL] = { 0 };
|
||||
|
||||
|
||||
static void
|
||||
gimp_dbus_service_class_init (GimpDBusServiceClass *klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
gimp_dbus_service_signals[OPENED] =
|
||||
g_signal_new ("opened",
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_FIRST,
|
||||
G_STRUCT_OFFSET (GimpDBusServiceClass, opened),
|
||||
NULL, NULL,
|
||||
g_cclosure_marshal_VOID__STRING,
|
||||
G_TYPE_NONE, 1, G_TYPE_STRING);
|
||||
|
||||
object_class->dispose = gimp_dbus_service_dispose;
|
||||
object_class->finalize = gimp_dbus_service_finalize;
|
||||
|
||||
@@ -97,6 +118,10 @@ gimp_dbus_service_new (Gimp *gimp)
|
||||
|
||||
service->gimp = gimp;
|
||||
|
||||
g_signal_connect_object (gimp, "image-opened",
|
||||
G_CALLBACK (gimp_dbus_service_gimp_opened),
|
||||
service, 0);
|
||||
|
||||
return G_OBJECT (service);
|
||||
}
|
||||
|
||||
@@ -185,6 +210,14 @@ gimp_dbus_service_activate (GimpDBusService *service,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_dbus_service_gimp_opened (Gimp *gimp,
|
||||
const gchar *uri,
|
||||
GimpDBusService *service)
|
||||
{
|
||||
g_signal_emit (service, gimp_dbus_service_signals[OPENED], 0, uri);
|
||||
}
|
||||
|
||||
/*
|
||||
* Adds a request to open a file to the end of the queue and
|
||||
* starts an idle source if it is not already running.
|
||||
|
@@ -53,6 +53,10 @@ struct _GimpDBusService
|
||||
struct _GimpDBusServiceClass
|
||||
{
|
||||
GObjectClass parent_class;
|
||||
|
||||
/* signals */
|
||||
void (* opened) (GimpDBusService *service,
|
||||
const gchar *uri);
|
||||
};
|
||||
|
||||
|
||||
|
@@ -51,8 +51,8 @@ static DBusGConnection *dbus_connection = NULL;
|
||||
#ifdef G_OS_WIN32
|
||||
#include "file/file-open.h"
|
||||
|
||||
static void gui_unique_win32_init (Gimp *gimp);
|
||||
static void gui_unique_win32_exit (void);
|
||||
static void gui_unique_win32_init (Gimp *gimp);
|
||||
static void gui_unique_win32_exit (void);
|
||||
|
||||
static Gimp *unique_gimp = NULL;
|
||||
static HWND proxy_window = NULL;
|
||||
|
@@ -112,6 +112,9 @@ static void gui_show_tooltips_notify (GimpGuiConfig *gui_config,
|
||||
static void gui_show_help_button_notify (GimpGuiConfig *gui_config,
|
||||
GParamSpec *pspec,
|
||||
Gimp *gimp);
|
||||
static void gui_user_manual_notify (GimpGuiConfig *gui_config,
|
||||
GParamSpec *pspec,
|
||||
Gimp *gimp);
|
||||
static void gui_tearoff_menus_notify (GimpGuiConfig *gui_config,
|
||||
GParamSpec *pspec,
|
||||
GtkUIManager *manager);
|
||||
@@ -369,6 +372,9 @@ gui_restore_callback (Gimp *gimp,
|
||||
g_signal_connect (gui_config, "notify::use-help",
|
||||
G_CALLBACK (gui_show_help_button_notify),
|
||||
gimp);
|
||||
g_signal_connect (gui_config, "notify::user-manual-online",
|
||||
G_CALLBACK (gui_user_manual_notify),
|
||||
gimp);
|
||||
g_signal_connect (gui_config, "notify::show-help-button",
|
||||
G_CALLBACK (gui_show_help_button_notify),
|
||||
gimp);
|
||||
@@ -587,6 +593,9 @@ gui_exit_after_callback (Gimp *gimp,
|
||||
g_signal_handlers_disconnect_by_func (gimp->config,
|
||||
gui_show_help_button_notify,
|
||||
gimp);
|
||||
g_signal_handlers_disconnect_by_func (gimp->config,
|
||||
gui_user_manual_notify,
|
||||
gimp);
|
||||
g_signal_handlers_disconnect_by_func (gimp->config,
|
||||
gui_show_tooltips_notify,
|
||||
gimp);
|
||||
@@ -636,6 +645,14 @@ gui_show_help_button_notify (GimpGuiConfig *gui_config,
|
||||
gui_config->show_help_button);
|
||||
}
|
||||
|
||||
static void
|
||||
gui_user_manual_notify (GimpGuiConfig *gui_config,
|
||||
GParamSpec *param_spec,
|
||||
Gimp *gimp)
|
||||
{
|
||||
gimp_help_user_manual_changed (gimp);
|
||||
}
|
||||
|
||||
static void
|
||||
gui_tearoff_menus_notify (GimpGuiConfig *gui_config,
|
||||
GParamSpec *pspec,
|
||||
|
@@ -208,20 +208,7 @@ scale_determine_levels (PixelRegion *srcPR,
|
||||
gint width = srcPR->w;
|
||||
gint height = srcPR->h;
|
||||
|
||||
/* determine scaling levels */
|
||||
while (scalex > 2)
|
||||
{
|
||||
scalex /= 2;
|
||||
width *= 2;
|
||||
*levelx -= 1;
|
||||
}
|
||||
|
||||
while (scaley > 2)
|
||||
{
|
||||
scaley /= 2;
|
||||
height *= 2;
|
||||
*levely -= 1;
|
||||
}
|
||||
/* downscaling is done in multiple steps */
|
||||
|
||||
while (scalex < 0.5 && width > 1)
|
||||
{
|
||||
@@ -466,8 +453,8 @@ 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) dst_height / (gdouble) src_height;
|
||||
const gdouble scalex = (gdouble) dst_width / (gdouble) src_width;
|
||||
const gdouble scaley = (gdouble) src_height / (gdouble) dst_height;
|
||||
const gdouble scalex = (gdouble) src_width / (gdouble) dst_width;
|
||||
gpointer pr;
|
||||
gfloat *kernel_lookup = NULL;
|
||||
|
||||
@@ -522,38 +509,38 @@ scale (TileManager *srcTM,
|
||||
for (y = region.y; y < y1; y++)
|
||||
{
|
||||
guchar *pixel = row;
|
||||
gdouble yfrac = y / scaley;
|
||||
gint sy0 = (gint) yfrac;
|
||||
gdouble yfrac = (y + 0.5) * scaley - 0.5;
|
||||
gint sy = (gint) yfrac;
|
||||
gint x;
|
||||
|
||||
yfrac = yfrac - sy0;
|
||||
yfrac = yfrac - sy;
|
||||
|
||||
for (x = region.x; x < x1; x++)
|
||||
{
|
||||
gdouble xfrac = x / scalex;
|
||||
gint sx0 = (gint) xfrac;
|
||||
gdouble xfrac = (x + 0.5) * scalex - 0.5;
|
||||
gint sx = (gint) xfrac;
|
||||
|
||||
xfrac = xfrac - sx0;
|
||||
xfrac = xfrac - sx;
|
||||
|
||||
switch (interpolation)
|
||||
{
|
||||
case GIMP_INTERPOLATION_NONE:
|
||||
interpolate_nearest (srcTM, sx0, sy0, xfrac, yfrac, pixel);
|
||||
interpolate_nearest (srcTM, sx, sy, xfrac, yfrac, pixel);
|
||||
break;
|
||||
|
||||
case GIMP_INTERPOLATION_LINEAR:
|
||||
interpolate_bilinear (surround,
|
||||
sx0, sy0, xfrac, yfrac, bytes, pixel);
|
||||
sx, sy, xfrac, yfrac, bytes, pixel);
|
||||
break;
|
||||
|
||||
case GIMP_INTERPOLATION_CUBIC:
|
||||
interpolate_cubic (surround,
|
||||
sx0, sy0, xfrac, yfrac, bytes, pixel);
|
||||
sx, sy, xfrac, yfrac, bytes, pixel);
|
||||
break;
|
||||
|
||||
case GIMP_INTERPOLATION_LANCZOS:
|
||||
interpolate_lanczos3 (surround,
|
||||
sx0, sy0, xfrac, yfrac, bytes, pixel,
|
||||
sx, sy, xfrac, yfrac, bytes, pixel,
|
||||
kernel_lookup);
|
||||
break;
|
||||
}
|
||||
@@ -869,7 +856,7 @@ pixel_average2 (const guchar *p1,
|
||||
break;
|
||||
|
||||
case 510: /* all opaque */
|
||||
p[0] = (p1[0] + p2[0] + 1) >> 2;
|
||||
p[0] = (p1[0] + p2[0] + 1) >> 1;
|
||||
p[1] = 255;
|
||||
break;
|
||||
|
||||
|
@@ -33,6 +33,8 @@
|
||||
#include "gimppaintcore-stroke.h"
|
||||
#include "gimppaintoptions.h"
|
||||
|
||||
#include "gimp-intl.h"
|
||||
|
||||
|
||||
static void gimp_paint_core_stroke_emulate_dynamics (GimpCoords *coords,
|
||||
gint length);
|
||||
@@ -233,6 +235,7 @@ gimp_paint_core_stroke_vectors (GimpPaintCore *core,
|
||||
{
|
||||
GList *stroke;
|
||||
gboolean initialized = FALSE;
|
||||
gboolean due_to_lack_of_points = FALSE;
|
||||
gint off_x, off_y;
|
||||
gint vectors_off_x, vectors_off_y;
|
||||
|
||||
@@ -306,6 +309,10 @@ gimp_paint_core_stroke_vectors (GimpPaintCore *core,
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
due_to_lack_of_points = TRUE;
|
||||
}
|
||||
|
||||
if (coords)
|
||||
g_array_free (coords, TRUE);
|
||||
@@ -318,6 +325,13 @@ gimp_paint_core_stroke_vectors (GimpPaintCore *core,
|
||||
gimp_paint_core_cleanup (core);
|
||||
}
|
||||
|
||||
if (! initialized &&
|
||||
due_to_lack_of_points &&
|
||||
*error == NULL)
|
||||
{
|
||||
g_set_error (error, 0, 0, _("Not enough points to stroke"));
|
||||
}
|
||||
|
||||
return initialized;
|
||||
}
|
||||
|
||||
|
@@ -22,6 +22,8 @@
|
||||
|
||||
#include <glib-object.h>
|
||||
|
||||
#include "libgimpbase/gimpbase.h"
|
||||
|
||||
#include "paint-types.h"
|
||||
|
||||
#include "base/pixel-region.h"
|
||||
@@ -799,15 +801,24 @@ gimp_paint_core_paste (GimpPaintCore *core,
|
||||
GimpProjection *projection = gimp_image_get_projection (image);
|
||||
gint off_x;
|
||||
gint off_y;
|
||||
gint x, y;
|
||||
gint w, h;
|
||||
|
||||
gimp_item_offsets (GIMP_ITEM (drawable), &off_x, &off_y);
|
||||
|
||||
gimp_paint_core_validate_saved_proj_tiles (core,
|
||||
GIMP_PICKABLE (projection),
|
||||
core->canvas_buf->x + off_x,
|
||||
core->canvas_buf->y + off_y,
|
||||
core->canvas_buf->width,
|
||||
core->canvas_buf->height);
|
||||
if (gimp_rectangle_intersect (core->canvas_buf->x + off_x,
|
||||
core->canvas_buf->y + off_y,
|
||||
core->canvas_buf->width,
|
||||
core->canvas_buf->height,
|
||||
0, 0,
|
||||
tile_manager_width (core->saved_proj_tiles),
|
||||
tile_manager_height (core->saved_proj_tiles),
|
||||
&x, &y, &w, &h))
|
||||
{
|
||||
gimp_paint_core_validate_saved_proj_tiles (core,
|
||||
GIMP_PICKABLE (projection),
|
||||
x, y, w, h);
|
||||
}
|
||||
}
|
||||
|
||||
/* If the mode is CONSTANT:
|
||||
|
@@ -216,7 +216,7 @@ register_convert_procs (GimpPDB *pdb)
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-image-convert-rgb",
|
||||
"Convert specified image to RGB color",
|
||||
"This procedure converts the specified image to RGB color. This process requires an image in RGB or Indexed color mode. No image content is lost in this process aside from the colormap for an indexed image.",
|
||||
"This procedure converts the specified image to RGB color. This process requires an image in Grayscale or Indexed color mode. No image content is lost in this process aside from the colormap for an indexed image.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
|
@@ -272,7 +272,7 @@ gimp_pdb_compat_arg_type_from_gtype (GType type)
|
||||
|
||||
if (! pdb_type_quark)
|
||||
{
|
||||
const struct
|
||||
struct
|
||||
{
|
||||
GType g_type;
|
||||
GimpPDBArgType pdb_type;
|
||||
|
@@ -32,6 +32,8 @@
|
||||
#include "core/gimpimage.h"
|
||||
#include "core/gimpitem.h"
|
||||
|
||||
#include "file/file-utils.h"
|
||||
|
||||
#include "text/gimptextlayer.h"
|
||||
|
||||
#include "vectors/gimpvectors.h"
|
||||
@@ -385,21 +387,27 @@ gimp_pdb_image_is_base_type (GimpImage *image,
|
||||
GimpImageBaseType type,
|
||||
GError **error)
|
||||
{
|
||||
gchar *name;
|
||||
|
||||
g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE);
|
||||
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
|
||||
|
||||
if (gimp_image_base_type (image) == type)
|
||||
return TRUE;
|
||||
|
||||
name = file_utils_uri_display_basename (gimp_image_get_uri (image));
|
||||
|
||||
g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT,
|
||||
_("Image '%s' (%d) is of type '%s', "
|
||||
"but an image of type '%s' is expected"),
|
||||
gimp_object_get_name (GIMP_OBJECT (image)),
|
||||
name,
|
||||
gimp_image_get_ID (image),
|
||||
gimp_pdb_enum_value_get_nick (GIMP_TYPE_IMAGE_BASE_TYPE,
|
||||
gimp_image_base_type (image)),
|
||||
gimp_pdb_enum_value_get_nick (GIMP_TYPE_IMAGE_BASE_TYPE, type));
|
||||
|
||||
g_free (name);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -408,18 +416,24 @@ gimp_pdb_image_is_not_base_type (GimpImage *image,
|
||||
GimpImageBaseType type,
|
||||
GError **error)
|
||||
{
|
||||
gchar *name;
|
||||
|
||||
g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE);
|
||||
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
|
||||
|
||||
if (gimp_image_base_type (image) != type)
|
||||
return TRUE;
|
||||
|
||||
name = file_utils_uri_display_basename (gimp_image_get_uri (image));
|
||||
|
||||
g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT,
|
||||
_("Image '%s' (%d) is already of type '%s'"),
|
||||
gimp_object_get_name (GIMP_OBJECT (image)),
|
||||
name,
|
||||
gimp_image_get_ID (image),
|
||||
gimp_pdb_enum_value_get_nick (GIMP_TYPE_IMAGE_BASE_TYPE, type));
|
||||
|
||||
g_free (name);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@@ -347,7 +347,8 @@ gimp_procedure_execute (GimpProcedure *procedure,
|
||||
G_VALUE_HOLDS_STRING (&return_vals->values[1]))
|
||||
{
|
||||
g_set_error (error, 0, 0,
|
||||
g_value_get_string (&return_vals->values[1]));
|
||||
"%s",
|
||||
g_value_get_string (&return_vals->values[1]));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -118,12 +118,6 @@ gimp_plug_in_proc_frame_dispose (GimpPlugInProcFrame *proc_frame,
|
||||
proc_frame->main_context = NULL;
|
||||
}
|
||||
|
||||
if (proc_frame->procedure)
|
||||
{
|
||||
g_object_unref (proc_frame->procedure);
|
||||
proc_frame->procedure = NULL;
|
||||
}
|
||||
|
||||
if (proc_frame->return_vals)
|
||||
{
|
||||
g_value_array_free (proc_frame->return_vals);
|
||||
@@ -138,6 +132,12 @@ gimp_plug_in_proc_frame_dispose (GimpPlugInProcFrame *proc_frame,
|
||||
|
||||
if (proc_frame->image_cleanups || proc_frame->item_cleanups)
|
||||
gimp_plug_in_cleanup (plug_in, proc_frame);
|
||||
|
||||
if (proc_frame->procedure)
|
||||
{
|
||||
g_object_unref (proc_frame->procedure);
|
||||
proc_frame->procedure = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
GimpPlugInProcFrame *
|
||||
|
@@ -199,12 +199,19 @@ gimp_align_tool_constructor (GType type,
|
||||
align_tool = GIMP_ALIGN_TOOL (object);
|
||||
options = G_OBJECT (gimp_tool_get_options (tool));
|
||||
|
||||
/* This line of code is evil because it relies on that the 'options'
|
||||
* object is fully constructed before we get here, which is not
|
||||
* guaranteed
|
||||
*/
|
||||
container = GTK_CONTAINER (g_object_get_data (options,
|
||||
"controls-container"));
|
||||
|
||||
align_tool->controls = gimp_align_tool_controls (align_tool);
|
||||
gtk_container_add (container, align_tool->controls);
|
||||
gtk_widget_show (align_tool->controls);
|
||||
if (container)
|
||||
{
|
||||
align_tool->controls = gimp_align_tool_controls (align_tool);
|
||||
gtk_container_add (container, align_tool->controls);
|
||||
gtk_widget_show (align_tool->controls);
|
||||
}
|
||||
|
||||
return object;
|
||||
}
|
||||
@@ -427,8 +434,13 @@ gimp_align_tool_button_release (GimpTool *tool,
|
||||
}
|
||||
|
||||
for (i = 0; i < ALIGN_TOOL_NUM_BUTTONS; i++)
|
||||
gtk_widget_set_sensitive (align_tool->button[i],
|
||||
(align_tool->selected_objects != NULL));
|
||||
{
|
||||
if (align_tool->button[i])
|
||||
{
|
||||
gtk_widget_set_sensitive (align_tool->button[i],
|
||||
(align_tool->selected_objects != NULL));
|
||||
}
|
||||
}
|
||||
|
||||
align_tool->x1 = align_tool->x0;
|
||||
align_tool->y1 = align_tool->y0;
|
||||
|
@@ -134,6 +134,8 @@ gimp_blend_tool_init (GimpBlendTool *blend_tool)
|
||||
GimpTool *tool = GIMP_TOOL (blend_tool);
|
||||
|
||||
gimp_tool_control_set_scroll_lock (tool->control, TRUE);
|
||||
gimp_tool_control_set_precision (tool->control,
|
||||
GIMP_CURSOR_PRECISION_SUBPIXEL);
|
||||
gimp_tool_control_set_cursor (tool->control,
|
||||
GIMP_CURSOR_MOUSE);
|
||||
gimp_tool_control_set_tool_cursor (tool->control,
|
||||
|
@@ -31,6 +31,7 @@
|
||||
#include "base/gimplut.h"
|
||||
#include "base/lut-funcs.h"
|
||||
|
||||
#include "gegl/gimp-gegl-utils.h"
|
||||
#include "gegl/gimpbrightnesscontrastconfig.h"
|
||||
|
||||
#include "core/gimpdrawable.h"
|
||||
@@ -196,6 +197,7 @@ gimp_brightness_contrast_tool_get_operation (GimpImageMapTool *im_tool,
|
||||
GObject **config)
|
||||
{
|
||||
GimpBrightnessContrastTool *bc_tool = GIMP_BRIGHTNESS_CONTRAST_TOOL (im_tool);
|
||||
const gchar *name;
|
||||
|
||||
bc_tool->config = g_object_new (GIMP_TYPE_BRIGHTNESS_CONTRAST_CONFIG, NULL);
|
||||
|
||||
@@ -205,8 +207,11 @@ gimp_brightness_contrast_tool_get_operation (GimpImageMapTool *im_tool,
|
||||
G_CALLBACK (brightness_contrast_config_notify),
|
||||
G_OBJECT (bc_tool), 0);
|
||||
|
||||
name = (gimp_gegl_check_version (0, 0, 21) ?
|
||||
"gegl:brightness-contrast" : "brightness-contrast");
|
||||
|
||||
return g_object_new (GEGL_TYPE_NODE,
|
||||
"operation", "brightness-contrast",
|
||||
"operation", name,
|
||||
NULL);
|
||||
}
|
||||
|
||||
|
@@ -101,6 +101,10 @@ static gboolean gimp_curves_tool_settings_export(GimpImageMapTool *image_m
|
||||
const gchar *filename,
|
||||
GError **error);
|
||||
|
||||
static void gimp_curves_tool_export_setup (GimpSettingsBox *settings_box,
|
||||
GtkFileChooserDialog *dialog,
|
||||
gboolean export,
|
||||
GimpCurvesTool *tool);
|
||||
static void gimp_curves_tool_config_notify (GObject *object,
|
||||
GParamSpec *pspec,
|
||||
GimpCurvesTool *tool);
|
||||
@@ -422,6 +426,10 @@ gimp_curves_tool_dialog (GimpImageMapTool *image_map_tool)
|
||||
GtkWidget *bar;
|
||||
GtkWidget *combo;
|
||||
|
||||
g_signal_connect (image_map_tool->settings_box, "file-dialog-setup",
|
||||
G_CALLBACK (gimp_curves_tool_export_setup),
|
||||
image_map_tool);
|
||||
|
||||
main_vbox = gimp_image_map_tool_dialog_get_vbox (image_map_tool);
|
||||
label_group = gimp_image_map_tool_dialog_get_label_group (image_map_tool);
|
||||
|
||||
@@ -605,7 +613,6 @@ gimp_curves_tool_settings_import (GimpImageMapTool *image_map_tool,
|
||||
{
|
||||
GimpCurvesTool *tool = GIMP_CURVES_TOOL (image_map_tool);
|
||||
FILE *file;
|
||||
gboolean success;
|
||||
gchar header[64];
|
||||
|
||||
file = g_fopen (filename, "rt");
|
||||
@@ -631,6 +638,8 @@ gimp_curves_tool_settings_import (GimpImageMapTool *image_map_tool,
|
||||
|
||||
if (g_str_has_prefix (header, "# GIMP Curves File\n"))
|
||||
{
|
||||
gboolean success;
|
||||
|
||||
rewind (file);
|
||||
|
||||
success = gimp_curves_config_load_cruft (tool->config, file, error);
|
||||
@@ -653,25 +662,55 @@ gimp_curves_tool_settings_export (GimpImageMapTool *image_map_tool,
|
||||
GError **error)
|
||||
{
|
||||
GimpCurvesTool *tool = GIMP_CURVES_TOOL (image_map_tool);
|
||||
FILE *file;
|
||||
gboolean success;
|
||||
|
||||
file = g_fopen (filename, "wt");
|
||||
|
||||
if (! file)
|
||||
if (tool->export_old_format)
|
||||
{
|
||||
g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),
|
||||
_("Could not open '%s' for writing: %s"),
|
||||
gimp_filename_to_utf8 (filename),
|
||||
g_strerror (errno));
|
||||
return FALSE;
|
||||
FILE *file;
|
||||
gboolean success;
|
||||
|
||||
file = g_fopen (filename, "wt");
|
||||
|
||||
if (! file)
|
||||
{
|
||||
g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),
|
||||
_("Could not open '%s' for writing: %s"),
|
||||
gimp_filename_to_utf8 (filename),
|
||||
g_strerror (errno));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
success = gimp_curves_config_save_cruft (tool->config, file, error);
|
||||
|
||||
fclose (file);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
success = gimp_curves_config_save_cruft (tool->config, file, error);
|
||||
return GIMP_IMAGE_MAP_TOOL_CLASS (parent_class)->settings_export (image_map_tool,
|
||||
filename,
|
||||
error);
|
||||
}
|
||||
|
||||
fclose (file);
|
||||
static void
|
||||
gimp_curves_tool_export_setup (GimpSettingsBox *settings_box,
|
||||
GtkFileChooserDialog *dialog,
|
||||
gboolean export,
|
||||
GimpCurvesTool *tool)
|
||||
{
|
||||
GtkWidget *button;
|
||||
|
||||
return success;
|
||||
if (! export)
|
||||
return;
|
||||
|
||||
button = gtk_check_button_new_with_mnemonic (_("Use _old curves file format"));
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
|
||||
tool->export_old_format);
|
||||
gtk_file_chooser_set_extra_widget (GTK_FILE_CHOOSER (dialog), button);
|
||||
gtk_widget_show (button);
|
||||
|
||||
g_signal_connect (button, "toggled",
|
||||
G_CALLBACK (gimp_toggle_button_update),
|
||||
&tool->export_old_format);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@@ -48,6 +48,9 @@ struct _GimpCurvesTool
|
||||
GtkWidget *yrange;
|
||||
GtkWidget *graph;
|
||||
GtkWidget *curve_type;
|
||||
|
||||
/* export dialog */
|
||||
gboolean export_old_format;
|
||||
};
|
||||
|
||||
struct _GimpCurvesToolClass
|
||||
|
@@ -62,7 +62,7 @@
|
||||
|
||||
#define EDIT_SELECT_SCROLL_LOCK FALSE
|
||||
#define ARROW_VELOCITY 25
|
||||
#define CENTER_CROSS_SIZE 6
|
||||
#define CENTER_CROSS_SIZE 7
|
||||
|
||||
|
||||
typedef struct _GimpEditSelectionTool
|
||||
|
@@ -45,6 +45,15 @@
|
||||
#include "gimp-intl.h"
|
||||
|
||||
|
||||
enum
|
||||
{
|
||||
COLUMN_NAME,
|
||||
COLUMN_LABEL,
|
||||
COLUMN_STOCK_ID,
|
||||
NUM_COLUMNS
|
||||
};
|
||||
|
||||
|
||||
/* local function prototypes */
|
||||
|
||||
static void gimp_gegl_tool_finalize (GObject *object);
|
||||
@@ -226,8 +235,13 @@ gimp_gegl_tool_operation_blacklisted (const gchar *name)
|
||||
{
|
||||
static const gchar * const blacklist[] =
|
||||
{
|
||||
"convert-format", "gimp-", "introspect", "stress", "text"
|
||||
"gimp-",
|
||||
"convert-format", "gegl:convert-format",
|
||||
"introspect", "gegl:introspect",
|
||||
"stress", "gegl:stress",
|
||||
"text", "gegl:text"
|
||||
};
|
||||
|
||||
gint i;
|
||||
|
||||
for (i = 0; i < G_N_ELEMENTS (blacklist); i++)
|
||||
@@ -325,11 +339,12 @@ gimp_gegl_tool_dialog (GimpImageMapTool *image_map_tool)
|
||||
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
|
||||
gtk_widget_show (label);
|
||||
|
||||
store = gtk_list_store_new (1, G_TYPE_STRING);
|
||||
store = gtk_list_store_new (NUM_COLUMNS,
|
||||
G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING);
|
||||
|
||||
opclasses = gimp_get_geglopclasses ();
|
||||
|
||||
for (iter = opclasses; iter; iter=iter->next)
|
||||
for (iter = opclasses; iter; iter = iter->next)
|
||||
{
|
||||
GeglOperationClass *opclass = GEGL_OPERATION_CLASS (iter->data);
|
||||
|
||||
@@ -340,8 +355,29 @@ gimp_gegl_tool_dialog (GimpImageMapTool *image_map_tool)
|
||||
strstr (opclass->categories, "edge") ||
|
||||
strstr (opclass->categories, "render"))
|
||||
{
|
||||
const gchar *stock_id;
|
||||
const gchar *label;
|
||||
|
||||
if (g_str_has_prefix (opclass->name, "gegl:"))
|
||||
{
|
||||
label = opclass->name + strlen ("gegl:");
|
||||
stock_id = GIMP_STOCK_GEGL;
|
||||
}
|
||||
else if (g_str_has_prefix (opclass->name, "gimp:"))
|
||||
{
|
||||
label = opclass->name + strlen ("gimp:");
|
||||
stock_id = GIMP_STOCK_WILBER;
|
||||
}
|
||||
else
|
||||
{
|
||||
label = opclass->name;
|
||||
stock_id = NULL;
|
||||
}
|
||||
|
||||
gtk_list_store_insert_with_values (store, NULL, -1,
|
||||
0, opclass->name,
|
||||
COLUMN_NAME, opclass->name,
|
||||
COLUMN_LABEL, label,
|
||||
COLUMN_STOCK_ID, stock_id,
|
||||
-1);
|
||||
}
|
||||
}
|
||||
@@ -349,14 +385,19 @@ gimp_gegl_tool_dialog (GimpImageMapTool *image_map_tool)
|
||||
g_list_free (opclasses);
|
||||
|
||||
combo = gtk_combo_box_new_with_model (GTK_TREE_MODEL (store));
|
||||
cell = gtk_cell_renderer_text_new ();
|
||||
gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo), cell, TRUE);
|
||||
gtk_cell_layout_add_attribute (GTK_CELL_LAYOUT (combo), cell,
|
||||
"text", 0);
|
||||
g_object_unref (store);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), combo, TRUE, TRUE, 0);
|
||||
gtk_widget_show (combo);
|
||||
|
||||
g_object_unref (store);
|
||||
cell = gtk_cell_renderer_pixbuf_new ();
|
||||
gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo), cell, FALSE);
|
||||
gtk_cell_layout_add_attribute (GTK_CELL_LAYOUT (combo), cell,
|
||||
"stock-id", COLUMN_STOCK_ID);
|
||||
|
||||
cell = gtk_cell_renderer_text_new ();
|
||||
gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo), cell, TRUE);
|
||||
gtk_cell_layout_add_attribute (GTK_CELL_LAYOUT (combo), cell,
|
||||
"text", COLUMN_LABEL);
|
||||
|
||||
g_signal_connect (combo, "changed",
|
||||
G_CALLBACK (gimp_gegl_tool_operation_changed),
|
||||
@@ -405,7 +446,13 @@ gimp_param_spec_duplicate (GParamSpec *pspec)
|
||||
{
|
||||
GParamSpecString *spec = G_PARAM_SPEC_STRING (pspec);
|
||||
|
||||
#if (GEGL_MAJOR_VERSION > 0 || \
|
||||
(GEGL_MAJOR_VERSION == 0 && GEGL_MINOR_VERSION > 0) || \
|
||||
(GEGL_MAJOR_VERSION == 0 && GEGL_MINOR_VERSION == 0 && GEGL_MICRO_VERSION >= 21))
|
||||
if (GEGL_IS_PARAM_SPEC_FILE_PATH (pspec))
|
||||
#else
|
||||
if (GEGL_IS_PARAM_SPEC_PATH (pspec))
|
||||
#endif
|
||||
{
|
||||
return gimp_param_spec_config_path (pspec->name,
|
||||
g_param_spec_get_nick (pspec),
|
||||
@@ -510,10 +557,19 @@ gimp_param_spec_duplicate (GParamSpec *pspec)
|
||||
{
|
||||
GeglColor *gegl_color;
|
||||
GimpRGB gimp_color;
|
||||
#if (GEGL_MAJOR_VERSION > 0 || \
|
||||
(GEGL_MAJOR_VERSION == 0 && GEGL_MINOR_VERSION > 0) || \
|
||||
(GEGL_MAJOR_VERSION == 0 && GEGL_MINOR_VERSION == 0 && GEGL_MICRO_VERSION >= 23))
|
||||
gdouble r = 0.0;
|
||||
gdouble g = 0.0;
|
||||
gdouble b = 0.0;
|
||||
gdouble a = 1.0;
|
||||
#else
|
||||
gfloat r = 0.0;
|
||||
gfloat g = 0.0;
|
||||
gfloat b = 0.0;
|
||||
gfloat a = 1.0;
|
||||
#endif
|
||||
GValue value = { 0, };
|
||||
|
||||
g_value_init (&value, GEGL_TYPE_COLOR);
|
||||
@@ -673,7 +729,7 @@ gimp_gegl_tool_get_config (GimpGeglTool *tool)
|
||||
|
||||
if (! config_type)
|
||||
{
|
||||
const GTypeInfo info =
|
||||
GTypeInfo info =
|
||||
{
|
||||
sizeof (GimpObjectClass),
|
||||
(GBaseInitFunc) NULL,
|
||||
@@ -696,6 +752,8 @@ gimp_gegl_tool_get_config (GimpGeglTool *tool)
|
||||
gchar *type_name = g_strdup_printf ("GimpGeglTool-%s-config",
|
||||
tool->operation);
|
||||
|
||||
g_strcanon (type_name, G_CSET_DIGITS "-" G_CSET_a_2_z G_CSET_A_2_Z, '-');
|
||||
|
||||
config_type = g_type_register_static (GIMP_TYPE_OBJECT, type_name,
|
||||
&info, 0);
|
||||
|
||||
@@ -737,7 +795,7 @@ gimp_gegl_tool_operation_changed (GtkWidget *widget,
|
||||
}
|
||||
|
||||
gtk_tree_model_get (model, &iter,
|
||||
0, &tool->operation,
|
||||
COLUMN_NAME, &tool->operation,
|
||||
-1);
|
||||
|
||||
if (! tool->operation)
|
||||
|
@@ -94,6 +94,10 @@ static gboolean gimp_levels_tool_settings_export(GimpImageMapTool *im_tool,
|
||||
const gchar *filename,
|
||||
GError **error);
|
||||
|
||||
static void gimp_levels_tool_export_setup (GimpSettingsBox *settings_box,
|
||||
GtkFileChooserDialog *dialog,
|
||||
gboolean export,
|
||||
GimpLevelsTool *tool);
|
||||
static void gimp_levels_tool_config_notify (GObject *object,
|
||||
GParamSpec *pspec,
|
||||
GimpLevelsTool *tool);
|
||||
@@ -361,6 +365,10 @@ gimp_levels_tool_dialog (GimpImageMapTool *image_map_tool)
|
||||
GtkObject *data;
|
||||
gint border;
|
||||
|
||||
g_signal_connect (image_map_tool->settings_box, "file-dialog-setup",
|
||||
G_CALLBACK (gimp_levels_tool_export_setup),
|
||||
image_map_tool);
|
||||
|
||||
main_vbox = gimp_image_map_tool_dialog_get_vbox (image_map_tool);
|
||||
label_group = gimp_image_map_tool_dialog_get_label_group (image_map_tool);
|
||||
|
||||
@@ -725,7 +733,7 @@ gimp_levels_tool_settings_import (GimpImageMapTool *image_map_tool,
|
||||
{
|
||||
GimpLevelsTool *tool = GIMP_LEVELS_TOOL (image_map_tool);
|
||||
FILE *file;
|
||||
gboolean success;
|
||||
gchar header[64];
|
||||
|
||||
file = g_fopen (filename, "rt");
|
||||
|
||||
@@ -738,11 +746,34 @@ gimp_levels_tool_settings_import (GimpImageMapTool *image_map_tool,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
success = gimp_levels_config_load_cruft (tool->config, file, error);
|
||||
if (! fgets (header, sizeof (header), file))
|
||||
{
|
||||
g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),
|
||||
_("Could not read header from '%s': %s"),
|
||||
gimp_filename_to_utf8 (filename),
|
||||
g_strerror (errno));
|
||||
fclose (file);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (g_str_has_prefix (header, "# GIMP Levels File\n"))
|
||||
{
|
||||
gboolean success;
|
||||
|
||||
rewind (file);
|
||||
|
||||
success = gimp_levels_config_load_cruft (tool->config, file, error);
|
||||
|
||||
fclose (file);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
fclose (file);
|
||||
|
||||
return success;
|
||||
return GIMP_IMAGE_MAP_TOOL_CLASS (parent_class)->settings_import (image_map_tool,
|
||||
filename,
|
||||
error);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@@ -751,25 +782,55 @@ gimp_levels_tool_settings_export (GimpImageMapTool *image_map_tool,
|
||||
GError **error)
|
||||
{
|
||||
GimpLevelsTool *tool = GIMP_LEVELS_TOOL (image_map_tool);
|
||||
FILE *file;
|
||||
gboolean success;
|
||||
|
||||
file = g_fopen (filename, "wt");
|
||||
|
||||
if (! file)
|
||||
if (tool->export_old_format)
|
||||
{
|
||||
g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),
|
||||
_("Could not open '%s' for writing: %s"),
|
||||
gimp_filename_to_utf8 (filename),
|
||||
g_strerror (errno));
|
||||
return FALSE;
|
||||
FILE *file;
|
||||
gboolean success;
|
||||
|
||||
file = g_fopen (filename, "wt");
|
||||
|
||||
if (! file)
|
||||
{
|
||||
g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),
|
||||
_("Could not open '%s' for writing: %s"),
|
||||
gimp_filename_to_utf8 (filename),
|
||||
g_strerror (errno));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
success = gimp_levels_config_save_cruft (tool->config, file, error);
|
||||
|
||||
fclose (file);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
success = gimp_levels_config_save_cruft (tool->config, file, error);
|
||||
return GIMP_IMAGE_MAP_TOOL_CLASS (parent_class)->settings_export (image_map_tool,
|
||||
filename,
|
||||
error);
|
||||
}
|
||||
|
||||
fclose (file);
|
||||
static void
|
||||
gimp_levels_tool_export_setup (GimpSettingsBox *settings_box,
|
||||
GtkFileChooserDialog *dialog,
|
||||
gboolean export,
|
||||
GimpLevelsTool *tool)
|
||||
{
|
||||
GtkWidget *button;
|
||||
|
||||
return success;
|
||||
if (! export)
|
||||
return;
|
||||
|
||||
button = gtk_check_button_new_with_mnemonic (_("Use _old levels file format"));
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
|
||||
tool->export_old_format);
|
||||
gtk_file_chooser_set_extra_widget (GTK_FILE_CHOOSER (dialog), button);
|
||||
gtk_widget_show (button);
|
||||
|
||||
g_signal_connect (button, "toggled",
|
||||
G_CALLBACK (gimp_toggle_button_update),
|
||||
&tool->export_old_format);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@@ -61,6 +61,9 @@ struct _GimpLevelsTool
|
||||
GtkAdjustment *high_output;
|
||||
|
||||
GtkWidget *active_picker;
|
||||
|
||||
/* export dialog */
|
||||
gboolean export_old_format;
|
||||
};
|
||||
|
||||
struct _GimpLevelsToolClass
|
||||
|
@@ -189,8 +189,10 @@ gimp_magnify_tool_button_release (GimpTool *tool,
|
||||
if (release_type == GIMP_BUTTON_RELEASE_CLICK ||
|
||||
release_type == GIMP_BUTTON_RELEASE_NO_MOTION)
|
||||
{
|
||||
new_scale = gimp_zoom_model_zoom_step (options->zoom_type,
|
||||
current_scale);
|
||||
gimp_display_shell_scale (shell,
|
||||
options->zoom_type,
|
||||
0.0,
|
||||
GIMP_ZOOM_FOCUS_BEST_GUESS);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -218,71 +220,71 @@ gimp_magnify_tool_button_release (GimpTool *tool,
|
||||
}
|
||||
|
||||
new_scale = current_scale * factor;
|
||||
}
|
||||
|
||||
if (new_scale != current_scale)
|
||||
{
|
||||
gdouble xres;
|
||||
gdouble yres;
|
||||
gint offset_x = 0;
|
||||
gint offset_y = 0;
|
||||
|
||||
gimp_image_get_resolution (display->image, &xres, &yres);
|
||||
|
||||
switch (options->zoom_type)
|
||||
if (new_scale != current_scale)
|
||||
{
|
||||
case GIMP_ZOOM_IN:
|
||||
/* move the center of the rectangle to the center of the
|
||||
* viewport:
|
||||
*
|
||||
* new_offset = center of rectangle in new scale screen coords
|
||||
* including offset
|
||||
* -
|
||||
* center of viewport in screen coords without
|
||||
* offset
|
||||
*/
|
||||
offset_x = RINT (new_scale * ((x1 + x2) / 2.0) *
|
||||
SCREEN_XRES (shell) / xres -
|
||||
(shell->disp_width / 2.0));
|
||||
gdouble xres;
|
||||
gdouble yres;
|
||||
gint offset_x = 0;
|
||||
gint offset_y = 0;
|
||||
|
||||
offset_y = RINT (new_scale * ((y1 + y2) / 2.0) *
|
||||
SCREEN_YRES (shell) / yres -
|
||||
(shell->disp_height / 2.0));
|
||||
break;
|
||||
gimp_image_get_resolution (display->image, &xres, &yres);
|
||||
|
||||
case GIMP_ZOOM_OUT:
|
||||
/* move the center of the viewport to the center of the
|
||||
* rectangle:
|
||||
*
|
||||
* new_offset = center of viewport in new scale screen coords
|
||||
* including offset
|
||||
* -
|
||||
* center of rectangle in screen coords without
|
||||
* offset
|
||||
*/
|
||||
offset_x = RINT (new_scale * UNSCALEX (shell,
|
||||
shell->offset_x +
|
||||
shell->disp_width / 2.0) *
|
||||
SCREEN_XRES (shell) / xres -
|
||||
(SCALEX (shell, (x1 + x2) / 2.0) -
|
||||
shell->offset_x));
|
||||
switch (options->zoom_type)
|
||||
{
|
||||
case GIMP_ZOOM_IN:
|
||||
/* move the center of the rectangle to the center of the
|
||||
* viewport:
|
||||
*
|
||||
* new_offset = center of rectangle in new scale screen coords
|
||||
* including offset
|
||||
* -
|
||||
* center of viewport in screen coords without
|
||||
* offset
|
||||
*/
|
||||
offset_x = RINT (new_scale * ((x1 + x2) / 2.0) *
|
||||
SCREEN_XRES (shell) / xres -
|
||||
(shell->disp_width / 2.0));
|
||||
|
||||
offset_y = RINT (new_scale * UNSCALEY (shell,
|
||||
shell->offset_y +
|
||||
shell->disp_height / 2.0) *
|
||||
SCREEN_YRES (shell) / yres -
|
||||
(SCALEY (shell, (y1 + y2) / 2.0) -
|
||||
shell->offset_y));
|
||||
break;
|
||||
offset_y = RINT (new_scale * ((y1 + y2) / 2.0) *
|
||||
SCREEN_YRES (shell) / yres -
|
||||
(shell->disp_height / 2.0));
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
case GIMP_ZOOM_OUT:
|
||||
/* move the center of the viewport to the center of the
|
||||
* rectangle:
|
||||
*
|
||||
* new_offset = center of viewport in new scale screen coords
|
||||
* including offset
|
||||
* -
|
||||
* center of rectangle in screen coords without
|
||||
* offset
|
||||
*/
|
||||
offset_x = RINT (new_scale * UNSCALEX (shell,
|
||||
shell->offset_x +
|
||||
shell->disp_width / 2.0) *
|
||||
SCREEN_XRES (shell) / xres -
|
||||
(SCALEX (shell, (x1 + x2) / 2.0) -
|
||||
shell->offset_x));
|
||||
|
||||
offset_y = RINT (new_scale * UNSCALEY (shell,
|
||||
shell->offset_y +
|
||||
shell->disp_height / 2.0) *
|
||||
SCREEN_YRES (shell) / yres -
|
||||
(SCALEY (shell, (y1 + y2) / 2.0) -
|
||||
shell->offset_y));
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
gimp_display_shell_scale_by_values (shell,
|
||||
new_scale,
|
||||
offset_x, offset_y,
|
||||
options->auto_resize);
|
||||
}
|
||||
|
||||
gimp_display_shell_scale_by_values (shell,
|
||||
new_scale,
|
||||
offset_x, offset_y,
|
||||
options->auto_resize);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -149,8 +149,11 @@ gimp_measure_tool_init (GimpMeasureTool *measure_tool)
|
||||
GimpTool *tool = GIMP_TOOL (measure_tool);
|
||||
|
||||
gimp_tool_control_set_handle_empty_image (tool->control, TRUE);
|
||||
gimp_tool_control_set_precision (tool->control,
|
||||
GIMP_CURSOR_PRECISION_PIXEL_BORDER);
|
||||
gimp_tool_control_set_tool_cursor (tool->control,
|
||||
GIMP_TOOL_CURSOR_MEASURE);
|
||||
|
||||
measure_tool->function = CREATING;
|
||||
measure_tool->status_help = TRUE;
|
||||
}
|
||||
|
@@ -453,6 +453,8 @@ gimp_move_tool_button_release (GimpTool *tool,
|
||||
}
|
||||
else
|
||||
{
|
||||
gboolean flush = FALSE;
|
||||
|
||||
if (! config->move_tool_changes_active ||
|
||||
(release_type == GIMP_BUTTON_RELEASE_CANCEL))
|
||||
{
|
||||
@@ -461,6 +463,8 @@ gimp_move_tool_button_release (GimpTool *tool,
|
||||
gimp_image_set_active_layer (display->image,
|
||||
move->old_active_layer);
|
||||
move->old_active_layer = NULL;
|
||||
|
||||
flush = TRUE;
|
||||
}
|
||||
|
||||
if (move->old_active_vectors)
|
||||
@@ -468,6 +472,8 @@ gimp_move_tool_button_release (GimpTool *tool,
|
||||
gimp_image_set_active_vectors (display->image,
|
||||
move->old_active_vectors);
|
||||
move->old_active_vectors = NULL;
|
||||
|
||||
flush = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -476,9 +482,13 @@ gimp_move_tool_button_release (GimpTool *tool,
|
||||
if (move->floating_layer)
|
||||
{
|
||||
floating_sel_anchor (move->floating_layer);
|
||||
gimp_image_flush (display->image);
|
||||
|
||||
flush = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
if (flush)
|
||||
gimp_image_flush (display->image);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -91,7 +91,8 @@ typedef enum
|
||||
} SideToResize;
|
||||
|
||||
|
||||
#define FEQUAL(a,b) (fabs ((a) - (b)) < 0.0001)
|
||||
#define FEQUAL(a,b) (fabs ((a) - (b)) < 0.0001)
|
||||
#define PIXEL_FEQUAL(a,b) (fabs ((a) - (b)) < 0.5)
|
||||
|
||||
#define GIMP_RECTANGLE_TOOL_GET_PRIVATE(obj) \
|
||||
(gimp_rectangle_tool_get_private (GIMP_RECTANGLE_TOOL (obj)))
|
||||
@@ -2254,7 +2255,7 @@ gimp_rectangle_tool_options_notify (GimpRectangleOptions *options,
|
||||
gimp_draw_tool_resume (GIMP_DRAW_TOOL (rect_tool));
|
||||
}
|
||||
else if (strcmp (pspec->name, "x") == 0 &&
|
||||
!FEQUAL (private->x1, options_private->x))
|
||||
!PIXEL_FEQUAL (private->x1, options_private->x))
|
||||
{
|
||||
gimp_rectangle_tool_synthesize_motion (rect_tool,
|
||||
GIMP_RECTANGLE_TOOL_MOVING,
|
||||
@@ -2262,7 +2263,7 @@ gimp_rectangle_tool_options_notify (GimpRectangleOptions *options,
|
||||
private->y1);
|
||||
}
|
||||
else if (strcmp (pspec->name, "y") == 0 &&
|
||||
!FEQUAL (private->y1, options_private->y))
|
||||
!PIXEL_FEQUAL (private->y1, options_private->y))
|
||||
{
|
||||
gimp_rectangle_tool_synthesize_motion (rect_tool,
|
||||
GIMP_RECTANGLE_TOOL_MOVING,
|
||||
@@ -2270,7 +2271,7 @@ gimp_rectangle_tool_options_notify (GimpRectangleOptions *options,
|
||||
options_private->y);
|
||||
}
|
||||
else if (strcmp (pspec->name, "width") == 0 &&
|
||||
!FEQUAL (private->x2 - private->x1, options_private->width))
|
||||
!PIXEL_FEQUAL (private->x2 - private->x1, options_private->width))
|
||||
{
|
||||
/* Calculate x2, y2 that will create a rectangle of given width, for the
|
||||
* current options.
|
||||
@@ -2293,7 +2294,7 @@ gimp_rectangle_tool_options_notify (GimpRectangleOptions *options,
|
||||
private->y2);
|
||||
}
|
||||
else if (strcmp (pspec->name, "height") == 0 &&
|
||||
!FEQUAL (private->y2 - private->y1, options_private->height))
|
||||
!PIXEL_FEQUAL (private->y2 - private->y1, options_private->height))
|
||||
{
|
||||
/* Calculate x2, y2 that will create a rectangle of given height, for the
|
||||
* current options.
|
||||
|
@@ -212,9 +212,11 @@ gimp_text_tool_init (GimpTextTool *text_tool)
|
||||
text_tool->layer = NULL;
|
||||
text_tool->image = NULL;
|
||||
|
||||
gimp_tool_control_set_scroll_lock (tool->control, TRUE);
|
||||
gimp_tool_control_set_tool_cursor (tool->control,
|
||||
GIMP_TOOL_CURSOR_TEXT);
|
||||
gimp_tool_control_set_scroll_lock (tool->control, TRUE);
|
||||
gimp_tool_control_set_precision (tool->control,
|
||||
GIMP_CURSOR_PRECISION_PIXEL_BORDER);
|
||||
gimp_tool_control_set_tool_cursor (tool->control,
|
||||
GIMP_TOOL_CURSOR_TEXT);
|
||||
gimp_tool_control_set_action_object_1 (tool->control,
|
||||
"context/context-font-select-set");
|
||||
|
||||
|
@@ -427,8 +427,12 @@ gimp_tool_initialize (GimpTool *tool,
|
||||
|
||||
if (! GIMP_TOOL_GET_CLASS (tool)->initialize (tool, display, &error))
|
||||
{
|
||||
gimp_tool_message (tool, display, error->message);
|
||||
g_clear_error (&error);
|
||||
if (error)
|
||||
{
|
||||
gimp_tool_message (tool, display, error->message);
|
||||
g_clear_error (&error);
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@@ -62,7 +62,7 @@ gimp_show_library_version (const gchar *package,
|
||||
|
||||
/* show versions of libraries used by GIMP */
|
||||
g_print (_("using %s version %s (compiled against version %s)"),
|
||||
package, build_time_version, run_time_version);
|
||||
package, run_time_version, build_time_version);
|
||||
g_print ("\n");
|
||||
|
||||
g_free (run_time_version);
|
||||
|
@@ -895,6 +895,9 @@ gimp_dialog_factory_add_dialog (GimpDialogFactory *factory,
|
||||
"creating session info %p (widget %p) for dock",
|
||||
info, info->widget);
|
||||
|
||||
/* let new docks appear at the pointer position */
|
||||
gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_MOUSE);
|
||||
|
||||
/* if we create a new session info, we never call
|
||||
* gimp_session_info_set_geometry(), but still the
|
||||
* dialog needs GDK_HINT_USER_POS so it keeps its
|
||||
|
@@ -77,10 +77,10 @@ gimp_error_console_init (GimpErrorConsole *console)
|
||||
console->text_buffer = gtk_text_buffer_new (NULL);
|
||||
|
||||
gtk_text_buffer_create_tag (console->text_buffer, "title",
|
||||
"scale", PANGO_SCALE_LARGE,
|
||||
"weight", PANGO_WEIGHT_BOLD,
|
||||
NULL);
|
||||
gtk_text_buffer_create_tag (console->text_buffer, "message",
|
||||
"scale", PANGO_SCALE_SMALL,
|
||||
NULL);
|
||||
|
||||
scrolled_window = gtk_scrolled_window_new (NULL, NULL);
|
||||
@@ -201,7 +201,7 @@ gimp_error_console_add (GimpErrorConsole *console,
|
||||
|
||||
pixbuf = gtk_widget_render_icon (console->text_view,
|
||||
gimp_get_message_stock_id (severity),
|
||||
GTK_ICON_SIZE_MENU, NULL);
|
||||
GTK_ICON_SIZE_BUTTON, NULL);
|
||||
gtk_text_buffer_insert_pixbuf (console->text_buffer, &end, pixbuf);
|
||||
g_object_unref (pixbuf);
|
||||
|
||||
|
@@ -62,6 +62,8 @@ struct _GimpFileDialogState
|
||||
|
||||
|
||||
static void gimp_file_dialog_progress_iface_init (GimpProgressInterface *iface);
|
||||
|
||||
static void gimp_file_dialog_destroy (GtkObject *object);
|
||||
static gboolean gimp_file_dialog_delete_event (GtkWidget *widget,
|
||||
GdkEventAny *event);
|
||||
static void gimp_file_dialog_response (GtkDialog *dialog,
|
||||
@@ -121,9 +123,12 @@ G_DEFINE_TYPE_WITH_CODE (GimpFileDialog, gimp_file_dialog,
|
||||
static void
|
||||
gimp_file_dialog_class_init (GimpFileDialogClass *klass)
|
||||
{
|
||||
GtkObjectClass *object_class = GTK_OBJECT_CLASS (klass);
|
||||
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
|
||||
GtkDialogClass *dialog_class = GTK_DIALOG_CLASS (klass);
|
||||
|
||||
object_class->destroy = gimp_file_dialog_destroy;
|
||||
|
||||
widget_class->delete_event = gimp_file_dialog_delete_event;
|
||||
|
||||
dialog_class->response = gimp_file_dialog_response;
|
||||
@@ -147,6 +152,16 @@ gimp_file_dialog_progress_iface_init (GimpProgressInterface *iface)
|
||||
iface->get_window = gimp_file_dialog_progress_get_window;
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_file_dialog_destroy (GtkObject *object)
|
||||
{
|
||||
GimpFileDialog *dialog = GIMP_FILE_DIALOG (object);
|
||||
|
||||
GTK_OBJECT_CLASS (parent_class)->destroy (object);
|
||||
|
||||
dialog->progress = NULL;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gimp_file_dialog_delete_event (GtkWidget *widget,
|
||||
GdkEventAny *event)
|
||||
@@ -164,7 +179,8 @@ gimp_file_dialog_response (GtkDialog *dialog,
|
||||
{
|
||||
file_dialog->canceled = TRUE;
|
||||
|
||||
if (GIMP_PROGRESS_BOX (file_dialog->progress)->active &&
|
||||
if (file_dialog->progress &&
|
||||
GIMP_PROGRESS_BOX (file_dialog->progress)->active &&
|
||||
GIMP_PROGRESS_BOX (file_dialog->progress)->cancelable)
|
||||
{
|
||||
gimp_progress_cancel (GIMP_PROGRESS (dialog));
|
||||
@@ -178,14 +194,17 @@ gimp_file_dialog_progress_start (GimpProgress *progress,
|
||||
gboolean cancelable)
|
||||
{
|
||||
GimpFileDialog *dialog = GIMP_FILE_DIALOG (progress);
|
||||
GimpProgress *retval;
|
||||
GimpProgress *retval = NULL;
|
||||
|
||||
retval = gimp_progress_start (GIMP_PROGRESS (dialog->progress),
|
||||
message, cancelable);
|
||||
gtk_widget_show (dialog->progress);
|
||||
if (dialog->progress)
|
||||
{
|
||||
retval = gimp_progress_start (GIMP_PROGRESS (dialog->progress),
|
||||
message, cancelable);
|
||||
gtk_widget_show (dialog->progress);
|
||||
|
||||
gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog),
|
||||
GTK_RESPONSE_CANCEL, cancelable);
|
||||
gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog),
|
||||
GTK_RESPONSE_CANCEL, cancelable);
|
||||
}
|
||||
|
||||
return retval;
|
||||
}
|
||||
@@ -195,8 +214,11 @@ gimp_file_dialog_progress_end (GimpProgress *progress)
|
||||
{
|
||||
GimpFileDialog *dialog = GIMP_FILE_DIALOG (progress);
|
||||
|
||||
gimp_progress_end (GIMP_PROGRESS (dialog->progress));
|
||||
gtk_widget_hide (dialog->progress);
|
||||
if (dialog->progress)
|
||||
{
|
||||
gimp_progress_end (GIMP_PROGRESS (dialog->progress));
|
||||
gtk_widget_hide (dialog->progress);
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@@ -204,7 +226,10 @@ gimp_file_dialog_progress_is_active (GimpProgress *progress)
|
||||
{
|
||||
GimpFileDialog *dialog = GIMP_FILE_DIALOG (progress);
|
||||
|
||||
return gimp_progress_is_active (GIMP_PROGRESS (dialog->progress));
|
||||
if (dialog->progress)
|
||||
return gimp_progress_is_active (GIMP_PROGRESS (dialog->progress));
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -213,7 +238,8 @@ gimp_file_dialog_progress_set_text (GimpProgress *progress,
|
||||
{
|
||||
GimpFileDialog *dialog = GIMP_FILE_DIALOG (progress);
|
||||
|
||||
gimp_progress_set_text (GIMP_PROGRESS (dialog->progress), message);
|
||||
if (dialog->progress)
|
||||
gimp_progress_set_text (GIMP_PROGRESS (dialog->progress), message);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -222,7 +248,8 @@ gimp_file_dialog_progress_set_value (GimpProgress *progress,
|
||||
{
|
||||
GimpFileDialog *dialog = GIMP_FILE_DIALOG (progress);
|
||||
|
||||
gimp_progress_set_value (GIMP_PROGRESS (dialog->progress), percentage);
|
||||
if (dialog->progress)
|
||||
gimp_progress_set_value (GIMP_PROGRESS (dialog->progress), percentage);
|
||||
}
|
||||
|
||||
static gdouble
|
||||
@@ -230,7 +257,10 @@ gimp_file_dialog_progress_get_value (GimpProgress *progress)
|
||||
{
|
||||
GimpFileDialog *dialog = GIMP_FILE_DIALOG (progress);
|
||||
|
||||
return gimp_progress_get_value (GIMP_PROGRESS (dialog->progress));
|
||||
if (dialog->progress)
|
||||
return gimp_progress_get_value (GIMP_PROGRESS (dialog->progress));
|
||||
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -238,7 +268,8 @@ gimp_file_dialog_progress_pulse (GimpProgress *progress)
|
||||
{
|
||||
GimpFileDialog *dialog = GIMP_FILE_DIALOG (progress);
|
||||
|
||||
gimp_progress_pulse (GIMP_PROGRESS (dialog->progress));
|
||||
if (dialog->progress)
|
||||
gimp_progress_pulse (GIMP_PROGRESS (dialog->progress));
|
||||
}
|
||||
|
||||
static guint32
|
||||
@@ -368,6 +399,10 @@ gimp_file_dialog_set_sensitive (GimpFileDialog *dialog,
|
||||
|
||||
g_return_if_fail (GIMP_IS_FILE_DIALOG (dialog));
|
||||
|
||||
/* bail out if we are already destroyed */
|
||||
if (! dialog->progress)
|
||||
return;
|
||||
|
||||
children =
|
||||
gtk_container_get_children (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox));
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user