Commit Graph

267 Commits

Author SHA1 Message Date
Jehan ee2f86105c app: move "System Language" out of GIMP_L10N_LANGS_SIZE.
This is the only "language" from the list whose name is special and
should be localized at runtime, yet before we set any Preferences
language. It needs to be localized as the System Language itself which
will be run-dependant.

For instance, if your system is in French, it will be displayed as
"Langue système" but if you change your system to Korean, at next run,
it would show "시스템 언어". It is a per-run localization, independant
from the language selected in Preferences, and even less dependant from
build-time system language.
2024-08-15 20:57:02 +02:00
Jacob Boerema f78186e03b Get rid of old Windows specific defines
MINGW64
- uses 0x601 as value for _WIN32_WINNT. No need for us to define
it to that value or even lower values in some places.
This also gets rid of:  warning: "_WIN32_WINNT" redefined
- has 0x0502 for WINVER, so get rid of us setting it to 0x0500 in
gimp-app-test-utils.h. It also seems that the need to use G_OS_WIN32
has disappeared here.
- DIRECTINPUT_VERSION is 0x0800, no need for us to set it to that value.
- AI_ADDRCONFIG was apparently missing from the MINGW headers in the
past, but not anymore.
2024-01-24 12:10:00 -05:00
Idriss Fekir e93e7a124c Improve text quality of UI on Windows
When using the default pangocairo backend (win32),
AA is not enabled.

