Commit Graph

33 Commits

Author SHA1 Message Date
Simon Budig 9a245989c0 fix bogus checks against unsigned variables.
Spotted by Andrey Karpov using static code analysis:
   http://www.viva64.com/en/b/0273/
2014-08-16 00:37:13 +02:00
Michael Natterer 0d481702c7 libgimp*: add GIMP_DEPRECATED macros using G_DEPRECATED
and start using them instead of GIMP_DISABLE_DEPRECATED where possible.
2012-05-03 00:54:21 +02:00
Martin Nordholts 9ddbc55a08 libgimpbase: Disable gimp_wire_read() warning
Disable gimp_wire_read() warning, most of the time it just gives this
confusing error message when the GIMP core crashes:

(script-fu:28495): LibGimpBase-WARNING **: script-fu: gimp_wire_read(): error
2010-07-06 15:15:29 +02:00
Michael Natterer d9b5207aa2 Change licence to GPLv3 (and to LGPLv3 for libgimp).
2009-01-17  Michael Natterer  <mitch@gimp.org>

	* all files with a GPL header and all COPYING files:

	Change licence to GPLv3 (and to LGPLv3 for libgimp).

	Cleaned up some copyright headers and regenerated the parsers in
	the ImageMap plugin.


svn path=/trunk/; revision=27913
2009-01-17 22:28:01 +00:00
Sven Neumann a23029a05f use g_try_new() so a plug-in can't easily crash the core by sending an
2007-12-11  Sven Neumann  <sven@gimp.org>

	* libgimpbase/gimpwire.c (_gimp_wire_read_string): use g_try_new()
	so a plug-in can't easily crash the core by sending an invalid
	string message.

svn path=/trunk/; revision=24316
2007-12-11 09:36:38 +00:00
Sven Neumann 18db691f0e allocate GimpWireHandler structs using GSlice.
2007-12-11  Sven Neumann  <sven@gimp.org>

	* libgimpbase/gimpwire.c (gimp_wire_register): allocate
	GimpWireHandler structs using GSlice.

svn path=/trunk/; revision=24315
2007-12-11 08:39:10 +00:00
Sven Neumann 09cca4bf9a NULL-terminate all strings coming in over the wire protocol. Should help
2007-12-11  Sven Neumann  <sven@gimp.org>

	* libgimpbase/gimpwire.c (_gimp_read_read_string): 
NULL-terminate
	all strings coming in over the wire protocol. Should help with 
bug
	#498207.


svn path=/trunk/; revision=24312
2007-12-11 07:16:04 +00:00
Sven Neumann 2c02cac0ad libgimp/gimp.c cosmetic changes.
2007-07-30  Sven Neumann  <sven@gimp.org>

	* libgimp/gimp.c
	* libgimpbase/gimpwire.c: cosmetic changes.

svn path=/trunk/; revision=23075
2007-07-30 15:44:56 +00:00
Sven Neumann 3254ed4d42 if the wire protocol is used without prior initialization, abort with
2007-06-25  Sven Neumann  <sven@gimp.org>

	* libgimpbase/gimpwire.c: if the wire protocol is used without
	prior initialization, abort with g_error() instead of crashing.

svn path=/trunk/; revision=22831
2007-06-25 10:42:52 +00:00
Sven Neumann 75737492db sprinkled a few G_UNLIKELY() macros to help the compiler.
2006-03-30  Sven Neumann  <sven@gimp.org>

	* libgimpbase/gimpwire.c (gimp_wire_read, gimp_wire_write):
	sprinkled a few G_UNLIKELY() macros to help the compiler.
2006-03-30 08:43:34 +00:00
Sven Neumann 3343baa84c added utility functions to send GimpRGB values over the wire.
2006-02-23  Sven Neumann  <sven@gimp.org>

	* libgimpbase/gimpwire.[ch]: added utility functions to send
	GimpRGB values over the wire.

	* libgimpbase/gimpprotocol.c: use the functions.
2006-02-23 13:53:32 +00:00
Sven Neumann 4467e1cd4b let the private wire methods live in the GIMP namespace. Declare internal
2005-12-13  Sven Neumann  <sven@gimp.org>

        * libgimpbase/gimpwire.[ch]: let the private wire methods live in
        the GIMP namespace. Declare internal functions as such and prefix
        them with an underscore.

        * libgimp/gimp.c
        * libgimp/gimptile.c
        * libgimpbase/gimpbase.def
        * libgimpbase/gimpprotocol.c
        * app/plug-in/plug-in-message.[ch]
        * app/plug-in/plug-in-run.c
        * app/plug-in/plug-in.c: changed accordingly.
