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.
This commit is contained in:

committed by
Michael Natterer

parent
758635d7a4
commit
9ee632a656
@ -36,10 +36,6 @@ static void gimp_image_preview_class_init (GimpImagePreviewClass *klass);
|
||||
static void gimp_image_preview_init (GimpImagePreview *preview);
|
||||
|
||||
static void gimp_image_preview_render (GimpPreview *preview);
|
||||
static void gimp_image_preview_get_size (GimpPreview *preview,
|
||||
gint size,
|
||||
gint *width,
|
||||
gint *height);
|
||||
static GtkWidget * gimp_image_preview_create_popup (GimpPreview *preview);
|
||||
|
||||
|
||||
@ -84,7 +80,6 @@ gimp_image_preview_class_init (GimpImagePreviewClass *klass)
|
||||
parent_class = g_type_class_peek_parent (klass);
|
||||
|
||||
preview_class->render = gimp_image_preview_render;
|
||||
preview_class->get_size = gimp_image_preview_get_size;
|
||||
preview_class->create_popup = gimp_image_preview_create_popup;
|
||||
}
|
||||
|
||||
@ -94,29 +89,6 @@ gimp_image_preview_init (GimpImagePreview *preview)
|
||||
preview->channel = -1;
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_image_preview_get_size (GimpPreview *preview,
|
||||
gint size,
|
||||
gint *width,
|
||||
gint *height)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
gboolean scaling_up;
|
||||
|
||||
gimage = GIMP_IMAGE (preview->viewable);
|
||||
|
||||
gimp_preview_calc_size (preview,
|
||||
gimage->width,
|
||||
gimage->height,
|
||||
size,
|
||||
size,
|
||||
gimage->xresolution,
|
||||
gimage->yresolution,
|
||||
width,
|
||||
height,
|
||||
&scaling_up);
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_image_preview_render (GimpPreview *preview)
|
||||
{
|
||||
@ -133,16 +105,17 @@ gimp_image_preview_render (GimpPreview *preview)
|
||||
width = preview->width;
|
||||
height = preview->height;
|
||||
|
||||
gimp_preview_calc_size (preview,
|
||||
gimage->width,
|
||||
gimage->height,
|
||||
width,
|
||||
height,
|
||||
gimage->xresolution,
|
||||
gimage->yresolution,
|
||||
&preview_width,
|
||||
&preview_height,
|
||||
&scaling_up);
|
||||
gimp_viewable_calc_preview_size (preview->viewable,
|
||||
gimage->width,
|
||||
gimage->height,
|
||||
width,
|
||||
height,
|
||||
preview->dot_for_dot,
|
||||
gimage->xresolution,
|
||||
gimage->yresolution,
|
||||
&preview_width,
|
||||
&preview_height,
|
||||
&scaling_up);
|
||||
|
||||
if (scaling_up)
|
||||
{
|
||||
@ -215,16 +188,19 @@ gimp_image_preview_create_popup (GimpPreview *preview)
|
||||
|
||||
gimage = GIMP_IMAGE (preview->viewable);
|
||||
|
||||
gimp_preview_calc_size (preview,
|
||||
gimage->width,
|
||||
gimage->height,
|
||||
MIN (preview->width * 2, GIMP_PREVIEW_MAX_POPUP_SIZE),
|
||||
MIN (preview->height * 2, GIMP_PREVIEW_MAX_POPUP_SIZE),
|
||||
gimage->xresolution,
|
||||
gimage->yresolution,
|
||||
&popup_width,
|
||||
&popup_height,
|
||||
&scaling_up);
|
||||
gimp_viewable_calc_preview_size (preview->viewable,
|
||||
gimage->width,
|
||||
gimage->height,
|
||||
MIN (preview->width * 2,
|
||||
GIMP_PREVIEW_MAX_POPUP_SIZE),
|
||||
MIN (preview->height * 2,
|
||||
GIMP_PREVIEW_MAX_POPUP_SIZE),
|
||||
preview->dot_for_dot,
|
||||
gimage->xresolution,
|
||||
gimage->yresolution,
|
||||
&popup_width,
|
||||
&popup_height,
|
||||
&scaling_up);
|
||||
|
||||
if (scaling_up)
|
||||
{
|
||||
|
Reference in New Issue
Block a user