2000-11-18 Michael Natterer <mitch@gimp.org>
* app/fileops.c
* libgimp/gimpquerybox.[ch]: Make sure that we don't try to destroy
query_boxes twice or try to disconnect not-any-more connected
handlers.
* app/color_notebook.c
* app/gimpcontext.[ch]
* app/gimphelp.[ch]
* app/lc_dialog.[ch]
* app/menus.h
* app/preferences_dialog.c
* app/tools.[ch]
* libgimp/gimpcolorbutton.[ch]
* libgimp/gimpdialog.[ch]
* libgimp/gimpexport.[ch]
* libgimp/gimpfileselection.[ch]
* libgimp/gimphelpui.[ch]
* libgimp/gimppatheditor.[ch]
* libgimp/gimppixmap.[ch]
* libgimp/gimpsizeentry.[ch]
* libgimp/gimpui.[ch]
* libgimp/gimpunitmenu.[ch]
* libgimp/gimpwidgets.[ch]: in a coding attack, changed help_data
and many other strings passed to UI functions to (const gchar *).
As a consequence, I had to fix lots of warnings ;)
* plug-ins/common/tga.c
* plug-ins/imagemap/imap_main.c: fixed warnings.
Code cleanup and indentation all over the place.
2000-02-22 Michael Natterer <mitch@gimp.org>
* app/gimpcontext.[ch]: it's more intelligent to implement the
parent_context stuff with gtk_signal_connect_object() instead of
having internal callbacks for each context attribute.
Exported the existing gimp_context_*_changed() functions and
changed them to do nothing but emitting the signal.
* app/app_procs.c
* app/tools.c
* app/transform_tool.c: use gimp_context_tool_changed() instead of
gtk_signal_emit_by_name().
1999-11-14 Michael Natterer <mitch@gimp.org>
* app/airbrush.c
* app/apptypes.h
* app/brushes_cmds.c
* tools/pdbgen/pdb/brushes.pdb
* app/bucket_fill.c
* app/clone.c
* app/gimpbrushpipe.c
* app/paint_core.c
* app/patterns.h
* app/patterns_cmds.c
* tools/pdbgen/pdb/patterns.pdb: removed the GimpBrushP and
GPatternP types and use ordinary pointers instead.
The following stuff makes the "no_data" behaviour consistent. As a
side-effect it should make the gimp work when there are _really_ no
brushes/patterns/gradients.
* app/brush_select.c
* app/pattern_select.c: set the initial brush/pattern name to "No
Brushes/Patterns available" instead of "Active".
* app/devices.c: set the device contexts' brush/pattern/gradient
names if we started with no_data, so we find them on refresh.
* app/gimpbrushlist.c: set the name of the standard_brush to
"Standard".
* app/gimpcontext.c: don't replace the current
brush/pattern/gradient's name if the new one to be set is the
standard one. Together with the change in devices.c, this ensures
that we get what is set in devicerc. Minor fixes.
* app/gradient.c: changed gradients_init() to work like the other
data init functions. Only insert a default gradient in the
gradients list when the editor is opened (this means that the
gradients now behave like brushes/patterns when we start with
"no_data").
New function gradient_update() avoids tons of useless redraws of
all clist gradient previews whenever the gradient editor wants to
update it's large preview.
* app/gradient_select.c: don't segfault when the user tries to
drag from an empty gradient list.
* app/patterns.c: set the index of the standard_pattern to -1 to
indicate that it's not part of the pattern list.
* app/xcf.c: add "(GIMP)" to the menu entry for XCF, in an attempt
to make it clear that it is the native file format.
* app/gimpcontext.c: correct doubled arg name on arg type addition,
which was messing up the internal gtkarg hashtable
-Yosh
1999-10-19 Michael Natterer <mitch@gimp.org>
* gimpcontext.[ch]: changed the "parent context" implementation:
- Automatically connect/disconnect the "*_changed" signals when
changing the parent and when setting the "defined" flag of the
attributes.
- Store the former *_defined booleans in a single guint32.
- Added generic functions to set the "defined" flags of the
attributes and to copy attributes between contexts.
The contexts now correctly handle disappearing images and
displays, so we don't have to explicitly reset them any more.
* context_manager.[ch]: adopted to the changed context
implementation, connect to the user context's "tool_changed"
signal to switch the per-tool contexts, don't connect to the
"removed" signal of the image context.
* brush_select.c
* tool_options.c: use LayerModeEffects instead of int when calling
gimp_context_set_paint_mode().
* gdisplay.c: no need to reset the active display when deleting it
because the context connects to the "destroy" signal of the shell
now.
* menus.c: a shortcut for the navigation window. Moved
<Image>/Image/Colors/Desaturate before the separator.
* tools.c: tools_select(): set the active tool of the user context
instead of calling a special context manager function.
1999-10-17 Michael Natterer <mitch@gimp.org>
* app/gimpsignal.[ch]: new GimpSignalType gimp_sigtype_int_int_int.
* app/gimpcontext.[ch]: set/get colors as separate r/g/b values
instead of a guchar[3] array.
The "[foreground|background]_changed" signal handlers must have
the following signature now:
color_changed_callback (GimpContext *, gint, gint, gint, gpointer).
1999-10-17 Michael Natterer <mitch@gimp.org>
* app/gimpcontext.[ch]: added the possibility to store the current
tool, FG/BG color, brush, pattern and gradient, but don't use
these attributes yet.
Before replacing the get/set color/brush/... functions with
context functions, I'll have to change the "parent context"
implementation to something where the children catch the parent's
color/brush/..._changed signals.
Finally, updating the indicator_area, device_status, tool_options
etc. will be done by connecting to their own context's "*_changed"
signals, which will be much cleaner than calling the update
functions from various places.
(I think this is a "consistency fix", please let me know if you
consider it a new feature).
* app/*.[ch]: Actually use the enum types GimpImageType,
GimpImageBaseType, LayerModeEffects, PaintApplicationMode,
BrushApplicationMode, GimpFillType and ConvertPaletteType, instead
of just int or gint. Hopefully I catched most of the places
where these should be used.
Add an enum ConvolutionType, suffix the too general constants
NORMAL, ABSOLUTE and NEGATIVE with _CONVOL. Use NORMAL_MODE
instead of NORMAL in some places (this was what was intended). Fix
some minor gccisms.
* app/apptypes.h: New file. This file contains the above
enumeration types, and some opaque struct typedefs. It was
necessary to collect these in one header that doesn't include
other headers, because when we started using the above mentioned
types in the headers, all hell broke loose because of the
spaghetti-like cross-inclusion mess between headers.
(An example: Header A includes header B, which includes header C
which includes A. B uses a type defined in A. This is not defined,
because A hasn't defined it yet at the point where it includes B,
and A included from B of course is skipped as we already are
reading A.)
1999-06-21 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/context_manager.c: connect to the user context's
"display_changed" and to the image context's "remove" signal to
avoid dangling references and to set the menu sensitivity on
display change.
* app/disp_callbacks.c
* app/file_new_dialog.c
* app/fileops.c
* app/gdisplay.c
* app/gdisplay_ops.c
* app/gimpcontext.c
* app/interface.[ch]: entirely moved the active display stuff to
the user context:
- The active display is set by any event in the display shell,
by File/New and File/Open.
- gdisplay_delete() resets the active display to NULL if we
deleted the active display.
- Reduced gdisplay_active() to a single statement returning the
context's active display. Should replace it by a macro.
- gdisplay_flush_whenever() sets the menu sensitivity for the
active display.
- Removed global variable popup_shell since it was only set all
the time but never used. I guess it's original job is now done
by the context anyway.
- gdisplay_set_menu_sensitivity() works with gdisp == NULL.
- There are mysterious Gdk-CRITICALs if both <Image> and one of
it's sub-menus are teared-off. Probably a gtk+ bug.
To do all this stuff at a central place, there needs to be a
GimpSet of displays (and ideally, GDisplay should be a GtkObject).
* app/commands.c
* app/lc_dialog.c: fixed segfaults happening with teared-off menus.
1999-06-20 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/commands.c
* app/disp_callbacks.c
* app/gdisplay.c
* app/lc_dialog.c
* app/menus.c: applied a patch from <Simon.Budig@unix-ag.org>
which implements tear-off-menus(!!!). Modified it to use the
GimpContext.
The sensitivity of the menu entries is not updated after
executing a command. This leaves the sensitivity in the state
before the command was executed (which is buggy). Will probably
have to update the sensitivity from gdisplays_flush().
Simon called the patch "temporary" but it looks pretty stable to
me. Please test it :-)
* app/context_manager.[ch]: minor changes.
* app/gimpcontext.[ch]: the user context keeps track of the
current display and image. The image is set automatically from
gimp_context_set_display().
Still have to figure out how this should interact with
gdisplay_active() (the current state is a hack).
Made the context attributes real GtkObject arguments.
Pass the changed attributes to the callbacks which connect to
the <attribute>_changed signals.
* app/gimpset.[ch]
* app/gimpsetF.h
* app/gimpsetP.h: made the gimpset properly derivable by adding
signal slots to the object class structure. Added copyright
headers.
* app/gimpsignal.[ch]: new type gimp_sigtype_double, copyright
header and my usual indentation fanaticism.
1999-06-19 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/gimpcontext.[ch]: added some functions. Still does nothing.
* app/bezier_select.c
* app/devices.c
* app/tools.[ch]: removed global variable active_tool_type
because it was always equal to active_tool->type.
1999-06-18 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/Makefile.am
* app/context_manager.[ch]: new files. Currently only init and
destroy the static contexts (user, standard and default).
* app/app_procs.c: call the context manager's init and free
functions. Still have to figure out the right time to do this.
* app/gimpcontext.[ch]: alpha version 0.0.1 :-)
Features:
- Each context has a name
- Attributes: opacity, paint mode, image, display
- Signal emission on attribute change
- Possibility to set a "parent" context
- Each attribute can be defined or undefined. In the latter case
the values are taken from the parent context.
- Possibility to pass a template and parent context to the
constructor
Bugs:
- Many attributes/functions still missing
- It's connected to nothing
1999-06-17 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/Makefile.am
* app/gimpcontext.[ch]: new files. Does nothing yet. Checked in
because I found some bugs while hacking it:
* libgimp/gimpchainbutton.[ch]
* libgimp/gimpfileselection.[ch]
* libgimp/gimppatheditor.[ch]
* libgimp/gimpsizeentry.[ch]
* libgimp/gimpunitmenu.[ch]: fixed some cut & paste bugs and some
gtk 1.0 artefacts in the object class initialisation code.