gimp/app/widgets/gimpcontainertreeview.c

707 lines
22 KiB
C
Raw Normal View History

Started migration from GtkList to GtkTreeView: 2003-02-21 Michael Natterer <mitch@gimp.org> Started migration from GtkList to GtkTreeView: * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpcontainertreeview.[ch]; new GimpContainerView subclass using GtkListStore/GtkTreeView. * app/widgets/widgets-enums.h: added GIMP_VIEW_TYPE_TREE to thje GimpViewType enum. * app/widgets/gimpcontainereditor.c: added GimpContainerTreeView to the switch() which selects the view type. * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.[ch] * app/gui/dialogs-menu.c * app/gui/dialogs.c: added tree view versions of many dialogs. * app/widgets/gimppreview.[ch]: removed the get_size() virtual function and gimp_preview_calc_size(). * app/core/gimpviewable.[ch]: added virtual function get_preview_size() and gimp_viewable_calc_preview_size(). * 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: added get_preview_size() implementations. * app/widgets/gimpbufferpreview.c * app/widgets/gimpdrawablepreview.c * app/widgets/gimpgradientpreview.c * app/widgets/gimpimagepreview.c * app/widgets/gimppalettepreview.c * app/widgets/gimpselectioneditor.c * app/widgets/gimpundopreview.c * app/display/gimpnavigationview.c: changed accordingly, removed get_size() implementations. * app/widgets/widgets-types.h: changed the first param of GimpItemGetNameFunc from GtkWidget to GObject. * app/widgets/gimpcontainerview-utils.c: accept a GimpViewable as object in the built-in get_name funcs. * app/widgets/gimpcomponentlistitem.c * app/widgets/gimpcontainergridview.c * app/widgets/gimplistitem.c * app/widgets/gimpmenuitem.c: changed accordingly.
2003-02-22 03:03:19 +08:00
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* gimpcontainertreeview.c
* Copyright (C) 2003 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.
*/
#include "config.h"
#include <gtk/gtk.h>
#include "widgets-types.h"
added "gchar *stock_id" to the GimpViewable struct. It is used by the GUI 2003-02-26 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:17:10 +08:00
#include "base/temp-buf.h"
Started migration from GtkList to GtkTreeView: 2003-02-21 Michael Natterer <mitch@gimp.org> Started migration from GtkList to GtkTreeView: * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpcontainertreeview.[ch]; new GimpContainerView subclass using GtkListStore/GtkTreeView. * app/widgets/widgets-enums.h: added GIMP_VIEW_TYPE_TREE to thje GimpViewType enum. * app/widgets/gimpcontainereditor.c: added GimpContainerTreeView to the switch() which selects the view type. * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.[ch] * app/gui/dialogs-menu.c * app/gui/dialogs.c: added tree view versions of many dialogs. * app/widgets/gimppreview.[ch]: removed the get_size() virtual function and gimp_preview_calc_size(). * app/core/gimpviewable.[ch]: added virtual function get_preview_size() and gimp_viewable_calc_preview_size(). * 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: added get_preview_size() implementations. * app/widgets/gimpbufferpreview.c * app/widgets/gimpdrawablepreview.c * app/widgets/gimpgradientpreview.c * app/widgets/gimpimagepreview.c * app/widgets/gimppalettepreview.c * app/widgets/gimpselectioneditor.c * app/widgets/gimpundopreview.c * app/display/gimpnavigationview.c: changed accordingly, removed get_size() implementations. * app/widgets/widgets-types.h: changed the first param of GimpItemGetNameFunc from GtkWidget to GObject. * app/widgets/gimpcontainerview-utils.c: accept a GimpViewable as object in the built-in get_name funcs. * app/widgets/gimpcomponentlistitem.c * app/widgets/gimpcontainergridview.c * app/widgets/gimplistitem.c * app/widgets/gimpmenuitem.c: changed accordingly.
2003-02-22 03:03:19 +08:00
#include "core/gimpcontainer.h"
#include "core/gimpcontext.h"
#include "core/gimpviewable.h"
added "gchar *stock_id" to the GimpViewable struct. It is used by the GUI 2003-02-26 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:17:10 +08:00
#include "gimpcellrendererviewable.h"
Started migration from GtkList to GtkTreeView: 2003-02-21 Michael Natterer <mitch@gimp.org> Started migration from GtkList to GtkTreeView: * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpcontainertreeview.[ch]; new GimpContainerView subclass using GtkListStore/GtkTreeView. * app/widgets/widgets-enums.h: added GIMP_VIEW_TYPE_TREE to thje GimpViewType enum. * app/widgets/gimpcontainereditor.c: added GimpContainerTreeView to the switch() which selects the view type. * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.[ch] * app/gui/dialogs-menu.c * app/gui/dialogs.c: added tree view versions of many dialogs. * app/widgets/gimppreview.[ch]: removed the get_size() virtual function and gimp_preview_calc_size(). * app/core/gimpviewable.[ch]: added virtual function get_preview_size() and gimp_viewable_calc_preview_size(). * 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: added get_preview_size() implementations. * app/widgets/gimpbufferpreview.c * app/widgets/gimpdrawablepreview.c * app/widgets/gimpgradientpreview.c * app/widgets/gimpimagepreview.c * app/widgets/gimppalettepreview.c * app/widgets/gimpselectioneditor.c * app/widgets/gimpundopreview.c * app/display/gimpnavigationview.c: changed accordingly, removed get_size() implementations. * app/widgets/widgets-types.h: changed the first param of GimpItemGetNameFunc from GtkWidget to GObject. * app/widgets/gimpcontainerview-utils.c: accept a GimpViewable as object in the built-in get_name funcs. * app/widgets/gimpcomponentlistitem.c * app/widgets/gimpcontainergridview.c * app/widgets/gimplistitem.c * app/widgets/gimpmenuitem.c: changed accordingly.
2003-02-22 03:03:19 +08:00
#include "gimpcontainertreeview.h"
#include "gimpdnd.h"
added "gchar *stock_id" to the GimpViewable struct. It is used by the GUI 2003-02-26 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:17:10 +08:00
#include "gimppreview.h"
don't scale the preview up if the buffer is too small. 2003-03-01 Michael Natterer <mitch@gimp.org> * app/core/gimpbuffer.c: don't scale the preview up if the buffer is too small. * app/core/gimppattern.c: don't add a white border around the preview if the pattern is too small. * app/widgets/gimppreviewrenderer.[ch]: new object. A buffer that updates itself on GimpViewable changes and can render itself to any widget. Basically GimpPreview reduced to the render and draw code. * app/widgets/gimppreview.[ch]: removed all rendering and drawing code and keep a GimpPreviewRenderer instance. Connect to its "update" signal for queuing draws on the preview. * app/widgets/gimpcellrendererviewable.[ch] * app/widgets/gimpcontainertreeview.c: same here: removed rendering and drawing code and keep GimpPreviewRenderers in the list store. Delays preview creation for GtkTreeViews until the buffer is really needed for drawing and adds idle preview updating on viewable changes. * app/widgets/gimppreview-utils.[ch] * app/widgets/gimpbrushpreview.[ch] * app/widgets/gimpbufferpreview.[ch] * app/widgets/gimpdrawablepreview.[ch] * app/widgets/gimpimagepreview.[ch]: removed... * app/widgets/gimppreviewrenderer-utils.[ch] * app/widgets/gimppreviewrendererbrush.[ch] * app/widgets/gimppreviewrendererdrawable.[ch] * app/widgets/gimppreviewrendererimage.[ch]: ...and converted to GimpPreviewRenderer subclasses. * app/display/gimpnavigationview.c * app/gui/palette-import-dialog.c * app/widgets/Makefile.am * app/widgets/widgets-enums.h * app/widgets/widgets-types.h * app/widgets/gimpchannellistview.c * app/widgets/gimpcomponentlistitem.c * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainermenuimpl.c * app/widgets/gimplayerlistitem.c * app/widgets/gimplistitem.c * app/widgets/gimpnavigationpreview.[ch] * app/widgets/gimpselectioneditor.c * app/widgets/gimpvectorslistview.c: changed accordingly.
2003-03-01 11:53:41 +08:00
#include "gimppreviewrenderer.h"
Started migration from GtkList to GtkTreeView: 2003-02-21 Michael Natterer <mitch@gimp.org> Started migration from GtkList to GtkTreeView: * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpcontainertreeview.[ch]; new GimpContainerView subclass using GtkListStore/GtkTreeView. * app/widgets/widgets-enums.h: added GIMP_VIEW_TYPE_TREE to thje GimpViewType enum. * app/widgets/gimpcontainereditor.c: added GimpContainerTreeView to the switch() which selects the view type. * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.[ch] * app/gui/dialogs-menu.c * app/gui/dialogs.c: added tree view versions of many dialogs. * app/widgets/gimppreview.[ch]: removed the get_size() virtual function and gimp_preview_calc_size(). * app/core/gimpviewable.[ch]: added virtual function get_preview_size() and gimp_viewable_calc_preview_size(). * 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: added get_preview_size() implementations. * app/widgets/gimpbufferpreview.c * app/widgets/gimpdrawablepreview.c * app/widgets/gimpgradientpreview.c * app/widgets/gimpimagepreview.c * app/widgets/gimppalettepreview.c * app/widgets/gimpselectioneditor.c * app/widgets/gimpundopreview.c * app/display/gimpnavigationview.c: changed accordingly, removed get_size() implementations. * app/widgets/widgets-types.h: changed the first param of GimpItemGetNameFunc from GtkWidget to GObject. * app/widgets/gimpcontainerview-utils.c: accept a GimpViewable as object in the built-in get_name funcs. * app/widgets/gimpcomponentlistitem.c * app/widgets/gimpcontainergridview.c * app/widgets/gimplistitem.c * app/widgets/gimpmenuitem.c: changed accordingly.
2003-02-22 03:03:19 +08:00
enum
{
COLUMN_VIEWABLE,
don't scale the preview up if the buffer is too small. 2003-03-01 Michael Natterer <mitch@gimp.org> * app/core/gimpbuffer.c: don't scale the preview up if the buffer is too small. * app/core/gimppattern.c: don't add a white border around the preview if the pattern is too small. * app/widgets/gimppreviewrenderer.[ch]: new object. A buffer that updates itself on GimpViewable changes and can render itself to any widget. Basically GimpPreview reduced to the render and draw code. * app/widgets/gimppreview.[ch]: removed all rendering and drawing code and keep a GimpPreviewRenderer instance. Connect to its "update" signal for queuing draws on the preview. * app/widgets/gimpcellrendererviewable.[ch] * app/widgets/gimpcontainertreeview.c: same here: removed rendering and drawing code and keep GimpPreviewRenderers in the list store. Delays preview creation for GtkTreeViews until the buffer is really needed for drawing and adds idle preview updating on viewable changes. * app/widgets/gimppreview-utils.[ch] * app/widgets/gimpbrushpreview.[ch] * app/widgets/gimpbufferpreview.[ch] * app/widgets/gimpdrawablepreview.[ch] * app/widgets/gimpimagepreview.[ch]: removed... * app/widgets/gimppreviewrenderer-utils.[ch] * app/widgets/gimppreviewrendererbrush.[ch] * app/widgets/gimppreviewrendererdrawable.[ch] * app/widgets/gimppreviewrendererimage.[ch]: ...and converted to GimpPreviewRenderer subclasses. * app/display/gimpnavigationview.c * app/gui/palette-import-dialog.c * app/widgets/Makefile.am * app/widgets/widgets-enums.h * app/widgets/widgets-types.h * app/widgets/gimpchannellistview.c * app/widgets/gimpcomponentlistitem.c * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainermenuimpl.c * app/widgets/gimplayerlistitem.c * app/widgets/gimplistitem.c * app/widgets/gimpnavigationpreview.[ch] * app/widgets/gimpselectioneditor.c * app/widgets/gimpvectorslistview.c: changed accordingly.
2003-03-01 11:53:41 +08:00
COLUMN_RENDERER,
Started migration from GtkList to GtkTreeView: 2003-02-21 Michael Natterer <mitch@gimp.org> Started migration from GtkList to GtkTreeView: * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpcontainertreeview.[ch]; new GimpContainerView subclass using GtkListStore/GtkTreeView. * app/widgets/widgets-enums.h: added GIMP_VIEW_TYPE_TREE to thje GimpViewType enum. * app/widgets/gimpcontainereditor.c: added GimpContainerTreeView to the switch() which selects the view type. * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.[ch] * app/gui/dialogs-menu.c * app/gui/dialogs.c: added tree view versions of many dialogs. * app/widgets/gimppreview.[ch]: removed the get_size() virtual function and gimp_preview_calc_size(). * app/core/gimpviewable.[ch]: added virtual function get_preview_size() and gimp_viewable_calc_preview_size(). * 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: added get_preview_size() implementations. * app/widgets/gimpbufferpreview.c * app/widgets/gimpdrawablepreview.c * app/widgets/gimpgradientpreview.c * app/widgets/gimpimagepreview.c * app/widgets/gimppalettepreview.c * app/widgets/gimpselectioneditor.c * app/widgets/gimpundopreview.c * app/display/gimpnavigationview.c: changed accordingly, removed get_size() implementations. * app/widgets/widgets-types.h: changed the first param of GimpItemGetNameFunc from GtkWidget to GObject. * app/widgets/gimpcontainerview-utils.c: accept a GimpViewable as object in the built-in get_name funcs. * app/widgets/gimpcomponentlistitem.c * app/widgets/gimpcontainergridview.c * app/widgets/gimplistitem.c * app/widgets/gimpmenuitem.c: changed accordingly.
2003-02-22 03:03:19 +08:00
COLUMN_NAME,
NUM_COLUMNS
};
static void gimp_container_tree_view_class_init (GimpContainerTreeViewClass *klass);
static void gimp_container_tree_view_init (GimpContainerTreeView *view);
static void gimp_container_tree_view_set_container (GimpContainerView *view,
GimpContainer *container);
static gpointer gimp_container_tree_view_insert_item (GimpContainerView *view,
GimpViewable *viewable,
gint index);
static void gimp_container_tree_view_remove_item (GimpContainerView *view,
GimpViewable *viewable,
gpointer insert_data);
static void gimp_container_tree_view_reorder_item (GimpContainerView *view,
GimpViewable *viewable,
gint new_index,
gpointer insert_data);
static void gimp_container_tree_view_select_item (GimpContainerView *view,
GimpViewable *viewable,
gpointer insert_data);
static void gimp_container_tree_view_clear_items (GimpContainerView *view);
themes/Default/images/stock-delete-16.png 2003-03-06 Michael Natterer <mitch@gimp.org> * themes/Default/images/stock-delete-16.png * themes/Default/images/stock-lower-16.png * themes/Default/images/stock-new-16.png * themes/Default/images/stock-paste-16.png * themes/Default/images/stock-raise-16.png * themes/Default/images/stock-refresh-16.png: removed these files since we use the icons provided by GTK+ now. * themes/Default/gtkrc * themes/Default/images/Makefile.am: removed them here hoo. * libgimpwidgets/gimpstock.[ch]: reordered stuff to be consistent in the header and the .c file. Added GIMP_STOCK_ERROR and GIMP_STOCK_QUESTION which are available in all sizes (unlike GTK_STOCK_DIALOG_ERROR and GTK_STOCK_DIALOG_QUESTION). * app/core/gimpviewable.c * app/display/gimpdisplayshell.c * app/gui/file-commands.c * app/gui/file-new-dialog.c * app/gui/file-save-dialog.c * app/widgets/gimpwidgets-utils.c * app/widgets/gimpdatafactoryview.c: use the new stock IDs. * app/config/gimpcoreconfig.[ch]: renamed "preview_size" to "layer_preview_size" and added "gboolean layer_previews" which switches layer previews on/off independent of their size. * app/config/gimprc-blurbs.h: added/changed their blurbs. * app/core/core-enums.[ch]: removed GIMP_PREVIEW_SIZE_NONE. * app/core/gimpdrawable-preview.c * app/core/gimpdrawable.c * app/core/gimpimage.c: return NULL previews if core_config->layer_previews is FALSE. Invalidate all layer/channel previews whenever "layer_previews" changes. * app/widgets/gimppreviewrendererdrawable.c * app/widgets/gimppreviewrendererimage.c: render the stock_id if the drawable/image returns a NULL preview. Fixes bug #107242. * app/display/gimpdisplayshell-handlers.c: don't set the sensitivity of the navigation button because it can no longer be disabled. * app/display/gimpdisplayshell-layer-select.c * app/gui/dialogs-constructors.c * app/gui/dialogs.c * app/gui/paths-dialog.c: changed accordingly. * app/gui/preferences-dialog.c: added a toggle button for the new "layer_previews" boolean. * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainerlistview.c: chain up unconditionally in GimpContainerView::clear_items(). * app/widgets/gimpcontainertreeview.c: ditto. Made the reorder() implementation lengthy and eeky (but working) again... Stop signal emission on double clicks so GtkTreeView doesn't re-select the item we are about change. * app/widgets/gimpcontainerview.c (gimp_container_view_real_clear_items): need to use g_hash_table_new_full() here too or everything will b0rk. * app/widgets/gimppreviewrenderer.c (gimp_preview_renderer_default_render_stock): use gtk_widget_render_icon() instead of gtk_icon_set_render_icon(). * tools/pdbgen/enums.pl: this file wanted to be regenerated...
2003-03-07 00:47:34 +08:00
static void gimp_container_tree_view_set_preview_size (GimpContainerView *view);
Started migration from GtkList to GtkTreeView: 2003-02-21 Michael Natterer <mitch@gimp.org> Started migration from GtkList to GtkTreeView: * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpcontainertreeview.[ch]; new GimpContainerView subclass using GtkListStore/GtkTreeView. * app/widgets/widgets-enums.h: added GIMP_VIEW_TYPE_TREE to thje GimpViewType enum. * app/widgets/gimpcontainereditor.c: added GimpContainerTreeView to the switch() which selects the view type. * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.[ch] * app/gui/dialogs-menu.c * app/gui/dialogs.c: added tree view versions of many dialogs. * app/widgets/gimppreview.[ch]: removed the get_size() virtual function and gimp_preview_calc_size(). * app/core/gimpviewable.[ch]: added virtual function get_preview_size() and gimp_viewable_calc_preview_size(). * 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: added get_preview_size() implementations. * app/widgets/gimpbufferpreview.c * app/widgets/gimpdrawablepreview.c * app/widgets/gimpgradientpreview.c * app/widgets/gimpimagepreview.c * app/widgets/gimppalettepreview.c * app/widgets/gimpselectioneditor.c * app/widgets/gimpundopreview.c * app/display/gimpnavigationview.c: changed accordingly, removed get_size() implementations. * app/widgets/widgets-types.h: changed the first param of GimpItemGetNameFunc from GtkWidget to GObject. * app/widgets/gimpcontainerview-utils.c: accept a GimpViewable as object in the built-in get_name funcs. * app/widgets/gimpcomponentlistitem.c * app/widgets/gimpcontainergridview.c * app/widgets/gimplistitem.c * app/widgets/gimpmenuitem.c: changed accordingly.
2003-02-22 03:03:19 +08:00
static void gimp_container_tree_view_selection_changed (GtkTreeSelection *sel,
GimpContainerTreeView *tree_view);
static gboolean gimp_container_tree_view_button_press (GtkWidget *widget,
GdkEventButton *bevent,
GimpContainerTreeView *tree_view);
themes/Default/images/stock-delete-16.png 2003-03-06 Michael Natterer <mitch@gimp.org> * themes/Default/images/stock-delete-16.png * themes/Default/images/stock-lower-16.png * themes/Default/images/stock-new-16.png * themes/Default/images/stock-paste-16.png * themes/Default/images/stock-raise-16.png * themes/Default/images/stock-refresh-16.png: removed these files since we use the icons provided by GTK+ now. * themes/Default/gtkrc * themes/Default/images/Makefile.am: removed them here hoo. * libgimpwidgets/gimpstock.[ch]: reordered stuff to be consistent in the header and the .c file. Added GIMP_STOCK_ERROR and GIMP_STOCK_QUESTION which are available in all sizes (unlike GTK_STOCK_DIALOG_ERROR and GTK_STOCK_DIALOG_QUESTION). * app/core/gimpviewable.c * app/display/gimpdisplayshell.c * app/gui/file-commands.c * app/gui/file-new-dialog.c * app/gui/file-save-dialog.c * app/widgets/gimpwidgets-utils.c * app/widgets/gimpdatafactoryview.c: use the new stock IDs. * app/config/gimpcoreconfig.[ch]: renamed "preview_size" to "layer_preview_size" and added "gboolean layer_previews" which switches layer previews on/off independent of their size. * app/config/gimprc-blurbs.h: added/changed their blurbs. * app/core/core-enums.[ch]: removed GIMP_PREVIEW_SIZE_NONE. * app/core/gimpdrawable-preview.c * app/core/gimpdrawable.c * app/core/gimpimage.c: return NULL previews if core_config->layer_previews is FALSE. Invalidate all layer/channel previews whenever "layer_previews" changes. * app/widgets/gimppreviewrendererdrawable.c * app/widgets/gimppreviewrendererimage.c: render the stock_id if the drawable/image returns a NULL preview. Fixes bug #107242. * app/display/gimpdisplayshell-handlers.c: don't set the sensitivity of the navigation button because it can no longer be disabled. * app/display/gimpdisplayshell-layer-select.c * app/gui/dialogs-constructors.c * app/gui/dialogs.c * app/gui/paths-dialog.c: changed accordingly. * app/gui/preferences-dialog.c: added a toggle button for the new "layer_previews" boolean. * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainerlistview.c: chain up unconditionally in GimpContainerView::clear_items(). * app/widgets/gimpcontainertreeview.c: ditto. Made the reorder() implementation lengthy and eeky (but working) again... Stop signal emission on double clicks so GtkTreeView doesn't re-select the item we are about change. * app/widgets/gimpcontainerview.c (gimp_container_view_real_clear_items): need to use g_hash_table_new_full() here too or everything will b0rk. * app/widgets/gimppreviewrenderer.c (gimp_preview_renderer_default_render_stock): use gtk_widget_render_icon() instead of gtk_icon_set_render_icon(). * tools/pdbgen/enums.pl: this file wanted to be regenerated...
2003-03-07 00:47:34 +08:00
static void gimp_container_tree_view_renderer_update (GimpPreviewRenderer *renderer,
GimpContainerTreeView *tree_view);
static void gimp_container_tree_view_name_changed (GimpObject *object,
GimpContainerTreeView *tree_view);
Started migration from GtkList to GtkTreeView: 2003-02-21 Michael Natterer <mitch@gimp.org> Started migration from GtkList to GtkTreeView: * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpcontainertreeview.[ch]; new GimpContainerView subclass using GtkListStore/GtkTreeView. * app/widgets/widgets-enums.h: added GIMP_VIEW_TYPE_TREE to thje GimpViewType enum. * app/widgets/gimpcontainereditor.c: added GimpContainerTreeView to the switch() which selects the view type. * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.[ch] * app/gui/dialogs-menu.c * app/gui/dialogs.c: added tree view versions of many dialogs. * app/widgets/gimppreview.[ch]: removed the get_size() virtual function and gimp_preview_calc_size(). * app/core/gimpviewable.[ch]: added virtual function get_preview_size() and gimp_viewable_calc_preview_size(). * 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: added get_preview_size() implementations. * app/widgets/gimpbufferpreview.c * app/widgets/gimpdrawablepreview.c * app/widgets/gimpgradientpreview.c * app/widgets/gimpimagepreview.c * app/widgets/gimppalettepreview.c * app/widgets/gimpselectioneditor.c * app/widgets/gimpundopreview.c * app/display/gimpnavigationview.c: changed accordingly, removed get_size() implementations. * app/widgets/widgets-types.h: changed the first param of GimpItemGetNameFunc from GtkWidget to GObject. * app/widgets/gimpcontainerview-utils.c: accept a GimpViewable as object in the built-in get_name funcs. * app/widgets/gimpcomponentlistitem.c * app/widgets/gimpcontainergridview.c * app/widgets/gimplistitem.c * app/widgets/gimpmenuitem.c: changed accordingly.
2003-02-22 03:03:19 +08:00
themes/Default/images/stock-delete-16.png 2003-03-06 Michael Natterer <mitch@gimp.org> * themes/Default/images/stock-delete-16.png * themes/Default/images/stock-lower-16.png * themes/Default/images/stock-new-16.png * themes/Default/images/stock-paste-16.png * themes/Default/images/stock-raise-16.png * themes/Default/images/stock-refresh-16.png: removed these files since we use the icons provided by GTK+ now. * themes/Default/gtkrc * themes/Default/images/Makefile.am: removed them here hoo. * libgimpwidgets/gimpstock.[ch]: reordered stuff to be consistent in the header and the .c file. Added GIMP_STOCK_ERROR and GIMP_STOCK_QUESTION which are available in all sizes (unlike GTK_STOCK_DIALOG_ERROR and GTK_STOCK_DIALOG_QUESTION). * app/core/gimpviewable.c * app/display/gimpdisplayshell.c * app/gui/file-commands.c * app/gui/file-new-dialog.c * app/gui/file-save-dialog.c * app/widgets/gimpwidgets-utils.c * app/widgets/gimpdatafactoryview.c: use the new stock IDs. * app/config/gimpcoreconfig.[ch]: renamed "preview_size" to "layer_preview_size" and added "gboolean layer_previews" which switches layer previews on/off independent of their size. * app/config/gimprc-blurbs.h: added/changed their blurbs. * app/core/core-enums.[ch]: removed GIMP_PREVIEW_SIZE_NONE. * app/core/gimpdrawable-preview.c * app/core/gimpdrawable.c * app/core/gimpimage.c: return NULL previews if core_config->layer_previews is FALSE. Invalidate all layer/channel previews whenever "layer_previews" changes. * app/widgets/gimppreviewrendererdrawable.c * app/widgets/gimppreviewrendererimage.c: render the stock_id if the drawable/image returns a NULL preview. Fixes bug #107242. * app/display/gimpdisplayshell-handlers.c: don't set the sensitivity of the navigation button because it can no longer be disabled. * app/display/gimpdisplayshell-layer-select.c * app/gui/dialogs-constructors.c * app/gui/dialogs.c * app/gui/paths-dialog.c: changed accordingly. * app/gui/preferences-dialog.c: added a toggle button for the new "layer_previews" boolean. * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainerlistview.c: chain up unconditionally in GimpContainerView::clear_items(). * app/widgets/gimpcontainertreeview.c: ditto. Made the reorder() implementation lengthy and eeky (but working) again... Stop signal emission on double clicks so GtkTreeView doesn't re-select the item we are about change. * app/widgets/gimpcontainerview.c (gimp_container_view_real_clear_items): need to use g_hash_table_new_full() here too or everything will b0rk. * app/widgets/gimppreviewrenderer.c (gimp_preview_renderer_default_render_stock): use gtk_widget_render_icon() instead of gtk_icon_set_render_icon(). * tools/pdbgen/enums.pl: this file wanted to be regenerated...
2003-03-07 00:47:34 +08:00
static GimpViewable * gimp_container_tree_view_drag_viewable (GtkWidget *widget,
gpointer data);
Started migration from GtkList to GtkTreeView: 2003-02-21 Michael Natterer <mitch@gimp.org> Started migration from GtkList to GtkTreeView: * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpcontainertreeview.[ch]; new GimpContainerView subclass using GtkListStore/GtkTreeView. * app/widgets/widgets-enums.h: added GIMP_VIEW_TYPE_TREE to thje GimpViewType enum. * app/widgets/gimpcontainereditor.c: added GimpContainerTreeView to the switch() which selects the view type. * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.[ch] * app/gui/dialogs-menu.c * app/gui/dialogs.c: added tree view versions of many dialogs. * app/widgets/gimppreview.[ch]: removed the get_size() virtual function and gimp_preview_calc_size(). * app/core/gimpviewable.[ch]: added virtual function get_preview_size() and gimp_viewable_calc_preview_size(). * 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: added get_preview_size() implementations. * app/widgets/gimpbufferpreview.c * app/widgets/gimpdrawablepreview.c * app/widgets/gimpgradientpreview.c * app/widgets/gimpimagepreview.c * app/widgets/gimppalettepreview.c * app/widgets/gimpselectioneditor.c * app/widgets/gimpundopreview.c * app/display/gimpnavigationview.c: changed accordingly, removed get_size() implementations. * app/widgets/widgets-types.h: changed the first param of GimpItemGetNameFunc from GtkWidget to GObject. * app/widgets/gimpcontainerview-utils.c: accept a GimpViewable as object in the built-in get_name funcs. * app/widgets/gimpcomponentlistitem.c * app/widgets/gimpcontainergridview.c * app/widgets/gimplistitem.c * app/widgets/gimpmenuitem.c: changed accordingly.
2003-02-22 03:03:19 +08:00
static GimpContainerViewClass *parent_class = NULL;
GType
gimp_container_tree_view_get_type (void)
{
static GType view_type = 0;
if (! view_type)
{
static const GTypeInfo view_info =
{
sizeof (GimpContainerTreeViewClass),
NULL, /* base_init */
NULL, /* base_finalize */
(GClassInitFunc) gimp_container_tree_view_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GimpContainerTreeView),
0, /* n_preallocs */
(GInstanceInitFunc) gimp_container_tree_view_init,
};
view_type = g_type_register_static (GIMP_TYPE_CONTAINER_VIEW,
"GimpContainerTreeView",
&view_info, 0);
}
return view_type;
}
static void
gimp_container_tree_view_class_init (GimpContainerTreeViewClass *klass)
{
GimpContainerViewClass *container_view_class;
container_view_class = GIMP_CONTAINER_VIEW_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
container_view_class->set_container = gimp_container_tree_view_set_container;
container_view_class->insert_item = gimp_container_tree_view_insert_item;
container_view_class->remove_item = gimp_container_tree_view_remove_item;
container_view_class->reorder_item = gimp_container_tree_view_reorder_item;
container_view_class->select_item = gimp_container_tree_view_select_item;
container_view_class->clear_items = gimp_container_tree_view_clear_items;
container_view_class->set_preview_size = gimp_container_tree_view_set_preview_size;
container_view_class->insert_data_free = (GDestroyNotify) g_free;
Started migration from GtkList to GtkTreeView: 2003-02-21 Michael Natterer <mitch@gimp.org> Started migration from GtkList to GtkTreeView: * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpcontainertreeview.[ch]; new GimpContainerView subclass using GtkListStore/GtkTreeView. * app/widgets/widgets-enums.h: added GIMP_VIEW_TYPE_TREE to thje GimpViewType enum. * app/widgets/gimpcontainereditor.c: added GimpContainerTreeView to the switch() which selects the view type. * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.[ch] * app/gui/dialogs-menu.c * app/gui/dialogs.c: added tree view versions of many dialogs. * app/widgets/gimppreview.[ch]: removed the get_size() virtual function and gimp_preview_calc_size(). * app/core/gimpviewable.[ch]: added virtual function get_preview_size() and gimp_viewable_calc_preview_size(). * 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: added get_preview_size() implementations. * app/widgets/gimpbufferpreview.c * app/widgets/gimpdrawablepreview.c * app/widgets/gimpgradientpreview.c * app/widgets/gimpimagepreview.c * app/widgets/gimppalettepreview.c * app/widgets/gimpselectioneditor.c * app/widgets/gimpundopreview.c * app/display/gimpnavigationview.c: changed accordingly, removed get_size() implementations. * app/widgets/widgets-types.h: changed the first param of GimpItemGetNameFunc from GtkWidget to GObject. * app/widgets/gimpcontainerview-utils.c: accept a GimpViewable as object in the built-in get_name funcs. * app/widgets/gimpcomponentlistitem.c * app/widgets/gimpcontainergridview.c * app/widgets/gimplistitem.c * app/widgets/gimpmenuitem.c: changed accordingly.
2003-02-22 03:03:19 +08:00
}
static void
gimp_container_tree_view_init (GimpContainerTreeView *tree_view)
{
GtkTreeViewColumn *column;
GtkCellRenderer *cell;
tree_view->scrolled_win = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (tree_view->scrolled_win),
GTK_SHADOW_IN);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (tree_view->scrolled_win),
GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC);
gtk_box_pack_start (GTK_BOX (tree_view), tree_view->scrolled_win,
TRUE, TRUE, 0);
gtk_widget_show (tree_view->scrolled_win);
tree_view->list = gtk_list_store_new (NUM_COLUMNS,
GIMP_TYPE_VIEWABLE,
don't scale the preview up if the buffer is too small. 2003-03-01 Michael Natterer <mitch@gimp.org> * app/core/gimpbuffer.c: don't scale the preview up if the buffer is too small. * app/core/gimppattern.c: don't add a white border around the preview if the pattern is too small. * app/widgets/gimppreviewrenderer.[ch]: new object. A buffer that updates itself on GimpViewable changes and can render itself to any widget. Basically GimpPreview reduced to the render and draw code. * app/widgets/gimppreview.[ch]: removed all rendering and drawing code and keep a GimpPreviewRenderer instance. Connect to its "update" signal for queuing draws on the preview. * app/widgets/gimpcellrendererviewable.[ch] * app/widgets/gimpcontainertreeview.c: same here: removed rendering and drawing code and keep GimpPreviewRenderers in the list store. Delays preview creation for GtkTreeViews until the buffer is really needed for drawing and adds idle preview updating on viewable changes. * app/widgets/gimppreview-utils.[ch] * app/widgets/gimpbrushpreview.[ch] * app/widgets/gimpbufferpreview.[ch] * app/widgets/gimpdrawablepreview.[ch] * app/widgets/gimpimagepreview.[ch]: removed... * app/widgets/gimppreviewrenderer-utils.[ch] * app/widgets/gimppreviewrendererbrush.[ch] * app/widgets/gimppreviewrendererdrawable.[ch] * app/widgets/gimppreviewrendererimage.[ch]: ...and converted to GimpPreviewRenderer subclasses. * app/display/gimpnavigationview.c * app/gui/palette-import-dialog.c * app/widgets/Makefile.am * app/widgets/widgets-enums.h * app/widgets/widgets-types.h * app/widgets/gimpchannellistview.c * app/widgets/gimpcomponentlistitem.c * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainermenuimpl.c * app/widgets/gimplayerlistitem.c * app/widgets/gimplistitem.c * app/widgets/gimpnavigationpreview.[ch] * app/widgets/gimpselectioneditor.c * app/widgets/gimpvectorslistview.c: changed accordingly.
2003-03-01 11:53:41 +08:00
GIMP_TYPE_PREVIEW_RENDERER,
Started migration from GtkList to GtkTreeView: 2003-02-21 Michael Natterer <mitch@gimp.org> Started migration from GtkList to GtkTreeView: * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpcontainertreeview.[ch]; new GimpContainerView subclass using GtkListStore/GtkTreeView. * app/widgets/widgets-enums.h: added GIMP_VIEW_TYPE_TREE to thje GimpViewType enum. * app/widgets/gimpcontainereditor.c: added GimpContainerTreeView to the switch() which selects the view type. * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.[ch] * app/gui/dialogs-menu.c * app/gui/dialogs.c: added tree view versions of many dialogs. * app/widgets/gimppreview.[ch]: removed the get_size() virtual function and gimp_preview_calc_size(). * app/core/gimpviewable.[ch]: added virtual function get_preview_size() and gimp_viewable_calc_preview_size(). * 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: added get_preview_size() implementations. * app/widgets/gimpbufferpreview.c * app/widgets/gimpdrawablepreview.c * app/widgets/gimpgradientpreview.c * app/widgets/gimpimagepreview.c * app/widgets/gimppalettepreview.c * app/widgets/gimpselectioneditor.c * app/widgets/gimpundopreview.c * app/display/gimpnavigationview.c: changed accordingly, removed get_size() implementations. * app/widgets/widgets-types.h: changed the first param of GimpItemGetNameFunc from GtkWidget to GObject. * app/widgets/gimpcontainerview-utils.c: accept a GimpViewable as object in the built-in get_name funcs. * app/widgets/gimpcomponentlistitem.c * app/widgets/gimpcontainergridview.c * app/widgets/gimplistitem.c * app/widgets/gimpmenuitem.c: changed accordingly.
2003-02-22 03:03:19 +08:00
G_TYPE_STRING);
tree_view->view = GTK_TREE_VIEW
(gtk_tree_view_new_with_model (GTK_TREE_MODEL (tree_view->list)));
g_object_unref (tree_view->list);
Started migration from GtkList to GtkTreeView: 2003-02-21 Michael Natterer <mitch@gimp.org> Started migration from GtkList to GtkTreeView: * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpcontainertreeview.[ch]; new GimpContainerView subclass using GtkListStore/GtkTreeView. * app/widgets/widgets-enums.h: added GIMP_VIEW_TYPE_TREE to thje GimpViewType enum. * app/widgets/gimpcontainereditor.c: added GimpContainerTreeView to the switch() which selects the view type. * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.[ch] * app/gui/dialogs-menu.c * app/gui/dialogs.c: added tree view versions of many dialogs. * app/widgets/gimppreview.[ch]: removed the get_size() virtual function and gimp_preview_calc_size(). * app/core/gimpviewable.[ch]: added virtual function get_preview_size() and gimp_viewable_calc_preview_size(). * 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: added get_preview_size() implementations. * app/widgets/gimpbufferpreview.c * app/widgets/gimpdrawablepreview.c * app/widgets/gimpgradientpreview.c * app/widgets/gimpimagepreview.c * app/widgets/gimppalettepreview.c * app/widgets/gimpselectioneditor.c * app/widgets/gimpundopreview.c * app/display/gimpnavigationview.c: changed accordingly, removed get_size() implementations. * app/widgets/widgets-types.h: changed the first param of GimpItemGetNameFunc from GtkWidget to GObject. * app/widgets/gimpcontainerview-utils.c: accept a GimpViewable as object in the built-in get_name funcs. * app/widgets/gimpcomponentlistitem.c * app/widgets/gimpcontainergridview.c * app/widgets/gimplistitem.c * app/widgets/gimpmenuitem.c: changed accordingly.
2003-02-22 03:03:19 +08:00
GIMP_CONTAINER_VIEW (tree_view)->dnd_widget = GTK_WIDGET (tree_view->view);
Started migration from GtkList to GtkTreeView: 2003-02-21 Michael Natterer <mitch@gimp.org> Started migration from GtkList to GtkTreeView: * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpcontainertreeview.[ch]; new GimpContainerView subclass using GtkListStore/GtkTreeView. * app/widgets/widgets-enums.h: added GIMP_VIEW_TYPE_TREE to thje GimpViewType enum. * app/widgets/gimpcontainereditor.c: added GimpContainerTreeView to the switch() which selects the view type. * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.[ch] * app/gui/dialogs-menu.c * app/gui/dialogs.c: added tree view versions of many dialogs. * app/widgets/gimppreview.[ch]: removed the get_size() virtual function and gimp_preview_calc_size(). * app/core/gimpviewable.[ch]: added virtual function get_preview_size() and gimp_viewable_calc_preview_size(). * 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: added get_preview_size() implementations. * app/widgets/gimpbufferpreview.c * app/widgets/gimpdrawablepreview.c * app/widgets/gimpgradientpreview.c * app/widgets/gimpimagepreview.c * app/widgets/gimppalettepreview.c * app/widgets/gimpselectioneditor.c * app/widgets/gimpundopreview.c * app/display/gimpnavigationview.c: changed accordingly, removed get_size() implementations. * app/widgets/widgets-types.h: changed the first param of GimpItemGetNameFunc from GtkWidget to GObject. * app/widgets/gimpcontainerview-utils.c: accept a GimpViewable as object in the built-in get_name funcs. * app/widgets/gimpcomponentlistitem.c * app/widgets/gimpcontainergridview.c * app/widgets/gimplistitem.c * app/widgets/gimpmenuitem.c: changed accordingly.
2003-02-22 03:03:19 +08:00
gtk_tree_view_set_headers_visible (tree_view->view, FALSE);
column = gtk_tree_view_column_new ();
gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
Started migration from GtkList to GtkTreeView: 2003-02-21 Michael Natterer <mitch@gimp.org> Started migration from GtkList to GtkTreeView: * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpcontainertreeview.[ch]; new GimpContainerView subclass using GtkListStore/GtkTreeView. * app/widgets/widgets-enums.h: added GIMP_VIEW_TYPE_TREE to thje GimpViewType enum. * app/widgets/gimpcontainereditor.c: added GimpContainerTreeView to the switch() which selects the view type. * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.[ch] * app/gui/dialogs-menu.c * app/gui/dialogs.c: added tree view versions of many dialogs. * app/widgets/gimppreview.[ch]: removed the get_size() virtual function and gimp_preview_calc_size(). * app/core/gimpviewable.[ch]: added virtual function get_preview_size() and gimp_viewable_calc_preview_size(). * 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: added get_preview_size() implementations. * app/widgets/gimpbufferpreview.c * app/widgets/gimpdrawablepreview.c * app/widgets/gimpgradientpreview.c * app/widgets/gimpimagepreview.c * app/widgets/gimppalettepreview.c * app/widgets/gimpselectioneditor.c * app/widgets/gimpundopreview.c * app/display/gimpnavigationview.c: changed accordingly, removed get_size() implementations. * app/widgets/widgets-types.h: changed the first param of GimpItemGetNameFunc from GtkWidget to GObject. * app/widgets/gimpcontainerview-utils.c: accept a GimpViewable as object in the built-in get_name funcs. * app/widgets/gimpcomponentlistitem.c * app/widgets/gimpcontainergridview.c * app/widgets/gimplistitem.c * app/widgets/gimpmenuitem.c: changed accordingly.
2003-02-22 03:03:19 +08:00
gtk_tree_view_append_column (tree_view->view, column);
added "gchar *stock_id" to the GimpViewable struct. It is used by the GUI 2003-02-26 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:17:10 +08:00
cell = gimp_cell_renderer_viewable_new ();
Started migration from GtkList to GtkTreeView: 2003-02-21 Michael Natterer <mitch@gimp.org> Started migration from GtkList to GtkTreeView: * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpcontainertreeview.[ch]; new GimpContainerView subclass using GtkListStore/GtkTreeView. * app/widgets/widgets-enums.h: added GIMP_VIEW_TYPE_TREE to thje GimpViewType enum. * app/widgets/gimpcontainereditor.c: added GimpContainerTreeView to the switch() which selects the view type. * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.[ch] * app/gui/dialogs-menu.c * app/gui/dialogs.c: added tree view versions of many dialogs. * app/widgets/gimppreview.[ch]: removed the get_size() virtual function and gimp_preview_calc_size(). * app/core/gimpviewable.[ch]: added virtual function get_preview_size() and gimp_viewable_calc_preview_size(). * 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: added get_preview_size() implementations. * app/widgets/gimpbufferpreview.c * app/widgets/gimpdrawablepreview.c * app/widgets/gimpgradientpreview.c * app/widgets/gimpimagepreview.c * app/widgets/gimppalettepreview.c * app/widgets/gimpselectioneditor.c * app/widgets/gimpundopreview.c * app/display/gimpnavigationview.c: changed accordingly, removed get_size() implementations. * app/widgets/widgets-types.h: changed the first param of GimpItemGetNameFunc from GtkWidget to GObject. * app/widgets/gimpcontainerview-utils.c: accept a GimpViewable as object in the built-in get_name funcs. * app/widgets/gimpcomponentlistitem.c * app/widgets/gimpcontainergridview.c * app/widgets/gimplistitem.c * app/widgets/gimpmenuitem.c: changed accordingly.
2003-02-22 03:03:19 +08:00
gtk_tree_view_column_pack_start (column, cell, FALSE);
don't scale the preview up if the buffer is too small. 2003-03-01 Michael Natterer <mitch@gimp.org> * app/core/gimpbuffer.c: don't scale the preview up if the buffer is too small. * app/core/gimppattern.c: don't add a white border around the preview if the pattern is too small. * app/widgets/gimppreviewrenderer.[ch]: new object. A buffer that updates itself on GimpViewable changes and can render itself to any widget. Basically GimpPreview reduced to the render and draw code. * app/widgets/gimppreview.[ch]: removed all rendering and drawing code and keep a GimpPreviewRenderer instance. Connect to its "update" signal for queuing draws on the preview. * app/widgets/gimpcellrendererviewable.[ch] * app/widgets/gimpcontainertreeview.c: same here: removed rendering and drawing code and keep GimpPreviewRenderers in the list store. Delays preview creation for GtkTreeViews until the buffer is really needed for drawing and adds idle preview updating on viewable changes. * app/widgets/gimppreview-utils.[ch] * app/widgets/gimpbrushpreview.[ch] * app/widgets/gimpbufferpreview.[ch] * app/widgets/gimpdrawablepreview.[ch] * app/widgets/gimpimagepreview.[ch]: removed... * app/widgets/gimppreviewrenderer-utils.[ch] * app/widgets/gimppreviewrendererbrush.[ch] * app/widgets/gimppreviewrendererdrawable.[ch] * app/widgets/gimppreviewrendererimage.[ch]: ...and converted to GimpPreviewRenderer subclasses. * app/display/gimpnavigationview.c * app/gui/palette-import-dialog.c * app/widgets/Makefile.am * app/widgets/widgets-enums.h * app/widgets/widgets-types.h * app/widgets/gimpchannellistview.c * app/widgets/gimpcomponentlistitem.c * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainermenuimpl.c * app/widgets/gimplayerlistitem.c * app/widgets/gimplistitem.c * app/widgets/gimpnavigationpreview.[ch] * app/widgets/gimpselectioneditor.c * app/widgets/gimpvectorslistview.c: changed accordingly.
2003-03-01 11:53:41 +08:00
gtk_tree_view_column_set_attributes (column, cell,
"renderer", COLUMN_RENDERER,
NULL);
Started migration from GtkList to GtkTreeView: 2003-02-21 Michael Natterer <mitch@gimp.org> Started migration from GtkList to GtkTreeView: * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpcontainertreeview.[ch]; new GimpContainerView subclass using GtkListStore/GtkTreeView. * app/widgets/widgets-enums.h: added GIMP_VIEW_TYPE_TREE to thje GimpViewType enum. * app/widgets/gimpcontainereditor.c: added GimpContainerTreeView to the switch() which selects the view type. * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.[ch] * app/gui/dialogs-menu.c * app/gui/dialogs.c: added tree view versions of many dialogs. * app/widgets/gimppreview.[ch]: removed the get_size() virtual function and gimp_preview_calc_size(). * app/core/gimpviewable.[ch]: added virtual function get_preview_size() and gimp_viewable_calc_preview_size(). * 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: added get_preview_size() implementations. * app/widgets/gimpbufferpreview.c * app/widgets/gimpdrawablepreview.c * app/widgets/gimpgradientpreview.c * app/widgets/gimpimagepreview.c * app/widgets/gimppalettepreview.c * app/widgets/gimpselectioneditor.c * app/widgets/gimpundopreview.c * app/display/gimpnavigationview.c: changed accordingly, removed get_size() implementations. * app/widgets/widgets-types.h: changed the first param of GimpItemGetNameFunc from GtkWidget to GObject. * app/widgets/gimpcontainerview-utils.c: accept a GimpViewable as object in the built-in get_name funcs. * app/widgets/gimpcomponentlistitem.c * app/widgets/gimpcontainergridview.c * app/widgets/gimplistitem.c * app/widgets/gimpmenuitem.c: changed accordingly.
2003-02-22 03:03:19 +08:00
gtk_tree_view_insert_column_with_attributes (tree_view->view,
1, NULL,
gtk_cell_renderer_text_new (),
"text", COLUMN_NAME,
NULL);
gtk_container_add (GTK_CONTAINER (tree_view->scrolled_win),
GTK_WIDGET (tree_view->view));
gtk_widget_show (GTK_WIDGET (tree_view->view));
GTK_WIDGET_UNSET_FLAGS (GTK_SCROLLED_WINDOW
(tree_view->scrolled_win)->vscrollbar,
GTK_CAN_FOCUS);
tree_view->selection = gtk_tree_view_get_selection (tree_view->view);
g_signal_connect (tree_view->selection, "changed",
G_CALLBACK (gimp_container_tree_view_selection_changed),
tree_view);
}
GtkWidget *
gimp_container_tree_view_new (GimpContainer *container,
GimpContext *context,
gint preview_size,
gboolean reorderable,
gint min_items_x,
gint min_items_y)
{
GimpContainerTreeView *tree_view;
GimpContainerView *view;
gint window_border;
g_return_val_if_fail (! container || GIMP_IS_CONTAINER (container), NULL);
g_return_val_if_fail (! context || GIMP_IS_CONTEXT (context), NULL);
added "gchar *stock_id" to the GimpViewable struct. It is used by the GUI 2003-02-26 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:17:10 +08:00
g_return_val_if_fail (preview_size > 0 &&
preview_size <= GIMP_PREVIEW_MAX_SIZE, NULL);
Started migration from GtkList to GtkTreeView: 2003-02-21 Michael Natterer <mitch@gimp.org> Started migration from GtkList to GtkTreeView: * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpcontainertreeview.[ch]; new GimpContainerView subclass using GtkListStore/GtkTreeView. * app/widgets/widgets-enums.h: added GIMP_VIEW_TYPE_TREE to thje GimpViewType enum. * app/widgets/gimpcontainereditor.c: added GimpContainerTreeView to the switch() which selects the view type. * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.[ch] * app/gui/dialogs-menu.c * app/gui/dialogs.c: added tree view versions of many dialogs. * app/widgets/gimppreview.[ch]: removed the get_size() virtual function and gimp_preview_calc_size(). * app/core/gimpviewable.[ch]: added virtual function get_preview_size() and gimp_viewable_calc_preview_size(). * 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: added get_preview_size() implementations. * app/widgets/gimpbufferpreview.c * app/widgets/gimpdrawablepreview.c * app/widgets/gimpgradientpreview.c * app/widgets/gimpimagepreview.c * app/widgets/gimppalettepreview.c * app/widgets/gimpselectioneditor.c * app/widgets/gimpundopreview.c * app/display/gimpnavigationview.c: changed accordingly, removed get_size() implementations. * app/widgets/widgets-types.h: changed the first param of GimpItemGetNameFunc from GtkWidget to GObject. * app/widgets/gimpcontainerview-utils.c: accept a GimpViewable as object in the built-in get_name funcs. * app/widgets/gimpcomponentlistitem.c * app/widgets/gimpcontainergridview.c * app/widgets/gimplistitem.c * app/widgets/gimpmenuitem.c: changed accordingly.
2003-02-22 03:03:19 +08:00
g_return_val_if_fail (min_items_x > 0 && min_items_x <= 64, NULL);
g_return_val_if_fail (min_items_y > 0 && min_items_y <= 64, NULL);
tree_view = g_object_new (GIMP_TYPE_CONTAINER_TREE_VIEW, NULL);
view = GIMP_CONTAINER_VIEW (tree_view);
view->preview_size = preview_size;
view->reorderable = reorderable ? TRUE : FALSE;
window_border =
GTK_SCROLLED_WINDOW (tree_view->scrolled_win)->vscrollbar->requisition.width +
GTK_SCROLLED_WINDOW_GET_CLASS (tree_view->scrolled_win)->scrollbar_spacing +
tree_view->scrolled_win->style->xthickness * 4;
gtk_widget_set_size_request (GTK_WIDGET (tree_view),
(preview_size + 2) * min_items_x + window_border,
(preview_size + 6) * min_items_y + window_border);
if (container)
gimp_container_view_set_container (view, container);
if (context)
gimp_container_view_set_context (view, context);
return GTK_WIDGET (tree_view);
}
static void
gimp_container_tree_view_set (GimpContainerTreeView *tree_view,
GtkTreeIter *iter,
don't scale the preview up if the buffer is too small. 2003-03-01 Michael Natterer <mitch@gimp.org> * app/core/gimpbuffer.c: don't scale the preview up if the buffer is too small. * app/core/gimppattern.c: don't add a white border around the preview if the pattern is too small. * app/widgets/gimppreviewrenderer.[ch]: new object. A buffer that updates itself on GimpViewable changes and can render itself to any widget. Basically GimpPreview reduced to the render and draw code. * app/widgets/gimppreview.[ch]: removed all rendering and drawing code and keep a GimpPreviewRenderer instance. Connect to its "update" signal for queuing draws on the preview. * app/widgets/gimpcellrendererviewable.[ch] * app/widgets/gimpcontainertreeview.c: same here: removed rendering and drawing code and keep GimpPreviewRenderers in the list store. Delays preview creation for GtkTreeViews until the buffer is really needed for drawing and adds idle preview updating on viewable changes. * app/widgets/gimppreview-utils.[ch] * app/widgets/gimpbrushpreview.[ch] * app/widgets/gimpbufferpreview.[ch] * app/widgets/gimpdrawablepreview.[ch] * app/widgets/gimpimagepreview.[ch]: removed... * app/widgets/gimppreviewrenderer-utils.[ch] * app/widgets/gimppreviewrendererbrush.[ch] * app/widgets/gimppreviewrendererdrawable.[ch] * app/widgets/gimppreviewrendererimage.[ch]: ...and converted to GimpPreviewRenderer subclasses. * app/display/gimpnavigationview.c * app/gui/palette-import-dialog.c * app/widgets/Makefile.am * app/widgets/widgets-enums.h * app/widgets/widgets-types.h * app/widgets/gimpchannellistview.c * app/widgets/gimpcomponentlistitem.c * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainermenuimpl.c * app/widgets/gimplayerlistitem.c * app/widgets/gimplistitem.c * app/widgets/gimpnavigationpreview.[ch] * app/widgets/gimpselectioneditor.c * app/widgets/gimpvectorslistview.c: changed accordingly.
2003-03-01 11:53:41 +08:00
GimpViewable *viewable)
Started migration from GtkList to GtkTreeView: 2003-02-21 Michael Natterer <mitch@gimp.org> Started migration from GtkList to GtkTreeView: * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpcontainertreeview.[ch]; new GimpContainerView subclass using GtkListStore/GtkTreeView. * app/widgets/widgets-enums.h: added GIMP_VIEW_TYPE_TREE to thje GimpViewType enum. * app/widgets/gimpcontainereditor.c: added GimpContainerTreeView to the switch() which selects the view type. * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.[ch] * app/gui/dialogs-menu.c * app/gui/dialogs.c: added tree view versions of many dialogs. * app/widgets/gimppreview.[ch]: removed the get_size() virtual function and gimp_preview_calc_size(). * app/core/gimpviewable.[ch]: added virtual function get_preview_size() and gimp_viewable_calc_preview_size(). * 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: added get_preview_size() implementations. * app/widgets/gimpbufferpreview.c * app/widgets/gimpdrawablepreview.c * app/widgets/gimpgradientpreview.c * app/widgets/gimpimagepreview.c * app/widgets/gimppalettepreview.c * app/widgets/gimpselectioneditor.c * app/widgets/gimpundopreview.c * app/display/gimpnavigationview.c: changed accordingly, removed get_size() implementations. * app/widgets/widgets-types.h: changed the first param of GimpItemGetNameFunc from GtkWidget to GObject. * app/widgets/gimpcontainerview-utils.c: accept a GimpViewable as object in the built-in get_name funcs. * app/widgets/gimpcomponentlistitem.c * app/widgets/gimpcontainergridview.c * app/widgets/gimplistitem.c * app/widgets/gimpmenuitem.c: changed accordingly.
2003-02-22 03:03:19 +08:00
{
don't scale the preview up if the buffer is too small. 2003-03-01 Michael Natterer <mitch@gimp.org> * app/core/gimpbuffer.c: don't scale the preview up if the buffer is too small. * app/core/gimppattern.c: don't add a white border around the preview if the pattern is too small. * app/widgets/gimppreviewrenderer.[ch]: new object. A buffer that updates itself on GimpViewable changes and can render itself to any widget. Basically GimpPreview reduced to the render and draw code. * app/widgets/gimppreview.[ch]: removed all rendering and drawing code and keep a GimpPreviewRenderer instance. Connect to its "update" signal for queuing draws on the preview. * app/widgets/gimpcellrendererviewable.[ch] * app/widgets/gimpcontainertreeview.c: same here: removed rendering and drawing code and keep GimpPreviewRenderers in the list store. Delays preview creation for GtkTreeViews until the buffer is really needed for drawing and adds idle preview updating on viewable changes. * app/widgets/gimppreview-utils.[ch] * app/widgets/gimpbrushpreview.[ch] * app/widgets/gimpbufferpreview.[ch] * app/widgets/gimpdrawablepreview.[ch] * app/widgets/gimpimagepreview.[ch]: removed... * app/widgets/gimppreviewrenderer-utils.[ch] * app/widgets/gimppreviewrendererbrush.[ch] * app/widgets/gimppreviewrendererdrawable.[ch] * app/widgets/gimppreviewrendererimage.[ch]: ...and converted to GimpPreviewRenderer subclasses. * app/display/gimpnavigationview.c * app/gui/palette-import-dialog.c * app/widgets/Makefile.am * app/widgets/widgets-enums.h * app/widgets/widgets-types.h * app/widgets/gimpchannellistview.c * app/widgets/gimpcomponentlistitem.c * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainermenuimpl.c * app/widgets/gimplayerlistitem.c * app/widgets/gimplistitem.c * app/widgets/gimpnavigationpreview.[ch] * app/widgets/gimpselectioneditor.c * app/widgets/gimpvectorslistview.c: changed accordingly.
2003-03-01 11:53:41 +08:00
GimpContainerView *view;
GimpPreviewRenderer *renderer;
gchar *name;
Started migration from GtkList to GtkTreeView: 2003-02-21 Michael Natterer <mitch@gimp.org> Started migration from GtkList to GtkTreeView: * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpcontainertreeview.[ch]; new GimpContainerView subclass using GtkListStore/GtkTreeView. * app/widgets/widgets-enums.h: added GIMP_VIEW_TYPE_TREE to thje GimpViewType enum. * app/widgets/gimpcontainereditor.c: added GimpContainerTreeView to the switch() which selects the view type. * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.[ch] * app/gui/dialogs-menu.c * app/gui/dialogs.c: added tree view versions of many dialogs. * app/widgets/gimppreview.[ch]: removed the get_size() virtual function and gimp_preview_calc_size(). * app/core/gimpviewable.[ch]: added virtual function get_preview_size() and gimp_viewable_calc_preview_size(). * 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: added get_preview_size() implementations. * app/widgets/gimpbufferpreview.c * app/widgets/gimpdrawablepreview.c * app/widgets/gimpgradientpreview.c * app/widgets/gimpimagepreview.c * app/widgets/gimppalettepreview.c * app/widgets/gimpselectioneditor.c * app/widgets/gimpundopreview.c * app/display/gimpnavigationview.c: changed accordingly, removed get_size() implementations. * app/widgets/widgets-types.h: changed the first param of GimpItemGetNameFunc from GtkWidget to GObject. * app/widgets/gimpcontainerview-utils.c: accept a GimpViewable as object in the built-in get_name funcs. * app/widgets/gimpcomponentlistitem.c * app/widgets/gimpcontainergridview.c * app/widgets/gimplistitem.c * app/widgets/gimpmenuitem.c: changed accordingly.
2003-02-22 03:03:19 +08:00
view = GIMP_CONTAINER_VIEW (tree_view);
don't scale the preview up if the buffer is too small. 2003-03-01 Michael Natterer <mitch@gimp.org> * app/core/gimpbuffer.c: don't scale the preview up if the buffer is too small. * app/core/gimppattern.c: don't add a white border around the preview if the pattern is too small. * app/widgets/gimppreviewrenderer.[ch]: new object. A buffer that updates itself on GimpViewable changes and can render itself to any widget. Basically GimpPreview reduced to the render and draw code. * app/widgets/gimppreview.[ch]: removed all rendering and drawing code and keep a GimpPreviewRenderer instance. Connect to its "update" signal for queuing draws on the preview. * app/widgets/gimpcellrendererviewable.[ch] * app/widgets/gimpcontainertreeview.c: same here: removed rendering and drawing code and keep GimpPreviewRenderers in the list store. Delays preview creation for GtkTreeViews until the buffer is really needed for drawing and adds idle preview updating on viewable changes. * app/widgets/gimppreview-utils.[ch] * app/widgets/gimpbrushpreview.[ch] * app/widgets/gimpbufferpreview.[ch] * app/widgets/gimpdrawablepreview.[ch] * app/widgets/gimpimagepreview.[ch]: removed... * app/widgets/gimppreviewrenderer-utils.[ch] * app/widgets/gimppreviewrendererbrush.[ch] * app/widgets/gimppreviewrendererdrawable.[ch] * app/widgets/gimppreviewrendererimage.[ch]: ...and converted to GimpPreviewRenderer subclasses. * app/display/gimpnavigationview.c * app/gui/palette-import-dialog.c * app/widgets/Makefile.am * app/widgets/widgets-enums.h * app/widgets/widgets-types.h * app/widgets/gimpchannellistview.c * app/widgets/gimpcomponentlistitem.c * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainermenuimpl.c * app/widgets/gimplayerlistitem.c * app/widgets/gimplistitem.c * app/widgets/gimpnavigationpreview.[ch] * app/widgets/gimpselectioneditor.c * app/widgets/gimpvectorslistview.c: changed accordingly.
2003-03-01 11:53:41 +08:00
if (view->get_name_func)
name = view->get_name_func (G_OBJECT (viewable), NULL);
else
name = g_strdup (gimp_object_get_name (GIMP_OBJECT (viewable)));
renderer = gimp_preview_renderer_new (G_TYPE_FROM_INSTANCE (viewable),
view->preview_size, 1, FALSE);
gimp_preview_renderer_set_viewable (renderer, viewable);
gimp_preview_renderer_remove_idle (renderer);
don't scale the preview up if the buffer is too small. 2003-03-01 Michael Natterer <mitch@gimp.org> * app/core/gimpbuffer.c: don't scale the preview up if the buffer is too small. * app/core/gimppattern.c: don't add a white border around the preview if the pattern is too small. * app/widgets/gimppreviewrenderer.[ch]: new object. A buffer that updates itself on GimpViewable changes and can render itself to any widget. Basically GimpPreview reduced to the render and draw code. * app/widgets/gimppreview.[ch]: removed all rendering and drawing code and keep a GimpPreviewRenderer instance. Connect to its "update" signal for queuing draws on the preview. * app/widgets/gimpcellrendererviewable.[ch] * app/widgets/gimpcontainertreeview.c: same here: removed rendering and drawing code and keep GimpPreviewRenderers in the list store. Delays preview creation for GtkTreeViews until the buffer is really needed for drawing and adds idle preview updating on viewable changes. * app/widgets/gimppreview-utils.[ch] * app/widgets/gimpbrushpreview.[ch] * app/widgets/gimpbufferpreview.[ch] * app/widgets/gimpdrawablepreview.[ch] * app/widgets/gimpimagepreview.[ch]: removed... * app/widgets/gimppreviewrenderer-utils.[ch] * app/widgets/gimppreviewrendererbrush.[ch] * app/widgets/gimppreviewrendererdrawable.[ch] * app/widgets/gimppreviewrendererimage.[ch]: ...and converted to GimpPreviewRenderer subclasses. * app/display/gimpnavigationview.c * app/gui/palette-import-dialog.c * app/widgets/Makefile.am * app/widgets/widgets-enums.h * app/widgets/widgets-types.h * app/widgets/gimpchannellistview.c * app/widgets/gimpcomponentlistitem.c * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainermenuimpl.c * app/widgets/gimplayerlistitem.c * app/widgets/gimplistitem.c * app/widgets/gimpnavigationpreview.[ch] * app/widgets/gimpselectioneditor.c * app/widgets/gimpvectorslistview.c: changed accordingly.
2003-03-01 11:53:41 +08:00
g_signal_connect (renderer, "update",
G_CALLBACK (gimp_container_tree_view_renderer_update),
tree_view);
Started migration from GtkList to GtkTreeView: 2003-02-21 Michael Natterer <mitch@gimp.org> Started migration from GtkList to GtkTreeView: * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpcontainertreeview.[ch]; new GimpContainerView subclass using GtkListStore/GtkTreeView. * app/widgets/widgets-enums.h: added GIMP_VIEW_TYPE_TREE to thje GimpViewType enum. * app/widgets/gimpcontainereditor.c: added GimpContainerTreeView to the switch() which selects the view type. * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.[ch] * app/gui/dialogs-menu.c * app/gui/dialogs.c: added tree view versions of many dialogs. * app/widgets/gimppreview.[ch]: removed the get_size() virtual function and gimp_preview_calc_size(). * app/core/gimpviewable.[ch]: added virtual function get_preview_size() and gimp_viewable_calc_preview_size(). * 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: added get_preview_size() implementations. * app/widgets/gimpbufferpreview.c * app/widgets/gimpdrawablepreview.c * app/widgets/gimpgradientpreview.c * app/widgets/gimpimagepreview.c * app/widgets/gimppalettepreview.c * app/widgets/gimpselectioneditor.c * app/widgets/gimpundopreview.c * app/display/gimpnavigationview.c: changed accordingly, removed get_size() implementations. * app/widgets/widgets-types.h: changed the first param of GimpItemGetNameFunc from GtkWidget to GObject. * app/widgets/gimpcontainerview-utils.c: accept a GimpViewable as object in the built-in get_name funcs. * app/widgets/gimpcomponentlistitem.c * app/widgets/gimpcontainergridview.c * app/widgets/gimplistitem.c * app/widgets/gimpmenuitem.c: changed accordingly.
2003-02-22 03:03:19 +08:00
gtk_list_store_set (tree_view->list, iter,
COLUMN_VIEWABLE, viewable,
don't scale the preview up if the buffer is too small. 2003-03-01 Michael Natterer <mitch@gimp.org> * app/core/gimpbuffer.c: don't scale the preview up if the buffer is too small. * app/core/gimppattern.c: don't add a white border around the preview if the pattern is too small. * app/widgets/gimppreviewrenderer.[ch]: new object. A buffer that updates itself on GimpViewable changes and can render itself to any widget. Basically GimpPreview reduced to the render and draw code. * app/widgets/gimppreview.[ch]: removed all rendering and drawing code and keep a GimpPreviewRenderer instance. Connect to its "update" signal for queuing draws on the preview. * app/widgets/gimpcellrendererviewable.[ch] * app/widgets/gimpcontainertreeview.c: same here: removed rendering and drawing code and keep GimpPreviewRenderers in the list store. Delays preview creation for GtkTreeViews until the buffer is really needed for drawing and adds idle preview updating on viewable changes. * app/widgets/gimppreview-utils.[ch] * app/widgets/gimpbrushpreview.[ch] * app/widgets/gimpbufferpreview.[ch] * app/widgets/gimpdrawablepreview.[ch] * app/widgets/gimpimagepreview.[ch]: removed... * app/widgets/gimppreviewrenderer-utils.[ch] * app/widgets/gimppreviewrendererbrush.[ch] * app/widgets/gimppreviewrendererdrawable.[ch] * app/widgets/gimppreviewrendererimage.[ch]: ...and converted to GimpPreviewRenderer subclasses. * app/display/gimpnavigationview.c * app/gui/palette-import-dialog.c * app/widgets/Makefile.am * app/widgets/widgets-enums.h * app/widgets/widgets-types.h * app/widgets/gimpchannellistview.c * app/widgets/gimpcomponentlistitem.c * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainermenuimpl.c * app/widgets/gimplayerlistitem.c * app/widgets/gimplistitem.c * app/widgets/gimpnavigationpreview.[ch] * app/widgets/gimpselectioneditor.c * app/widgets/gimpvectorslistview.c: changed accordingly.
2003-03-01 11:53:41 +08:00
COLUMN_RENDERER, renderer,
COLUMN_NAME, name,
Started migration from GtkList to GtkTreeView: 2003-02-21 Michael Natterer <mitch@gimp.org> Started migration from GtkList to GtkTreeView: * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpcontainertreeview.[ch]; new GimpContainerView subclass using GtkListStore/GtkTreeView. * app/widgets/widgets-enums.h: added GIMP_VIEW_TYPE_TREE to thje GimpViewType enum. * app/widgets/gimpcontainereditor.c: added GimpContainerTreeView to the switch() which selects the view type. * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.[ch] * app/gui/dialogs-menu.c * app/gui/dialogs.c: added tree view versions of many dialogs. * app/widgets/gimppreview.[ch]: removed the get_size() virtual function and gimp_preview_calc_size(). * app/core/gimpviewable.[ch]: added virtual function get_preview_size() and gimp_viewable_calc_preview_size(). * 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: added get_preview_size() implementations. * app/widgets/gimpbufferpreview.c * app/widgets/gimpdrawablepreview.c * app/widgets/gimpgradientpreview.c * app/widgets/gimpimagepreview.c * app/widgets/gimppalettepreview.c * app/widgets/gimpselectioneditor.c * app/widgets/gimpundopreview.c * app/display/gimpnavigationview.c: changed accordingly, removed get_size() implementations. * app/widgets/widgets-types.h: changed the first param of GimpItemGetNameFunc from GtkWidget to GObject. * app/widgets/gimpcontainerview-utils.c: accept a GimpViewable as object in the built-in get_name funcs. * app/widgets/gimpcomponentlistitem.c * app/widgets/gimpcontainergridview.c * app/widgets/gimplistitem.c * app/widgets/gimpmenuitem.c: changed accordingly.
2003-02-22 03:03:19 +08:00
-1);
don't scale the preview up if the buffer is too small. 2003-03-01 Michael Natterer <mitch@gimp.org> * app/core/gimpbuffer.c: don't scale the preview up if the buffer is too small. * app/core/gimppattern.c: don't add a white border around the preview if the pattern is too small. * app/widgets/gimppreviewrenderer.[ch]: new object. A buffer that updates itself on GimpViewable changes and can render itself to any widget. Basically GimpPreview reduced to the render and draw code. * app/widgets/gimppreview.[ch]: removed all rendering and drawing code and keep a GimpPreviewRenderer instance. Connect to its "update" signal for queuing draws on the preview. * app/widgets/gimpcellrendererviewable.[ch] * app/widgets/gimpcontainertreeview.c: same here: removed rendering and drawing code and keep GimpPreviewRenderers in the list store. Delays preview creation for GtkTreeViews until the buffer is really needed for drawing and adds idle preview updating on viewable changes. * app/widgets/gimppreview-utils.[ch] * app/widgets/gimpbrushpreview.[ch] * app/widgets/gimpbufferpreview.[ch] * app/widgets/gimpdrawablepreview.[ch] * app/widgets/gimpimagepreview.[ch]: removed... * app/widgets/gimppreviewrenderer-utils.[ch] * app/widgets/gimppreviewrendererbrush.[ch] * app/widgets/gimppreviewrendererdrawable.[ch] * app/widgets/gimppreviewrendererimage.[ch]: ...and converted to GimpPreviewRenderer subclasses. * app/display/gimpnavigationview.c * app/gui/palette-import-dialog.c * app/widgets/Makefile.am * app/widgets/widgets-enums.h * app/widgets/widgets-types.h * app/widgets/gimpchannellistview.c * app/widgets/gimpcomponentlistitem.c * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainermenuimpl.c * app/widgets/gimplayerlistitem.c * app/widgets/gimplistitem.c * app/widgets/gimpnavigationpreview.[ch] * app/widgets/gimpselectioneditor.c * app/widgets/gimpvectorslistview.c: changed accordingly.
2003-03-01 11:53:41 +08:00
g_object_unref (renderer);
g_free (name);
Started migration from GtkList to GtkTreeView: 2003-02-21 Michael Natterer <mitch@gimp.org> Started migration from GtkList to GtkTreeView: * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpcontainertreeview.[ch]; new GimpContainerView subclass using GtkListStore/GtkTreeView. * app/widgets/widgets-enums.h: added GIMP_VIEW_TYPE_TREE to thje GimpViewType enum. * app/widgets/gimpcontainereditor.c: added GimpContainerTreeView to the switch() which selects the view type. * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.[ch] * app/gui/dialogs-menu.c * app/gui/dialogs.c: added tree view versions of many dialogs. * app/widgets/gimppreview.[ch]: removed the get_size() virtual function and gimp_preview_calc_size(). * app/core/gimpviewable.[ch]: added virtual function get_preview_size() and gimp_viewable_calc_preview_size(). * 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: added get_preview_size() implementations. * app/widgets/gimpbufferpreview.c * app/widgets/gimpdrawablepreview.c * app/widgets/gimpgradientpreview.c * app/widgets/gimpimagepreview.c * app/widgets/gimppalettepreview.c * app/widgets/gimpselectioneditor.c * app/widgets/gimpundopreview.c * app/display/gimpnavigationview.c: changed accordingly, removed get_size() implementations. * app/widgets/widgets-types.h: changed the first param of GimpItemGetNameFunc from GtkWidget to GObject. * app/widgets/gimpcontainerview-utils.c: accept a GimpViewable as object in the built-in get_name funcs. * app/widgets/gimpcomponentlistitem.c * app/widgets/gimpcontainergridview.c * app/widgets/gimplistitem.c * app/widgets/gimpmenuitem.c: changed accordingly.
2003-02-22 03:03:19 +08:00
}
/* GimpContainerView methods */
static void
gimp_container_tree_view_set_container (GimpContainerView *view,
GimpContainer *container)
{
GimpContainerTreeView *tree_view;
tree_view = GIMP_CONTAINER_TREE_VIEW (view);
if (view->container)
{
gimp_container_remove_handler (view->container,
tree_view->name_changed_handler_id);
if (! container)
{
if (gimp_dnd_viewable_source_unset (GTK_WIDGET (tree_view->view),
view->container->children_type))
{
gtk_drag_source_unset (GTK_WIDGET (tree_view->view));
}
g_signal_handlers_disconnect_by_func (tree_view->view,
gimp_container_tree_view_button_press,
tree_view);
}
}
else if (container)
{
if (gimp_dnd_drag_source_set_by_type (GTK_WIDGET (tree_view->view),
GDK_BUTTON1_MASK | GDK_BUTTON2_MASK,
container->children_type,
GDK_ACTION_COPY))
{
gimp_dnd_viewable_source_set (GTK_WIDGET (tree_view->view),
container->children_type,
gimp_container_tree_view_drag_viewable,
tree_view);
}
/* connect button_press_event after DND so we can keep the list from
* selecting the item on button2
*/
g_signal_connect (tree_view->view, "button_press_event",
G_CALLBACK (gimp_container_tree_view_button_press),
tree_view);
Started migration from GtkList to GtkTreeView: 2003-02-21 Michael Natterer <mitch@gimp.org> Started migration from GtkList to GtkTreeView: * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpcontainertreeview.[ch]; new GimpContainerView subclass using GtkListStore/GtkTreeView. * app/widgets/widgets-enums.h: added GIMP_VIEW_TYPE_TREE to thje GimpViewType enum. * app/widgets/gimpcontainereditor.c: added GimpContainerTreeView to the switch() which selects the view type. * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.[ch] * app/gui/dialogs-menu.c * app/gui/dialogs.c: added tree view versions of many dialogs. * app/widgets/gimppreview.[ch]: removed the get_size() virtual function and gimp_preview_calc_size(). * app/core/gimpviewable.[ch]: added virtual function get_preview_size() and gimp_viewable_calc_preview_size(). * 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: added get_preview_size() implementations. * app/widgets/gimpbufferpreview.c * app/widgets/gimpdrawablepreview.c * app/widgets/gimpgradientpreview.c * app/widgets/gimpimagepreview.c * app/widgets/gimppalettepreview.c * app/widgets/gimpselectioneditor.c * app/widgets/gimpundopreview.c * app/display/gimpnavigationview.c: changed accordingly, removed get_size() implementations. * app/widgets/widgets-types.h: changed the first param of GimpItemGetNameFunc from GtkWidget to GObject. * app/widgets/gimpcontainerview-utils.c: accept a GimpViewable as object in the built-in get_name funcs. * app/widgets/gimpcomponentlistitem.c * app/widgets/gimpcontainergridview.c * app/widgets/gimplistitem.c * app/widgets/gimpmenuitem.c: changed accordingly.
2003-02-22 03:03:19 +08:00
}
GIMP_CONTAINER_VIEW_CLASS (parent_class)->set_container (view, container);
if (view->container)
{
GimpViewableClass *viewable_class;
viewable_class = g_type_class_ref (container->children_type);
Started migration from GtkList to GtkTreeView: 2003-02-21 Michael Natterer <mitch@gimp.org> Started migration from GtkList to GtkTreeView: * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpcontainertreeview.[ch]; new GimpContainerView subclass using GtkListStore/GtkTreeView. * app/widgets/widgets-enums.h: added GIMP_VIEW_TYPE_TREE to thje GimpViewType enum. * app/widgets/gimpcontainereditor.c: added GimpContainerTreeView to the switch() which selects the view type. * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.[ch] * app/gui/dialogs-menu.c * app/gui/dialogs.c: added tree view versions of many dialogs. * app/widgets/gimppreview.[ch]: removed the get_size() virtual function and gimp_preview_calc_size(). * app/core/gimpviewable.[ch]: added virtual function get_preview_size() and gimp_viewable_calc_preview_size(). * 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: added get_preview_size() implementations. * app/widgets/gimpbufferpreview.c * app/widgets/gimpdrawablepreview.c * app/widgets/gimpgradientpreview.c * app/widgets/gimpimagepreview.c * app/widgets/gimppalettepreview.c * app/widgets/gimpselectioneditor.c * app/widgets/gimpundopreview.c * app/display/gimpnavigationview.c: changed accordingly, removed get_size() implementations. * app/widgets/widgets-types.h: changed the first param of GimpItemGetNameFunc from GtkWidget to GObject. * app/widgets/gimpcontainerview-utils.c: accept a GimpViewable as object in the built-in get_name funcs. * app/widgets/gimpcomponentlistitem.c * app/widgets/gimpcontainergridview.c * app/widgets/gimplistitem.c * app/widgets/gimpmenuitem.c: changed accordingly.
2003-02-22 03:03:19 +08:00
tree_view->name_changed_handler_id =
gimp_container_add_handler (view->container,
viewable_class->name_changed_signal,
Started migration from GtkList to GtkTreeView: 2003-02-21 Michael Natterer <mitch@gimp.org> Started migration from GtkList to GtkTreeView: * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpcontainertreeview.[ch]; new GimpContainerView subclass using GtkListStore/GtkTreeView. * app/widgets/widgets-enums.h: added GIMP_VIEW_TYPE_TREE to thje GimpViewType enum. * app/widgets/gimpcontainereditor.c: added GimpContainerTreeView to the switch() which selects the view type. * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.[ch] * app/gui/dialogs-menu.c * app/gui/dialogs.c: added tree view versions of many dialogs. * app/widgets/gimppreview.[ch]: removed the get_size() virtual function and gimp_preview_calc_size(). * app/core/gimpviewable.[ch]: added virtual function get_preview_size() and gimp_viewable_calc_preview_size(). * 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: added get_preview_size() implementations. * app/widgets/gimpbufferpreview.c * app/widgets/gimpdrawablepreview.c * app/widgets/gimpgradientpreview.c * app/widgets/gimpimagepreview.c * app/widgets/gimppalettepreview.c * app/widgets/gimpselectioneditor.c * app/widgets/gimpundopreview.c * app/display/gimpnavigationview.c: changed accordingly, removed get_size() implementations. * app/widgets/widgets-types.h: changed the first param of GimpItemGetNameFunc from GtkWidget to GObject. * app/widgets/gimpcontainerview-utils.c: accept a GimpViewable as object in the built-in get_name funcs. * app/widgets/gimpcomponentlistitem.c * app/widgets/gimpcontainergridview.c * app/widgets/gimplistitem.c * app/widgets/gimpmenuitem.c: changed accordingly.
2003-02-22 03:03:19 +08:00
G_CALLBACK (gimp_container_tree_view_name_changed),
tree_view);
g_type_class_unref (viewable_class);
Started migration from GtkList to GtkTreeView: 2003-02-21 Michael Natterer <mitch@gimp.org> Started migration from GtkList to GtkTreeView: * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpcontainertreeview.[ch]; new GimpContainerView subclass using GtkListStore/GtkTreeView. * app/widgets/widgets-enums.h: added GIMP_VIEW_TYPE_TREE to thje GimpViewType enum. * app/widgets/gimpcontainereditor.c: added GimpContainerTreeView to the switch() which selects the view type. * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.[ch] * app/gui/dialogs-menu.c * app/gui/dialogs.c: added tree view versions of many dialogs. * app/widgets/gimppreview.[ch]: removed the get_size() virtual function and gimp_preview_calc_size(). * app/core/gimpviewable.[ch]: added virtual function get_preview_size() and gimp_viewable_calc_preview_size(). * 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: added get_preview_size() implementations. * app/widgets/gimpbufferpreview.c * app/widgets/gimpdrawablepreview.c * app/widgets/gimpgradientpreview.c * app/widgets/gimpimagepreview.c * app/widgets/gimppalettepreview.c * app/widgets/gimpselectioneditor.c * app/widgets/gimpundopreview.c * app/display/gimpnavigationview.c: changed accordingly, removed get_size() implementations. * app/widgets/widgets-types.h: changed the first param of GimpItemGetNameFunc from GtkWidget to GObject. * app/widgets/gimpcontainerview-utils.c: accept a GimpViewable as object in the built-in get_name funcs. * app/widgets/gimpcomponentlistitem.c * app/widgets/gimpcontainergridview.c * app/widgets/gimplistitem.c * app/widgets/gimpmenuitem.c: changed accordingly.
2003-02-22 03:03:19 +08:00
}
}
static gpointer
gimp_container_tree_view_insert_item (GimpContainerView *view,
GimpViewable *viewable,
gint index)
{
GimpContainerTreeView *tree_view;
GtkTreeIter *iter;
tree_view = GIMP_CONTAINER_TREE_VIEW (view);
iter = g_new0 (GtkTreeIter, 1);
if (index == -1)
gtk_list_store_append (tree_view->list, iter);
else
gtk_list_store_insert (tree_view->list, iter, index);
don't scale the preview up if the buffer is too small. 2003-03-01 Michael Natterer <mitch@gimp.org> * app/core/gimpbuffer.c: don't scale the preview up if the buffer is too small. * app/core/gimppattern.c: don't add a white border around the preview if the pattern is too small. * app/widgets/gimppreviewrenderer.[ch]: new object. A buffer that updates itself on GimpViewable changes and can render itself to any widget. Basically GimpPreview reduced to the render and draw code. * app/widgets/gimppreview.[ch]: removed all rendering and drawing code and keep a GimpPreviewRenderer instance. Connect to its "update" signal for queuing draws on the preview. * app/widgets/gimpcellrendererviewable.[ch] * app/widgets/gimpcontainertreeview.c: same here: removed rendering and drawing code and keep GimpPreviewRenderers in the list store. Delays preview creation for GtkTreeViews until the buffer is really needed for drawing and adds idle preview updating on viewable changes. * app/widgets/gimppreview-utils.[ch] * app/widgets/gimpbrushpreview.[ch] * app/widgets/gimpbufferpreview.[ch] * app/widgets/gimpdrawablepreview.[ch] * app/widgets/gimpimagepreview.[ch]: removed... * app/widgets/gimppreviewrenderer-utils.[ch] * app/widgets/gimppreviewrendererbrush.[ch] * app/widgets/gimppreviewrendererdrawable.[ch] * app/widgets/gimppreviewrendererimage.[ch]: ...and converted to GimpPreviewRenderer subclasses. * app/display/gimpnavigationview.c * app/gui/palette-import-dialog.c * app/widgets/Makefile.am * app/widgets/widgets-enums.h * app/widgets/widgets-types.h * app/widgets/gimpchannellistview.c * app/widgets/gimpcomponentlistitem.c * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainermenuimpl.c * app/widgets/gimplayerlistitem.c * app/widgets/gimplistitem.c * app/widgets/gimpnavigationpreview.[ch] * app/widgets/gimpselectioneditor.c * app/widgets/gimpvectorslistview.c: changed accordingly.
2003-03-01 11:53:41 +08:00
gimp_container_tree_view_set (tree_view, iter, viewable);
Started migration from GtkList to GtkTreeView: 2003-02-21 Michael Natterer <mitch@gimp.org> Started migration from GtkList to GtkTreeView: * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpcontainertreeview.[ch]; new GimpContainerView subclass using GtkListStore/GtkTreeView. * app/widgets/widgets-enums.h: added GIMP_VIEW_TYPE_TREE to thje GimpViewType enum. * app/widgets/gimpcontainereditor.c: added GimpContainerTreeView to the switch() which selects the view type. * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.[ch] * app/gui/dialogs-menu.c * app/gui/dialogs.c: added tree view versions of many dialogs. * app/widgets/gimppreview.[ch]: removed the get_size() virtual function and gimp_preview_calc_size(). * app/core/gimpviewable.[ch]: added virtual function get_preview_size() and gimp_viewable_calc_preview_size(). * 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: added get_preview_size() implementations. * app/widgets/gimpbufferpreview.c * app/widgets/gimpdrawablepreview.c * app/widgets/gimpgradientpreview.c * app/widgets/gimpimagepreview.c * app/widgets/gimppalettepreview.c * app/widgets/gimpselectioneditor.c * app/widgets/gimpundopreview.c * app/display/gimpnavigationview.c: changed accordingly, removed get_size() implementations. * app/widgets/widgets-types.h: changed the first param of GimpItemGetNameFunc from GtkWidget to GObject. * app/widgets/gimpcontainerview-utils.c: accept a GimpViewable as object in the built-in get_name funcs. * app/widgets/gimpcomponentlistitem.c * app/widgets/gimpcontainergridview.c * app/widgets/gimplistitem.c * app/widgets/gimpmenuitem.c: changed accordingly.
2003-02-22 03:03:19 +08:00
return (gpointer) iter;
}
static void
gimp_container_tree_view_remove_item (GimpContainerView *view,
GimpViewable *viewable,
gpointer insert_data)
{
GimpContainerTreeView *tree_view;
GtkTreeIter *iter;
tree_view = GIMP_CONTAINER_TREE_VIEW (view);
themes/Default/images/stock-delete-16.png 2003-03-06 Michael Natterer <mitch@gimp.org> * themes/Default/images/stock-delete-16.png * themes/Default/images/stock-lower-16.png * themes/Default/images/stock-new-16.png * themes/Default/images/stock-paste-16.png * themes/Default/images/stock-raise-16.png * themes/Default/images/stock-refresh-16.png: removed these files since we use the icons provided by GTK+ now. * themes/Default/gtkrc * themes/Default/images/Makefile.am: removed them here hoo. * libgimpwidgets/gimpstock.[ch]: reordered stuff to be consistent in the header and the .c file. Added GIMP_STOCK_ERROR and GIMP_STOCK_QUESTION which are available in all sizes (unlike GTK_STOCK_DIALOG_ERROR and GTK_STOCK_DIALOG_QUESTION). * app/core/gimpviewable.c * app/display/gimpdisplayshell.c * app/gui/file-commands.c * app/gui/file-new-dialog.c * app/gui/file-save-dialog.c * app/widgets/gimpwidgets-utils.c * app/widgets/gimpdatafactoryview.c: use the new stock IDs. * app/config/gimpcoreconfig.[ch]: renamed "preview_size" to "layer_preview_size" and added "gboolean layer_previews" which switches layer previews on/off independent of their size. * app/config/gimprc-blurbs.h: added/changed their blurbs. * app/core/core-enums.[ch]: removed GIMP_PREVIEW_SIZE_NONE. * app/core/gimpdrawable-preview.c * app/core/gimpdrawable.c * app/core/gimpimage.c: return NULL previews if core_config->layer_previews is FALSE. Invalidate all layer/channel previews whenever "layer_previews" changes. * app/widgets/gimppreviewrendererdrawable.c * app/widgets/gimppreviewrendererimage.c: render the stock_id if the drawable/image returns a NULL preview. Fixes bug #107242. * app/display/gimpdisplayshell-handlers.c: don't set the sensitivity of the navigation button because it can no longer be disabled. * app/display/gimpdisplayshell-layer-select.c * app/gui/dialogs-constructors.c * app/gui/dialogs.c * app/gui/paths-dialog.c: changed accordingly. * app/gui/preferences-dialog.c: added a toggle button for the new "layer_previews" boolean. * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainerlistview.c: chain up unconditionally in GimpContainerView::clear_items(). * app/widgets/gimpcontainertreeview.c: ditto. Made the reorder() implementation lengthy and eeky (but working) again... Stop signal emission on double clicks so GtkTreeView doesn't re-select the item we are about change. * app/widgets/gimpcontainerview.c (gimp_container_view_real_clear_items): need to use g_hash_table_new_full() here too or everything will b0rk. * app/widgets/gimppreviewrenderer.c (gimp_preview_renderer_default_render_stock): use gtk_widget_render_icon() instead of gtk_icon_set_render_icon(). * tools/pdbgen/enums.pl: this file wanted to be regenerated...
2003-03-07 00:47:34 +08:00
iter = (GtkTreeIter *) insert_data;
Started migration from GtkList to GtkTreeView: 2003-02-21 Michael Natterer <mitch@gimp.org> Started migration from GtkList to GtkTreeView: * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpcontainertreeview.[ch]; new GimpContainerView subclass using GtkListStore/GtkTreeView. * app/widgets/widgets-enums.h: added GIMP_VIEW_TYPE_TREE to thje GimpViewType enum. * app/widgets/gimpcontainereditor.c: added GimpContainerTreeView to the switch() which selects the view type. * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.[ch] * app/gui/dialogs-menu.c * app/gui/dialogs.c: added tree view versions of many dialogs. * app/widgets/gimppreview.[ch]: removed the get_size() virtual function and gimp_preview_calc_size(). * app/core/gimpviewable.[ch]: added virtual function get_preview_size() and gimp_viewable_calc_preview_size(). * 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: added get_preview_size() implementations. * app/widgets/gimpbufferpreview.c * app/widgets/gimpdrawablepreview.c * app/widgets/gimpgradientpreview.c * app/widgets/gimpimagepreview.c * app/widgets/gimppalettepreview.c * app/widgets/gimpselectioneditor.c * app/widgets/gimpundopreview.c * app/display/gimpnavigationview.c: changed accordingly, removed get_size() implementations. * app/widgets/widgets-types.h: changed the first param of GimpItemGetNameFunc from GtkWidget to GObject. * app/widgets/gimpcontainerview-utils.c: accept a GimpViewable as object in the built-in get_name funcs. * app/widgets/gimpcomponentlistitem.c * app/widgets/gimpcontainergridview.c * app/widgets/gimplistitem.c * app/widgets/gimpmenuitem.c: changed accordingly.
2003-02-22 03:03:19 +08:00
if (iter)
gtk_list_store_remove (tree_view->list, iter);
Started migration from GtkList to GtkTreeView: 2003-02-21 Michael Natterer <mitch@gimp.org> Started migration from GtkList to GtkTreeView: * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpcontainertreeview.[ch]; new GimpContainerView subclass using GtkListStore/GtkTreeView. * app/widgets/widgets-enums.h: added GIMP_VIEW_TYPE_TREE to thje GimpViewType enum. * app/widgets/gimpcontainereditor.c: added GimpContainerTreeView to the switch() which selects the view type. * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.[ch] * app/gui/dialogs-menu.c * app/gui/dialogs.c: added tree view versions of many dialogs. * app/widgets/gimppreview.[ch]: removed the get_size() virtual function and gimp_preview_calc_size(). * app/core/gimpviewable.[ch]: added virtual function get_preview_size() and gimp_viewable_calc_preview_size(). * 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: added get_preview_size() implementations. * app/widgets/gimpbufferpreview.c * app/widgets/gimpdrawablepreview.c * app/widgets/gimpgradientpreview.c * app/widgets/gimpimagepreview.c * app/widgets/gimppalettepreview.c * app/widgets/gimpselectioneditor.c * app/widgets/gimpundopreview.c * app/display/gimpnavigationview.c: changed accordingly, removed get_size() implementations. * app/widgets/widgets-types.h: changed the first param of GimpItemGetNameFunc from GtkWidget to GObject. * app/widgets/gimpcontainerview-utils.c: accept a GimpViewable as object in the built-in get_name funcs. * app/widgets/gimpcomponentlistitem.c * app/widgets/gimpcontainergridview.c * app/widgets/gimplistitem.c * app/widgets/gimpmenuitem.c: changed accordingly.
2003-02-22 03:03:19 +08:00
}
static void
gimp_container_tree_view_reorder_item (GimpContainerView *view,
GimpViewable *viewable,
gint new_index,
gpointer insert_data)
{
GimpContainerTreeView *tree_view;
GtkTreeIter *iter;
tree_view = GIMP_CONTAINER_TREE_VIEW (view);
themes/Default/images/stock-delete-16.png 2003-03-06 Michael Natterer <mitch@gimp.org> * themes/Default/images/stock-delete-16.png * themes/Default/images/stock-lower-16.png * themes/Default/images/stock-new-16.png * themes/Default/images/stock-paste-16.png * themes/Default/images/stock-raise-16.png * themes/Default/images/stock-refresh-16.png: removed these files since we use the icons provided by GTK+ now. * themes/Default/gtkrc * themes/Default/images/Makefile.am: removed them here hoo. * libgimpwidgets/gimpstock.[ch]: reordered stuff to be consistent in the header and the .c file. Added GIMP_STOCK_ERROR and GIMP_STOCK_QUESTION which are available in all sizes (unlike GTK_STOCK_DIALOG_ERROR and GTK_STOCK_DIALOG_QUESTION). * app/core/gimpviewable.c * app/display/gimpdisplayshell.c * app/gui/file-commands.c * app/gui/file-new-dialog.c * app/gui/file-save-dialog.c * app/widgets/gimpwidgets-utils.c * app/widgets/gimpdatafactoryview.c: use the new stock IDs. * app/config/gimpcoreconfig.[ch]: renamed "preview_size" to "layer_preview_size" and added "gboolean layer_previews" which switches layer previews on/off independent of their size. * app/config/gimprc-blurbs.h: added/changed their blurbs. * app/core/core-enums.[ch]: removed GIMP_PREVIEW_SIZE_NONE. * app/core/gimpdrawable-preview.c * app/core/gimpdrawable.c * app/core/gimpimage.c: return NULL previews if core_config->layer_previews is FALSE. Invalidate all layer/channel previews whenever "layer_previews" changes. * app/widgets/gimppreviewrendererdrawable.c * app/widgets/gimppreviewrendererimage.c: render the stock_id if the drawable/image returns a NULL preview. Fixes bug #107242. * app/display/gimpdisplayshell-handlers.c: don't set the sensitivity of the navigation button because it can no longer be disabled. * app/display/gimpdisplayshell-layer-select.c * app/gui/dialogs-constructors.c * app/gui/dialogs.c * app/gui/paths-dialog.c: changed accordingly. * app/gui/preferences-dialog.c: added a toggle button for the new "layer_previews" boolean. * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainerlistview.c: chain up unconditionally in GimpContainerView::clear_items(). * app/widgets/gimpcontainertreeview.c: ditto. Made the reorder() implementation lengthy and eeky (but working) again... Stop signal emission on double clicks so GtkTreeView doesn't re-select the item we are about change. * app/widgets/gimpcontainerview.c (gimp_container_view_real_clear_items): need to use g_hash_table_new_full() here too or everything will b0rk. * app/widgets/gimppreviewrenderer.c (gimp_preview_renderer_default_render_stock): use gtk_widget_render_icon() instead of gtk_icon_set_render_icon(). * tools/pdbgen/enums.pl: this file wanted to be regenerated...
2003-03-07 00:47:34 +08:00
iter = (GtkTreeIter *) insert_data;
Started migration from GtkList to GtkTreeView: 2003-02-21 Michael Natterer <mitch@gimp.org> Started migration from GtkList to GtkTreeView: * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpcontainertreeview.[ch]; new GimpContainerView subclass using GtkListStore/GtkTreeView. * app/widgets/widgets-enums.h: added GIMP_VIEW_TYPE_TREE to thje GimpViewType enum. * app/widgets/gimpcontainereditor.c: added GimpContainerTreeView to the switch() which selects the view type. * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.[ch] * app/gui/dialogs-menu.c * app/gui/dialogs.c: added tree view versions of many dialogs. * app/widgets/gimppreview.[ch]: removed the get_size() virtual function and gimp_preview_calc_size(). * app/core/gimpviewable.[ch]: added virtual function get_preview_size() and gimp_viewable_calc_preview_size(). * 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: added get_preview_size() implementations. * app/widgets/gimpbufferpreview.c * app/widgets/gimpdrawablepreview.c * app/widgets/gimpgradientpreview.c * app/widgets/gimpimagepreview.c * app/widgets/gimppalettepreview.c * app/widgets/gimpselectioneditor.c * app/widgets/gimpundopreview.c * app/display/gimpnavigationview.c: changed accordingly, removed get_size() implementations. * app/widgets/widgets-types.h: changed the first param of GimpItemGetNameFunc from GtkWidget to GObject. * app/widgets/gimpcontainerview-utils.c: accept a GimpViewable as object in the built-in get_name funcs. * app/widgets/gimpcomponentlistitem.c * app/widgets/gimpcontainergridview.c * app/widgets/gimplistitem.c * app/widgets/gimpmenuitem.c: changed accordingly.
2003-02-22 03:03:19 +08:00
if (iter)
{
GtkTreeModel *model;
GtkTreePath *path;
themes/Default/images/stock-delete-16.png 2003-03-06 Michael Natterer <mitch@gimp.org> * themes/Default/images/stock-delete-16.png * themes/Default/images/stock-lower-16.png * themes/Default/images/stock-new-16.png * themes/Default/images/stock-paste-16.png * themes/Default/images/stock-raise-16.png * themes/Default/images/stock-refresh-16.png: removed these files since we use the icons provided by GTK+ now. * themes/Default/gtkrc * themes/Default/images/Makefile.am: removed them here hoo. * libgimpwidgets/gimpstock.[ch]: reordered stuff to be consistent in the header and the .c file. Added GIMP_STOCK_ERROR and GIMP_STOCK_QUESTION which are available in all sizes (unlike GTK_STOCK_DIALOG_ERROR and GTK_STOCK_DIALOG_QUESTION). * app/core/gimpviewable.c * app/display/gimpdisplayshell.c * app/gui/file-commands.c * app/gui/file-new-dialog.c * app/gui/file-save-dialog.c * app/widgets/gimpwidgets-utils.c * app/widgets/gimpdatafactoryview.c: use the new stock IDs. * app/config/gimpcoreconfig.[ch]: renamed "preview_size" to "layer_preview_size" and added "gboolean layer_previews" which switches layer previews on/off independent of their size. * app/config/gimprc-blurbs.h: added/changed their blurbs. * app/core/core-enums.[ch]: removed GIMP_PREVIEW_SIZE_NONE. * app/core/gimpdrawable-preview.c * app/core/gimpdrawable.c * app/core/gimpimage.c: return NULL previews if core_config->layer_previews is FALSE. Invalidate all layer/channel previews whenever "layer_previews" changes. * app/widgets/gimppreviewrendererdrawable.c * app/widgets/gimppreviewrendererimage.c: render the stock_id if the drawable/image returns a NULL preview. Fixes bug #107242. * app/display/gimpdisplayshell-handlers.c: don't set the sensitivity of the navigation button because it can no longer be disabled. * app/display/gimpdisplayshell-layer-select.c * app/gui/dialogs-constructors.c * app/gui/dialogs.c * app/gui/paths-dialog.c: changed accordingly. * app/gui/preferences-dialog.c: added a toggle button for the new "layer_previews" boolean. * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainerlistview.c: chain up unconditionally in GimpContainerView::clear_items(). * app/widgets/gimpcontainertreeview.c: ditto. Made the reorder() implementation lengthy and eeky (but working) again... Stop signal emission on double clicks so GtkTreeView doesn't re-select the item we are about change. * app/widgets/gimpcontainerview.c (gimp_container_view_real_clear_items): need to use g_hash_table_new_full() here too or everything will b0rk. * app/widgets/gimppreviewrenderer.c (gimp_preview_renderer_default_render_stock): use gtk_widget_render_icon() instead of gtk_icon_set_render_icon(). * tools/pdbgen/enums.pl: this file wanted to be regenerated...
2003-03-07 00:47:34 +08:00
GtkTreeIter selected_iter;
gboolean selected;
Started migration from GtkList to GtkTreeView: 2003-02-21 Michael Natterer <mitch@gimp.org> Started migration from GtkList to GtkTreeView: * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpcontainertreeview.[ch]; new GimpContainerView subclass using GtkListStore/GtkTreeView. * app/widgets/widgets-enums.h: added GIMP_VIEW_TYPE_TREE to thje GimpViewType enum. * app/widgets/gimpcontainereditor.c: added GimpContainerTreeView to the switch() which selects the view type. * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.[ch] * app/gui/dialogs-menu.c * app/gui/dialogs.c: added tree view versions of many dialogs. * app/widgets/gimppreview.[ch]: removed the get_size() virtual function and gimp_preview_calc_size(). * app/core/gimpviewable.[ch]: added virtual function get_preview_size() and gimp_viewable_calc_preview_size(). * 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: added get_preview_size() implementations. * app/widgets/gimpbufferpreview.c * app/widgets/gimpdrawablepreview.c * app/widgets/gimpgradientpreview.c * app/widgets/gimpimagepreview.c * app/widgets/gimppalettepreview.c * app/widgets/gimpselectioneditor.c * app/widgets/gimpundopreview.c * app/display/gimpnavigationview.c: changed accordingly, removed get_size() implementations. * app/widgets/widgets-types.h: changed the first param of GimpItemGetNameFunc from GtkWidget to GObject. * app/widgets/gimpcontainerview-utils.c: accept a GimpViewable as object in the built-in get_name funcs. * app/widgets/gimpcomponentlistitem.c * app/widgets/gimpcontainergridview.c * app/widgets/gimplistitem.c * app/widgets/gimpmenuitem.c: changed accordingly.
2003-02-22 03:03:19 +08:00
model = GTK_TREE_MODEL (tree_view->list);
Started migration from GtkList to GtkTreeView: 2003-02-21 Michael Natterer <mitch@gimp.org> Started migration from GtkList to GtkTreeView: * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpcontainertreeview.[ch]; new GimpContainerView subclass using GtkListStore/GtkTreeView. * app/widgets/widgets-enums.h: added GIMP_VIEW_TYPE_TREE to thje GimpViewType enum. * app/widgets/gimpcontainereditor.c: added GimpContainerTreeView to the switch() which selects the view type. * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.[ch] * app/gui/dialogs-menu.c * app/gui/dialogs.c: added tree view versions of many dialogs. * app/widgets/gimppreview.[ch]: removed the get_size() virtual function and gimp_preview_calc_size(). * app/core/gimpviewable.[ch]: added virtual function get_preview_size() and gimp_viewable_calc_preview_size(). * 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: added get_preview_size() implementations. * app/widgets/gimpbufferpreview.c * app/widgets/gimpdrawablepreview.c * app/widgets/gimpgradientpreview.c * app/widgets/gimpimagepreview.c * app/widgets/gimppalettepreview.c * app/widgets/gimpselectioneditor.c * app/widgets/gimpundopreview.c * app/display/gimpnavigationview.c: changed accordingly, removed get_size() implementations. * app/widgets/widgets-types.h: changed the first param of GimpItemGetNameFunc from GtkWidget to GObject. * app/widgets/gimpcontainerview-utils.c: accept a GimpViewable as object in the built-in get_name funcs. * app/widgets/gimpcomponentlistitem.c * app/widgets/gimpcontainergridview.c * app/widgets/gimplistitem.c * app/widgets/gimpmenuitem.c: changed accordingly.
2003-02-22 03:03:19 +08:00
themes/Default/images/stock-delete-16.png 2003-03-06 Michael Natterer <mitch@gimp.org> * themes/Default/images/stock-delete-16.png * themes/Default/images/stock-lower-16.png * themes/Default/images/stock-new-16.png * themes/Default/images/stock-paste-16.png * themes/Default/images/stock-raise-16.png * themes/Default/images/stock-refresh-16.png: removed these files since we use the icons provided by GTK+ now. * themes/Default/gtkrc * themes/Default/images/Makefile.am: removed them here hoo. * libgimpwidgets/gimpstock.[ch]: reordered stuff to be consistent in the header and the .c file. Added GIMP_STOCK_ERROR and GIMP_STOCK_QUESTION which are available in all sizes (unlike GTK_STOCK_DIALOG_ERROR and GTK_STOCK_DIALOG_QUESTION). * app/core/gimpviewable.c * app/display/gimpdisplayshell.c * app/gui/file-commands.c * app/gui/file-new-dialog.c * app/gui/file-save-dialog.c * app/widgets/gimpwidgets-utils.c * app/widgets/gimpdatafactoryview.c: use the new stock IDs. * app/config/gimpcoreconfig.[ch]: renamed "preview_size" to "layer_preview_size" and added "gboolean layer_previews" which switches layer previews on/off independent of their size. * app/config/gimprc-blurbs.h: added/changed their blurbs. * app/core/core-enums.[ch]: removed GIMP_PREVIEW_SIZE_NONE. * app/core/gimpdrawable-preview.c * app/core/gimpdrawable.c * app/core/gimpimage.c: return NULL previews if core_config->layer_previews is FALSE. Invalidate all layer/channel previews whenever "layer_previews" changes. * app/widgets/gimppreviewrendererdrawable.c * app/widgets/gimppreviewrendererimage.c: render the stock_id if the drawable/image returns a NULL preview. Fixes bug #107242. * app/display/gimpdisplayshell-handlers.c: don't set the sensitivity of the navigation button because it can no longer be disabled. * app/display/gimpdisplayshell-layer-select.c * app/gui/dialogs-constructors.c * app/gui/dialogs.c * app/gui/paths-dialog.c: changed accordingly. * app/gui/preferences-dialog.c: added a toggle button for the new "layer_previews" boolean. * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainerlistview.c: chain up unconditionally in GimpContainerView::clear_items(). * app/widgets/gimpcontainertreeview.c: ditto. Made the reorder() implementation lengthy and eeky (but working) again... Stop signal emission on double clicks so GtkTreeView doesn't re-select the item we are about change. * app/widgets/gimpcontainerview.c (gimp_container_view_real_clear_items): need to use g_hash_table_new_full() here too or everything will b0rk. * app/widgets/gimppreviewrenderer.c (gimp_preview_renderer_default_render_stock): use gtk_widget_render_icon() instead of gtk_icon_set_render_icon(). * tools/pdbgen/enums.pl: this file wanted to be regenerated...
2003-03-07 00:47:34 +08:00
selected = gtk_tree_selection_get_selected (tree_view->selection,
NULL, &selected_iter);
added "gchar *stock_id" to the GimpViewable struct. It is used by the GUI 2003-02-26 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:17:10 +08:00
themes/Default/images/stock-delete-16.png 2003-03-06 Michael Natterer <mitch@gimp.org> * themes/Default/images/stock-delete-16.png * themes/Default/images/stock-lower-16.png * themes/Default/images/stock-new-16.png * themes/Default/images/stock-paste-16.png * themes/Default/images/stock-raise-16.png * themes/Default/images/stock-refresh-16.png: removed these files since we use the icons provided by GTK+ now. * themes/Default/gtkrc * themes/Default/images/Makefile.am: removed them here hoo. * libgimpwidgets/gimpstock.[ch]: reordered stuff to be consistent in the header and the .c file. Added GIMP_STOCK_ERROR and GIMP_STOCK_QUESTION which are available in all sizes (unlike GTK_STOCK_DIALOG_ERROR and GTK_STOCK_DIALOG_QUESTION). * app/core/gimpviewable.c * app/display/gimpdisplayshell.c * app/gui/file-commands.c * app/gui/file-new-dialog.c * app/gui/file-save-dialog.c * app/widgets/gimpwidgets-utils.c * app/widgets/gimpdatafactoryview.c: use the new stock IDs. * app/config/gimpcoreconfig.[ch]: renamed "preview_size" to "layer_preview_size" and added "gboolean layer_previews" which switches layer previews on/off independent of their size. * app/config/gimprc-blurbs.h: added/changed their blurbs. * app/core/core-enums.[ch]: removed GIMP_PREVIEW_SIZE_NONE. * app/core/gimpdrawable-preview.c * app/core/gimpdrawable.c * app/core/gimpimage.c: return NULL previews if core_config->layer_previews is FALSE. Invalidate all layer/channel previews whenever "layer_previews" changes. * app/widgets/gimppreviewrendererdrawable.c * app/widgets/gimppreviewrendererimage.c: render the stock_id if the drawable/image returns a NULL preview. Fixes bug #107242. * app/display/gimpdisplayshell-handlers.c: don't set the sensitivity of the navigation button because it can no longer be disabled. * app/display/gimpdisplayshell-layer-select.c * app/gui/dialogs-constructors.c * app/gui/dialogs.c * app/gui/paths-dialog.c: changed accordingly. * app/gui/preferences-dialog.c: added a toggle button for the new "layer_previews" boolean. * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainerlistview.c: chain up unconditionally in GimpContainerView::clear_items(). * app/widgets/gimpcontainertreeview.c: ditto. Made the reorder() implementation lengthy and eeky (but working) again... Stop signal emission on double clicks so GtkTreeView doesn't re-select the item we are about change. * app/widgets/gimpcontainerview.c (gimp_container_view_real_clear_items): need to use g_hash_table_new_full() here too or everything will b0rk. * app/widgets/gimppreviewrenderer.c (gimp_preview_renderer_default_render_stock): use gtk_widget_render_icon() instead of gtk_icon_set_render_icon(). * tools/pdbgen/enums.pl: this file wanted to be regenerated...
2003-03-07 00:47:34 +08:00
if (selected)
{
GimpViewable *selected_viewable;
added "gchar *stock_id" to the GimpViewable struct. It is used by the GUI 2003-02-26 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:17:10 +08:00
themes/Default/images/stock-delete-16.png 2003-03-06 Michael Natterer <mitch@gimp.org> * themes/Default/images/stock-delete-16.png * themes/Default/images/stock-lower-16.png * themes/Default/images/stock-new-16.png * themes/Default/images/stock-paste-16.png * themes/Default/images/stock-raise-16.png * themes/Default/images/stock-refresh-16.png: removed these files since we use the icons provided by GTK+ now. * themes/Default/gtkrc * themes/Default/images/Makefile.am: removed them here hoo. * libgimpwidgets/gimpstock.[ch]: reordered stuff to be consistent in the header and the .c file. Added GIMP_STOCK_ERROR and GIMP_STOCK_QUESTION which are available in all sizes (unlike GTK_STOCK_DIALOG_ERROR and GTK_STOCK_DIALOG_QUESTION). * app/core/gimpviewable.c * app/display/gimpdisplayshell.c * app/gui/file-commands.c * app/gui/file-new-dialog.c * app/gui/file-save-dialog.c * app/widgets/gimpwidgets-utils.c * app/widgets/gimpdatafactoryview.c: use the new stock IDs. * app/config/gimpcoreconfig.[ch]: renamed "preview_size" to "layer_preview_size" and added "gboolean layer_previews" which switches layer previews on/off independent of their size. * app/config/gimprc-blurbs.h: added/changed their blurbs. * app/core/core-enums.[ch]: removed GIMP_PREVIEW_SIZE_NONE. * app/core/gimpdrawable-preview.c * app/core/gimpdrawable.c * app/core/gimpimage.c: return NULL previews if core_config->layer_previews is FALSE. Invalidate all layer/channel previews whenever "layer_previews" changes. * app/widgets/gimppreviewrendererdrawable.c * app/widgets/gimppreviewrendererimage.c: render the stock_id if the drawable/image returns a NULL preview. Fixes bug #107242. * app/display/gimpdisplayshell-handlers.c: don't set the sensitivity of the navigation button because it can no longer be disabled. * app/display/gimpdisplayshell-layer-select.c * app/gui/dialogs-constructors.c * app/gui/dialogs.c * app/gui/paths-dialog.c: changed accordingly. * app/gui/preferences-dialog.c: added a toggle button for the new "layer_previews" boolean. * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainerlistview.c: chain up unconditionally in GimpContainerView::clear_items(). * app/widgets/gimpcontainertreeview.c: ditto. Made the reorder() implementation lengthy and eeky (but working) again... Stop signal emission on double clicks so GtkTreeView doesn't re-select the item we are about change. * app/widgets/gimpcontainerview.c (gimp_container_view_real_clear_items): need to use g_hash_table_new_full() here too or everything will b0rk. * app/widgets/gimppreviewrenderer.c (gimp_preview_renderer_default_render_stock): use gtk_widget_render_icon() instead of gtk_icon_set_render_icon(). * tools/pdbgen/enums.pl: this file wanted to be regenerated...
2003-03-07 00:47:34 +08:00
gtk_tree_model_get (model, &selected_iter,
COLUMN_VIEWABLE, &selected_viewable,
-1);
added "gchar *stock_id" to the GimpViewable struct. It is used by the GUI 2003-02-26 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:17:10 +08:00
themes/Default/images/stock-delete-16.png 2003-03-06 Michael Natterer <mitch@gimp.org> * themes/Default/images/stock-delete-16.png * themes/Default/images/stock-lower-16.png * themes/Default/images/stock-new-16.png * themes/Default/images/stock-paste-16.png * themes/Default/images/stock-raise-16.png * themes/Default/images/stock-refresh-16.png: removed these files since we use the icons provided by GTK+ now. * themes/Default/gtkrc * themes/Default/images/Makefile.am: removed them here hoo. * libgimpwidgets/gimpstock.[ch]: reordered stuff to be consistent in the header and the .c file. Added GIMP_STOCK_ERROR and GIMP_STOCK_QUESTION which are available in all sizes (unlike GTK_STOCK_DIALOG_ERROR and GTK_STOCK_DIALOG_QUESTION). * app/core/gimpviewable.c * app/display/gimpdisplayshell.c * app/gui/file-commands.c * app/gui/file-new-dialog.c * app/gui/file-save-dialog.c * app/widgets/gimpwidgets-utils.c * app/widgets/gimpdatafactoryview.c: use the new stock IDs. * app/config/gimpcoreconfig.[ch]: renamed "preview_size" to "layer_preview_size" and added "gboolean layer_previews" which switches layer previews on/off independent of their size. * app/config/gimprc-blurbs.h: added/changed their blurbs. * app/core/core-enums.[ch]: removed GIMP_PREVIEW_SIZE_NONE. * app/core/gimpdrawable-preview.c * app/core/gimpdrawable.c * app/core/gimpimage.c: return NULL previews if core_config->layer_previews is FALSE. Invalidate all layer/channel previews whenever "layer_previews" changes. * app/widgets/gimppreviewrendererdrawable.c * app/widgets/gimppreviewrendererimage.c: render the stock_id if the drawable/image returns a NULL preview. Fixes bug #107242. * app/display/gimpdisplayshell-handlers.c: don't set the sensitivity of the navigation button because it can no longer be disabled. * app/display/gimpdisplayshell-layer-select.c * app/gui/dialogs-constructors.c * app/gui/dialogs.c * app/gui/paths-dialog.c: changed accordingly. * app/gui/preferences-dialog.c: added a toggle button for the new "layer_previews" boolean. * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainerlistview.c: chain up unconditionally in GimpContainerView::clear_items(). * app/widgets/gimpcontainertreeview.c: ditto. Made the reorder() implementation lengthy and eeky (but working) again... Stop signal emission on double clicks so GtkTreeView doesn't re-select the item we are about change. * app/widgets/gimpcontainerview.c (gimp_container_view_real_clear_items): need to use g_hash_table_new_full() here too or everything will b0rk. * app/widgets/gimppreviewrenderer.c (gimp_preview_renderer_default_render_stock): use gtk_widget_render_icon() instead of gtk_icon_set_render_icon(). * tools/pdbgen/enums.pl: this file wanted to be regenerated...
2003-03-07 00:47:34 +08:00
if (selected_viewable != viewable)
selected = FALSE;
g_object_unref (selected_viewable);
}
if (new_index == -1 || new_index == view->container->num_children - 1)
{
gtk_list_store_move_before (tree_view->list, iter, NULL);
}
else if (new_index == 0)
{
gtk_list_store_move_after (tree_view->list, iter, NULL);
}
else
{
GtkTreeIter place_iter;
gint old_index;
path = gtk_tree_model_get_path (model, iter);
old_index = *(gtk_tree_path_get_indices (path));
gtk_tree_path_free (path);
if (new_index != old_index)
{
path = gtk_tree_path_new_from_indices (new_index, -1);
gtk_tree_model_get_iter (model, &place_iter, path);
gtk_tree_path_free (path);
if (new_index > old_index)
gtk_list_store_move_after (tree_view->list, iter, &place_iter);
else
gtk_list_store_move_before (tree_view->list, iter, &place_iter);
}
}
if (selected)
{
path = gtk_tree_model_get_path (model, iter);
gtk_tree_view_scroll_to_cell (tree_view->view, path,
NULL, FALSE, 0.0, 0.0);
gtk_tree_path_free (path);
}
Started migration from GtkList to GtkTreeView: 2003-02-21 Michael Natterer <mitch@gimp.org> Started migration from GtkList to GtkTreeView: * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpcontainertreeview.[ch]; new GimpContainerView subclass using GtkListStore/GtkTreeView. * app/widgets/widgets-enums.h: added GIMP_VIEW_TYPE_TREE to thje GimpViewType enum. * app/widgets/gimpcontainereditor.c: added GimpContainerTreeView to the switch() which selects the view type. * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.[ch] * app/gui/dialogs-menu.c * app/gui/dialogs.c: added tree view versions of many dialogs. * app/widgets/gimppreview.[ch]: removed the get_size() virtual function and gimp_preview_calc_size(). * app/core/gimpviewable.[ch]: added virtual function get_preview_size() and gimp_viewable_calc_preview_size(). * 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: added get_preview_size() implementations. * app/widgets/gimpbufferpreview.c * app/widgets/gimpdrawablepreview.c * app/widgets/gimpgradientpreview.c * app/widgets/gimpimagepreview.c * app/widgets/gimppalettepreview.c * app/widgets/gimpselectioneditor.c * app/widgets/gimpundopreview.c * app/display/gimpnavigationview.c: changed accordingly, removed get_size() implementations. * app/widgets/widgets-types.h: changed the first param of GimpItemGetNameFunc from GtkWidget to GObject. * app/widgets/gimpcontainerview-utils.c: accept a GimpViewable as object in the built-in get_name funcs. * app/widgets/gimpcomponentlistitem.c * app/widgets/gimpcontainergridview.c * app/widgets/gimplistitem.c * app/widgets/gimpmenuitem.c: changed accordingly.
2003-02-22 03:03:19 +08:00
}
}
static void
gimp_container_tree_view_select_item (GimpContainerView *view,
GimpViewable *viewable,
gpointer insert_data)
{
GimpContainerTreeView *tree_view;
GtkTreeIter *iter;
tree_view = GIMP_CONTAINER_TREE_VIEW (view);
themes/Default/images/stock-delete-16.png 2003-03-06 Michael Natterer <mitch@gimp.org> * themes/Default/images/stock-delete-16.png * themes/Default/images/stock-lower-16.png * themes/Default/images/stock-new-16.png * themes/Default/images/stock-paste-16.png * themes/Default/images/stock-raise-16.png * themes/Default/images/stock-refresh-16.png: removed these files since we use the icons provided by GTK+ now. * themes/Default/gtkrc * themes/Default/images/Makefile.am: removed them here hoo. * libgimpwidgets/gimpstock.[ch]: reordered stuff to be consistent in the header and the .c file. Added GIMP_STOCK_ERROR and GIMP_STOCK_QUESTION which are available in all sizes (unlike GTK_STOCK_DIALOG_ERROR and GTK_STOCK_DIALOG_QUESTION). * app/core/gimpviewable.c * app/display/gimpdisplayshell.c * app/gui/file-commands.c * app/gui/file-new-dialog.c * app/gui/file-save-dialog.c * app/widgets/gimpwidgets-utils.c * app/widgets/gimpdatafactoryview.c: use the new stock IDs. * app/config/gimpcoreconfig.[ch]: renamed "preview_size" to "layer_preview_size" and added "gboolean layer_previews" which switches layer previews on/off independent of their size. * app/config/gimprc-blurbs.h: added/changed their blurbs. * app/core/core-enums.[ch]: removed GIMP_PREVIEW_SIZE_NONE. * app/core/gimpdrawable-preview.c * app/core/gimpdrawable.c * app/core/gimpimage.c: return NULL previews if core_config->layer_previews is FALSE. Invalidate all layer/channel previews whenever "layer_previews" changes. * app/widgets/gimppreviewrendererdrawable.c * app/widgets/gimppreviewrendererimage.c: render the stock_id if the drawable/image returns a NULL preview. Fixes bug #107242. * app/display/gimpdisplayshell-handlers.c: don't set the sensitivity of the navigation button because it can no longer be disabled. * app/display/gimpdisplayshell-layer-select.c * app/gui/dialogs-constructors.c * app/gui/dialogs.c * app/gui/paths-dialog.c: changed accordingly. * app/gui/preferences-dialog.c: added a toggle button for the new "layer_previews" boolean. * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainerlistview.c: chain up unconditionally in GimpContainerView::clear_items(). * app/widgets/gimpcontainertreeview.c: ditto. Made the reorder() implementation lengthy and eeky (but working) again... Stop signal emission on double clicks so GtkTreeView doesn't re-select the item we are about change. * app/widgets/gimpcontainerview.c (gimp_container_view_real_clear_items): need to use g_hash_table_new_full() here too or everything will b0rk. * app/widgets/gimppreviewrenderer.c (gimp_preview_renderer_default_render_stock): use gtk_widget_render_icon() instead of gtk_icon_set_render_icon(). * tools/pdbgen/enums.pl: this file wanted to be regenerated...
2003-03-07 00:47:34 +08:00
iter = (GtkTreeIter *) insert_data;
Started migration from GtkList to GtkTreeView: 2003-02-21 Michael Natterer <mitch@gimp.org> Started migration from GtkList to GtkTreeView: * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpcontainertreeview.[ch]; new GimpContainerView subclass using GtkListStore/GtkTreeView. * app/widgets/widgets-enums.h: added GIMP_VIEW_TYPE_TREE to thje GimpViewType enum. * app/widgets/gimpcontainereditor.c: added GimpContainerTreeView to the switch() which selects the view type. * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.[ch] * app/gui/dialogs-menu.c * app/gui/dialogs.c: added tree view versions of many dialogs. * app/widgets/gimppreview.[ch]: removed the get_size() virtual function and gimp_preview_calc_size(). * app/core/gimpviewable.[ch]: added virtual function get_preview_size() and gimp_viewable_calc_preview_size(). * 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: added get_preview_size() implementations. * app/widgets/gimpbufferpreview.c * app/widgets/gimpdrawablepreview.c * app/widgets/gimpgradientpreview.c * app/widgets/gimpimagepreview.c * app/widgets/gimppalettepreview.c * app/widgets/gimpselectioneditor.c * app/widgets/gimpundopreview.c * app/display/gimpnavigationview.c: changed accordingly, removed get_size() implementations. * app/widgets/widgets-types.h: changed the first param of GimpItemGetNameFunc from GtkWidget to GObject. * app/widgets/gimpcontainerview-utils.c: accept a GimpViewable as object in the built-in get_name funcs. * app/widgets/gimpcomponentlistitem.c * app/widgets/gimpcontainergridview.c * app/widgets/gimplistitem.c * app/widgets/gimpmenuitem.c: changed accordingly.
2003-02-22 03:03:19 +08:00
if (iter)
{
GtkTreePath *path;
GtkTreeIter selected_iter;
if (gtk_tree_selection_get_selected (tree_view->selection, NULL,
&selected_iter))
{
GimpViewable *selected_viewable;
gboolean equal;
gtk_tree_model_get (GTK_TREE_MODEL (tree_view->list), &selected_iter,
COLUMN_VIEWABLE, &selected_viewable,
-1);
equal = (selected_viewable == viewable);
g_object_unref (selected_viewable);
if (equal)
return;
}
g_signal_handlers_block_by_func (tree_view->selection,
gimp_container_tree_view_selection_changed,
tree_view);
gtk_tree_selection_select_iter (tree_view->selection, iter);
g_signal_handlers_unblock_by_func (tree_view->selection,
gimp_container_tree_view_selection_changed,
tree_view);
path = gtk_tree_model_get_path (GTK_TREE_MODEL (tree_view->list), iter);
gtk_tree_view_scroll_to_cell (tree_view->view, path,
themes/Default/images/stock-delete-16.png 2003-03-06 Michael Natterer <mitch@gimp.org> * themes/Default/images/stock-delete-16.png * themes/Default/images/stock-lower-16.png * themes/Default/images/stock-new-16.png * themes/Default/images/stock-paste-16.png * themes/Default/images/stock-raise-16.png * themes/Default/images/stock-refresh-16.png: removed these files since we use the icons provided by GTK+ now. * themes/Default/gtkrc * themes/Default/images/Makefile.am: removed them here hoo. * libgimpwidgets/gimpstock.[ch]: reordered stuff to be consistent in the header and the .c file. Added GIMP_STOCK_ERROR and GIMP_STOCK_QUESTION which are available in all sizes (unlike GTK_STOCK_DIALOG_ERROR and GTK_STOCK_DIALOG_QUESTION). * app/core/gimpviewable.c * app/display/gimpdisplayshell.c * app/gui/file-commands.c * app/gui/file-new-dialog.c * app/gui/file-save-dialog.c * app/widgets/gimpwidgets-utils.c * app/widgets/gimpdatafactoryview.c: use the new stock IDs. * app/config/gimpcoreconfig.[ch]: renamed "preview_size" to "layer_preview_size" and added "gboolean layer_previews" which switches layer previews on/off independent of their size. * app/config/gimprc-blurbs.h: added/changed their blurbs. * app/core/core-enums.[ch]: removed GIMP_PREVIEW_SIZE_NONE. * app/core/gimpdrawable-preview.c * app/core/gimpdrawable.c * app/core/gimpimage.c: return NULL previews if core_config->layer_previews is FALSE. Invalidate all layer/channel previews whenever "layer_previews" changes. * app/widgets/gimppreviewrendererdrawable.c * app/widgets/gimppreviewrendererimage.c: render the stock_id if the drawable/image returns a NULL preview. Fixes bug #107242. * app/display/gimpdisplayshell-handlers.c: don't set the sensitivity of the navigation button because it can no longer be disabled. * app/display/gimpdisplayshell-layer-select.c * app/gui/dialogs-constructors.c * app/gui/dialogs.c * app/gui/paths-dialog.c: changed accordingly. * app/gui/preferences-dialog.c: added a toggle button for the new "layer_previews" boolean. * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainerlistview.c: chain up unconditionally in GimpContainerView::clear_items(). * app/widgets/gimpcontainertreeview.c: ditto. Made the reorder() implementation lengthy and eeky (but working) again... Stop signal emission on double clicks so GtkTreeView doesn't re-select the item we are about change. * app/widgets/gimpcontainerview.c (gimp_container_view_real_clear_items): need to use g_hash_table_new_full() here too or everything will b0rk. * app/widgets/gimppreviewrenderer.c (gimp_preview_renderer_default_render_stock): use gtk_widget_render_icon() instead of gtk_icon_set_render_icon(). * tools/pdbgen/enums.pl: this file wanted to be regenerated...
2003-03-07 00:47:34 +08:00
NULL, FALSE, 0.0, 0.0);
Started migration from GtkList to GtkTreeView: 2003-02-21 Michael Natterer <mitch@gimp.org> Started migration from GtkList to GtkTreeView: * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpcontainertreeview.[ch]; new GimpContainerView subclass using GtkListStore/GtkTreeView. * app/widgets/widgets-enums.h: added GIMP_VIEW_TYPE_TREE to thje GimpViewType enum. * app/widgets/gimpcontainereditor.c: added GimpContainerTreeView to the switch() which selects the view type. * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.[ch] * app/gui/dialogs-menu.c * app/gui/dialogs.c: added tree view versions of many dialogs. * app/widgets/gimppreview.[ch]: removed the get_size() virtual function and gimp_preview_calc_size(). * app/core/gimpviewable.[ch]: added virtual function get_preview_size() and gimp_viewable_calc_preview_size(). * 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: added get_preview_size() implementations. * app/widgets/gimpbufferpreview.c * app/widgets/gimpdrawablepreview.c * app/widgets/gimpgradientpreview.c * app/widgets/gimpimagepreview.c * app/widgets/gimppalettepreview.c * app/widgets/gimpselectioneditor.c * app/widgets/gimpundopreview.c * app/display/gimpnavigationview.c: changed accordingly, removed get_size() implementations. * app/widgets/widgets-types.h: changed the first param of GimpItemGetNameFunc from GtkWidget to GObject. * app/widgets/gimpcontainerview-utils.c: accept a GimpViewable as object in the built-in get_name funcs. * app/widgets/gimpcomponentlistitem.c * app/widgets/gimpcontainergridview.c * app/widgets/gimplistitem.c * app/widgets/gimpmenuitem.c: changed accordingly.
2003-02-22 03:03:19 +08:00
gtk_tree_path_free (path);
}
else
{
gtk_tree_selection_unselect_all (tree_view->selection);
}
}
static void
gimp_container_tree_view_clear_items (GimpContainerView *view)
{
GimpContainerTreeView *tree_view;
tree_view = GIMP_CONTAINER_TREE_VIEW (view);
gtk_list_store_clear (tree_view->list);
themes/Default/images/stock-delete-16.png 2003-03-06 Michael Natterer <mitch@gimp.org> * themes/Default/images/stock-delete-16.png * themes/Default/images/stock-lower-16.png * themes/Default/images/stock-new-16.png * themes/Default/images/stock-paste-16.png * themes/Default/images/stock-raise-16.png * themes/Default/images/stock-refresh-16.png: removed these files since we use the icons provided by GTK+ now. * themes/Default/gtkrc * themes/Default/images/Makefile.am: removed them here hoo. * libgimpwidgets/gimpstock.[ch]: reordered stuff to be consistent in the header and the .c file. Added GIMP_STOCK_ERROR and GIMP_STOCK_QUESTION which are available in all sizes (unlike GTK_STOCK_DIALOG_ERROR and GTK_STOCK_DIALOG_QUESTION). * app/core/gimpviewable.c * app/display/gimpdisplayshell.c * app/gui/file-commands.c * app/gui/file-new-dialog.c * app/gui/file-save-dialog.c * app/widgets/gimpwidgets-utils.c * app/widgets/gimpdatafactoryview.c: use the new stock IDs. * app/config/gimpcoreconfig.[ch]: renamed "preview_size" to "layer_preview_size" and added "gboolean layer_previews" which switches layer previews on/off independent of their size. * app/config/gimprc-blurbs.h: added/changed their blurbs. * app/core/core-enums.[ch]: removed GIMP_PREVIEW_SIZE_NONE. * app/core/gimpdrawable-preview.c * app/core/gimpdrawable.c * app/core/gimpimage.c: return NULL previews if core_config->layer_previews is FALSE. Invalidate all layer/channel previews whenever "layer_previews" changes. * app/widgets/gimppreviewrendererdrawable.c * app/widgets/gimppreviewrendererimage.c: render the stock_id if the drawable/image returns a NULL preview. Fixes bug #107242. * app/display/gimpdisplayshell-handlers.c: don't set the sensitivity of the navigation button because it can no longer be disabled. * app/display/gimpdisplayshell-layer-select.c * app/gui/dialogs-constructors.c * app/gui/dialogs.c * app/gui/paths-dialog.c: changed accordingly. * app/gui/preferences-dialog.c: added a toggle button for the new "layer_previews" boolean. * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainerlistview.c: chain up unconditionally in GimpContainerView::clear_items(). * app/widgets/gimpcontainertreeview.c: ditto. Made the reorder() implementation lengthy and eeky (but working) again... Stop signal emission on double clicks so GtkTreeView doesn't re-select the item we are about change. * app/widgets/gimpcontainerview.c (gimp_container_view_real_clear_items): need to use g_hash_table_new_full() here too or everything will b0rk. * app/widgets/gimppreviewrenderer.c (gimp_preview_renderer_default_render_stock): use gtk_widget_render_icon() instead of gtk_icon_set_render_icon(). * tools/pdbgen/enums.pl: this file wanted to be regenerated...
2003-03-07 00:47:34 +08:00
GIMP_CONTAINER_VIEW_CLASS (parent_class)->clear_items (view);
Started migration from GtkList to GtkTreeView: 2003-02-21 Michael Natterer <mitch@gimp.org> Started migration from GtkList to GtkTreeView: * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpcontainertreeview.[ch]; new GimpContainerView subclass using GtkListStore/GtkTreeView. * app/widgets/widgets-enums.h: added GIMP_VIEW_TYPE_TREE to thje GimpViewType enum. * app/widgets/gimpcontainereditor.c: added GimpContainerTreeView to the switch() which selects the view type. * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.[ch] * app/gui/dialogs-menu.c * app/gui/dialogs.c: added tree view versions of many dialogs. * app/widgets/gimppreview.[ch]: removed the get_size() virtual function and gimp_preview_calc_size(). * app/core/gimpviewable.[ch]: added virtual function get_preview_size() and gimp_viewable_calc_preview_size(). * 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: added get_preview_size() implementations. * app/widgets/gimpbufferpreview.c * app/widgets/gimpdrawablepreview.c * app/widgets/gimpgradientpreview.c * app/widgets/gimpimagepreview.c * app/widgets/gimppalettepreview.c * app/widgets/gimpselectioneditor.c * app/widgets/gimpundopreview.c * app/display/gimpnavigationview.c: changed accordingly, removed get_size() implementations. * app/widgets/widgets-types.h: changed the first param of GimpItemGetNameFunc from GtkWidget to GObject. * app/widgets/gimpcontainerview-utils.c: accept a GimpViewable as object in the built-in get_name funcs. * app/widgets/gimpcomponentlistitem.c * app/widgets/gimpcontainergridview.c * app/widgets/gimplistitem.c * app/widgets/gimpmenuitem.c: changed accordingly.
2003-02-22 03:03:19 +08:00
}
static void
gimp_container_tree_view_set_preview_size (GimpContainerView *view)
{
GimpContainerTreeView *tree_view;
GtkTreeModel *tree_model;
GtkTreeIter iter;
gboolean iter_valid;
Started migration from GtkList to GtkTreeView: 2003-02-21 Michael Natterer <mitch@gimp.org> Started migration from GtkList to GtkTreeView: * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpcontainertreeview.[ch]; new GimpContainerView subclass using GtkListStore/GtkTreeView. * app/widgets/widgets-enums.h: added GIMP_VIEW_TYPE_TREE to thje GimpViewType enum. * app/widgets/gimpcontainereditor.c: added GimpContainerTreeView to the switch() which selects the view type. * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.[ch] * app/gui/dialogs-menu.c * app/gui/dialogs.c: added tree view versions of many dialogs. * app/widgets/gimppreview.[ch]: removed the get_size() virtual function and gimp_preview_calc_size(). * app/core/gimpviewable.[ch]: added virtual function get_preview_size() and gimp_viewable_calc_preview_size(). * 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: added get_preview_size() implementations. * app/widgets/gimpbufferpreview.c * app/widgets/gimpdrawablepreview.c * app/widgets/gimpgradientpreview.c * app/widgets/gimpimagepreview.c * app/widgets/gimppalettepreview.c * app/widgets/gimpselectioneditor.c * app/widgets/gimpundopreview.c * app/display/gimpnavigationview.c: changed accordingly, removed get_size() implementations. * app/widgets/widgets-types.h: changed the first param of GimpItemGetNameFunc from GtkWidget to GObject. * app/widgets/gimpcontainerview-utils.c: accept a GimpViewable as object in the built-in get_name funcs. * app/widgets/gimpcomponentlistitem.c * app/widgets/gimpcontainergridview.c * app/widgets/gimplistitem.c * app/widgets/gimpmenuitem.c: changed accordingly.
2003-02-22 03:03:19 +08:00
tree_view = GIMP_CONTAINER_TREE_VIEW (view);
tree_model = GTK_TREE_MODEL (tree_view->list);
for (iter_valid = gtk_tree_model_get_iter_first (tree_model, &iter);
iter_valid;
iter_valid = gtk_tree_model_iter_next (tree_model, &iter))
Started migration from GtkList to GtkTreeView: 2003-02-21 Michael Natterer <mitch@gimp.org> Started migration from GtkList to GtkTreeView: * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpcontainertreeview.[ch]; new GimpContainerView subclass using GtkListStore/GtkTreeView. * app/widgets/widgets-enums.h: added GIMP_VIEW_TYPE_TREE to thje GimpViewType enum. * app/widgets/gimpcontainereditor.c: added GimpContainerTreeView to the switch() which selects the view type. * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.[ch] * app/gui/dialogs-menu.c * app/gui/dialogs.c: added tree view versions of many dialogs. * app/widgets/gimppreview.[ch]: removed the get_size() virtual function and gimp_preview_calc_size(). * app/core/gimpviewable.[ch]: added virtual function get_preview_size() and gimp_viewable_calc_preview_size(). * 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: added get_preview_size() implementations. * app/widgets/gimpbufferpreview.c * app/widgets/gimpdrawablepreview.c * app/widgets/gimpgradientpreview.c * app/widgets/gimpimagepreview.c * app/widgets/gimppalettepreview.c * app/widgets/gimpselectioneditor.c * app/widgets/gimpundopreview.c * app/display/gimpnavigationview.c: changed accordingly, removed get_size() implementations. * app/widgets/widgets-types.h: changed the first param of GimpItemGetNameFunc from GtkWidget to GObject. * app/widgets/gimpcontainerview-utils.c: accept a GimpViewable as object in the built-in get_name funcs. * app/widgets/gimpcomponentlistitem.c * app/widgets/gimpcontainergridview.c * app/widgets/gimplistitem.c * app/widgets/gimpmenuitem.c: changed accordingly.
2003-02-22 03:03:19 +08:00
{
GimpPreviewRenderer *renderer;
don't scale the preview up if the buffer is too small. 2003-03-01 Michael Natterer <mitch@gimp.org> * app/core/gimpbuffer.c: don't scale the preview up if the buffer is too small. * app/core/gimppattern.c: don't add a white border around the preview if the pattern is too small. * app/widgets/gimppreviewrenderer.[ch]: new object. A buffer that updates itself on GimpViewable changes and can render itself to any widget. Basically GimpPreview reduced to the render and draw code. * app/widgets/gimppreview.[ch]: removed all rendering and drawing code and keep a GimpPreviewRenderer instance. Connect to its "update" signal for queuing draws on the preview. * app/widgets/gimpcellrendererviewable.[ch] * app/widgets/gimpcontainertreeview.c: same here: removed rendering and drawing code and keep GimpPreviewRenderers in the list store. Delays preview creation for GtkTreeViews until the buffer is really needed for drawing and adds idle preview updating on viewable changes. * app/widgets/gimppreview-utils.[ch] * app/widgets/gimpbrushpreview.[ch] * app/widgets/gimpbufferpreview.[ch] * app/widgets/gimpdrawablepreview.[ch] * app/widgets/gimpimagepreview.[ch]: removed... * app/widgets/gimppreviewrenderer-utils.[ch] * app/widgets/gimppreviewrendererbrush.[ch] * app/widgets/gimppreviewrendererdrawable.[ch] * app/widgets/gimppreviewrendererimage.[ch]: ...and converted to GimpPreviewRenderer subclasses. * app/display/gimpnavigationview.c * app/gui/palette-import-dialog.c * app/widgets/Makefile.am * app/widgets/widgets-enums.h * app/widgets/widgets-types.h * app/widgets/gimpchannellistview.c * app/widgets/gimpcomponentlistitem.c * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainermenuimpl.c * app/widgets/gimplayerlistitem.c * app/widgets/gimplistitem.c * app/widgets/gimpnavigationpreview.[ch] * app/widgets/gimpselectioneditor.c * app/widgets/gimpvectorslistview.c: changed accordingly.
2003-03-01 11:53:41 +08:00
gtk_tree_model_get (GTK_TREE_MODEL (tree_view->list), &iter,
COLUMN_RENDERER, &renderer,
-1);
don't scale the preview up if the buffer is too small. 2003-03-01 Michael Natterer <mitch@gimp.org> * app/core/gimpbuffer.c: don't scale the preview up if the buffer is too small. * app/core/gimppattern.c: don't add a white border around the preview if the pattern is too small. * app/widgets/gimppreviewrenderer.[ch]: new object. A buffer that updates itself on GimpViewable changes and can render itself to any widget. Basically GimpPreview reduced to the render and draw code. * app/widgets/gimppreview.[ch]: removed all rendering and drawing code and keep a GimpPreviewRenderer instance. Connect to its "update" signal for queuing draws on the preview. * app/widgets/gimpcellrendererviewable.[ch] * app/widgets/gimpcontainertreeview.c: same here: removed rendering and drawing code and keep GimpPreviewRenderers in the list store. Delays preview creation for GtkTreeViews until the buffer is really needed for drawing and adds idle preview updating on viewable changes. * app/widgets/gimppreview-utils.[ch] * app/widgets/gimpbrushpreview.[ch] * app/widgets/gimpbufferpreview.[ch] * app/widgets/gimpdrawablepreview.[ch] * app/widgets/gimpimagepreview.[ch]: removed... * app/widgets/gimppreviewrenderer-utils.[ch] * app/widgets/gimppreviewrendererbrush.[ch] * app/widgets/gimppreviewrendererdrawable.[ch] * app/widgets/gimppreviewrendererimage.[ch]: ...and converted to GimpPreviewRenderer subclasses. * app/display/gimpnavigationview.c * app/gui/palette-import-dialog.c * app/widgets/Makefile.am * app/widgets/widgets-enums.h * app/widgets/widgets-types.h * app/widgets/gimpchannellistview.c * app/widgets/gimpcomponentlistitem.c * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainermenuimpl.c * app/widgets/gimplayerlistitem.c * app/widgets/gimplistitem.c * app/widgets/gimpnavigationpreview.[ch] * app/widgets/gimpselectioneditor.c * app/widgets/gimpvectorslistview.c: changed accordingly.
2003-03-01 11:53:41 +08:00
gimp_preview_renderer_set_size (renderer, view->preview_size, 1);
don't scale the preview up if the buffer is too small. 2003-03-01 Michael Natterer <mitch@gimp.org> * app/core/gimpbuffer.c: don't scale the preview up if the buffer is too small. * app/core/gimppattern.c: don't add a white border around the preview if the pattern is too small. * app/widgets/gimppreviewrenderer.[ch]: new object. A buffer that updates itself on GimpViewable changes and can render itself to any widget. Basically GimpPreview reduced to the render and draw code. * app/widgets/gimppreview.[ch]: removed all rendering and drawing code and keep a GimpPreviewRenderer instance. Connect to its "update" signal for queuing draws on the preview. * app/widgets/gimpcellrendererviewable.[ch] * app/widgets/gimpcontainertreeview.c: same here: removed rendering and drawing code and keep GimpPreviewRenderers in the list store. Delays preview creation for GtkTreeViews until the buffer is really needed for drawing and adds idle preview updating on viewable changes. * app/widgets/gimppreview-utils.[ch] * app/widgets/gimpbrushpreview.[ch] * app/widgets/gimpbufferpreview.[ch] * app/widgets/gimpdrawablepreview.[ch] * app/widgets/gimpimagepreview.[ch]: removed... * app/widgets/gimppreviewrenderer-utils.[ch] * app/widgets/gimppreviewrendererbrush.[ch] * app/widgets/gimppreviewrendererdrawable.[ch] * app/widgets/gimppreviewrendererimage.[ch]: ...and converted to GimpPreviewRenderer subclasses. * app/display/gimpnavigationview.c * app/gui/palette-import-dialog.c * app/widgets/Makefile.am * app/widgets/widgets-enums.h * app/widgets/widgets-types.h * app/widgets/gimpchannellistview.c * app/widgets/gimpcomponentlistitem.c * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainermenuimpl.c * app/widgets/gimplayerlistitem.c * app/widgets/gimplistitem.c * app/widgets/gimpnavigationpreview.[ch] * app/widgets/gimpselectioneditor.c * app/widgets/gimpvectorslistview.c: changed accordingly.
2003-03-01 11:53:41 +08:00
gtk_list_store_set (tree_view->list, &iter,
COLUMN_RENDERER, renderer,
-1);
don't scale the preview up if the buffer is too small. 2003-03-01 Michael Natterer <mitch@gimp.org> * app/core/gimpbuffer.c: don't scale the preview up if the buffer is too small. * app/core/gimppattern.c: don't add a white border around the preview if the pattern is too small. * app/widgets/gimppreviewrenderer.[ch]: new object. A buffer that updates itself on GimpViewable changes and can render itself to any widget. Basically GimpPreview reduced to the render and draw code. * app/widgets/gimppreview.[ch]: removed all rendering and drawing code and keep a GimpPreviewRenderer instance. Connect to its "update" signal for queuing draws on the preview. * app/widgets/gimpcellrendererviewable.[ch] * app/widgets/gimpcontainertreeview.c: same here: removed rendering and drawing code and keep GimpPreviewRenderers in the list store. Delays preview creation for GtkTreeViews until the buffer is really needed for drawing and adds idle preview updating on viewable changes. * app/widgets/gimppreview-utils.[ch] * app/widgets/gimpbrushpreview.[ch] * app/widgets/gimpbufferpreview.[ch] * app/widgets/gimpdrawablepreview.[ch] * app/widgets/gimpimagepreview.[ch]: removed... * app/widgets/gimppreviewrenderer-utils.[ch] * app/widgets/gimppreviewrendererbrush.[ch] * app/widgets/gimppreviewrendererdrawable.[ch] * app/widgets/gimppreviewrendererimage.[ch]: ...and converted to GimpPreviewRenderer subclasses. * app/display/gimpnavigationview.c * app/gui/palette-import-dialog.c * app/widgets/Makefile.am * app/widgets/widgets-enums.h * app/widgets/widgets-types.h * app/widgets/gimpchannellistview.c * app/widgets/gimpcomponentlistitem.c * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainermenuimpl.c * app/widgets/gimplayerlistitem.c * app/widgets/gimplistitem.c * app/widgets/gimpnavigationpreview.[ch] * app/widgets/gimpselectioneditor.c * app/widgets/gimpvectorslistview.c: changed accordingly.
2003-03-01 11:53:41 +08:00
g_object_unref (renderer);
Started migration from GtkList to GtkTreeView: 2003-02-21 Michael Natterer <mitch@gimp.org> Started migration from GtkList to GtkTreeView: * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpcontainertreeview.[ch]; new GimpContainerView subclass using GtkListStore/GtkTreeView. * app/widgets/widgets-enums.h: added GIMP_VIEW_TYPE_TREE to thje GimpViewType enum. * app/widgets/gimpcontainereditor.c: added GimpContainerTreeView to the switch() which selects the view type. * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.[ch] * app/gui/dialogs-menu.c * app/gui/dialogs.c: added tree view versions of many dialogs. * app/widgets/gimppreview.[ch]: removed the get_size() virtual function and gimp_preview_calc_size(). * app/core/gimpviewable.[ch]: added virtual function get_preview_size() and gimp_viewable_calc_preview_size(). * 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: added get_preview_size() implementations. * app/widgets/gimpbufferpreview.c * app/widgets/gimpdrawablepreview.c * app/widgets/gimpgradientpreview.c * app/widgets/gimpimagepreview.c * app/widgets/gimppalettepreview.c * app/widgets/gimpselectioneditor.c * app/widgets/gimpundopreview.c * app/display/gimpnavigationview.c: changed accordingly, removed get_size() implementations. * app/widgets/widgets-types.h: changed the first param of GimpItemGetNameFunc from GtkWidget to GObject. * app/widgets/gimpcontainerview-utils.c: accept a GimpViewable as object in the built-in get_name funcs. * app/widgets/gimpcomponentlistitem.c * app/widgets/gimpcontainergridview.c * app/widgets/gimplistitem.c * app/widgets/gimpmenuitem.c: changed accordingly.
2003-02-22 03:03:19 +08:00
}
}
/* callbacks */
static void
gimp_container_tree_view_selection_changed (GtkTreeSelection *selection,
GimpContainerTreeView *tree_view)
{
GimpViewable *selected_viewable = NULL;
GtkTreeIter selected_iter;
gboolean selected;
selected = gtk_tree_selection_get_selected (selection, NULL, &selected_iter);
if (selected)
gtk_tree_model_get (GTK_TREE_MODEL (tree_view->list), &selected_iter,
COLUMN_VIEWABLE, &selected_viewable,
-1);
if (selected_viewable)
{
gimp_container_view_item_selected (GIMP_CONTAINER_VIEW (tree_view),
selected_viewable);
g_object_unref (selected_viewable);
}
}
static gboolean
gimp_container_tree_view_button_press (GtkWidget *widget,
GdkEventButton *bevent,
GimpContainerTreeView *tree_view)
{
GtkTreePath *path;
gboolean retval = FALSE;
tree_view->dnd_viewable = NULL;
if (gtk_tree_view_get_path_at_pos (GTK_TREE_VIEW (widget),
bevent->x,
bevent->y,
&path, NULL, NULL, NULL))
Started migration from GtkList to GtkTreeView: 2003-02-21 Michael Natterer <mitch@gimp.org> Started migration from GtkList to GtkTreeView: * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpcontainertreeview.[ch]; new GimpContainerView subclass using GtkListStore/GtkTreeView. * app/widgets/widgets-enums.h: added GIMP_VIEW_TYPE_TREE to thje GimpViewType enum. * app/widgets/gimpcontainereditor.c: added GimpContainerTreeView to the switch() which selects the view type. * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.[ch] * app/gui/dialogs-menu.c * app/gui/dialogs.c: added tree view versions of many dialogs. * app/widgets/gimppreview.[ch]: removed the get_size() virtual function and gimp_preview_calc_size(). * app/core/gimpviewable.[ch]: added virtual function get_preview_size() and gimp_viewable_calc_preview_size(). * 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: added get_preview_size() implementations. * app/widgets/gimpbufferpreview.c * app/widgets/gimpdrawablepreview.c * app/widgets/gimpgradientpreview.c * app/widgets/gimpimagepreview.c * app/widgets/gimppalettepreview.c * app/widgets/gimpselectioneditor.c * app/widgets/gimpundopreview.c * app/display/gimpnavigationview.c: changed accordingly, removed get_size() implementations. * app/widgets/widgets-types.h: changed the first param of GimpItemGetNameFunc from GtkWidget to GObject. * app/widgets/gimpcontainerview-utils.c: accept a GimpViewable as object in the built-in get_name funcs. * app/widgets/gimpcomponentlistitem.c * app/widgets/gimpcontainergridview.c * app/widgets/gimplistitem.c * app/widgets/gimpmenuitem.c: changed accordingly.
2003-02-22 03:03:19 +08:00
{
GimpViewable *viewable;
GtkTreeIter iter;
Started migration from GtkList to GtkTreeView: 2003-02-21 Michael Natterer <mitch@gimp.org> Started migration from GtkList to GtkTreeView: * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpcontainertreeview.[ch]; new GimpContainerView subclass using GtkListStore/GtkTreeView. * app/widgets/widgets-enums.h: added GIMP_VIEW_TYPE_TREE to thje GimpViewType enum. * app/widgets/gimpcontainereditor.c: added GimpContainerTreeView to the switch() which selects the view type. * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.[ch] * app/gui/dialogs-menu.c * app/gui/dialogs.c: added tree view versions of many dialogs. * app/widgets/gimppreview.[ch]: removed the get_size() virtual function and gimp_preview_calc_size(). * app/core/gimpviewable.[ch]: added virtual function get_preview_size() and gimp_viewable_calc_preview_size(). * 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: added get_preview_size() implementations. * app/widgets/gimpbufferpreview.c * app/widgets/gimpdrawablepreview.c * app/widgets/gimpgradientpreview.c * app/widgets/gimpimagepreview.c * app/widgets/gimppalettepreview.c * app/widgets/gimpselectioneditor.c * app/widgets/gimpundopreview.c * app/display/gimpnavigationview.c: changed accordingly, removed get_size() implementations. * app/widgets/widgets-types.h: changed the first param of GimpItemGetNameFunc from GtkWidget to GObject. * app/widgets/gimpcontainerview-utils.c: accept a GimpViewable as object in the built-in get_name funcs. * app/widgets/gimpcomponentlistitem.c * app/widgets/gimpcontainergridview.c * app/widgets/gimplistitem.c * app/widgets/gimpmenuitem.c: changed accordingly.
2003-02-22 03:03:19 +08:00
gtk_tree_model_get_iter (GTK_TREE_MODEL (tree_view->list), &iter, path);
Started migration from GtkList to GtkTreeView: 2003-02-21 Michael Natterer <mitch@gimp.org> Started migration from GtkList to GtkTreeView: * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpcontainertreeview.[ch]; new GimpContainerView subclass using GtkListStore/GtkTreeView. * app/widgets/widgets-enums.h: added GIMP_VIEW_TYPE_TREE to thje GimpViewType enum. * app/widgets/gimpcontainereditor.c: added GimpContainerTreeView to the switch() which selects the view type. * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.[ch] * app/gui/dialogs-menu.c * app/gui/dialogs.c: added tree view versions of many dialogs. * app/widgets/gimppreview.[ch]: removed the get_size() virtual function and gimp_preview_calc_size(). * app/core/gimpviewable.[ch]: added virtual function get_preview_size() and gimp_viewable_calc_preview_size(). * 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: added get_preview_size() implementations. * app/widgets/gimpbufferpreview.c * app/widgets/gimpdrawablepreview.c * app/widgets/gimpgradientpreview.c * app/widgets/gimpimagepreview.c * app/widgets/gimppalettepreview.c * app/widgets/gimpselectioneditor.c * app/widgets/gimpundopreview.c * app/display/gimpnavigationview.c: changed accordingly, removed get_size() implementations. * app/widgets/widgets-types.h: changed the first param of GimpItemGetNameFunc from GtkWidget to GObject. * app/widgets/gimpcontainerview-utils.c: accept a GimpViewable as object in the built-in get_name funcs. * app/widgets/gimpcomponentlistitem.c * app/widgets/gimpcontainergridview.c * app/widgets/gimplistitem.c * app/widgets/gimpmenuitem.c: changed accordingly.
2003-02-22 03:03:19 +08:00
gtk_tree_path_free (path);
Started migration from GtkList to GtkTreeView: 2003-02-21 Michael Natterer <mitch@gimp.org> Started migration from GtkList to GtkTreeView: * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpcontainertreeview.[ch]; new GimpContainerView subclass using GtkListStore/GtkTreeView. * app/widgets/widgets-enums.h: added GIMP_VIEW_TYPE_TREE to thje GimpViewType enum. * app/widgets/gimpcontainereditor.c: added GimpContainerTreeView to the switch() which selects the view type. * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.[ch] * app/gui/dialogs-menu.c * app/gui/dialogs.c: added tree view versions of many dialogs. * app/widgets/gimppreview.[ch]: removed the get_size() virtual function and gimp_preview_calc_size(). * app/core/gimpviewable.[ch]: added virtual function get_preview_size() and gimp_viewable_calc_preview_size(). * 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: added get_preview_size() implementations. * app/widgets/gimpbufferpreview.c * app/widgets/gimpdrawablepreview.c * app/widgets/gimpgradientpreview.c * app/widgets/gimpimagepreview.c * app/widgets/gimppalettepreview.c * app/widgets/gimpselectioneditor.c * app/widgets/gimpundopreview.c * app/display/gimpnavigationview.c: changed accordingly, removed get_size() implementations. * app/widgets/widgets-types.h: changed the first param of GimpItemGetNameFunc from GtkWidget to GObject. * app/widgets/gimpcontainerview-utils.c: accept a GimpViewable as object in the built-in get_name funcs. * app/widgets/gimpcomponentlistitem.c * app/widgets/gimpcontainergridview.c * app/widgets/gimplistitem.c * app/widgets/gimpmenuitem.c: changed accordingly.
2003-02-22 03:03:19 +08:00
gtk_tree_model_get (GTK_TREE_MODEL (tree_view->list), &iter,
COLUMN_VIEWABLE, &viewable,
-1);
Started migration from GtkList to GtkTreeView: 2003-02-21 Michael Natterer <mitch@gimp.org> Started migration from GtkList to GtkTreeView: * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpcontainertreeview.[ch]; new GimpContainerView subclass using GtkListStore/GtkTreeView. * app/widgets/widgets-enums.h: added GIMP_VIEW_TYPE_TREE to thje GimpViewType enum. * app/widgets/gimpcontainereditor.c: added GimpContainerTreeView to the switch() which selects the view type. * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.[ch] * app/gui/dialogs-menu.c * app/gui/dialogs.c: added tree view versions of many dialogs. * app/widgets/gimppreview.[ch]: removed the get_size() virtual function and gimp_preview_calc_size(). * app/core/gimpviewable.[ch]: added virtual function get_preview_size() and gimp_viewable_calc_preview_size(). * 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: added get_preview_size() implementations. * app/widgets/gimpbufferpreview.c * app/widgets/gimpdrawablepreview.c * app/widgets/gimpgradientpreview.c * app/widgets/gimpimagepreview.c * app/widgets/gimppalettepreview.c * app/widgets/gimpselectioneditor.c * app/widgets/gimpundopreview.c * app/display/gimpnavigationview.c: changed accordingly, removed get_size() implementations. * app/widgets/widgets-types.h: changed the first param of GimpItemGetNameFunc from GtkWidget to GObject. * app/widgets/gimpcontainerview-utils.c: accept a GimpViewable as object in the built-in get_name funcs. * app/widgets/gimpcomponentlistitem.c * app/widgets/gimpcontainergridview.c * app/widgets/gimplistitem.c * app/widgets/gimpmenuitem.c: changed accordingly.
2003-02-22 03:03:19 +08:00
tree_view->dnd_viewable = viewable;
Started migration from GtkList to GtkTreeView: 2003-02-21 Michael Natterer <mitch@gimp.org> Started migration from GtkList to GtkTreeView: * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpcontainertreeview.[ch]; new GimpContainerView subclass using GtkListStore/GtkTreeView. * app/widgets/widgets-enums.h: added GIMP_VIEW_TYPE_TREE to thje GimpViewType enum. * app/widgets/gimpcontainereditor.c: added GimpContainerTreeView to the switch() which selects the view type. * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.[ch] * app/gui/dialogs-menu.c * app/gui/dialogs.c: added tree view versions of many dialogs. * app/widgets/gimppreview.[ch]: removed the get_size() virtual function and gimp_preview_calc_size(). * app/core/gimpviewable.[ch]: added virtual function get_preview_size() and gimp_viewable_calc_preview_size(). * 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: added get_preview_size() implementations. * app/widgets/gimpbufferpreview.c * app/widgets/gimpdrawablepreview.c * app/widgets/gimpgradientpreview.c * app/widgets/gimpimagepreview.c * app/widgets/gimppalettepreview.c * app/widgets/gimpselectioneditor.c * app/widgets/gimpundopreview.c * app/display/gimpnavigationview.c: changed accordingly, removed get_size() implementations. * app/widgets/widgets-types.h: changed the first param of GimpItemGetNameFunc from GtkWidget to GObject. * app/widgets/gimpcontainerview-utils.c: accept a GimpViewable as object in the built-in get_name funcs. * app/widgets/gimpcomponentlistitem.c * app/widgets/gimpcontainergridview.c * app/widgets/gimplistitem.c * app/widgets/gimpmenuitem.c: changed accordingly.
2003-02-22 03:03:19 +08:00
switch (bevent->button)
{
case 1:
if (bevent->type == GDK_2BUTTON_PRESS)
themes/Default/images/stock-delete-16.png 2003-03-06 Michael Natterer <mitch@gimp.org> * themes/Default/images/stock-delete-16.png * themes/Default/images/stock-lower-16.png * themes/Default/images/stock-new-16.png * themes/Default/images/stock-paste-16.png * themes/Default/images/stock-raise-16.png * themes/Default/images/stock-refresh-16.png: removed these files since we use the icons provided by GTK+ now. * themes/Default/gtkrc * themes/Default/images/Makefile.am: removed them here hoo. * libgimpwidgets/gimpstock.[ch]: reordered stuff to be consistent in the header and the .c file. Added GIMP_STOCK_ERROR and GIMP_STOCK_QUESTION which are available in all sizes (unlike GTK_STOCK_DIALOG_ERROR and GTK_STOCK_DIALOG_QUESTION). * app/core/gimpviewable.c * app/display/gimpdisplayshell.c * app/gui/file-commands.c * app/gui/file-new-dialog.c * app/gui/file-save-dialog.c * app/widgets/gimpwidgets-utils.c * app/widgets/gimpdatafactoryview.c: use the new stock IDs. * app/config/gimpcoreconfig.[ch]: renamed "preview_size" to "layer_preview_size" and added "gboolean layer_previews" which switches layer previews on/off independent of their size. * app/config/gimprc-blurbs.h: added/changed their blurbs. * app/core/core-enums.[ch]: removed GIMP_PREVIEW_SIZE_NONE. * app/core/gimpdrawable-preview.c * app/core/gimpdrawable.c * app/core/gimpimage.c: return NULL previews if core_config->layer_previews is FALSE. Invalidate all layer/channel previews whenever "layer_previews" changes. * app/widgets/gimppreviewrendererdrawable.c * app/widgets/gimppreviewrendererimage.c: render the stock_id if the drawable/image returns a NULL preview. Fixes bug #107242. * app/display/gimpdisplayshell-handlers.c: don't set the sensitivity of the navigation button because it can no longer be disabled. * app/display/gimpdisplayshell-layer-select.c * app/gui/dialogs-constructors.c * app/gui/dialogs.c * app/gui/paths-dialog.c: changed accordingly. * app/gui/preferences-dialog.c: added a toggle button for the new "layer_previews" boolean. * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainerlistview.c: chain up unconditionally in GimpContainerView::clear_items(). * app/widgets/gimpcontainertreeview.c: ditto. Made the reorder() implementation lengthy and eeky (but working) again... Stop signal emission on double clicks so GtkTreeView doesn't re-select the item we are about change. * app/widgets/gimpcontainerview.c (gimp_container_view_real_clear_items): need to use g_hash_table_new_full() here too or everything will b0rk. * app/widgets/gimppreviewrenderer.c (gimp_preview_renderer_default_render_stock): use gtk_widget_render_icon() instead of gtk_icon_set_render_icon(). * tools/pdbgen/enums.pl: this file wanted to be regenerated...
2003-03-07 00:47:34 +08:00
{
gimp_container_view_item_activated (GIMP_CONTAINER_VIEW (tree_view),
viewable);
retval = TRUE;
}
break;
Started migration from GtkList to GtkTreeView: 2003-02-21 Michael Natterer <mitch@gimp.org> Started migration from GtkList to GtkTreeView: * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpcontainertreeview.[ch]; new GimpContainerView subclass using GtkListStore/GtkTreeView. * app/widgets/widgets-enums.h: added GIMP_VIEW_TYPE_TREE to thje GimpViewType enum. * app/widgets/gimpcontainereditor.c: added GimpContainerTreeView to the switch() which selects the view type. * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.[ch] * app/gui/dialogs-menu.c * app/gui/dialogs.c: added tree view versions of many dialogs. * app/widgets/gimppreview.[ch]: removed the get_size() virtual function and gimp_preview_calc_size(). * app/core/gimpviewable.[ch]: added virtual function get_preview_size() and gimp_viewable_calc_preview_size(). * 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: added get_preview_size() implementations. * app/widgets/gimpbufferpreview.c * app/widgets/gimpdrawablepreview.c * app/widgets/gimpgradientpreview.c * app/widgets/gimpimagepreview.c * app/widgets/gimppalettepreview.c * app/widgets/gimpselectioneditor.c * app/widgets/gimpundopreview.c * app/display/gimpnavigationview.c: changed accordingly, removed get_size() implementations. * app/widgets/widgets-types.h: changed the first param of GimpItemGetNameFunc from GtkWidget to GObject. * app/widgets/gimpcontainerview-utils.c: accept a GimpViewable as object in the built-in get_name funcs. * app/widgets/gimpcomponentlistitem.c * app/widgets/gimpcontainergridview.c * app/widgets/gimplistitem.c * app/widgets/gimpmenuitem.c: changed accordingly.
2003-02-22 03:03:19 +08:00
case 2:
retval = TRUE; /* we want to button2-drag without selecting */
break;
case 3:
gimp_container_view_item_context (GIMP_CONTAINER_VIEW (tree_view),
viewable);
break;
default:
break;
Started migration from GtkList to GtkTreeView: 2003-02-21 Michael Natterer <mitch@gimp.org> Started migration from GtkList to GtkTreeView: * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpcontainertreeview.[ch]; new GimpContainerView subclass using GtkListStore/GtkTreeView. * app/widgets/widgets-enums.h: added GIMP_VIEW_TYPE_TREE to thje GimpViewType enum. * app/widgets/gimpcontainereditor.c: added GimpContainerTreeView to the switch() which selects the view type. * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.[ch] * app/gui/dialogs-menu.c * app/gui/dialogs.c: added tree view versions of many dialogs. * app/widgets/gimppreview.[ch]: removed the get_size() virtual function and gimp_preview_calc_size(). * app/core/gimpviewable.[ch]: added virtual function get_preview_size() and gimp_viewable_calc_preview_size(). * 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: added get_preview_size() implementations. * app/widgets/gimpbufferpreview.c * app/widgets/gimpdrawablepreview.c * app/widgets/gimpgradientpreview.c * app/widgets/gimpimagepreview.c * app/widgets/gimppalettepreview.c * app/widgets/gimpselectioneditor.c * app/widgets/gimpundopreview.c * app/display/gimpnavigationview.c: changed accordingly, removed get_size() implementations. * app/widgets/widgets-types.h: changed the first param of GimpItemGetNameFunc from GtkWidget to GObject. * app/widgets/gimpcontainerview-utils.c: accept a GimpViewable as object in the built-in get_name funcs. * app/widgets/gimpcomponentlistitem.c * app/widgets/gimpcontainergridview.c * app/widgets/gimplistitem.c * app/widgets/gimpmenuitem.c: changed accordingly.
2003-02-22 03:03:19 +08:00
}
g_object_unref (viewable);
Started migration from GtkList to GtkTreeView: 2003-02-21 Michael Natterer <mitch@gimp.org> Started migration from GtkList to GtkTreeView: * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpcontainertreeview.[ch]; new GimpContainerView subclass using GtkListStore/GtkTreeView. * app/widgets/widgets-enums.h: added GIMP_VIEW_TYPE_TREE to thje GimpViewType enum. * app/widgets/gimpcontainereditor.c: added GimpContainerTreeView to the switch() which selects the view type. * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.[ch] * app/gui/dialogs-menu.c * app/gui/dialogs.c: added tree view versions of many dialogs. * app/widgets/gimppreview.[ch]: removed the get_size() virtual function and gimp_preview_calc_size(). * app/core/gimpviewable.[ch]: added virtual function get_preview_size() and gimp_viewable_calc_preview_size(). * 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: added get_preview_size() implementations. * app/widgets/gimpbufferpreview.c * app/widgets/gimpdrawablepreview.c * app/widgets/gimpgradientpreview.c * app/widgets/gimpimagepreview.c * app/widgets/gimppalettepreview.c * app/widgets/gimpselectioneditor.c * app/widgets/gimpundopreview.c * app/display/gimpnavigationview.c: changed accordingly, removed get_size() implementations. * app/widgets/widgets-types.h: changed the first param of GimpItemGetNameFunc from GtkWidget to GObject. * app/widgets/gimpcontainerview-utils.c: accept a GimpViewable as object in the built-in get_name funcs. * app/widgets/gimpcomponentlistitem.c * app/widgets/gimpcontainergridview.c * app/widgets/gimplistitem.c * app/widgets/gimpmenuitem.c: changed accordingly.
2003-02-22 03:03:19 +08:00
}
return retval;
Started migration from GtkList to GtkTreeView: 2003-02-21 Michael Natterer <mitch@gimp.org> Started migration from GtkList to GtkTreeView: * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpcontainertreeview.[ch]; new GimpContainerView subclass using GtkListStore/GtkTreeView. * app/widgets/widgets-enums.h: added GIMP_VIEW_TYPE_TREE to thje GimpViewType enum. * app/widgets/gimpcontainereditor.c: added GimpContainerTreeView to the switch() which selects the view type. * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.[ch] * app/gui/dialogs-menu.c * app/gui/dialogs.c: added tree view versions of many dialogs. * app/widgets/gimppreview.[ch]: removed the get_size() virtual function and gimp_preview_calc_size(). * app/core/gimpviewable.[ch]: added virtual function get_preview_size() and gimp_viewable_calc_preview_size(). * 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: added get_preview_size() implementations. * app/widgets/gimpbufferpreview.c * app/widgets/gimpdrawablepreview.c * app/widgets/gimpgradientpreview.c * app/widgets/gimpimagepreview.c * app/widgets/gimppalettepreview.c * app/widgets/gimpselectioneditor.c * app/widgets/gimpundopreview.c * app/display/gimpnavigationview.c: changed accordingly, removed get_size() implementations. * app/widgets/widgets-types.h: changed the first param of GimpItemGetNameFunc from GtkWidget to GObject. * app/widgets/gimpcontainerview-utils.c: accept a GimpViewable as object in the built-in get_name funcs. * app/widgets/gimpcomponentlistitem.c * app/widgets/gimpcontainergridview.c * app/widgets/gimplistitem.c * app/widgets/gimpmenuitem.c: changed accordingly.
2003-02-22 03:03:19 +08:00
}
static void
don't scale the preview up if the buffer is too small. 2003-03-01 Michael Natterer <mitch@gimp.org> * app/core/gimpbuffer.c: don't scale the preview up if the buffer is too small. * app/core/gimppattern.c: don't add a white border around the preview if the pattern is too small. * app/widgets/gimppreviewrenderer.[ch]: new object. A buffer that updates itself on GimpViewable changes and can render itself to any widget. Basically GimpPreview reduced to the render and draw code. * app/widgets/gimppreview.[ch]: removed all rendering and drawing code and keep a GimpPreviewRenderer instance. Connect to its "update" signal for queuing draws on the preview. * app/widgets/gimpcellrendererviewable.[ch] * app/widgets/gimpcontainertreeview.c: same here: removed rendering and drawing code and keep GimpPreviewRenderers in the list store. Delays preview creation for GtkTreeViews until the buffer is really needed for drawing and adds idle preview updating on viewable changes. * app/widgets/gimppreview-utils.[ch] * app/widgets/gimpbrushpreview.[ch] * app/widgets/gimpbufferpreview.[ch] * app/widgets/gimpdrawablepreview.[ch] * app/widgets/gimpimagepreview.[ch]: removed... * app/widgets/gimppreviewrenderer-utils.[ch] * app/widgets/gimppreviewrendererbrush.[ch] * app/widgets/gimppreviewrendererdrawable.[ch] * app/widgets/gimppreviewrendererimage.[ch]: ...and converted to GimpPreviewRenderer subclasses. * app/display/gimpnavigationview.c * app/gui/palette-import-dialog.c * app/widgets/Makefile.am * app/widgets/widgets-enums.h * app/widgets/widgets-types.h * app/widgets/gimpchannellistview.c * app/widgets/gimpcomponentlistitem.c * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainermenuimpl.c * app/widgets/gimplayerlistitem.c * app/widgets/gimplistitem.c * app/widgets/gimpnavigationpreview.[ch] * app/widgets/gimpselectioneditor.c * app/widgets/gimpvectorslistview.c: changed accordingly.
2003-03-01 11:53:41 +08:00
gimp_container_tree_view_renderer_update (GimpPreviewRenderer *renderer,
GimpContainerTreeView *tree_view)
Started migration from GtkList to GtkTreeView: 2003-02-21 Michael Natterer <mitch@gimp.org> Started migration from GtkList to GtkTreeView: * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpcontainertreeview.[ch]; new GimpContainerView subclass using GtkListStore/GtkTreeView. * app/widgets/widgets-enums.h: added GIMP_VIEW_TYPE_TREE to thje GimpViewType enum. * app/widgets/gimpcontainereditor.c: added GimpContainerTreeView to the switch() which selects the view type. * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.[ch] * app/gui/dialogs-menu.c * app/gui/dialogs.c: added tree view versions of many dialogs. * app/widgets/gimppreview.[ch]: removed the get_size() virtual function and gimp_preview_calc_size(). * app/core/gimpviewable.[ch]: added virtual function get_preview_size() and gimp_viewable_calc_preview_size(). * 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: added get_preview_size() implementations. * app/widgets/gimpbufferpreview.c * app/widgets/gimpdrawablepreview.c * app/widgets/gimpgradientpreview.c * app/widgets/gimpimagepreview.c * app/widgets/gimppalettepreview.c * app/widgets/gimpselectioneditor.c * app/widgets/gimpundopreview.c * app/display/gimpnavigationview.c: changed accordingly, removed get_size() implementations. * app/widgets/widgets-types.h: changed the first param of GimpItemGetNameFunc from GtkWidget to GObject. * app/widgets/gimpcontainerview-utils.c: accept a GimpViewable as object in the built-in get_name funcs. * app/widgets/gimpcomponentlistitem.c * app/widgets/gimpcontainergridview.c * app/widgets/gimplistitem.c * app/widgets/gimpmenuitem.c: changed accordingly.
2003-02-22 03:03:19 +08:00
{
GimpContainerView *view;
GtkTreeIter *iter;
view = GIMP_CONTAINER_VIEW (tree_view);
don't scale the preview up if the buffer is too small. 2003-03-01 Michael Natterer <mitch@gimp.org> * app/core/gimpbuffer.c: don't scale the preview up if the buffer is too small. * app/core/gimppattern.c: don't add a white border around the preview if the pattern is too small. * app/widgets/gimppreviewrenderer.[ch]: new object. A buffer that updates itself on GimpViewable changes and can render itself to any widget. Basically GimpPreview reduced to the render and draw code. * app/widgets/gimppreview.[ch]: removed all rendering and drawing code and keep a GimpPreviewRenderer instance. Connect to its "update" signal for queuing draws on the preview. * app/widgets/gimpcellrendererviewable.[ch] * app/widgets/gimpcontainertreeview.c: same here: removed rendering and drawing code and keep GimpPreviewRenderers in the list store. Delays preview creation for GtkTreeViews until the buffer is really needed for drawing and adds idle preview updating on viewable changes. * app/widgets/gimppreview-utils.[ch] * app/widgets/gimpbrushpreview.[ch] * app/widgets/gimpbufferpreview.[ch] * app/widgets/gimpdrawablepreview.[ch] * app/widgets/gimpimagepreview.[ch]: removed... * app/widgets/gimppreviewrenderer-utils.[ch] * app/widgets/gimppreviewrendererbrush.[ch] * app/widgets/gimppreviewrendererdrawable.[ch] * app/widgets/gimppreviewrendererimage.[ch]: ...and converted to GimpPreviewRenderer subclasses. * app/display/gimpnavigationview.c * app/gui/palette-import-dialog.c * app/widgets/Makefile.am * app/widgets/widgets-enums.h * app/widgets/widgets-types.h * app/widgets/gimpchannellistview.c * app/widgets/gimpcomponentlistitem.c * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainermenuimpl.c * app/widgets/gimplayerlistitem.c * app/widgets/gimplistitem.c * app/widgets/gimpnavigationpreview.[ch] * app/widgets/gimpselectioneditor.c * app/widgets/gimpvectorslistview.c: changed accordingly.
2003-03-01 11:53:41 +08:00
iter = g_hash_table_lookup (view->hash_table, renderer->viewable);
Started migration from GtkList to GtkTreeView: 2003-02-21 Michael Natterer <mitch@gimp.org> Started migration from GtkList to GtkTreeView: * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpcontainertreeview.[ch]; new GimpContainerView subclass using GtkListStore/GtkTreeView. * app/widgets/widgets-enums.h: added GIMP_VIEW_TYPE_TREE to thje GimpViewType enum. * app/widgets/gimpcontainereditor.c: added GimpContainerTreeView to the switch() which selects the view type. * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.[ch] * app/gui/dialogs-menu.c * app/gui/dialogs.c: added tree view versions of many dialogs. * app/widgets/gimppreview.[ch]: removed the get_size() virtual function and gimp_preview_calc_size(). * app/core/gimpviewable.[ch]: added virtual function get_preview_size() and gimp_viewable_calc_preview_size(). * 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: added get_preview_size() implementations. * app/widgets/gimpbufferpreview.c * app/widgets/gimpdrawablepreview.c * app/widgets/gimpgradientpreview.c * app/widgets/gimpimagepreview.c * app/widgets/gimppalettepreview.c * app/widgets/gimpselectioneditor.c * app/widgets/gimpundopreview.c * app/display/gimpnavigationview.c: changed accordingly, removed get_size() implementations. * app/widgets/widgets-types.h: changed the first param of GimpItemGetNameFunc from GtkWidget to GObject. * app/widgets/gimpcontainerview-utils.c: accept a GimpViewable as object in the built-in get_name funcs. * app/widgets/gimpcomponentlistitem.c * app/widgets/gimpcontainergridview.c * app/widgets/gimplistitem.c * app/widgets/gimpmenuitem.c: changed accordingly.
2003-02-22 03:03:19 +08:00
if (iter)
don't scale the preview up if the buffer is too small. 2003-03-01 Michael Natterer <mitch@gimp.org> * app/core/gimpbuffer.c: don't scale the preview up if the buffer is too small. * app/core/gimppattern.c: don't add a white border around the preview if the pattern is too small. * app/widgets/gimppreviewrenderer.[ch]: new object. A buffer that updates itself on GimpViewable changes and can render itself to any widget. Basically GimpPreview reduced to the render and draw code. * app/widgets/gimppreview.[ch]: removed all rendering and drawing code and keep a GimpPreviewRenderer instance. Connect to its "update" signal for queuing draws on the preview. * app/widgets/gimpcellrendererviewable.[ch] * app/widgets/gimpcontainertreeview.c: same here: removed rendering and drawing code and keep GimpPreviewRenderers in the list store. Delays preview creation for GtkTreeViews until the buffer is really needed for drawing and adds idle preview updating on viewable changes. * app/widgets/gimppreview-utils.[ch] * app/widgets/gimpbrushpreview.[ch] * app/widgets/gimpbufferpreview.[ch] * app/widgets/gimpdrawablepreview.[ch] * app/widgets/gimpimagepreview.[ch]: removed... * app/widgets/gimppreviewrenderer-utils.[ch] * app/widgets/gimppreviewrendererbrush.[ch] * app/widgets/gimppreviewrendererdrawable.[ch] * app/widgets/gimppreviewrendererimage.[ch]: ...and converted to GimpPreviewRenderer subclasses. * app/display/gimpnavigationview.c * app/gui/palette-import-dialog.c * app/widgets/Makefile.am * app/widgets/widgets-enums.h * app/widgets/widgets-types.h * app/widgets/gimpchannellistview.c * app/widgets/gimpcomponentlistitem.c * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainermenuimpl.c * app/widgets/gimplayerlistitem.c * app/widgets/gimplistitem.c * app/widgets/gimpnavigationpreview.[ch] * app/widgets/gimpselectioneditor.c * app/widgets/gimpvectorslistview.c: changed accordingly.
2003-03-01 11:53:41 +08:00
{
GtkTreePath *path;
path = gtk_tree_model_get_path (GTK_TREE_MODEL (tree_view->list), iter);
gtk_tree_model_row_changed (GTK_TREE_MODEL (tree_view->list),
path, iter);
gtk_tree_path_free (path);
}
Started migration from GtkList to GtkTreeView: 2003-02-21 Michael Natterer <mitch@gimp.org> Started migration from GtkList to GtkTreeView: * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpcontainertreeview.[ch]; new GimpContainerView subclass using GtkListStore/GtkTreeView. * app/widgets/widgets-enums.h: added GIMP_VIEW_TYPE_TREE to thje GimpViewType enum. * app/widgets/gimpcontainereditor.c: added GimpContainerTreeView to the switch() which selects the view type. * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.[ch] * app/gui/dialogs-menu.c * app/gui/dialogs.c: added tree view versions of many dialogs. * app/widgets/gimppreview.[ch]: removed the get_size() virtual function and gimp_preview_calc_size(). * app/core/gimpviewable.[ch]: added virtual function get_preview_size() and gimp_viewable_calc_preview_size(). * 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: added get_preview_size() implementations. * app/widgets/gimpbufferpreview.c * app/widgets/gimpdrawablepreview.c * app/widgets/gimpgradientpreview.c * app/widgets/gimpimagepreview.c * app/widgets/gimppalettepreview.c * app/widgets/gimpselectioneditor.c * app/widgets/gimpundopreview.c * app/display/gimpnavigationview.c: changed accordingly, removed get_size() implementations. * app/widgets/widgets-types.h: changed the first param of GimpItemGetNameFunc from GtkWidget to GObject. * app/widgets/gimpcontainerview-utils.c: accept a GimpViewable as object in the built-in get_name funcs. * app/widgets/gimpcomponentlistitem.c * app/widgets/gimpcontainergridview.c * app/widgets/gimplistitem.c * app/widgets/gimpmenuitem.c: changed accordingly.
2003-02-22 03:03:19 +08:00
}
static void
gimp_container_tree_view_name_changed (GimpObject *object,
GimpContainerTreeView *tree_view)
{
GimpContainerView *view;
GtkTreeIter *iter;
view = GIMP_CONTAINER_VIEW (tree_view);
iter = g_hash_table_lookup (view->hash_table, object);
if (iter)
don't scale the preview up if the buffer is too small. 2003-03-01 Michael Natterer <mitch@gimp.org> * app/core/gimpbuffer.c: don't scale the preview up if the buffer is too small. * app/core/gimppattern.c: don't add a white border around the preview if the pattern is too small. * app/widgets/gimppreviewrenderer.[ch]: new object. A buffer that updates itself on GimpViewable changes and can render itself to any widget. Basically GimpPreview reduced to the render and draw code. * app/widgets/gimppreview.[ch]: removed all rendering and drawing code and keep a GimpPreviewRenderer instance. Connect to its "update" signal for queuing draws on the preview. * app/widgets/gimpcellrendererviewable.[ch] * app/widgets/gimpcontainertreeview.c: same here: removed rendering and drawing code and keep GimpPreviewRenderers in the list store. Delays preview creation for GtkTreeViews until the buffer is really needed for drawing and adds idle preview updating on viewable changes. * app/widgets/gimppreview-utils.[ch] * app/widgets/gimpbrushpreview.[ch] * app/widgets/gimpbufferpreview.[ch] * app/widgets/gimpdrawablepreview.[ch] * app/widgets/gimpimagepreview.[ch]: removed... * app/widgets/gimppreviewrenderer-utils.[ch] * app/widgets/gimppreviewrendererbrush.[ch] * app/widgets/gimppreviewrendererdrawable.[ch] * app/widgets/gimppreviewrendererimage.[ch]: ...and converted to GimpPreviewRenderer subclasses. * app/display/gimpnavigationview.c * app/gui/palette-import-dialog.c * app/widgets/Makefile.am * app/widgets/widgets-enums.h * app/widgets/widgets-types.h * app/widgets/gimpchannellistview.c * app/widgets/gimpcomponentlistitem.c * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainermenuimpl.c * app/widgets/gimplayerlistitem.c * app/widgets/gimplistitem.c * app/widgets/gimpnavigationpreview.[ch] * app/widgets/gimpselectioneditor.c * app/widgets/gimpvectorslistview.c: changed accordingly.
2003-03-01 11:53:41 +08:00
{
gchar *name;
if (view->get_name_func)
name = view->get_name_func (G_OBJECT (object), NULL);
else
name = g_strdup (gimp_object_get_name (object));
gtk_list_store_set (tree_view->list, iter,
COLUMN_NAME, name,
-1);
g_free (name);
}
}
Started migration from GtkList to GtkTreeView: 2003-02-21 Michael Natterer <mitch@gimp.org> Started migration from GtkList to GtkTreeView: * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpcontainertreeview.[ch]; new GimpContainerView subclass using GtkListStore/GtkTreeView. * app/widgets/widgets-enums.h: added GIMP_VIEW_TYPE_TREE to thje GimpViewType enum. * app/widgets/gimpcontainereditor.c: added GimpContainerTreeView to the switch() which selects the view type. * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.[ch] * app/gui/dialogs-menu.c * app/gui/dialogs.c: added tree view versions of many dialogs. * app/widgets/gimppreview.[ch]: removed the get_size() virtual function and gimp_preview_calc_size(). * app/core/gimpviewable.[ch]: added virtual function get_preview_size() and gimp_viewable_calc_preview_size(). * 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: added get_preview_size() implementations. * app/widgets/gimpbufferpreview.c * app/widgets/gimpdrawablepreview.c * app/widgets/gimpgradientpreview.c * app/widgets/gimpimagepreview.c * app/widgets/gimppalettepreview.c * app/widgets/gimpselectioneditor.c * app/widgets/gimpundopreview.c * app/display/gimpnavigationview.c: changed accordingly, removed get_size() implementations. * app/widgets/widgets-types.h: changed the first param of GimpItemGetNameFunc from GtkWidget to GObject. * app/widgets/gimpcontainerview-utils.c: accept a GimpViewable as object in the built-in get_name funcs. * app/widgets/gimpcomponentlistitem.c * app/widgets/gimpcontainergridview.c * app/widgets/gimplistitem.c * app/widgets/gimpmenuitem.c: changed accordingly.
2003-02-22 03:03:19 +08:00
static GimpViewable *
gimp_container_tree_view_drag_viewable (GtkWidget *widget,
gpointer data)
{
GimpContainerTreeView *tree_view;
Started migration from GtkList to GtkTreeView: 2003-02-21 Michael Natterer <mitch@gimp.org> Started migration from GtkList to GtkTreeView: * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpcontainertreeview.[ch]; new GimpContainerView subclass using GtkListStore/GtkTreeView. * app/widgets/widgets-enums.h: added GIMP_VIEW_TYPE_TREE to thje GimpViewType enum. * app/widgets/gimpcontainereditor.c: added GimpContainerTreeView to the switch() which selects the view type. * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.[ch] * app/gui/dialogs-menu.c * app/gui/dialogs.c: added tree view versions of many dialogs. * app/widgets/gimppreview.[ch]: removed the get_size() virtual function and gimp_preview_calc_size(). * app/core/gimpviewable.[ch]: added virtual function get_preview_size() and gimp_viewable_calc_preview_size(). * 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: added get_preview_size() implementations. * app/widgets/gimpbufferpreview.c * app/widgets/gimpdrawablepreview.c * app/widgets/gimpgradientpreview.c * app/widgets/gimpimagepreview.c * app/widgets/gimppalettepreview.c * app/widgets/gimpselectioneditor.c * app/widgets/gimpundopreview.c * app/display/gimpnavigationview.c: changed accordingly, removed get_size() implementations. * app/widgets/widgets-types.h: changed the first param of GimpItemGetNameFunc from GtkWidget to GObject. * app/widgets/gimpcontainerview-utils.c: accept a GimpViewable as object in the built-in get_name funcs. * app/widgets/gimpcomponentlistitem.c * app/widgets/gimpcontainergridview.c * app/widgets/gimplistitem.c * app/widgets/gimpmenuitem.c: changed accordingly.
2003-02-22 03:03:19 +08:00
tree_view = GIMP_CONTAINER_TREE_VIEW (data);
Started migration from GtkList to GtkTreeView: 2003-02-21 Michael Natterer <mitch@gimp.org> Started migration from GtkList to GtkTreeView: * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpcontainertreeview.[ch]; new GimpContainerView subclass using GtkListStore/GtkTreeView. * app/widgets/widgets-enums.h: added GIMP_VIEW_TYPE_TREE to thje GimpViewType enum. * app/widgets/gimpcontainereditor.c: added GimpContainerTreeView to the switch() which selects the view type. * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.[ch] * app/gui/dialogs-menu.c * app/gui/dialogs.c: added tree view versions of many dialogs. * app/widgets/gimppreview.[ch]: removed the get_size() virtual function and gimp_preview_calc_size(). * app/core/gimpviewable.[ch]: added virtual function get_preview_size() and gimp_viewable_calc_preview_size(). * 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: added get_preview_size() implementations. * app/widgets/gimpbufferpreview.c * app/widgets/gimpdrawablepreview.c * app/widgets/gimpgradientpreview.c * app/widgets/gimpimagepreview.c * app/widgets/gimppalettepreview.c * app/widgets/gimpselectioneditor.c * app/widgets/gimpundopreview.c * app/display/gimpnavigationview.c: changed accordingly, removed get_size() implementations. * app/widgets/widgets-types.h: changed the first param of GimpItemGetNameFunc from GtkWidget to GObject. * app/widgets/gimpcontainerview-utils.c: accept a GimpViewable as object in the built-in get_name funcs. * app/widgets/gimpcomponentlistitem.c * app/widgets/gimpcontainergridview.c * app/widgets/gimplistitem.c * app/widgets/gimpmenuitem.c: changed accordingly.
2003-02-22 03:03:19 +08:00
return tree_view->dnd_viewable;
Started migration from GtkList to GtkTreeView: 2003-02-21 Michael Natterer <mitch@gimp.org> Started migration from GtkList to GtkTreeView: * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpcontainertreeview.[ch]; new GimpContainerView subclass using GtkListStore/GtkTreeView. * app/widgets/widgets-enums.h: added GIMP_VIEW_TYPE_TREE to thje GimpViewType enum. * app/widgets/gimpcontainereditor.c: added GimpContainerTreeView to the switch() which selects the view type. * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.[ch] * app/gui/dialogs-menu.c * app/gui/dialogs.c: added tree view versions of many dialogs. * app/widgets/gimppreview.[ch]: removed the get_size() virtual function and gimp_preview_calc_size(). * app/core/gimpviewable.[ch]: added virtual function get_preview_size() and gimp_viewable_calc_preview_size(). * 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: added get_preview_size() implementations. * app/widgets/gimpbufferpreview.c * app/widgets/gimpdrawablepreview.c * app/widgets/gimpgradientpreview.c * app/widgets/gimpimagepreview.c * app/widgets/gimppalettepreview.c * app/widgets/gimpselectioneditor.c * app/widgets/gimpundopreview.c * app/display/gimpnavigationview.c: changed accordingly, removed get_size() implementations. * app/widgets/widgets-types.h: changed the first param of GimpItemGetNameFunc from GtkWidget to GObject. * app/widgets/gimpcontainerview-utils.c: accept a GimpViewable as object in the built-in get_name funcs. * app/widgets/gimpcomponentlistitem.c * app/widgets/gimpcontainergridview.c * app/widgets/gimplistitem.c * app/widgets/gimpmenuitem.c: changed accordingly.
2003-02-22 03:03:19 +08:00
}