Switching to the FontConfig backend fixes the problem.
2023-09-02 21:09:06 +00:00
Lukas Oberhuber 5ccac0dd9b macos: Remove DYLD_LIBRARY_PATH
Revert: https://gitlab.gnome.org/GNOME/gimp/-/merge_requests/561
2023-08-13 12:09:14 +00:00
Jehan dc8ba756e4 app: debug menu and playground should be visible on non-releases stable branch.
These should be hidden on stable releases and shown on unstable branch. But
we'll also want to show these in the stable branch, outside of release
(typically when we'll be at 3.0.1).
2023-07-15 15:06:51 +02:00
Jehan 7c1fb5bc67 app: return EXIT_FAILURE when failing to pass the batch commands to…
… the main instance.

Note that it doesn't say if the batch command succeded, only if they were
successfuly communicated to the main process for processing.
2023-06-12 01:20:11 +02:00
Luca Bacci 005b3a05b8 Make use of the gimp_bind_text_domain () util function 2023-01-24 14:48:44 +00:00
Luca Bacci db570de3b2 Use SetDllDirectoryW ()
No need to use GetProcAddress (), SetDllDirectory () is available
since XP SP1
2023-01-24 14:48:44 +00:00
Luca Bacci ed1e4236ba Use GetModuleHandleW ()
Also fix an unwanted ref-count increment on a module HANDLE
2023-01-24 14:48:44 +00:00
Luca Bacci c98ffb7e0e Replace uses of plain fopen () with GLib's g_fopen ()
On Windows fopen () is limited to the current codepage,
GLib's g_fopen () instead accepts full UTF-8 by calling
_wfopen () internally (or a similar wide-char CRT routine).
2023-01-24 14:48:44 +00:00
Luca Bacci 0657b85202 Use GLib to convert between UTF-8 and UTF-16 2023-01-24 14:48:44 +00:00
Lukas Oberhuber e62f00ad4e macos: support MacPorts
This provides MacPorts support which is now the official way that
the MacOS port is built and packaged.
2022-11-22 14:36:22 +00:00
Lukas Oberhuber 271435534f macos: support for homebrew build
Supports running gimp in homebrew builds which have more complex
structures of where things are placed.
2022-07-27 17:06:21 +00:00
Jehan 5831f5ef4e app: when called with --quit, GIMP exit code will report batch failure.
If you call GIMP with batch commands and ask it to quit immediately, you
are likely interested by failure information. For this reason, let's now
report exit code other than success, but only in such case. In
particular, even if the batch commands fail, but GIMP is not set to exit
immediately, we continue reporting SUCCESS run at the very end (when
exiting interactively).

Note that I hardcode a few exit values, as standardly found on Linux
(but not using headers which may not be found on all platforms; in
particular, Windows apparently doesn't use any standard code other than
0 for success, from what my searches return).

Additionally, when several commands are requested, GIMP will now stop at
the first failing and will return its error code, and print a message on
stderr to easily report the failed command for easier debugging.
2022-04-16 02:30:46 +02:00
Jehan 028210369a app: add a new --quit CLI option to quit GIMP after a batch script.
Instead of asking for the script to call gimp_quit() which is not too
proper (because this is actually meant to exit the script, not GIMP
itself. Scripts should not have the ability to basically kill the main
GIMP process), let's add a `--quit` option which does what it says: it
quits GIMP immediately (after having processed any task on command line,
such as running batch scripts).

See discussions in issue #7376.
2022-04-16 01:40:17 +02:00
Lukas Oberhuber ce90cc28a1 macos: support python plugins in meson
This change makes sure that plugins can load when gimp is built with
meson. This is because .typelibs and .gir files do not have full library
paths when build using meson (this is different from autotools).
2022-01-24 02:12:22 +00:00
Lukas Oberhuber 41ff82acbf macos: style cleanup in gimp wrapper code 2021-12-22 12:59:06 +00:00
Lukas Oberhuber d8afa6c829 gimp: macOS run from build directory
This change allows gimp to run from the build
directory rather than having to wait for the
full packaging process to complete.

However, 'gi' modules are not loading properly
so that might be something to fix.
2021-12-22 01:34:58 +00:00
Niels De Graef bba495999d app: Use g_clear_object() in main.c
Also no need to do a null-check if you're doing g_free(), it can handle
that already.
2021-12-17 09:49:05 +01:00
Lukas Oberhuber 6821636a7b gimp_macos_setenv: set GI_TYPELIB_PATH macos
This sets the GI_TYPELIB_PATH so that macOS
gobject-introspection can find the typelib files.
2021-12-03 10:14:35 +00:00
Lukas Oberhuber b0547a72c6 macos env: Fix #7567, crash on new and open dialog
Fixes https://gitlab.gnome.org/GNOME/gimp/-/issues/7567
2021-12-01 23:12:44 +00:00
Lukas Oberhuber ee30d50d60 packaging: Update paths for MacOS
Updates the various path variables used to run the applicaition on Mac.
This includes update to python.
2021-11-30 17:09:00 +00:00
Luca Bacci 825ea9dc1c
Move initialization order 2021-08-25 20:35:02 +02:00
Jehan 03d6bc9726 app: do not use PATH_MAX and realpath() on macOS.
See the comments in MR!424.
Basically realpath relies on false assumptions (probably ones which used
to be true when the API got created) on the max size of a path. Actually
nowadays paths can be much bigger than what the macro advertizes or can
even be unbounded.
The Linux version of realpath() allows the second parameter to be NULL,
in which case it would allocate the buffer, exactly for this reason
(written in the BUGS section on the man). Unfortunately this behavior is
not standardized in POSIX and the man from Apple I found does not
indicate it will do this.

So let's use g_canonicalize_filename() instead, which seems to do the
right thing. Similarly use g_strdup_printf instead of g_snprintf().
2021-03-25 03:15:50 +01:00
Oleksii Samorukov 12bc46ce14 Set required variables if is running from Apple application bundle
(cherry picked with small changes from commit 
e13e7fd8b6)
2019-11-03 15:07:46 +01:00
Michael Natterer 11ce199cea app: stop canonicalizing procedure names
on behalf of plug-in authors who have no style or can't type.

Instead, simply reject non-canonical procedure names and remove all
code that keeps aroud the original non-canonical shit just to pass it
back to the plug-in.
2019-08-18 01:55:47 +02:00
Ell 853d91b8e4 app: initialize GimpBacktrace earlier on
Initialize GimpBacktrace earlier on in the startup process, so that
the Windows backend installs the thread-name exception handler
early enough to catch threads created before app_run() (in
particular, the GEGL worker threads).
2019-05-19 10:49:57 -04:00
Jehan d5b0f71b4c app: open the Windows console a bit earlier.
If we enable the console on Windows, we might as well open it as fast as
possible, since its purpose is debugging.

(cherry picked from commit c9d7618056)
2018-08-15 14:34:26 +02:00
Jehan ddeff31476 app, configure: add a --enable-win32-debug-console build option.
Debugging stable versions under Windows is a pain because we don't have
access to the standard outputs. The debug console is indeed only built
on unstable builds. Let's make the debug console a separate build option
to allow building stable versions for debug (obviously the default
behavior when not configuring, is same as before, i.e. stable without
console and unstable with console).

(cherry picked from commit 1a28878943)
2018-08-12 22:54:25 +02:00
Michael Natterer 5f700549e7 Change the license URL from http://www.gnu.org/licenses/ to https:// 2018-07-11 23:29:46 +02:00
Jehan 4d6cba0cfb app: make --show-playground visible in --help.
After Alexandre Prokoudine's insistent demand! :-)
I am still not sure how wise this is, since this should be really
considered a "developer-only" option. Basically these tools are really
too buggy and unstable and we should not shine too much light on these.
The counter-argument is that doing so will favor the bitrot.

Well ok. At least let's add a big warning message at the top of the
Playground page, to make it very clear (if that were not already the
case) that basically this is not to be considered a secret feature, but
really more a "we are looking for contributors" option.
2018-04-21 15:48:22 +02:00
Ell 53c145c0be app: add --show-debug-menu command-line option
The debug menu is currently not included in stable versions.

Include the menu unconditionally, but hide it, and its associated
actions, by default in stable versions.  Allow enabling the menu
using a new --show-debug-menu command-line option, in the same vein
as --show-playground.
2018-03-29 05:26:03 -04:00
Jehan 1b4efd2d5a app, tools: rename app/version.[ch] to app/gimp-version.[ch].
Since commit 9fdf35550b, I removed the GIMP_APP_GLUE_COMPILATION check
because we need to have the whole versioning info from the new debug
widget. It just makes sense to go further and just make this a proper
internal API to get version information.
2018-01-29 01:48:30 +01:00
Jehan 4e5a5dbb87 app: make the backtrace GUI actually work on Win32.
It was previously untested, hence as expected needed fixes. First I add
our own exception handler using Win32 API SetUnhandledExceptionFilter().
Second, I reorder things so that ExcHndlInit() is run after this setter,
since they will be executed as a FILO and we need backtraces to be
generated before our separate GUI runs. Last I run the backtrace GUI as
async. No need to keep the main GIMP waiting since the traces have
already been generated into a separate file.

Also replace gtk_show_uri() by the implementation taken straight from
our web-browser plug-in, since apparently gtk_show_uri() doesn't work in
Windows (and probably not macOS either since I see we have a separate
implementation for this platform as well). I would like to be able to
use the PDB but can't because this code needs to be usable both within
the main process and into a separate tool process. Ideally, this should
just be a utils function which could be included without a problem.
2018-01-28 15:43:07 +01:00
Jehan ae3cd00fbd app, tools: add support for ExcHndl/DrMinGW for Win32 debugging.
The feature already exists in our code and produces backtraces upon a
crash into a file. The only difference is that we are now getting the
file contents and showing it in our new debug dialog, so that it works
similarly on all platform (and therefore making the debug info visible
to people, otherwise they would never report, even though the data is
generated).
The difference with gdb/lldb is that it doesn't allow backtraces at
random points (for debugging non-fatal yet bad errors). Also the API has
just 2 functions and in particular an ExcHndlInit() but no way to unload
the feature. So we don't need the debugging page in Preferences because
the switch option would not work. On Windows, the feature will be
decided at build time only.

Last point: the code is untested on Windows so far. I assume it would
work, but there is at least one point I am unsure of: will ExcHndl have
already generated the backtrace file when gimpdebug runs? If not, I will
have to let gimp die first to be able to get the backtrace.
2018-01-28 15:43:07 +01:00
Jehan f8411a3d1f app: add a "generate-backtrace" preference in GimpCoreConfig.
This will determine whether to output backtrace in a GUI and is disabled
by default on stable, and activated in dev builds. It is a bit redundant
with --stack-trace-mode option CLI and will take priority when enabled
since most people would run GIMP with a graphical interface anyway.
2018-01-28 15:43:07 +01:00
Ell d37fb8aa5c app: split sanity check into early/late stages, to fix gegl translation
The GEGL ops sanity check causes all ops to be initialized.  The
strings used by their properties will pick the translation selected
at the time of the check.  It must therefore run after language
intiailization, otherwise the selected translation would correspond
to the system locale, even if the user selected a different language
in the preferences.

Split the sanity check into early and late stages.  The early stage
is run before the call to app_run(), as it did before, while the
late stage is run during app_run(), after the configuration has been
loaded.  Currently, the GEGL ops check is the only late-stage check;
all other checks are performed during the early stage.
2017-06-15 09:51:25 -04:00
Jehan bc344a9991 Bug 750180 - Fix different ways of writing Plug-in Plug-In Plugin.
It was agreed that we should write "plug-in" consistently. Only possibly
user-visible strings were updated.
Thanks to scootergrisen for a first patch which could not make it
after changing decision on the canonical writing.
2017-03-21 17:52:22 +01:00
Michael Natterer 20a32d970d Bug 599573 - Remember dialog defaults between Gimp sessions
Add GimpFillOptions and GimpStrokeOptions to GimpDialogConfig and use
them in the Fill/Stroke Selection/Path dialogs and for the "with last
values" commands. Add GUI for them to Preferences -> Dialog Defaults.

This requires most of the stuff in my last few commits, and some
more changes:

GimpFillOptions is a GimpContext which has all sorts of connections to
everything, including a Gimp pointer. Hack around in GimpDialogConfig
to add a Gimp property, and add "gimp" parameters to quite some GimpRC
functions. Treat the Gimp* as a GObject* in all public API because
core/ stuff is not known in config/.
2016-09-14 01:27:42 +02:00
Michael Natterer 6fe900f7a7 app: always call gimp_load_config() on a newly created Gimp instance
Simply creating and destroying a Gimp now creates and destroys more
members, and some of them always need a gimp->config object.
2016-09-13 12:55:17 +02:00
Michael Natterer 631110e061 app: merge units.[ch] into core/gimp-units.[ch]
and initialize units in gimp_init(). This was completely
over-engineered but in the end boils down to a bad hack that needs a
static "the_unit_gimp" pointer anyway, so let's at least have the hacks
in one file.
2016-09-12 23:51:29 +02:00
Jehan 6edc9380f3 app: fix warnings for win32 builds.
Eliminates some "assignment from incompatible pointer type" warnings,
on calls to GetProcAddress().
2016-05-29 18:27:58 +02:00
Jehan 48b8df2f14 Indentation (tabs) cleanup. 2016-05-29 02:37:32 +02:00
Jehan 2bb0f1b1c9 app: fix "_WIN32_WINNT" redefined when cross-compiling with mingw-w64.
It was already defined in _mingw.h, provided with mingw-w64 headers.
2016-05-29 02:26:04 +02:00
Massimo Valentini 062cf1a5ab Bug 766895: The --dump-pdb-procedures-deprecated...
argument triggers a segmentation fault

Initialize babl so that, when gimp is unreffed,
using a babl_format to destroy a std brush does
not crash.
2016-05-27 19:30:49 +02:00
Mukund Sivaraman 6a6604871f windows: Add support for generating crash backtraces using Dr. MingW 2016-01-02 18:55:37 +05:30
Michael Natterer d5255dc133 app: derive GimpProcedure from GimpViewable
and remove redundant icon managing code from GimpPlugInProcedure
2016-01-01 20:05:32 +01:00
Jehan cd2b395194 app: batch commands won't run on existing instance. 2015-09-28 22:31:21 +02:00
Michael Henning 3e0d10d860 win: Group gimp windows together on the taskbar.
The plug-ins and the main window used to be separate.
2015-08-10 22:27:45 -04:00
Mukund Sivaraman 60197c227d windows: Call SetDLLDirectory() in the app
With this patch, there should be no more need to set PATH on Windows
before running GIMP.

This patch was tested by me and drawoc, but there could be some
undetected issues lurking. Revert if any problems arise.
2015-04-13 15:45:58 +05:30