Commit Graph

9 Commits

Author SHA1 Message Date
Michael Natterer 18d9161eea Get rid of the "current_context" which was in fact just a bunch of global
2004-04-15  Michael Natterer  <mitch@gimp.org>

	Get rid of the "current_context" which was in fact just a bunch of
	global variables. Instead, pass the needed context all the way
	from the GUI and the PDB to the core. This is a prerequisite for
	macro recording and generally helps separating the various
	subsystems from each other. Work in progress...

	* app/core/gimp.[ch]: removed member "current_context" and
	gimp_[get|set]_current_context().

	* app/core/gimp-edit.[ch]
	* app/core/gimpdrawable-blend.[ch]
	* app/core/gimpdrawable-bucket-fill.[ch]
	* app/core/gimpdrawable-offset.[ch]
	* app/core/gimpdrawable-transform.[ch]
	* app/core/gimpimage-crop.[ch]
	* app/core/gimpimage-flip.[ch]
	* app/core/gimpimage-merge.[ch]
	* app/core/gimpimage-resize.[ch]
	* app/core/gimpimage-rotate.[ch]
	* app/core/gimpimage.[ch]
	* app/core/gimpimagefile.[ch]
	* app/core/gimpitem-linked.[ch]
	* app/core/gimpitem.[ch]
	* app/core/gimplayer.[ch]
	* app/core/gimpselection.[ch]
	* app/core/gimptemplate.[ch]
	* app/file/file-open.[ch]
	* app/file/file-save.[ch]
	* app/pdb/procedural_db.[ch]
	* app/text/gimptext-compat.[ch]
	* app/text/gimptextlayer-transform.[ch]
	* app/gui/brush-select.[ch]
	* app/gui/font-select.[ch]
	* app/gui/gradient-select.[ch]
	* app/gui/palette-select.[ch]
	* app/gui/pattern-select.[ch]: added tons of "GimpContext *context"
	parameters and use the passed context instead of
	gimp_get_current_context().

	* app/app_procs.c
	* app/batch.c
	* app/core/gimpchannel.c
	* app/core/gimpdrawable.c
	* app/paint/gimperaser.c
	* app/paint/gimppaintbrush.c
	* app/plug-in/plug-in-message.c
	* app/plug-in/plug-ins.c
	* app/text/gimptextlayer.c
	* app/tools/gimpblendtool.c
	* app/tools/gimpbucketfilltool.c
	* app/tools/gimpcroptool.c
	* app/tools/gimpeditselectiontool.c
	* app/tools/gimpfliptool.c
	* app/tools/gimpinktool.c
	* app/tools/gimptransformtool.c
	* app/vectors/gimpvectors.c
	* app/gui/convert-dialog.c
	* app/gui/drawable-commands.c
	* app/gui/edit-commands.c
	* app/gui/file-commands.c
	* app/gui/file-new-dialog.c
	* app/gui/file-open-dialog.c
	* app/gui/file-save-dialog.c
	* app/gui/image-commands.c
	* app/gui/layers-commands.c
	* app/gui/offset-dialog.c
	* app/gui/select-commands.c
	* app/gui/vectors-commands.c
	* app/widgets/gimpdnd.c
	* app/widgets/gimpdocumentview.c
	* app/widgets/gimphelp.c
	* app/widgets/gimpthumbbox.c: pass gimp_get_user_context() or
	GIMP_CONTEXT(tool_options) or whatever is the right context
	to the changed core functions.

	* tools/pdbgen/app.pl: pass "GimpContext *context" to all
	generated PDB invokers.

	* tools/pdbgen/pdb/brush_select.pdb
	* tools/pdbgen/pdb/brushes.pdb
	* tools/pdbgen/pdb/drawable.pdb
	* tools/pdbgen/pdb/edit.pdb
	* tools/pdbgen/pdb/font_select.pdb
	* tools/pdbgen/pdb/gradient_select.pdb
	* tools/pdbgen/pdb/gradients.pdb
	* tools/pdbgen/pdb/image.pdb
	* tools/pdbgen/pdb/layer.pdb
	* tools/pdbgen/pdb/paint_tools.pdb
	* tools/pdbgen/pdb/palette.pdb
	* tools/pdbgen/pdb/palette_select.pdb
	* tools/pdbgen/pdb/palettes.pdb
	* tools/pdbgen/pdb/paths.pdb
	* tools/pdbgen/pdb/pattern_select.pdb
	* tools/pdbgen/pdb/patterns.pdb
	* tools/pdbgen/pdb/selection.pdb
	* tools/pdbgen/pdb/text_tool.pdb
	* tools/pdbgen/pdb/transform_tools.pdb: pass the new context
	parameter to the changed core functions.

	* app/pdb/*_cmds.c: regenerated.
2004-04-14 23:37:34 +00:00
Michael Natterer 062c2fd4ea Made 3rd party scripts work again after all that PDB function renaming:
2003-12-05  Michael Natterer  <mitch@gimp.org>

	Made 3rd party scripts work again after all that PDB function
	renaming:

	* app/core/gimp.[ch]: added "GHashTable *procedural_compat_ht" to
	the Gimp struct which maps old procedure names to new ones.
	Call new function procedural_db_init_procs() instead of
	internal_procs_init().

	* app/pdb/procedural_db.[ch]: create and destroy the new compat
	hash table. Added new function procedural_db_init_procs() which
	registers the internal procedures and fills the compat hash table.

	(procedural_db_execute): minor fixes.

	* app/plug-in/plug-in-message.c (plug_in_handle_proc_run): if
	the requested procedure was not found, try the compat table.

	* tools/pdbgen/pdb/procedural_db.pdb: made all PDB query
	procedures compat aware. For compat procedures, return help
	strings which declare the procedure as deprecated and tell
	the new name of the procedure. Cleanup.

	* app/pdb/procedural_db_cmds.c: regenerated.
2003-12-05 13:02:18 +00:00
Michael Natterer 451d392aac Some PDB cleanup:
2002-09-10  Michael Natterer  <mitch@gimp.org>

	Some PDB cleanup:

	* tools/pdbgen/pdb/procedural_db.pdb: removed the get_data() and
	set_data() implementations and the global "data_list" variable.
	Cleaned up the dump() stuff (pass the FILE pointer around instead
	of having a global variable for it). Fixed output_string() so it
	does not crash on NULL strings.

	* app/core/gimp.[ch]: added gimp->procedural_db_data_list.

	* app/pdb/procedural_db.[ch]: added procedural_db_[set|get]_data().
	Don't leak data identifiers when overwriting an already existing
	entry. Added g_return_if_fail() stuff to all public functions.

	* tools/pdbgen/pdb/channel.pdb
	* tools/pdbgen/pdb/drawable.pdb
	* tools/pdbgen/pdb/layer.pdb
	* tools/pdbgen/pdb/parasite.pdb: tweaked some helper functions to
	take parameters which make them aware of the real type of the
	objects they handle (e.g. the PDB function gimp_layer_set_name()
	matches the core function gimp_object_get_name()).

	* app/pdb/pdb_glue.h: removed ugly CPP-level workarounds for the
	issue mentioned above.

	* app/pdb/channel_cmds.c
	* app/pdb/drawable_cmds.c
	* app/pdb/layer_cmds.c
	* app/pdb/parasite_cmds.c
	* app/pdb/procedural_db_cmds.c: regenerated.
2002-09-10 20:23:00 +00:00
Michael Natterer 0164596064 app/core/Makefile.am app/core/core-types.h added an "application object"
2001-07-04  Michael Natterer  <mitch@gimp.org>

	* app/core/Makefile.am
	* app/core/core-types.h
	* app/core/gimp.[ch]: added an "application object" called Gimp.

	Currently, it contains the image list, the clipboard, the data
	factories, the procedural hashtable and the tool info list.  It's
	the toplevel object of the core object system. Finally, creating a
	Gimp object will return a standalone gimp core engine instance
	with no other global states/variables involved.

	* app/app_procs.[ch]: allocate a "Gimp" instance called "the_gimp" :)
	Removed stuff which is now done by the "Gimp" object. Merged
	gimp_init() into app_init() because gimp_init() is taken now.

	* app/context_manager.[ch]: removed stuff done by "Gimp".

	* app/batch.[ch]
	* app/gimage.[ch]
	* app/xcf/xcf-load.[ch]
	* app/xcf/xcf.[ch]
	* app/core/gimpedit.[ch]
	* app/tools/tool_manager.[ch]: pass around an additional "Gimp"
	argument.

	* app/pdb/procedural_db.[ch]: pass a "Gimp" pointer as first
	parameter to all internal procedures and to all procedural_db_*
	functions.

	* app/core/gimpcontext.[ch]
	* app/core/gimpimage.[ch]: added a "Gimp" pointer to the structs.

	* app/devices.c
	* app/errors.c
	* app/file-open.c
	* app/file-save.c
	* app/gimphelp.c
	* app/gimpunit.c
	* app/image_new.c
	* app/main.c
	* app/nav_window.c
	* app/plug_in.c
	* app/base/base.c
	* app/core/gimpdatafactory.c
	* app/core/gimpimage-duplicate.c
	* app/core/gimpimage-mask.c
	* app/core/gimptoolinfo.[ch]
	* app/gui/brush-select.c
	* app/gui/convert-dialog.c
	* app/gui/dialogs-constructors.c
	* app/gui/edit-commands.c
	* app/gui/file-open-dialog.c
	* app/gui/file-save-dialog.c
	* app/gui/gradient-editor.c
	* app/gui/gradient-select.c
	* app/gui/gui.c
	* app/gui/image-commands.c
	* app/gui/info-window.c
	* app/gui/menus.c
	* app/gui/palette-editor.c
	* app/gui/palette-import-dialog.c
	* app/gui/palette-select.c
	* app/gui/paths-dialog.c
	* app/gui/pattern-select.c
	* app/gui/preferences-dialog.c
	* app/gui/test-commands.c
	* app/gui/toolbox.c
	* app/gui/tools-commands.c
	* app/tools/gimpbezierselecttool.c
	* app/tools/gimpbucketfilltool.c
	* app/tools/gimppainttool.h
	* app/tools/gimptexttool.c
	* app/tools/gimptransformtool.h
	* app/widgets/gimpbufferview.c
	* app/widgets/gimpcontainerview-utils.c
	* app/widgets/gimpcursor.c
	* app/widgets/gimpdnd.c
	* app/widgets/gimpimagedock.c: changed accordingly. Cleaned up
	lots of includes. Many files still access the global "the_gimp"
	variable exported by app_procs.h.

	* tools/pdbgen/app.pl
	* tools/pdbgen/pdb/brush_select.pdb
	* tools/pdbgen/pdb/brushes.pdb
	* tools/pdbgen/pdb/convert.pdb
	* tools/pdbgen/pdb/edit.pdb
	* tools/pdbgen/pdb/fileops.pdb
	* tools/pdbgen/pdb/gradient_select.pdb
	* tools/pdbgen/pdb/gradients.pdb
	* tools/pdbgen/pdb/image.pdb
	* tools/pdbgen/pdb/palette.pdb
	* tools/pdbgen/pdb/pattern_select.pdb
	* tools/pdbgen/pdb/patterns.pdb
	* tools/pdbgen/pdb/procedural_db.pdb: changed accordingly. Don't
	use "the_gimp" here because all procedures get passed a "Gimp"
	pointer now.

	* app/pdb/*: regenerated.
2001-07-04 19:31:35 +00:00
Michael Natterer 7d1375e949 Makefile.am configure.in added new directory libgimpbase/
2001-05-21  Michael Natterer  <mitch@gimp.org>

	* Makefile.am
	* configure.in
	* gimptool-1.4.in: added new directory libgimpbase/

	* app/Makefile.am: link against the new lib.

	* app/appenums.h: removed the PDB enums which are in
	libgimpbase/gimpbasetypes.h now. They are all "Gimp" prefixed.

	* app/apptypes.h: #include "libgimpbase/gimpbasetypes.h"

	* app/[lots]
	* app/core/[of]
	* app/gui/[files]
	* app/tools/: changed includes and all PDB types.

	* app/pdb/*: regenerated.

	* libgimp/Makefile.am: don't build libgimpi.a uglyness any more.

	* libgimp/gimpenv.[ch]
	* libgimp/gimplimits.[hh]
	* libgimp/gimpparasite.[ch]
	* libgimp/gimpparasiteio.[ch]
	* libgimp/gimpprotocol.[ch]
	* libgimp/gimpsignal.[ch]
	* libgimp/gimpunit.h
	* libgimp/gimputils.[ch]
	* libgimp/gimpwire.[ch]: removed...

	* libgimpbase/*: ...and added here as new library.

	* libgimp/gimp.[ch]
	* libgimp/gimpdrawable.[ch]
	* libgimp/gimpenums.h
	* libgimp/gimpimage.[ch]
	* libgimp/gimptile.c
	* libgimp/gimptypes.h
	* libgimp/gimpunit.c: changed accordingly. Added the
	gimp_*_add_new_parasite to gimp.[ch], gimpdrawable.[ch] and
	gimpimage.[ch].

	* libgimpwidgets/gimppatheditor.c
	* libgimpwidgets/gimpquerybox.c
	* libgimpwidgets/gimpsizeentry.c
	* libgimpwidgets/gimpunitmenu.c
	* libgimpwidgets/gimpwidgets.c
	* libgimpwidgets/gimpwidgetstypes.h: changed includes accordingly.

	* plug-ins/*/Makefile.am
	* plug-ins/common/mkgen.pl: link against libgimpbase.

	* tools/pdbgen/Makefile.am: scan libgimpbase/gimpbasetypes.h, so
	the enums are known to pdbgen...

	* tools/pdbgen/enumcode.pl: ...but don't write them out to
	libgimp/gimpenums.h

	* tools/pdbgen/app.pl: include libgimp/gimpbase.h in all *_cmds.c
	files. Added GIMP_ to the type names ganerated in app/.

	* tools/pdbgen/enums.pl: regenerated.

	* tools/pdbgen/pdb.pl
	* tools/pdbgen/pdb/fileops.pdb
	* tools/pdbgen/pdb/procedural_db.pdb
	* tools/pdbgen/pdb/unit.pdb: changed includes.
