gimp/app/core/gimpviewable.h

179 lines
8.5 KiB
C
Raw Normal View History

/* GIMP - The GNU Image Manipulation Program
* Copyright (C) 1995-1997 Spencer Kimball and Peter Mattis
*
cleanup. 2001-04-22 Michael Natterer <mitch@gimp.org> * app/Makefile.am: cleanup. * app/interface.c: #include "gimpui.h" * app/gui/dialogs-constructors.[ch] * app/gui/dialogs.c * app/gui/menus.c * app/gui/test-commands.[ch]: changes for the image menu below. * app/apptypes.h * app/widgets/Makefile.am * app/widgets/gimpcontainermenu.[ch] * app/widgets/gimpcontainermenuimpl.[ch]: new widgets. The actual implemtation lives in a separate file because gimpcontainermenu.c's code is identical to gimpcontainerview.c's except for the base class. This will become an interface with Gtk 2.0. * app/widgets/gimpimagedock.[ch]: a dock with an image menu. The pages still don't follow the context correctly. * app/widgets/gimpmenuitem.[ch]: a menu item with a preview. * app/widgets/gimpdialogfactory.[ch]: pass a dock constructor to the constructor and provide a method to create a new dock within this factory's context. * app/widgets/gimpdock.[ch]: removed the constructor because we create only image docks now. Put the vbox into a main_vbox (which also contains the image menu). * app/widgets/gimpdockbook.[ch]: create new docks with the dialog factory. * app/gimpcontainer.[ch] * app/gimpdata.[ch] * app/gimpdatafactory.[ch] * app/gimpdatalist.[ch] * app/gimplist.[ch] * app/gimpviewable.[ch] * app/widgets/gimpbrushpreview.[ch] * app/widgets/gimpcontainergridview.[ch] * app/widgets/gimpcontainerlistview.[ch] * app/widgets/gimpcontainerview.[ch] * app/widgets/gimpdatafactoryview.[ch] * app/widgets/gimpdockable.[ch] * app/widgets/gimpdrawablelistitem.[ch] * app/widgets/gimpdrawablelistview.[ch] * app/widgets/gimpdrawablepreview.[ch] * app/widgets/gimplayerlistitem.[ch] * app/widgets/gimplayerlistview.[ch] * app/widgets/gimplistitem.[ch] * app/widgets/gimppalettepreview.[ch] * app/widgets/gimppatternpreview.[ch] * app/widgets/gimppreview.[ch]: ass-sign some copyrights.
2001-04-22 08:38:56 +08:00
* gimpviewable.h
* Copyright (C) 2001 Michael Natterer <mitch@gimp.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __GIMP_VIEWABLE_H__
#define __GIMP_VIEWABLE_H__
#include "gimpobject.h"
include the new "paint-funcs/paint-funcs-types.h". 2001-11-28 Michael Natterer <mitch@gimp.org> * app/base/base-types.h: include the new "paint-funcs/paint-funcs-types.h". * app/paint-funcs/Makefile.am * app/paint-funcs/paint-funcs-types.h: new file. Includes "base/base-types.h". * app/paint-funcs/paint-funcs.[ch]: removed the enums here, include "paint-funcs-types.h". * app/widgets/widgets-types.h: include "display/display-types.h" * app/display/display-types.h: include "widgets/widgets-types.h". * app/tools/tools-types.h: include "display/display-types.h" * app/gui/gui-types.h: include "tools/tools-types.h". The order of namespaces/dependencies should be (but is not): (base, paint-funcs) -> (core, file, xcf, pdb) -> (widgets, display) -> tools -> gui * app/path.c: include "tools/tools-types.h". * app/core/Makefile.am * app/core/gimpimage-guides.[ch] * app/core/gimpimage-merge.[ch] * app/core/gimpimage-resize.[ch] * app/core/gimpimage-scale.[ch]: new files. * app/core/gimpimage.[ch]: removed the stuff which is in the new files. Reordered all functions in both the .h and .c files, commented the groups of functions. * app/core/gimpcontainer.c: create the handler_id using a counter, not the address of a pointer, because the address *may* be the same twice, added debugging output. * app/core/gimpviewable.[ch]: added primitive support for getting a preview GdkPixbuf. * app/nav_window.c * app/undo.c * app/undo_history.c * app/core/gimpimage-duplicate.c * app/core/gimpimage-mask.[ch] * app/display/gimpdisplay.c * app/display/gimpdisplayshell-callbacks.c * app/display/gimpdisplayshell-dnd.c * app/display/gimpdisplayshell-render.c * app/display/gimpdisplayshell-scale.c * app/display/gimpdisplayshell-scroll.c * app/gui/image-commands.c * app/gui/info-window.c * app/gui/layers-commands.c * app/gui/palette-import-dialog.c * app/tools/gimpbycolorselecttool.c * app/tools/gimpeditselectiontool.c * app/tools/gimpmeasuretool.c * app/tools/gimpmovetool.c * app/widgets/gimpcontainerview-utils.c * app/xcf/xcf-load.c: changed accordingly, some cleanup. * tools/pdbgen/pdb/guides.pdb * tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions. * app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu items to the name of the last plug-in (Fixes #50986). * app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and "Redo" to the resp. undo names. Much simplified the WM icon stuff by removing most code and using gimp_viewable_get_new_preview_pixbuf(). * app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark returned by gimp_container_add_handler(). * app/pdb/guides_cmds.c * app/pdb/image_cmds.c * libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
#include <gdk-pixbuf/gdk-pixbuf.h>
#define GIMP_VIEWABLE_MAX_PREVIEW_SIZE 2048
#define GIMP_VIEWABLE_MAX_POPUP_SIZE 256
#define GIMP_VIEWABLE_MAX_BUTTON_SIZE 64
#define GIMP_VIEWABLE_MAX_MENU_SIZE 48
added virtual function get_popup_size() which returns a boolean indicating 2003-02-27 Michael Natterer <mitch@gimp.org> * app/core/gimpviewable.[ch]: added virtual function get_popup_size() which returns a boolean indicating if a popup is needed and its size. * app/core/gimpbrush.c * app/core/gimpbrushpipe.c * app/core/gimpbuffer.c * app/core/gimpdrawable-preview.[ch] * app/core/gimpdrawable.c * app/core/gimpgradient.c * app/core/gimpimage.c * app/core/gimppalette.c * app/core/gimppattern.c * app/core/gimpundo.c: implement it. * app/widgets/gimppreview.[ch]: removed virtual functions needs_popup() and create_popup(). Removed the code which creates the popup and the popup members of the GimpPreview struct. * app/widgets/gimppreview-popup.[ch]: new files providing the utility function gimp_preview_popup_show() which can show popups from any widget, not just from a GimpPreview. Checks if a popup is needed using gimp_viewable_get_popup_size(). * app/widgets/gimpcellrendererviewable.c: show popups here too. * app/widgets/gimpbrushpreview.c * app/widgets/gimpbufferpreview.c * app/widgets/gimpdrawablepreview.c * app/widgets/gimpimagepreview.c: removed needs_popup() and create_popup() implementations. * app/widgets/gimpnavigationpreview.c: removed empty render() implementation. * app/widgets/gimpundoeditor.c: use a tree instead of a list view. * app/widgets/gimpgradientpreview.[ch] * app/widgets/gimppalettepreview.[ch] * app/widgets/gimppatternpreview.[ch]: removed because they only implemented the removed popup functions. * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpmenuitem.c * app/widgets/gimppreview-utils.c: changed accordingly
2003-02-27 21:59:41 +08:00
#define GIMP_VIEWABLE_PRIORITY_IDLE G_PRIORITY_LOW
added virtual function get_popup_size() which returns a boolean indicating 2003-02-27 Michael Natterer <mitch@gimp.org> * app/core/gimpviewable.[ch]: added virtual function get_popup_size() which returns a boolean indicating if a popup is needed and its size. * app/core/gimpbrush.c * app/core/gimpbrushpipe.c * app/core/gimpbuffer.c * app/core/gimpdrawable-preview.[ch] * app/core/gimpdrawable.c * app/core/gimpgradient.c * app/core/gimpimage.c * app/core/gimppalette.c * app/core/gimppattern.c * app/core/gimpundo.c: implement it. * app/widgets/gimppreview.[ch]: removed virtual functions needs_popup() and create_popup(). Removed the code which creates the popup and the popup members of the GimpPreview struct. * app/widgets/gimppreview-popup.[ch]: new files providing the utility function gimp_preview_popup_show() which can show popups from any widget, not just from a GimpPreview. Checks if a popup is needed using gimp_viewable_get_popup_size(). * app/widgets/gimpcellrendererviewable.c: show popups here too. * app/widgets/gimpbrushpreview.c * app/widgets/gimpbufferpreview.c * app/widgets/gimpdrawablepreview.c * app/widgets/gimpimagepreview.c: removed needs_popup() and create_popup() implementations. * app/widgets/gimpnavigationpreview.c: removed empty render() implementation. * app/widgets/gimpundoeditor.c: use a tree instead of a list view. * app/widgets/gimpgradientpreview.[ch] * app/widgets/gimppalettepreview.[ch] * app/widgets/gimppatternpreview.[ch]: removed because they only implemented the removed popup functions. * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpmenuitem.c * app/widgets/gimppreview-utils.c: changed accordingly
2003-02-27 21:59:41 +08:00
#define GIMP_TYPE_VIEWABLE (gimp_viewable_get_type ())
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning) 2001-07-24 Michael Natterer <mitch@gimp.org> Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning) * configure.in: require glib/gtk+ >= 1.3.7, commented out the gtkxmhtml stuff. From now on, you will need glib, pango, atk and gtk+ HEAD from CVS to hack or use GIMP HEAD. Beware, it crashes randomly :) * app/core/Makefile.am * app/core/gimpmarshal.list: new file plus rules to generate gimpmarshal.[ch] from it. * app/core/* * app/tools/* * app/widgets/* * libgimpwidgets/*: started to use the glib object system. All core/ objects are still gtk objects however. All signals are created using g_signal_new(). There are many gtk+ artefacts left. Finally, we will _not_ use the gtk_signal_foo() wrappers and friends any more. * app/colormaps.c * app/devices.[ch] * app/disp_callbacks.c * app/errorconsole.c * app/file-save.[ch] * app/interface.c * app/module_db.c * app/nav_window.c * app/ops_buttons.c * app/scroll.c * app/user_install.c * app/gui/about-dialog.c * app/gui/brush-editor.c * app/gui/brushes-commands.c * app/gui/color-notebook.c * app/gui/colormap-dialog.c * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.c * app/gui/file-commands.c * app/gui/file-dialog-utils.c * app/gui/file-new-dialog.c * app/gui/file-open-dialog.[ch] * app/gui/file-save-dialog.c * app/gui/gradient-editor.c * app/gui/gradients-commands.c * app/gui/image-commands.c * app/gui/info-dialog.[ch] * app/gui/layer-select.c * app/gui/layers-commands.c * app/gui/menus.c * app/gui/offset-dialog.c * app/gui/palette-editor.c * app/gui/palettes-commands.c * app/gui/patterns-commands.c * app/gui/preferences-dialog.c * app/gui/resize-dialog.[ch] * app/gui/splash.c * app/gui/tips-dialog.c * app/gui/tool-options-dialog.c * app/gui/toolbox.c * app/gui/tools-commands.c * libgimp/gimpbrushmenu.c * libgimp/gimpmenu.c * libgimp/gimppatternmenu.c * libgimp/gimpui.c * libgimpbase/gimpenv.c: tons and tons of changes like "const gchar*", switch from GdkDeviceInfo to GdkDevice (very incomplete and currently disables), lots of s/gtk_signal/g_signal/, removal/replacement of deprecated stuff, s/GtkSignalFunc/GCallback/ and lots of small changes and fixes while I was on it, zillions of warnings left... * modules/Makefile.am: disabled the water color selector temporarily (XInput issues). * plug-ins/Makefile.am * plug-ins/common/.cvsignore * plug-ins/common/Makefile.am * plug-ins/common/plugin-defs.pl: simply excluded all plug-ins which did not build (including Script-Fu). They are trivial to fix.
2001-07-25 05:27:11 +08:00
#define GIMP_VIEWABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_VIEWABLE, GimpViewable))
#define GIMP_VIEWABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_VIEWABLE, GimpViewableClass))
#define GIMP_IS_VIEWABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_VIEWABLE))
#define GIMP_IS_VIEWABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_VIEWABLE))
#define GIMP_VIEWABLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_VIEWABLE, GimpViewableClass))
typedef struct _GimpViewableClass GimpViewableClass;
struct _GimpViewable
{
GimpObject parent_instance;
added "gchar *stock_id" to the GimpViewable struct. It is used by the GUI 2003-02-25 Michael Natterer <mitch@gimp.org> * app/core/gimpviewable.[ch]: added "gchar *stock_id" to the GimpViewable struct. It is used by the GUI if the get_preview() functions return NULL. Default to GTK_STOCK_DIALOG_QUESTION. * app/core/gimptoolinfo.[ch]: set the tool's stock_id. Removed the cached GdkPixbuf. Don't implement any preview function so the GUI uses the stock_id. * app/tools/tool_manager.c: removed GdkPixbuf creation, removed the #warning about the buggy way we created the pixbuf. * app/gui/dialogs-constructors.c * app/gui/image-menu.c * app/tools/gimpcroptool.c * app/tools/gimphistogramtool.c * app/tools/gimpimagemaptool.c * app/tools/gimpmeasuretool.c * app/tools/gimptransformtool.c * app/widgets/gimptoolbox.c: use viewable->stock_id instead of tool_info->stock_id. * app/core/gimpbrush.c * app/core/gimpgradient.c * app/core/gimpimagefile.c * app/core/gimpundo.c: simplified get_preview() implementations: - never scale previews up, only down. - don't render white or checks backgrounds but simply return TempBufs with alpha and let the preview system do its job. - don't add padding but simply return previews smaller than requested. * app/display/gimpdisplayshell-render.[ch]: added "render_blend_white", a 2d lookup table for blending on white, just as the check lookup tables. Added "render_white_buf". * app/widgets/gimppreview.[ch]: changed a lot: - don't render the preview's border into the buffer. - added "GdkGC *border_gc" and draw the preview's border in expose() using gdk_draw_rectangle(). - added "GdkPixbuf *no_preview_pixbuf" and create it in gimp_preview_real_render() if gimp_viewable_get_preview() returned NULL. - factored the actual preview rendering out to gimp_preview_render_to_buffer(). Added configurable background rendering for the preview itself and it's padding area (the area the preview is larger than the buffer returned by gimp_viewable_get_preview()). - changed gimp_preview_render_and_flush() to gimp_preview_render_preview() and added "inside_bg" and "outside_bg" parameters. - use the new render buffers for blending on white. * app/widgets/gimpbrushpreview.c * app/widgets/gimpbufferpreview.c * app/widgets/gimpdrawablepreview.c * app/widgets/gimpgradientpreview.c * app/widgets/gimpimagepreview.c * app/widgets/gimppalettepreview.c * app/widgets/gimppatternpreview.c: don't create large white TempBufs to center the previews in but simply set the TempBuf's offsets to get them centered. Simplified & cleaned up many preview render functions. Pass the correct GimpPreviewBG modes to gimp_preview_render_preview(). * app/widgets/gimpcellrendererviewable.[ch]: new GtkCellRenderer class derived from GtkCellRendererPixbuf which knows how to use gimp_viewable_get_preview_size() and renders the viewable's stock item if no preview can be created. * app/widgets/gimpcontainertreeview.c: added a GtkTreeCellDataFunc which creates the preview pixbuf if needed so we don't create it unconditionally upon item insertion. Fixed preview size assertion to use GIMP_PREVIEW_MAX_SIZE, not "64". Block "selection_changed" while reordering the selected item. * app/widgets/gimpcontainerview.c: cosmetic. * app/widgets/gimpimagefilepreview.[ch] * app/widgets/gimptoolinfopreview.[ch] * app/widgets/gimpundopreview.[ch]: removed because the default implementation is good enough. * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimppreview-utils.c: changed accordingly. * app/gui/dialogs-constructors.[ch] * app/gui/dialogs-menu.c * app/gui/dialogs.c * app/gui/image-menu.c * app/gui/toolbox-menu.c: register grid and tree view variants of the document history. Unrelated: * app/gui/gui.c (gui_exit_finish_callback): disconnect from signals earlier. * app/gui/user-install-dialog.c: create the "tool-options" subdir of the user's ~/.gimp-1.3 directory.
2003-02-27 00:15:50 +08:00
/*< private >*/
added "gchar *stock_id" to the GimpViewable struct. It is used by the GUI 2003-02-25 Michael Natterer <mitch@gimp.org> * app/core/gimpviewable.[ch]: added "gchar *stock_id" to the GimpViewable struct. It is used by the GUI if the get_preview() functions return NULL. Default to GTK_STOCK_DIALOG_QUESTION. * app/core/gimptoolinfo.[ch]: set the tool's stock_id. Removed the cached GdkPixbuf. Don't implement any preview function so the GUI uses the stock_id. * app/tools/tool_manager.c: removed GdkPixbuf creation, removed the #warning about the buggy way we created the pixbuf. * app/gui/dialogs-constructors.c * app/gui/image-menu.c * app/tools/gimpcroptool.c * app/tools/gimphistogramtool.c * app/tools/gimpimagemaptool.c * app/tools/gimpmeasuretool.c * app/tools/gimptransformtool.c * app/widgets/gimptoolbox.c: use viewable->stock_id instead of tool_info->stock_id. * app/core/gimpbrush.c * app/core/gimpgradient.c * app/core/gimpimagefile.c * app/core/gimpundo.c: simplified get_preview() implementations: - never scale previews up, only down. - don't render white or checks backgrounds but simply return TempBufs with alpha and let the preview system do its job. - don't add padding but simply return previews smaller than requested. * app/display/gimpdisplayshell-render.[ch]: added "render_blend_white", a 2d lookup table for blending on white, just as the check lookup tables. Added "render_white_buf". * app/widgets/gimppreview.[ch]: changed a lot: - don't render the preview's border into the buffer. - added "GdkGC *border_gc" and draw the preview's border in expose() using gdk_draw_rectangle(). - added "GdkPixbuf *no_preview_pixbuf" and create it in gimp_preview_real_render() if gimp_viewable_get_preview() returned NULL. - factored the actual preview rendering out to gimp_preview_render_to_buffer(). Added configurable background rendering for the preview itself and it's padding area (the area the preview is larger than the buffer returned by gimp_viewable_get_preview()). - changed gimp_preview_render_and_flush() to gimp_preview_render_preview() and added "inside_bg" and "outside_bg" parameters. - use the new render buffers for blending on white. * app/widgets/gimpbrushpreview.c * app/widgets/gimpbufferpreview.c * app/widgets/gimpdrawablepreview.c * app/widgets/gimpgradientpreview.c * app/widgets/gimpimagepreview.c * app/widgets/gimppalettepreview.c * app/widgets/gimppatternpreview.c: don't create large white TempBufs to center the previews in but simply set the TempBuf's offsets to get them centered. Simplified & cleaned up many preview render functions. Pass the correct GimpPreviewBG modes to gimp_preview_render_preview(). * app/widgets/gimpcellrendererviewable.[ch]: new GtkCellRenderer class derived from GtkCellRendererPixbuf which knows how to use gimp_viewable_get_preview_size() and renders the viewable's stock item if no preview can be created. * app/widgets/gimpcontainertreeview.c: added a GtkTreeCellDataFunc which creates the preview pixbuf if needed so we don't create it unconditionally upon item insertion. Fixed preview size assertion to use GIMP_PREVIEW_MAX_SIZE, not "64". Block "selection_changed" while reordering the selected item. * app/widgets/gimpcontainerview.c: cosmetic. * app/widgets/gimpimagefilepreview.[ch] * app/widgets/gimptoolinfopreview.[ch] * app/widgets/gimpundopreview.[ch]: removed because the default implementation is good enough. * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimppreview-utils.c: changed accordingly. * app/gui/dialogs-constructors.[ch] * app/gui/dialogs-menu.c * app/gui/dialogs.c * app/gui/image-menu.c * app/gui/toolbox-menu.c: register grid and tree view variants of the document history. Unrelated: * app/gui/gui.c (gui_exit_finish_callback): disconnect from signals earlier. * app/gui/user-install-dialog.c: create the "tool-options" subdir of the user's ~/.gimp-1.3 directory.
2003-02-27 00:15:50 +08:00
gchar *stock_id;
gint freeze_count;
};
struct _GimpViewableClass
{
GimpObjectClass parent_class;
const gchar *default_stock_id;
const gchar *name_changed_signal;
/* signals */
void (* invalidate_preview) (GimpViewable *viewable);
void (* size_changed) (GimpViewable *viewable);
major cleanup. After being finished, I decided that it needs to be 2001-06-18 Michael Natterer <mitch@gimp.org> * app/nav_window.[ch]: major cleanup. After being finished, I decided that it needs to be factored out to a widget (see below), so like 90% of this file will go away soon. * app/apptypes.h: added opaque NavigationDialog typedef. * app/gdisplay.[ch]: Added gdisplay_selection_visibility() which is called from gdisplays_selection_visibility(). Capitalized the SelectionControl enum values. Cleaned up the GDisplay struct and it's initialisation while i was on it. * app/gimage.c: gimage_size_changed_handler(): removed stuff which is now done by GimpImage itself. * app/scale.c * app/scroll.c: also update the navigation popup, not only the dialog. * app/selection.[ch]: major indentation & cleanup attack. Maybe found the "Selection vanishes" bug (the timeout id was assinged to a gint, not a _guint_). * app/undo.c: s/gimp_image_size_changed/gimp_viweable_size_changed/ * app/core/gimpdrawable.c: invalidate the image's preview from our "invalidate_preview" implementation. This means that the image's preview is invalidated way too often currently, which cries for some general freeze/thaw mechanism on the GimpViewable level. (Note that previews are rendered in the idle loop, so this is not really a major performance impact, it's just ugly). * app/core/gimpimage.[ch]: removed the "size_changed" signal... * app/core/gimpviewable.[ch]: ...and added it here. * app/core/gimplayer.c: invalidate_preview(): always chain up, also if it's a floating selection. * app/gui/info-dialog.[ch] * app/gui/info-window.c: minor cleanups. * app/gui/preferences-dialog.c: no need to invalidate the image after we have invalidated all it's layers. * app/core/gimpimage-mask.c * app/gui/commands.c * app/tools/gimpeditselectiontool.c * app/tools/gimpinktool.c * app/tools/gimpmovetool.c * app/tools/gimppainttool.c: capitalized the SelectionCommand enum values. * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpnavigationpreview.[ch]: new widget. * app/widgets/gimppreview.[ch]: added a non-working non-dot-for-dot mode. Added xres/yres params to the gimp_preview_calc_size() helper function. Cache the "size" value which was passed to the simple function variants (gimp_preview_new() and gimp_preview_set_size()) so we can re-calculate the preview's extents on the underlying viewable's "size_changed" signal and on gimp_preview_set_viewable(). * app/widgets/gimpdrawablepreview.c * app/widgets/gimpimagepreview.c: changed accordingly.
2001-06-18 21:10:03 +08:00
/* virtual functions */
gboolean (* get_size) (GimpViewable *viewable,
gint *width,
gint *height);
void (* get_preview_size) (GimpViewable *viewable,
gint size,
gboolean is_popup,
gboolean dot_for_dot,
gint *width,
gint *height);
gboolean (* get_popup_size) (GimpViewable *viewable,
gint width,
gint height,
gboolean dot_for_dot,
gint *popup_width,
gint *popup_height);
TempBuf * (* get_preview) (GimpViewable *viewable,
Changed GimpViewable preview rendering to have a context to get 2006-08-29 Michael Natterer <mitch@gimp.org> Changed GimpViewable preview rendering to have a context to get FG/BG/whatever from. Use the context to enable dynamic FG/BG colors in gradients. Fixes bug #127676 and bug #352214. Addresses bug #128367 (doesn't fix it because there's no loading/saving and no GUI yet). * app/core/core-enums.[ch]: added enum GimpGradientColor to enable specifying gradient colors in terms of foreground and background. * app/core/gimpgradient.[ch]: added color_type members to the GimpGradientSegment struct and honor them in gimp_gradient_get_color_at(). Added GimpContext parameters to all functions which finally call get_color_at(). * app/core/gimp-gradients.c: use the new method to implement the builtin gradients. * app/core/gimpviewable.[ch]: added GimpContext parameters to all get_preview() and get_pixbuf() functions. * app/core/gimpbrush.c * app/core/gimpbuffer.c * app/core/gimpdrawable-preview.[ch] * app/core/gimpgradient.c * app/core/gimpimage-preview.[ch] * app/core/gimpimagefile.c * app/core/gimppalette.c * app/core/gimppattern.c * app/core/gimpundo.[ch] * app/text/gimpfont.c * app/vectors/gimpvectors-preview.[ch]: changed ::get_preview() and ::get_pixbuf() implementations accordingly. * app/core/gimpdrawable-blend.c * app/core/gimppalette-import.[ch] * app/dialogs/dialogs-constructors.c * app/dialogs/palette-import-dialog.c * app/dialogs/resize-dialog.c * app/display/gimpdisplayshell-layer-select.c * app/display/gimpdisplayshell.c * app/display/gimpnavigationeditor.c * app/paint/gimppaintoptions.c * app/tools/gimpeditselectiontool.c * app/tools/gimptexttool.c * app/actions/gradient-editor-commands.c * app/widgets/gimpaction.c * app/widgets/gimpbrusheditor.[ch] * app/widgets/gimpbufferview.c * app/widgets/gimpcellrendererviewable.c * app/widgets/gimpchanneltreeview.c * app/widgets/gimpclipboard.c * app/widgets/gimpcoloreditor.c * app/widgets/gimpcomponenteditor.c * app/widgets/gimpcontainerbox.c * app/widgets/gimpcontainercombobox.c * app/widgets/gimpcontainereditor.c * app/widgets/gimpcontainerentry.c * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainertreeview.[ch] * app/widgets/gimpdataeditor.[ch] * app/widgets/gimpdevicestatus.c * app/widgets/gimpdnd.[ch] * app/widgets/gimpdrawabletreeview.c * app/widgets/gimpfiledialog.c * app/widgets/gimpgradienteditor.[ch] * app/widgets/gimpgradientselect.c * app/widgets/gimpitemtreeview.c * app/widgets/gimplayertreeview.c * app/widgets/gimppaletteeditor.[ch] * app/widgets/gimppropwidgets.[ch] * app/widgets/gimpselectioneditor.c * app/widgets/gimpthumbbox.[ch] * app/widgets/gimptoolbox-image-area.c * app/widgets/gimptoolbox-indicator-area.c * app/widgets/gimptooloptionseditor.c * app/widgets/gimpundoeditor.c * app/widgets/gimpvectorstreeview.c * app/widgets/gimpview-popup.[ch] * app/widgets/gimpview.[ch] * app/widgets/gimpviewablebutton.c * app/widgets/gimpviewabledialog.c * app/widgets/gimpviewrenderer.[ch] * app/widgets/gimpviewrenderer-frame.c * app/widgets/gimpviewrendererbrush.c * app/widgets/gimpviewrendererbuffer.c * app/widgets/gimpviewrendererdrawable.c * app/widgets/gimpviewrenderergradient.c * app/widgets/gimpviewrendererimage.c * tools/pdbgen/pdb/drawable.pdb * tools/pdbgen/pdb/gradient.pdb * tools/pdbgen/pdb/gradients.pdb * tools/pdbgen/pdb/image.pdb: added tons of GimpContext members and parameters, implement GimpDocked::set_context() in many widgets. Pass these locally remembered contexts to GimpViewable functions. Did some minor cleanups on the way. There are still some minor FIXMEs around where the code uses a NULL context (which is allowed by the APIs) * app/pdb/drawable_cmds.c * app/pdb/gradient_cmds.c * app/pdb/gradients_cmds.c * app/pdb/image_cmds.c: regenerated.
2006-08-30 05:44:51 +08:00
GimpContext *context,
gint width,
gint height);
TempBuf * (* get_new_preview) (GimpViewable *viewable,
Changed GimpViewable preview rendering to have a context to get 2006-08-29 Michael Natterer <mitch@gimp.org> Changed GimpViewable preview rendering to have a context to get FG/BG/whatever from. Use the context to enable dynamic FG/BG colors in gradients. Fixes bug #127676 and bug #352214. Addresses bug #128367 (doesn't fix it because there's no loading/saving and no GUI yet). * app/core/core-enums.[ch]: added enum GimpGradientColor to enable specifying gradient colors in terms of foreground and background. * app/core/gimpgradient.[ch]: added color_type members to the GimpGradientSegment struct and honor them in gimp_gradient_get_color_at(). Added GimpContext parameters to all functions which finally call get_color_at(). * app/core/gimp-gradients.c: use the new method to implement the builtin gradients. * app/core/gimpviewable.[ch]: added GimpContext parameters to all get_preview() and get_pixbuf() functions. * app/core/gimpbrush.c * app/core/gimpbuffer.c * app/core/gimpdrawable-preview.[ch] * app/core/gimpgradient.c * app/core/gimpimage-preview.[ch] * app/core/gimpimagefile.c * app/core/gimppalette.c * app/core/gimppattern.c * app/core/gimpundo.[ch] * app/text/gimpfont.c * app/vectors/gimpvectors-preview.[ch]: changed ::get_preview() and ::get_pixbuf() implementations accordingly. * app/core/gimpdrawable-blend.c * app/core/gimppalette-import.[ch] * app/dialogs/dialogs-constructors.c * app/dialogs/palette-import-dialog.c * app/dialogs/resize-dialog.c * app/display/gimpdisplayshell-layer-select.c * app/display/gimpdisplayshell.c * app/display/gimpnavigationeditor.c * app/paint/gimppaintoptions.c * app/tools/gimpeditselectiontool.c * app/tools/gimptexttool.c * app/actions/gradient-editor-commands.c * app/widgets/gimpaction.c * app/widgets/gimpbrusheditor.[ch] * app/widgets/gimpbufferview.c * app/widgets/gimpcellrendererviewable.c * app/widgets/gimpchanneltreeview.c * app/widgets/gimpclipboard.c * app/widgets/gimpcoloreditor.c * app/widgets/gimpcomponenteditor.c * app/widgets/gimpcontainerbox.c * app/widgets/gimpcontainercombobox.c * app/widgets/gimpcontainereditor.c * app/widgets/gimpcontainerentry.c * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainertreeview.[ch] * app/widgets/gimpdataeditor.[ch] * app/widgets/gimpdevicestatus.c * app/widgets/gimpdnd.[ch] * app/widgets/gimpdrawabletreeview.c * app/widgets/gimpfiledialog.c * app/widgets/gimpgradienteditor.[ch] * app/widgets/gimpgradientselect.c * app/widgets/gimpitemtreeview.c * app/widgets/gimplayertreeview.c * app/widgets/gimppaletteeditor.[ch] * app/widgets/gimppropwidgets.[ch] * app/widgets/gimpselectioneditor.c * app/widgets/gimpthumbbox.[ch] * app/widgets/gimptoolbox-image-area.c * app/widgets/gimptoolbox-indicator-area.c * app/widgets/gimptooloptionseditor.c * app/widgets/gimpundoeditor.c * app/widgets/gimpvectorstreeview.c * app/widgets/gimpview-popup.[ch] * app/widgets/gimpview.[ch] * app/widgets/gimpviewablebutton.c * app/widgets/gimpviewabledialog.c * app/widgets/gimpviewrenderer.[ch] * app/widgets/gimpviewrenderer-frame.c * app/widgets/gimpviewrendererbrush.c * app/widgets/gimpviewrendererbuffer.c * app/widgets/gimpviewrendererdrawable.c * app/widgets/gimpviewrenderergradient.c * app/widgets/gimpviewrendererimage.c * tools/pdbgen/pdb/drawable.pdb * tools/pdbgen/pdb/gradient.pdb * tools/pdbgen/pdb/gradients.pdb * tools/pdbgen/pdb/image.pdb: added tons of GimpContext members and parameters, implement GimpDocked::set_context() in many widgets. Pass these locally remembered contexts to GimpViewable functions. Did some minor cleanups on the way. There are still some minor FIXMEs around where the code uses a NULL context (which is allowed by the APIs) * app/pdb/drawable_cmds.c * app/pdb/gradient_cmds.c * app/pdb/gradients_cmds.c * app/pdb/image_cmds.c: regenerated.
2006-08-30 05:44:51 +08:00
GimpContext *context,
gint width,
gint height);
GdkPixbuf * (* get_pixbuf) (GimpViewable *viewable,
Changed GimpViewable preview rendering to have a context to get 2006-08-29 Michael Natterer <mitch@gimp.org> Changed GimpViewable preview rendering to have a context to get FG/BG/whatever from. Use the context to enable dynamic FG/BG colors in gradients. Fixes bug #127676 and bug #352214. Addresses bug #128367 (doesn't fix it because there's no loading/saving and no GUI yet). * app/core/core-enums.[ch]: added enum GimpGradientColor to enable specifying gradient colors in terms of foreground and background. * app/core/gimpgradient.[ch]: added color_type members to the GimpGradientSegment struct and honor them in gimp_gradient_get_color_at(). Added GimpContext parameters to all functions which finally call get_color_at(). * app/core/gimp-gradients.c: use the new method to implement the builtin gradients. * app/core/gimpviewable.[ch]: added GimpContext parameters to all get_preview() and get_pixbuf() functions. * app/core/gimpbrush.c * app/core/gimpbuffer.c * app/core/gimpdrawable-preview.[ch] * app/core/gimpgradient.c * app/core/gimpimage-preview.[ch] * app/core/gimpimagefile.c * app/core/gimppalette.c * app/core/gimppattern.c * app/core/gimpundo.[ch] * app/text/gimpfont.c * app/vectors/gimpvectors-preview.[ch]: changed ::get_preview() and ::get_pixbuf() implementations accordingly. * app/core/gimpdrawable-blend.c * app/core/gimppalette-import.[ch] * app/dialogs/dialogs-constructors.c * app/dialogs/palette-import-dialog.c * app/dialogs/resize-dialog.c * app/display/gimpdisplayshell-layer-select.c * app/display/gimpdisplayshell.c * app/display/gimpnavigationeditor.c * app/paint/gimppaintoptions.c * app/tools/gimpeditselectiontool.c * app/tools/gimptexttool.c * app/actions/gradient-editor-commands.c * app/widgets/gimpaction.c * app/widgets/gimpbrusheditor.[ch] * app/widgets/gimpbufferview.c * app/widgets/gimpcellrendererviewable.c * app/widgets/gimpchanneltreeview.c * app/widgets/gimpclipboard.c * app/widgets/gimpcoloreditor.c * app/widgets/gimpcomponenteditor.c * app/widgets/gimpcontainerbox.c * app/widgets/gimpcontainercombobox.c * app/widgets/gimpcontainereditor.c * app/widgets/gimpcontainerentry.c * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainertreeview.[ch] * app/widgets/gimpdataeditor.[ch] * app/widgets/gimpdevicestatus.c * app/widgets/gimpdnd.[ch] * app/widgets/gimpdrawabletreeview.c * app/widgets/gimpfiledialog.c * app/widgets/gimpgradienteditor.[ch] * app/widgets/gimpgradientselect.c * app/widgets/gimpitemtreeview.c * app/widgets/gimplayertreeview.c * app/widgets/gimppaletteeditor.[ch] * app/widgets/gimppropwidgets.[ch] * app/widgets/gimpselectioneditor.c * app/widgets/gimpthumbbox.[ch] * app/widgets/gimptoolbox-image-area.c * app/widgets/gimptoolbox-indicator-area.c * app/widgets/gimptooloptionseditor.c * app/widgets/gimpundoeditor.c * app/widgets/gimpvectorstreeview.c * app/widgets/gimpview-popup.[ch] * app/widgets/gimpview.[ch] * app/widgets/gimpviewablebutton.c * app/widgets/gimpviewabledialog.c * app/widgets/gimpviewrenderer.[ch] * app/widgets/gimpviewrenderer-frame.c * app/widgets/gimpviewrendererbrush.c * app/widgets/gimpviewrendererbuffer.c * app/widgets/gimpviewrendererdrawable.c * app/widgets/gimpviewrenderergradient.c * app/widgets/gimpviewrendererimage.c * tools/pdbgen/pdb/drawable.pdb * tools/pdbgen/pdb/gradient.pdb * tools/pdbgen/pdb/gradients.pdb * tools/pdbgen/pdb/image.pdb: added tons of GimpContext members and parameters, implement GimpDocked::set_context() in many widgets. Pass these locally remembered contexts to GimpViewable functions. Did some minor cleanups on the way. There are still some minor FIXMEs around where the code uses a NULL context (which is allowed by the APIs) * app/pdb/drawable_cmds.c * app/pdb/gradient_cmds.c * app/pdb/gradients_cmds.c * app/pdb/image_cmds.c: regenerated.
2006-08-30 05:44:51 +08:00
GimpContext *context,
gint width,
gint height);
GdkPixbuf * (* get_new_pixbuf) (GimpViewable *viewable,
Changed GimpViewable preview rendering to have a context to get 2006-08-29 Michael Natterer <mitch@gimp.org> Changed GimpViewable preview rendering to have a context to get FG/BG/whatever from. Use the context to enable dynamic FG/BG colors in gradients. Fixes bug #127676 and bug #352214. Addresses bug #128367 (doesn't fix it because there's no loading/saving and no GUI yet). * app/core/core-enums.[ch]: added enum GimpGradientColor to enable specifying gradient colors in terms of foreground and background. * app/core/gimpgradient.[ch]: added color_type members to the GimpGradientSegment struct and honor them in gimp_gradient_get_color_at(). Added GimpContext parameters to all functions which finally call get_color_at(). * app/core/gimp-gradients.c: use the new method to implement the builtin gradients. * app/core/gimpviewable.[ch]: added GimpContext parameters to all get_preview() and get_pixbuf() functions. * app/core/gimpbrush.c * app/core/gimpbuffer.c * app/core/gimpdrawable-preview.[ch] * app/core/gimpgradient.c * app/core/gimpimage-preview.[ch] * app/core/gimpimagefile.c * app/core/gimppalette.c * app/core/gimppattern.c * app/core/gimpundo.[ch] * app/text/gimpfont.c * app/vectors/gimpvectors-preview.[ch]: changed ::get_preview() and ::get_pixbuf() implementations accordingly. * app/core/gimpdrawable-blend.c * app/core/gimppalette-import.[ch] * app/dialogs/dialogs-constructors.c * app/dialogs/palette-import-dialog.c * app/dialogs/resize-dialog.c * app/display/gimpdisplayshell-layer-select.c * app/display/gimpdisplayshell.c * app/display/gimpnavigationeditor.c * app/paint/gimppaintoptions.c * app/tools/gimpeditselectiontool.c * app/tools/gimptexttool.c * app/actions/gradient-editor-commands.c * app/widgets/gimpaction.c * app/widgets/gimpbrusheditor.[ch] * app/widgets/gimpbufferview.c * app/widgets/gimpcellrendererviewable.c * app/widgets/gimpchanneltreeview.c * app/widgets/gimpclipboard.c * app/widgets/gimpcoloreditor.c * app/widgets/gimpcomponenteditor.c * app/widgets/gimpcontainerbox.c * app/widgets/gimpcontainercombobox.c * app/widgets/gimpcontainereditor.c * app/widgets/gimpcontainerentry.c * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainertreeview.[ch] * app/widgets/gimpdataeditor.[ch] * app/widgets/gimpdevicestatus.c * app/widgets/gimpdnd.[ch] * app/widgets/gimpdrawabletreeview.c * app/widgets/gimpfiledialog.c * app/widgets/gimpgradienteditor.[ch] * app/widgets/gimpgradientselect.c * app/widgets/gimpitemtreeview.c * app/widgets/gimplayertreeview.c * app/widgets/gimppaletteeditor.[ch] * app/widgets/gimppropwidgets.[ch] * app/widgets/gimpselectioneditor.c * app/widgets/gimpthumbbox.[ch] * app/widgets/gimptoolbox-image-area.c * app/widgets/gimptoolbox-indicator-area.c * app/widgets/gimptooloptionseditor.c * app/widgets/gimpundoeditor.c * app/widgets/gimpvectorstreeview.c * app/widgets/gimpview-popup.[ch] * app/widgets/gimpview.[ch] * app/widgets/gimpviewablebutton.c * app/widgets/gimpviewabledialog.c * app/widgets/gimpviewrenderer.[ch] * app/widgets/gimpviewrenderer-frame.c * app/widgets/gimpviewrendererbrush.c * app/widgets/gimpviewrendererbuffer.c * app/widgets/gimpviewrendererdrawable.c * app/widgets/gimpviewrenderergradient.c * app/widgets/gimpviewrendererimage.c * tools/pdbgen/pdb/drawable.pdb * tools/pdbgen/pdb/gradient.pdb * tools/pdbgen/pdb/gradients.pdb * tools/pdbgen/pdb/image.pdb: added tons of GimpContext members and parameters, implement GimpDocked::set_context() in many widgets. Pass these locally remembered contexts to GimpViewable functions. Did some minor cleanups on the way. There are still some minor FIXMEs around where the code uses a NULL context (which is allowed by the APIs) * app/pdb/drawable_cmds.c * app/pdb/gradient_cmds.c * app/pdb/gradients_cmds.c * app/pdb/image_cmds.c: regenerated.
2006-08-30 05:44:51 +08:00
GimpContext *context,
gint width,
gint height);
gchar * (* get_description) (GimpViewable *viewable,
gchar **tooltip);
};
GType gimp_viewable_get_type (void) G_GNUC_CONST;
void gimp_viewable_invalidate_preview (GimpViewable *viewable);
void gimp_viewable_size_changed (GimpViewable *viewable);
void gimp_viewable_calc_preview_size (gint aspect_width,
gint aspect_height,
gint width,
gint height,
gboolean dot_for_dot,
gdouble xresolution,
gdouble yresolution,
gint *return_width,
gint *return_height,
gboolean *scaling_up);
gboolean gimp_viewable_get_size (GimpViewable *viewable,
gint *width,
gint *height);
void gimp_viewable_get_preview_size (GimpViewable *viewable,
gint size,
gboolean popup,
gboolean dot_for_dot,
gint *width,
gint *height);
gboolean gimp_viewable_get_popup_size (GimpViewable *viewable,
gint width,
gint height,
gboolean dot_for_dot,
gint *popup_width,
gint *popup_height);
TempBuf * gimp_viewable_get_preview (GimpViewable *viewable,
Changed GimpViewable preview rendering to have a context to get 2006-08-29 Michael Natterer <mitch@gimp.org> Changed GimpViewable preview rendering to have a context to get FG/BG/whatever from. Use the context to enable dynamic FG/BG colors in gradients. Fixes bug #127676 and bug #352214. Addresses bug #128367 (doesn't fix it because there's no loading/saving and no GUI yet). * app/core/core-enums.[ch]: added enum GimpGradientColor to enable specifying gradient colors in terms of foreground and background. * app/core/gimpgradient.[ch]: added color_type members to the GimpGradientSegment struct and honor them in gimp_gradient_get_color_at(). Added GimpContext parameters to all functions which finally call get_color_at(). * app/core/gimp-gradients.c: use the new method to implement the builtin gradients. * app/core/gimpviewable.[ch]: added GimpContext parameters to all get_preview() and get_pixbuf() functions. * app/core/gimpbrush.c * app/core/gimpbuffer.c * app/core/gimpdrawable-preview.[ch] * app/core/gimpgradient.c * app/core/gimpimage-preview.[ch] * app/core/gimpimagefile.c * app/core/gimppalette.c * app/core/gimppattern.c * app/core/gimpundo.[ch] * app/text/gimpfont.c * app/vectors/gimpvectors-preview.[ch]: changed ::get_preview() and ::get_pixbuf() implementations accordingly. * app/core/gimpdrawable-blend.c * app/core/gimppalette-import.[ch] * app/dialogs/dialogs-constructors.c * app/dialogs/palette-import-dialog.c * app/dialogs/resize-dialog.c * app/display/gimpdisplayshell-layer-select.c * app/display/gimpdisplayshell.c * app/display/gimpnavigationeditor.c * app/paint/gimppaintoptions.c * app/tools/gimpeditselectiontool.c * app/tools/gimptexttool.c * app/actions/gradient-editor-commands.c * app/widgets/gimpaction.c * app/widgets/gimpbrusheditor.[ch] * app/widgets/gimpbufferview.c * app/widgets/gimpcellrendererviewable.c * app/widgets/gimpchanneltreeview.c * app/widgets/gimpclipboard.c * app/widgets/gimpcoloreditor.c * app/widgets/gimpcomponenteditor.c * app/widgets/gimpcontainerbox.c * app/widgets/gimpcontainercombobox.c * app/widgets/gimpcontainereditor.c * app/widgets/gimpcontainerentry.c * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainertreeview.[ch] * app/widgets/gimpdataeditor.[ch] * app/widgets/gimpdevicestatus.c * app/widgets/gimpdnd.[ch] * app/widgets/gimpdrawabletreeview.c * app/widgets/gimpfiledialog.c * app/widgets/gimpgradienteditor.[ch] * app/widgets/gimpgradientselect.c * app/widgets/gimpitemtreeview.c * app/widgets/gimplayertreeview.c * app/widgets/gimppaletteeditor.[ch] * app/widgets/gimppropwidgets.[ch] * app/widgets/gimpselectioneditor.c * app/widgets/gimpthumbbox.[ch] * app/widgets/gimptoolbox-image-area.c * app/widgets/gimptoolbox-indicator-area.c * app/widgets/gimptooloptionseditor.c * app/widgets/gimpundoeditor.c * app/widgets/gimpvectorstreeview.c * app/widgets/gimpview-popup.[ch] * app/widgets/gimpview.[ch] * app/widgets/gimpviewablebutton.c * app/widgets/gimpviewabledialog.c * app/widgets/gimpviewrenderer.[ch] * app/widgets/gimpviewrenderer-frame.c * app/widgets/gimpviewrendererbrush.c * app/widgets/gimpviewrendererbuffer.c * app/widgets/gimpviewrendererdrawable.c * app/widgets/gimpviewrenderergradient.c * app/widgets/gimpviewrendererimage.c * tools/pdbgen/pdb/drawable.pdb * tools/pdbgen/pdb/gradient.pdb * tools/pdbgen/pdb/gradients.pdb * tools/pdbgen/pdb/image.pdb: added tons of GimpContext members and parameters, implement GimpDocked::set_context() in many widgets. Pass these locally remembered contexts to GimpViewable functions. Did some minor cleanups on the way. There are still some minor FIXMEs around where the code uses a NULL context (which is allowed by the APIs) * app/pdb/drawable_cmds.c * app/pdb/gradient_cmds.c * app/pdb/gradients_cmds.c * app/pdb/image_cmds.c: regenerated.
2006-08-30 05:44:51 +08:00
GimpContext *context,
gint width,
gint height);
TempBuf * gimp_viewable_get_new_preview (GimpViewable *viewable,
Changed GimpViewable preview rendering to have a context to get 2006-08-29 Michael Natterer <mitch@gimp.org> Changed GimpViewable preview rendering to have a context to get FG/BG/whatever from. Use the context to enable dynamic FG/BG colors in gradients. Fixes bug #127676 and bug #352214. Addresses bug #128367 (doesn't fix it because there's no loading/saving and no GUI yet). * app/core/core-enums.[ch]: added enum GimpGradientColor to enable specifying gradient colors in terms of foreground and background. * app/core/gimpgradient.[ch]: added color_type members to the GimpGradientSegment struct and honor them in gimp_gradient_get_color_at(). Added GimpContext parameters to all functions which finally call get_color_at(). * app/core/gimp-gradients.c: use the new method to implement the builtin gradients. * app/core/gimpviewable.[ch]: added GimpContext parameters to all get_preview() and get_pixbuf() functions. * app/core/gimpbrush.c * app/core/gimpbuffer.c * app/core/gimpdrawable-preview.[ch] * app/core/gimpgradient.c * app/core/gimpimage-preview.[ch] * app/core/gimpimagefile.c * app/core/gimppalette.c * app/core/gimppattern.c * app/core/gimpundo.[ch] * app/text/gimpfont.c * app/vectors/gimpvectors-preview.[ch]: changed ::get_preview() and ::get_pixbuf() implementations accordingly. * app/core/gimpdrawable-blend.c * app/core/gimppalette-import.[ch] * app/dialogs/dialogs-constructors.c * app/dialogs/palette-import-dialog.c * app/dialogs/resize-dialog.c * app/display/gimpdisplayshell-layer-select.c * app/display/gimpdisplayshell.c * app/display/gimpnavigationeditor.c * app/paint/gimppaintoptions.c * app/tools/gimpeditselectiontool.c * app/tools/gimptexttool.c * app/actions/gradient-editor-commands.c * app/widgets/gimpaction.c * app/widgets/gimpbrusheditor.[ch] * app/widgets/gimpbufferview.c * app/widgets/gimpcellrendererviewable.c * app/widgets/gimpchanneltreeview.c * app/widgets/gimpclipboard.c * app/widgets/gimpcoloreditor.c * app/widgets/gimpcomponenteditor.c * app/widgets/gimpcontainerbox.c * app/widgets/gimpcontainercombobox.c * app/widgets/gimpcontainereditor.c * app/widgets/gimpcontainerentry.c * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainertreeview.[ch] * app/widgets/gimpdataeditor.[ch] * app/widgets/gimpdevicestatus.c * app/widgets/gimpdnd.[ch] * app/widgets/gimpdrawabletreeview.c * app/widgets/gimpfiledialog.c * app/widgets/gimpgradienteditor.[ch] * app/widgets/gimpgradientselect.c * app/widgets/gimpitemtreeview.c * app/widgets/gimplayertreeview.c * app/widgets/gimppaletteeditor.[ch] * app/widgets/gimppropwidgets.[ch] * app/widgets/gimpselectioneditor.c * app/widgets/gimpthumbbox.[ch] * app/widgets/gimptoolbox-image-area.c * app/widgets/gimptoolbox-indicator-area.c * app/widgets/gimptooloptionseditor.c * app/widgets/gimpundoeditor.c * app/widgets/gimpvectorstreeview.c * app/widgets/gimpview-popup.[ch] * app/widgets/gimpview.[ch] * app/widgets/gimpviewablebutton.c * app/widgets/gimpviewabledialog.c * app/widgets/gimpviewrenderer.[ch] * app/widgets/gimpviewrenderer-frame.c * app/widgets/gimpviewrendererbrush.c * app/widgets/gimpviewrendererbuffer.c * app/widgets/gimpviewrendererdrawable.c * app/widgets/gimpviewrenderergradient.c * app/widgets/gimpviewrendererimage.c * tools/pdbgen/pdb/drawable.pdb * tools/pdbgen/pdb/gradient.pdb * tools/pdbgen/pdb/gradients.pdb * tools/pdbgen/pdb/image.pdb: added tons of GimpContext members and parameters, implement GimpDocked::set_context() in many widgets. Pass these locally remembered contexts to GimpViewable functions. Did some minor cleanups on the way. There are still some minor FIXMEs around where the code uses a NULL context (which is allowed by the APIs) * app/pdb/drawable_cmds.c * app/pdb/gradient_cmds.c * app/pdb/gradients_cmds.c * app/pdb/image_cmds.c: regenerated.
2006-08-30 05:44:51 +08:00
GimpContext *context,
gint width,
gint height);
TempBuf * gimp_viewable_get_dummy_preview (GimpViewable *viewable,
gint width,
gint height,
gint bpp);
GdkPixbuf * gimp_viewable_get_pixbuf (GimpViewable *viewable,
Changed GimpViewable preview rendering to have a context to get 2006-08-29 Michael Natterer <mitch@gimp.org> Changed GimpViewable preview rendering to have a context to get FG/BG/whatever from. Use the context to enable dynamic FG/BG colors in gradients. Fixes bug #127676 and bug #352214. Addresses bug #128367 (doesn't fix it because there's no loading/saving and no GUI yet). * app/core/core-enums.[ch]: added enum GimpGradientColor to enable specifying gradient colors in terms of foreground and background. * app/core/gimpgradient.[ch]: added color_type members to the GimpGradientSegment struct and honor them in gimp_gradient_get_color_at(). Added GimpContext parameters to all functions which finally call get_color_at(). * app/core/gimp-gradients.c: use the new method to implement the builtin gradients. * app/core/gimpviewable.[ch]: added GimpContext parameters to all get_preview() and get_pixbuf() functions. * app/core/gimpbrush.c * app/core/gimpbuffer.c * app/core/gimpdrawable-preview.[ch] * app/core/gimpgradient.c * app/core/gimpimage-preview.[ch] * app/core/gimpimagefile.c * app/core/gimppalette.c * app/core/gimppattern.c * app/core/gimpundo.[ch] * app/text/gimpfont.c * app/vectors/gimpvectors-preview.[ch]: changed ::get_preview() and ::get_pixbuf() implementations accordingly. * app/core/gimpdrawable-blend.c * app/core/gimppalette-import.[ch] * app/dialogs/dialogs-constructors.c * app/dialogs/palette-import-dialog.c * app/dialogs/resize-dialog.c * app/display/gimpdisplayshell-layer-select.c * app/display/gimpdisplayshell.c * app/display/gimpnavigationeditor.c * app/paint/gimppaintoptions.c * app/tools/gimpeditselectiontool.c * app/tools/gimptexttool.c * app/actions/gradient-editor-commands.c * app/widgets/gimpaction.c * app/widgets/gimpbrusheditor.[ch] * app/widgets/gimpbufferview.c * app/widgets/gimpcellrendererviewable.c * app/widgets/gimpchanneltreeview.c * app/widgets/gimpclipboard.c * app/widgets/gimpcoloreditor.c * app/widgets/gimpcomponenteditor.c * app/widgets/gimpcontainerbox.c * app/widgets/gimpcontainercombobox.c * app/widgets/gimpcontainereditor.c * app/widgets/gimpcontainerentry.c * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainertreeview.[ch] * app/widgets/gimpdataeditor.[ch] * app/widgets/gimpdevicestatus.c * app/widgets/gimpdnd.[ch] * app/widgets/gimpdrawabletreeview.c * app/widgets/gimpfiledialog.c * app/widgets/gimpgradienteditor.[ch] * app/widgets/gimpgradientselect.c * app/widgets/gimpitemtreeview.c * app/widgets/gimplayertreeview.c * app/widgets/gimppaletteeditor.[ch] * app/widgets/gimppropwidgets.[ch] * app/widgets/gimpselectioneditor.c * app/widgets/gimpthumbbox.[ch] * app/widgets/gimptoolbox-image-area.c * app/widgets/gimptoolbox-indicator-area.c * app/widgets/gimptooloptionseditor.c * app/widgets/gimpundoeditor.c * app/widgets/gimpvectorstreeview.c * app/widgets/gimpview-popup.[ch] * app/widgets/gimpview.[ch] * app/widgets/gimpviewablebutton.c * app/widgets/gimpviewabledialog.c * app/widgets/gimpviewrenderer.[ch] * app/widgets/gimpviewrenderer-frame.c * app/widgets/gimpviewrendererbrush.c * app/widgets/gimpviewrendererbuffer.c * app/widgets/gimpviewrendererdrawable.c * app/widgets/gimpviewrenderergradient.c * app/widgets/gimpviewrendererimage.c * tools/pdbgen/pdb/drawable.pdb * tools/pdbgen/pdb/gradient.pdb * tools/pdbgen/pdb/gradients.pdb * tools/pdbgen/pdb/image.pdb: added tons of GimpContext members and parameters, implement GimpDocked::set_context() in many widgets. Pass these locally remembered contexts to GimpViewable functions. Did some minor cleanups on the way. There are still some minor FIXMEs around where the code uses a NULL context (which is allowed by the APIs) * app/pdb/drawable_cmds.c * app/pdb/gradient_cmds.c * app/pdb/gradients_cmds.c * app/pdb/image_cmds.c: regenerated.
2006-08-30 05:44:51 +08:00
GimpContext *context,
gint width,
gint height);
GdkPixbuf * gimp_viewable_get_new_pixbuf (GimpViewable *viewable,
Changed GimpViewable preview rendering to have a context to get 2006-08-29 Michael Natterer <mitch@gimp.org> Changed GimpViewable preview rendering to have a context to get FG/BG/whatever from. Use the context to enable dynamic FG/BG colors in gradients. Fixes bug #127676 and bug #352214. Addresses bug #128367 (doesn't fix it because there's no loading/saving and no GUI yet). * app/core/core-enums.[ch]: added enum GimpGradientColor to enable specifying gradient colors in terms of foreground and background. * app/core/gimpgradient.[ch]: added color_type members to the GimpGradientSegment struct and honor them in gimp_gradient_get_color_at(). Added GimpContext parameters to all functions which finally call get_color_at(). * app/core/gimp-gradients.c: use the new method to implement the builtin gradients. * app/core/gimpviewable.[ch]: added GimpContext parameters to all get_preview() and get_pixbuf() functions. * app/core/gimpbrush.c * app/core/gimpbuffer.c * app/core/gimpdrawable-preview.[ch] * app/core/gimpgradient.c * app/core/gimpimage-preview.[ch] * app/core/gimpimagefile.c * app/core/gimppalette.c * app/core/gimppattern.c * app/core/gimpundo.[ch] * app/text/gimpfont.c * app/vectors/gimpvectors-preview.[ch]: changed ::get_preview() and ::get_pixbuf() implementations accordingly. * app/core/gimpdrawable-blend.c * app/core/gimppalette-import.[ch] * app/dialogs/dialogs-constructors.c * app/dialogs/palette-import-dialog.c * app/dialogs/resize-dialog.c * app/display/gimpdisplayshell-layer-select.c * app/display/gimpdisplayshell.c * app/display/gimpnavigationeditor.c * app/paint/gimppaintoptions.c * app/tools/gimpeditselectiontool.c * app/tools/gimptexttool.c * app/actions/gradient-editor-commands.c * app/widgets/gimpaction.c * app/widgets/gimpbrusheditor.[ch] * app/widgets/gimpbufferview.c * app/widgets/gimpcellrendererviewable.c * app/widgets/gimpchanneltreeview.c * app/widgets/gimpclipboard.c * app/widgets/gimpcoloreditor.c * app/widgets/gimpcomponenteditor.c * app/widgets/gimpcontainerbox.c * app/widgets/gimpcontainercombobox.c * app/widgets/gimpcontainereditor.c * app/widgets/gimpcontainerentry.c * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainertreeview.[ch] * app/widgets/gimpdataeditor.[ch] * app/widgets/gimpdevicestatus.c * app/widgets/gimpdnd.[ch] * app/widgets/gimpdrawabletreeview.c * app/widgets/gimpfiledialog.c * app/widgets/gimpgradienteditor.[ch] * app/widgets/gimpgradientselect.c * app/widgets/gimpitemtreeview.c * app/widgets/gimplayertreeview.c * app/widgets/gimppaletteeditor.[ch] * app/widgets/gimppropwidgets.[ch] * app/widgets/gimpselectioneditor.c * app/widgets/gimpthumbbox.[ch] * app/widgets/gimptoolbox-image-area.c * app/widgets/gimptoolbox-indicator-area.c * app/widgets/gimptooloptionseditor.c * app/widgets/gimpundoeditor.c * app/widgets/gimpvectorstreeview.c * app/widgets/gimpview-popup.[ch] * app/widgets/gimpview.[ch] * app/widgets/gimpviewablebutton.c * app/widgets/gimpviewabledialog.c * app/widgets/gimpviewrenderer.[ch] * app/widgets/gimpviewrenderer-frame.c * app/widgets/gimpviewrendererbrush.c * app/widgets/gimpviewrendererbuffer.c * app/widgets/gimpviewrendererdrawable.c * app/widgets/gimpviewrenderergradient.c * app/widgets/gimpviewrendererimage.c * tools/pdbgen/pdb/drawable.pdb * tools/pdbgen/pdb/gradient.pdb * tools/pdbgen/pdb/gradients.pdb * tools/pdbgen/pdb/image.pdb: added tons of GimpContext members and parameters, implement GimpDocked::set_context() in many widgets. Pass these locally remembered contexts to GimpViewable functions. Did some minor cleanups on the way. There are still some minor FIXMEs around where the code uses a NULL context (which is allowed by the APIs) * app/pdb/drawable_cmds.c * app/pdb/gradient_cmds.c * app/pdb/gradients_cmds.c * app/pdb/image_cmds.c: regenerated.
2006-08-30 05:44:51 +08:00
GimpContext *context,
gint width,
gint height);
GdkPixbuf * gimp_viewable_get_dummy_pixbuf (GimpViewable *viewable,
gint width,
gint height,
gint bpp);
gchar * gimp_viewable_get_description (GimpViewable *viewable,
gchar **tooltip);
const gchar * gimp_viewable_get_stock_id (GimpViewable *viewable);
void gimp_viewable_set_stock_id (GimpViewable *viewable,
const gchar *stock_id);
void gimp_viewable_preview_freeze (GimpViewable *viewable);
void gimp_viewable_preview_thaw (GimpViewable *viewable);
gboolean gimp_viewable_preview_is_frozen (GimpViewable *viewable);
#endif /* __GIMP_VIEWABLE_H__ */