2005-12-13 14:11:56 +00:00
Michael Natterer bd27b41457 added assertions to make sure "count" is always >= 0. Turns the crash
2004-10-04  Michael Natterer  <mitch@gimp.org>

	* libgimpbase/gimpwire.c: added assertions to make sure "count" is
	always >= 0. Turns the crash described in bug #154266 into a
	warning plus corrupted wire state :) Real fix (in script-fu) will
	follow. Untabified.
2004-10-04 13:25:33 +00:00
Manish Singh e1de2dbc06 using a union like that may not be completely portable. Use a guint8 array
2002-11-25  Manish Singh  <yosh@gimp.org>

        * libgimpbase/gimpwire.c: using a union like that may not be
        completely portable. Use a guint8 array instead. One wonders
        if we really need to support the off-chance someone will make
        a distributed gimp framework with this current incarnation
        of the wire protocol.
2002-11-25 10:12:02 +00:00
Manish Singh 0c06eda874 use a union instead of separate types to read/write doubles so we don't
2002-11-25  Manish Singh  <yosh@gimp.org>

        * libgimpbase/gimpwire.c: use a union instead of separate types to
        read/write doubles so we don't violate C's aliasing rules. Fixes
        bug #85249.
2002-11-25 08:02:54 +00:00
Michael Natterer dba356d815 libgimpbase/gimpprotocol.[ch] pass "gpointer user_data" to all functions,
2002-05-16  Michael Natterer  <mitch@gimp.org>

	* libgimpbase/gimpprotocol.[ch]
	* libgimpbase/gimpwire.[ch]: pass "gpointer user_data" to all
	functions, which in gets turn passed to the registered reader,
	writer, and flusher funcs.

	* libgimp/gimp.c
	* libgimp/gimptile.c: pass NULL as user_data. We have only one
	pipe on the plug-in side.

	* app/plug-in/plug-in.c: pass the PlugIn as user_data. As a
	consequence, got rid of more global variables. The global
	"current_plug_in" and the plug_in_push()/pop() madness are still
	there. Will reeplace them by some less ugly hack later...

2002-05-16  Michael Natterer  <mitch@gimp.org>

	* libgimpbase/tmpl/gimpprotocol.sgml
	* libgimpbase/tmpl/gimpwire.sgml: regenerated after API change.
2002-05-16 17:41:38 +00:00
Michael Natterer 51f99c3259 app/plug_in.c libgimpbase/gimpwire.c removed GIOChannel
2001-08-30  Michael Natterer  <mitch@gimp.org>

	* app/plug_in.c
	* libgimpbase/gimpwire.c
	* libgimp/gimp.c: removed GIOChannel "channel->funcs->io_foo()"
	hacks and use plain g_io_channel_[read|write]_chars(). An
	additional g_io_channel_set_buffered (channel, FALSE); is needed
	to make the channels work in binary mode. Fixed misc other stuff
	in the GIOChannel code.

	* app/tools/gimpdrawtool.c
	* app/tools/gimpmovetool.c
	* app/tools/gimptransformtool.c
	* app/widgets/gimpdialogfactory.c
	* libgimpwidgets/gimpcolorarea.c
	* libgimp/gimpui.c: replaced some deprecated GDK functions.

	* app/gui/palette-editor.c: block the color_name entry's "changed"
	signal while setting it. Fixes invalid UTF-8 warnings.
