gimp/libgimpbase
Michael Natterer 894cf70dd5 Added infrastructure to make sure we don't write to the global brush,
2004-01-28  Michael Natterer  <mitch@gimp.org>

	Added infrastructure to make sure we don't write to the global
	brush, pattern etc. directories. Needed to make this configurable
	because we can't rely on the global directories being read-only,
	having certain names or being otherwise detectable at runtime in a
	sane way. Fixes bug #132214.

	* libgimpbase/gimpdatafiles.[ch]: added "const gchar *dirname" to
	the GimpDataFileData struct so callbacks don't need to call
	g_path_get_dirname() for each file.

	* libgimpwidgets/gimpfileentry.c: made it work with non UTF-8
	encoded filenames.

	* libgimpwidgets/gimppatheditor.[ch]: ditto. Added GUI and API for
	setting/getting a second "writable_path". The widget makes sure
	that the writable_path is always a subset of the path.

	* app/config/gimpconfig-utils.[ch]: added new function
	gimp_config_build_writable_path().

	* app/config/gimpcoreconfig.[ch]: added separate properties for
	the writable brush, pattern, gradient, palette and font paths.

	* app/config/gimprc-blurbs.h: added (still empty) blurbs for the
	new properties.

	* app/core/gimpdata.[ch] (gimp_data_set_filename): added parameter
	"gboolean writable". Set data->writable to FALSE by default. If
	"writable" is passed as TRUE, still check if we can write to the
	file before setting data->writable to TRUE.

	(gimp_data_create_filename): changed "data_path" parameter to
	"dest_dir" and assume dest_dir is writable.

	(gimp_data_duplicate): set data->dirty to TRUE to make sure
	duplicated things will be saved.

	* app/core/gimpbrush.c
	* app/core/gimpbrushgenerated.c
	* app/core/gimpbrushpipe.c
	* app/core/gimpgradient.c
	* app/core/gimppalette.c
	* app/core/gimppattern.c: don't set the data's filename and don't
	touch data->dirty in the _load() functions because that's done by
	the data factory now. Don't touch data->dirty in the _duplicate()
	functions because that's done by gimp_data_duplicate() itself now.

	* app/core/gimpdatafactory.[ch] (gimp_data_factory_new): added
	"writable_property_name" and remember it.
	Added utility function gimp_data_factory_get_save_dir() which
	determines the directory to save new datas to.
	Added public function gimp_data_factory_data_save_single() which
	saves a single data object.
	Make sure new things get saved to the first writable directory
	as specified in preferences.

	* app/core/gimp.c (gimp_real_initialize): pass the writable_paths'
	property names to gimp_data_factory_new().

	* app/widgets/gimpdataeditor.c (gimp_data_editor_save_dirty): use
	gimp_data_factory_data_save_single() instead of implementing
	saving here.

	* app/widgets/gimppropwidgets.[ch] (gimp_prop_path_editor_new):
	added "const gchar *writable_property_name" parameter (can be
	NULL).

	Added the needed callbacks to handle the writable_path and made
	the path_editor and file_entry code aware of non UTF-8 filename
	encodings. Some general cleanup.

	* app/gui/preferences-dialog.c: changed accordingly.
2004-01-28 21:53:50 +00:00
..
.cvsignore Additions for Win32: Use -no-undefined. Use the gimpbase.def file. Produce 2002-03-29 23:10:18 +00:00
Makefile.am modernized, made a lot of things m4 macros, and made versioning a lot more 2004-01-22 03:51:46 +00:00
gimpbase-private.c libgimpbase/Makefile.am libgimpbase/gimpbase-private.[ch] new files 2003-11-15 22:53:28 +00:00
gimpbase-private.h libgimpbase/Makefile.am libgimpbase/gimpbase-private.[ch] new files 2003-11-15 22:53:28 +00:00
gimpbase.def removed file_utils_filename_to_utf8() ... 2004-01-19 01:08:43 +00:00
gimpbase.h libgimp/gimp.h libgimp/gimpbrushmenu.h libgimp/gimpbrushselect.[ch] 2003-12-05 15:55:15 +00:00
gimpbasetypes.h Enabled skipping enum values for either the PDB or GType registration 2004-01-06 14:02:08 +00:00
gimpcpuaccel.c null-terminate string for vendor comparisions. 2003-09-04 22:31:12 +00:00
gimpcpuaccel.h rewrote the x86 tests, moved debug printout from base.c to here. 2003-09-04 21:58:57 +00:00
gimpdatafiles.c Added infrastructure to make sure we don't write to the global brush, 2004-01-28 21:53:50 +00:00
gimpdatafiles.h Added infrastructure to make sure we don't write to the global brush, 2004-01-28 21:53:50 +00:00
gimpenv.c Add new function file_utils_filename_to_utf8(), which is to be used when 2004-01-14 02:03:37 +00:00
gimpenv.h libgimpbase/gimpdatafiles.[ch] libgimpbase/gimpenv.[ch] 2003-11-23 15:35:27 +00:00
gimplimits.h remove unnecessary GTK_WIDGET() cast. 2004-01-06 10:04:31 +00:00
gimpparasite.c libgimp/gimp.h libgimp/gimpbrushmenu.h libgimp/gimpbrushselect.[ch] 2003-12-05 15:55:15 +00:00
gimpparasite.h libgimp/gimp.h libgimp/gimpbrushmenu.h libgimp/gimpbrushselect.[ch] 2003-12-05 15:55:15 +00:00
gimpparasiteio.c libgimp/gimp.h libgimp/gimpbrushmenu.h libgimp/gimpbrushselect.[ch] 2003-12-05 15:55:15 +00:00
gimpparasiteio.h libgimp/gimp.h libgimp/gimpbrushmenu.h libgimp/gimpbrushselect.[ch] 2003-12-05 15:55:15 +00:00
gimpprotocol.c added "wm_name", "wm_class", "display_name" and "monitor_number" to the 2003-11-07 17:29:02 +00:00
gimpprotocol.h added GIMP_CONFIG_ERROR_VERSION to GimpConfigError enum. 2003-11-07 23:47:35 +00:00
gimpsignal.c libgimp/gimp.h libgimp/gimpbrushmenu.h libgimp/gimpbrushselect.[ch] 2003-12-05 15:55:15 +00:00
gimpsignal.h bumped version number to 2.0pre3 (1.3.26), binary age 2, interface age 0. 2004-01-19 17:35:20 +00:00
gimpunit.c doc fixes. 2003-11-15 23:23:42 +00:00
gimpunit.h libgimpbase/Makefile.am libgimpbase/gimpbase-private.[ch] new files 2003-11-15 22:53:28 +00:00
gimputils.c removed file_utils_filename_to_utf8() ... 2004-01-19 01:08:43 +00:00
gimputils.h removed file_utils_filename_to_utf8() ... 2004-01-19 01:08:43 +00:00
gimpwin32-io.h renamed GimpOrientationType with Compat postfix to avoid name clashing 2003-07-26 17:37:32 +00:00
gimpwire.c using a union like that may not be completely portable. Use a guint8 array 2002-11-25 10:12:02 +00:00
gimpwire.h libgimpbase/gimpprotocol.[ch] pass "gpointer user_data" to all functions, 2002-05-16 17:41:38 +00:00
makefile.msc still unacceptable patched to compile without FT2, see bug #113681 2003-11-16 21:20:14 +00:00