2001-05-21 13:58:46 +00:00
Sven Neumann fdbdb390ab app/Makefile.am removed this file ...
2001-05-14  Sven Neumann  <sven@gimp.org>

        * app/Makefile.am
        * app/pixmaps2.h: removed this file ...

        * app/tools/Makefile.am
        * app/tools/icons.h: ... and readded it here with some changes.

        * app/tools/*.c: include the new icons.h file

        * app/pdb/procedural_db.[ch]: declare name as const
2001-05-14 00:04:29 +00:00
Michael Natterer 86dc60045c removed the ID system from the pdb/ subdir...
2001-04-13  Michael Natterer  <mitch@gimp.org>

	* app/pdb/procedural_db.[ch]: removed the ID system from the pdb/
	subdir...

	* app/gimpimage.[ch]: ...and temporarily added it back to GimpImage.

	The ID stuff is not only used by the PDB but is a more general
	type of service which is needed for the PDB, DND and some parts of
	the GUI. Finally, a GimpFactory class with subclasses for data
	objects, images etc. will maintain the ID spaces.

	* app/colormap_dialog.c
	* app/file-open.c
	* app/file-save.c
	* app/gdisplay.c
	* app/gimpdnd.c
	* app/gimpdrawable.c
	* app/info_window.c
	* app/lc_dialog.c
	* app/nav_window.c
	* app/palette_import.c
	* app/paths_dialog.c
	* app/plug_in.c
	* app/xcf.c
	* app/tools/gimptexttool.c
	* tools/pdbgen/pdb.pl
	* tools/pdbgen/pdb/image.pdb: use GimpImage's ID functions.

	* app/pdb/channel_cmds.c
	* app/pdb/channel_ops_cmds.c
	* app/pdb/convert_cmds.c
	* app/pdb/display_cmds.c
	* app/pdb/drawable_cmds.c
	* app/pdb/fileops_cmds.c
	* app/pdb/guides_cmds.c
	* app/pdb/image_cmds.c
	* app/pdb/layer_cmds.c
	* app/pdb/parasite_cmds.c
	* app/pdb/paths_cmds.c
	* app/pdb/selection_cmds.c
	* app/pdb/text_tool_cmds.c
	* app/pdb/tools_cmds.c
	* app/pdb/undo_cmds.c: regenerated.
2001-04-13 14:50:43 +00:00
Sven Neumann 0d533abbdd tools/pdbgen/lib.pl tools/pdbgen/pdb.pl tools/pdbgen/pdb/channel.pdb
2001-01-25  Sven Neumann  <sven@gimp.org>

	* tools/pdbgen/lib.pl
	* tools/pdbgen/pdb.pl
	* tools/pdbgen/pdb/channel.pdb
	* tools/pdbgen/pdb/palette.pdb
	* tools/pdbgen/pdb/tools.pdb: changed these with the help of
	Yosh. PDB functions take GimpRGB as color type now.

	* app/plug_in.c
	* app/pdb/channel_cmds.c
	* app/pdb/internal_procs.c
	* app/pdb/palette_cmds.c
	* app/pdb/procedural_db.[ch]
	* app/pdb/tools_cmds.c
	* libgimp/gimp.[ch]
	* libgimp/gimpchannel.[ch]
	* libgimp/gimpchannel_pdb.[ch]
	* libgimp/gimppalette_pdb.[ch]
	* libgimp/gimpprotocol.[ch]
	* libgimp/gimptools_pdb.[ch]: incremented Gimp protocol version
	and changed color type from array of chars to GimpRGB.

	* libgimp/Makefile.am
	* libgimp/gimppalette.[ch]: removed these files again

	* app/libgimp_glue.[ch]
	* libgimpwidgets/gimpcolorbutton.c
	* plug-ins/Lighting/lighting_main.c
	* plug-ins/Lighting/lighting_preview.c
	* plug-ins/MapObject/mapobject_image.c
	* plug-ins/MapObject/mapobject_main.c
	* plug-ins/MapObject/mapobject_preview.c
	* plug-ins/common/apply_lens.c
	* plug-ins/common/blinds.c
	* plug-ins/common/borderaverage.c
	* plug-ins/common/checkerboard.c
	* plug-ins/common/colorify.c
	* plug-ins/common/colortoalpha.c
	* plug-ins/common/cubism.c
	* plug-ins/common/exchange.c
	* plug-ins/common/film.c
	* plug-ins/common/gif.c
	* plug-ins/common/grid.c
	* plug-ins/common/mapcolor.c
	* plug-ins/common/mblur.c
	* plug-ins/common/nova.c
	* plug-ins/common/papertile.c
	* plug-ins/common/png.c
	* plug-ins/common/polar.c
	* plug-ins/common/psd.c
	* plug-ins/common/semiflatten.c
	* plug-ins/common/sinus.c
	* plug-ins/common/sparkle.c
	* plug-ins/common/tiff.c
	* plug-ins/common/vpropagate.c
	* plug-ins/common/warp.c
	* plug-ins/common/whirlpinch.c
	* plug-ins/gap/gap_filter_iterators.c
	* plug-ins/gap/gap_mov_dialog.c
	* plug-ins/gdyntext/gdyntext.c
	* plug-ins/gfig/gfig.c
	* plug-ins/gfli/gfli.c
	* plug-ins/ifscompose/ifscompose.c
	* plug-ins/maze/handy.c
	* plug-ins/mosaic/mosaic.c
	* plug-ins/pagecurl/pagecurl.c
	* plug-ins/script-fu/script-fu-scripts.c
	* plug-ins/script-fu/script-fu.c
	* plug-ins/xjt/xjt.c: changed accordingly. A few plug-ins need
	to be looked at more closely after this change. I tried to put
	FIXME comments into those.
2001-01-25 01:20:05 +00:00
Sven Neumann 6a31b131d1 changed destdir for app-side PDB wrappers to app/pdb
2001-01-21  Sven Neumann  <sven@gimp.org>

	* tools/pdbgen/app.pl: changed destdir for app-side PDB wrappers to
	app/pdb

	* app/Makefile.am: don't create libgimpim.a in app.

	* configure.in
	* app/pdb/Makefile.am
	* app/pdb/internal_procs.[ch]
	* app/pdb/procedural_db.[ch]
	* app/pdb/*_cmds.c: moved PDB functions into their own subdirectory.

	* app/internal_procs.[ch]
	* app/procedural_db.[ch]
	* app/*_cmds.c: removed here

	* app/app_procs.c
	* app/batch.c
	* app/bezier_select.c
	* app/brush_select.c
	* app/bucket_fill.c
	* app/colormap_dialog.c
	* app/fileops.c
	* app/gimage.c
	* app/gimage_mask.c
	* app/gimphelp.c
	* app/gradient_select.c
	* app/info_window.c
	* app/invert.c
	* app/lc_dialog.c
	* app/menus.c
	* app/nav_window.c
	* app/palette_import.c
	* app/paths_dialog.c
	* app/pattern_select.c
	* app/plug_in.h
	* app/text_tool.c
	* app/xcf.c
	* po/POTFILES.in: changed accordingly
2001-01-21 21:58:16 +00:00