2001-08-30 01:09:58 +00:00
Michael Natterer 98410c35a9 added -DG_DISABLE_DEPRECATED and -DGDK_DISABLE_COMPAT_H.
2001-08-29  Michael Natterer  <mitch@gimp.org>

	* configure.in: added -DG_DISABLE_DEPRECATED and
	-DGDK_DISABLE_COMPAT_H.

	* app/batch.c
	* app/file-utils.c
	* app/gdisplay.c
	* app/gdisplay_ops.c
	* app/gimprc.[ch]
	* app/module_db.c
	* app/nav_window.c
	* app/undo_history.c
	* app/core/gimpgradient.c
	* app/core/gimpimagefile.c
	* app/core/gimppalette.c
	* app/gui/color-notebook.c
	* app/gui/convert-dialog.c
	* app/gui/error-console-dialog.c
	* app/gui/file-commands.c
	* app/gui/file-open-dialog.c
	* app/gui/file-save-dialog.c
	* app/gui/gradient-editor.c
	* app/gui/info-window.c
	* app/gui/menus.c
	* app/gui/palette-import-dialog.c
	* app/tools/gimpbycolorselecttool.c
	* app/widgets/gimpcontainerview-utils.c
	* app/widgets/gimpdatafactoryview.c
	* libgimp/gimpmenu.c
	* plug-ins/common/bz2.c
	* plug-ins/common/compose.c
	* plug-ins/common/csource.c
	* plug-ins/common/decompose.c
	* plug-ins/common/gz.c
	* plug-ins/common/uniteditor.c
	* plug-ins/common/wmf.c
	* plug-ins/common/xbm.c
	* plug-ins/rcm/rcm_dialog.c
	* plug-ins/script-fu/interp_slib.c
	* plug-ins/script-fu/script-fu-console.c
	* plug-ins/script-fu/script-fu-scripts.c
	* tools/pdbgen/pdb/fileops.pdb
	* tools/pdbgen/pdb/gimprc.pdb
	* app/pdb/fileops_cmds.c
	* app/pdb/gimprc_cmds.c: removed deprecated stuff like
	g_basename(), g_dirname(), g_strup() and friends. Added some
	"const gchar *" declarations while I was on it. Added some
	G_N_ELEMENTS() macros instead of declaring a useless variable
	for the number of items.

	* app/widgets/gtkhwrapbox.[ch]
	* app/widgets/gtkvwrapbox.[ch]
	* app/widgets/gtkwrapbox.[ch]: replaced with the latest versions
	from GLE, ported by the master himself.

	* app/gui/toolbox.c: changed accordingly.

	* app/plug_in.c
	* libgimp/gimp.c
	* libgimpbase/gimpwire.[ch]: use evil hacks to get binary mode
	from the new GIOChannel implementation (upstream bugreport already
	posted).
2001-08-29 17:48:28 +00:00
Michael Natterer dcaeb08a13 remove the usage of printf()/scanf() when sending doubles over the wire.
2001-07-15  Michael Natterer  <mitch@gimp.org>

	* libgimpbase/gimpwire.c: remove the usage of printf()/scanf()
	when sending doubles over the wire. Instead, rely on the memory
	layout of gdouble being IEEE compliant and transmit 8 bytes in
	network byte order.

	* libgimpbase/gimpprotocol.h: increase GP_VERSION because this
	makes the wire protocol binary incompatible.

	* app/main.c
	* libgimp/gimp.c: removed the setlocate(LC_NUMERIC,"C") workaround.
2001-07-15 20:47:03 +00:00
Michael Natterer 804af727f6 app/gimpunit.c all libgimp headers are included via gimp.h or gimpui.h, so
2000-05-31  Michael Natterer  <mitch@gimp.org>

	* app/gimpunit.c
	* libgimp/*: all libgimp headers are included via gimp.h or
	gimpui.h, so include <gtk/gtk.h> there and in the *.c files.
	Various cleanups.
2000-05-30 23:38:46 +00:00
Michael Natterer 3fc6d56d1d After a weekend of extensive mail exchange with the signal crew, we
2000-05-14  Michael Natterer  <mitch@gimp.org>

	After a weekend of extensive mail exchange with the signal crew,
	we finally found that #2742 is not a Gimp bug but a real OSF/1
	bug. OSF/1 does _not_ reliably restart read() and write() calls
	on certain slow devices (pipes).

	* libgimp/gimpwire.[ch]: guard all read/write calls on the wire
	with loops checking for EINTR. This has to be done "manually"
	as glib's GIOChannels return G_IO_ERROR_UNKNOWN on the occurence
	of EINTR (which is a bug, too).
	s/int/gboolean and minor cleanups while I was on it (not changing
	any logic).

	This fix depends on the current (broken) state of the GIOChannel
	implementation and is scheduled for removal as soon as glib
	behaves nicely here.

	Left SA_RESTART there for the moment in app/main.c. See it as
	defensive programming or just my fear to change two #2742-related
	places at the same time. We might choose to remove SA_RESTART
	later. Many thanks again to Austin, Garry and Tim.
2000-05-14 12:09:43 +00:00
Michael Natterer 86e4b1ef65 Another try to get the signal/dead child recovery stuff right.
2000-05-10  Michael Natterer  <mitch@gimp.org>

	Another try to get the signal/dead child recovery stuff right.

	Could the brave signal crew (TM) (Austin, Garry, Raphael, Tim)
	please do bad tests to the new code? I removed all strange
	constants (SA_NODEFER etc.) and used only glib and POSIX stuff.

	* app/main.c
	* libgimp/gimp.c:
	- Call gimp_signal_private() with no flags to enforce a proper
	  sigaction() behaviour (block signals while handler is active).
	- Removed the reentrancy guards from the handlers.
	- Renamed the handlers.
	- Ignore SIGPIPE in the app and in plugins.
	- Re-introduced the SIGCHLD handler because it should work
	  now. Also added a SIGCHLD handler to libgimp/gimp.c.

	* app/errors.c
	* libgimp/gimp.c: in the signal handler, unblock all signals
	with sigprocmask() before calling g_on_error_query() because
	gdb otherwise inherits the blocked signals and does nothing.
	Wrapped the statements with "if (TRUE) { }" blocks so it's
	easy to make the stack trace a command line option.

	* app/plug_in.c
	* libgimp/gimp.c: listen for G_IO_ERR and G_IO_HUP on the read
	channels. In the app, pop up an error message and clean up the
	plugin. In plugins, clean up and exit.

	* libgimp/gimpwire.c: removed the "plug-in chrashed?" message
	and print the program's name with all error messages.

	* plug-ins/helpbrowser/helpbrowser.c: typo.
2000-05-10 21:21:23 +00:00
Sven Neumann d4250cb410 please picky compilers
--Sven
1999-12-06 22:44:40 +00:00
Marc Lehmann df8b445be6 *** empty log message *** 1999-11-17 21:13:50 +00:00
Manish Singh d0519fd33d use G_OS_WIN32 and G_HAVE_CYGWIN #defines
* app/app_procs.c
* app/gdisplay_color.[ch]
* app/gdisplay_color_ui.c: make the ui usable

* app/gdisplay.c: enable cdisplay support

* modules/Makefile.am
* modules/cdisplay_gamma.c: moved gamma functionality to separate

-Yosh
1999-10-04 19:26:07 +00:00
Tor Lillqvist b6021023ee No need for <io.h> on Win32.
* libgimp/gimp.c: No need for <io.h> on Win32.

	* libgimp/{gimp,gimpui}.def: Add two entry points.

	* libgimp/gimp.h: Can't use __declspec(dllexport) for PLUG_IN_INFO
	when compiling with gcc on Win32. Also handle __argc, __argv and
	_stdcall differently with gcc on Win32

	* libgimp/gimpenv.c: Include <string.h>.

	* libgimp/gimpfeatures.h.in: Remove lots of extraneous trailing blanks.

	* libgimp/gimpfileselection.c: Include <glib.h> early, see above.

	* libgimp/{gimpwire,parasite}.c: Test for NATIVE_WIN32, not
	_MSC_VER.

	* libgimp/makefile.msc: Miscellaneous updates. The gimpi library
 	is now built as a static library.
1999-05-28 21:56:04 +00:00
Tor Lillqvist 951c92a602 Second batch of Win32 merge. 1999-03-07 12:56:03 +00:00
Manish Singh 25f3cc8d31 require GTK+ 1.1.5
* configure.in: require GTK+ 1.1.5

* app/bezier_select.c
* app/channels_dialog.c
* app/global_edit.c
* app/layers_dialog.c
* plug-ins/film/film.c
* plug-ins/gfig/gfig.c
* plug-ins/xd/xd.c
* plug-ins/libgck/gck/gcklistbox.c: fixes for new scrolled window viewport
behavior

* libgimp/gimpwire.c
* app/xcf.c: use g_htonl and friends

* app/main.c: ditch some unused variables

* app/Makefile.am: removed unused pixmap references

-Yosh
1998-11-23 09:25:10 +00:00
Manish Singh 84abd5d700 Have fun recompiling gimp everyone. It's the great FSF address change!
-Yosh
1998-04-13 05:44:11 +00:00
Sven Neumann 2a866db2bf Applied Raphael Quinet's patch that changes the wire_read error message to
something slightly more useful.


--Sven
1998-03-15 12:46:59 +00:00
Manish Singh 2afd3ffb75 From the Changelog:
* Makefile.am: don't do docs generation by default

        * configure.in: -lXt for webbrowser plugin

        * libgimp/gimp.c
        * libgimp/gimpprotocol.c
        * libgimp/gimptile.c
        * libgimp/gimpwire.c
        * app/plug_in.c: applied memory leak patch from Mattias Gronlund

        * app/eraser.c
        * app/eraser.h
        * app/internal_procs.c
        * app/paintbrush.c
        * app/paintbrush.h: incremental modes for eraser and paintbrush,
        as well as a "hard eraser"

        * plug-ins/ifscompose/ifscompose.c: pixmap visual fixups

-Yosh
1998-03-01 01:18:45 +00:00
Manish Singh 92ab4b4278 Placed libgimp under LGPL
-Yosh
1998-01-25 10:26:47 +00:00
Elliot Lee 32cefec8f7 Initial revision 1997-11-24 22:05:25 +00:00