Commit 98dc0a67 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

app/widgets/Makefile.am app/widgets/widgets-types.h new view renderer,

2005-07-13  Michael Natterer  <mitch@gimp.org>

	* app/widgets/Makefile.am
	* app/widgets/widgets-types.h
	* app/widgets/gimpviewrendererpalette.[ch]: new view renderer,
	does nothing yet except chaining up in ::render().

	* app/widgets/gimpviewrenderer-utils.c
	(gimp_view_renderer_type_by_viewable_type): use it for palettes.
parent 845fa0cb
2005-07-13 Michael Natterer <mitch@gimp.org>
* app/widgets/Makefile.am
* app/widgets/widgets-types.h
* app/widgets/gimpviewrendererpalette.[ch]: new view renderer,
does nothing yet except chaining up in ::render().
* app/widgets/gimpviewrenderer-utils.c
(gimp_view_renderer_type_by_viewable_type): use it for palettes.
2005-07-13 Michael Schumacher <schumaml@cvs.gnome.org>
* plug-ins/gfig/gfig-dialog.c
......
......@@ -283,6 +283,8 @@ libappwidgets_a_sources = \
gimpviewrendererimagefile.h \
gimpviewrendererlayer.c \
gimpviewrendererlayer.h \
gimpviewrendererpalette.c \
gimpviewrendererpalette.h \
gimpviewrenderervectors.c \
gimpviewrenderervectors.h \
gimpwidgets-constructors.c \
......
......@@ -29,9 +29,10 @@
#include "core/gimpbuffer.h"
#include "core/gimpdrawable.h"
#include "core/gimpgradient.h"
#include "core/gimplayer.h"
#include "core/gimpimage.h"
#include "core/gimpimagefile.h"
#include "core/gimplayer.h"
#include "core/gimppalette.h"
#include "vectors/gimpvectors.h"
#include "gimpviewrendererbrush.h"
......@@ -40,6 +41,7 @@
#include "gimpviewrenderergradient.h"
#include "gimpviewrendererimage.h"
#include "gimpviewrendererimagefile.h"
#include "gimpviewrendererpalette.h"
#include "gimpviewrenderervectors.h"
......@@ -83,6 +85,10 @@ gimp_view_renderer_type_from_viewable_type (GType viewable_type)
{
type = GIMP_TYPE_VIEW_RENDERER_IMAGEFILE;
}
else if (g_type_is_a (viewable_type, GIMP_TYPE_PALETTE))
{
type = GIMP_TYPE_VIEW_RENDERER_PALETTE;
}
return type;
}
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* gimpviewrendererpalette.c
* Copyright (C) 2005 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 <string.h>
#include <gtk/gtk.h>
#include "libgimpcolor/gimpcolor.h"
#include "libgimpmath/gimpmath.h"
#include "widgets-types.h"
#include "core/gimppalette.h"
#include "gimpviewrendererpalette.h"
static void gimp_view_renderer_palette_class_init (GimpViewRendererPaletteClass *klass);
static void gimp_view_renderer_palette_init (GimpViewRendererPalette *renderer);
static void gimp_view_renderer_palette_finalize (GObject *object);
static void gimp_view_renderer_palette_render (GimpViewRenderer *renderer,
GtkWidget *widget);
static GimpViewRendererClass *parent_class = NULL;
GType
gimp_view_renderer_palette_get_type (void)
{
static GType renderer_type = 0;
if (! renderer_type)
{
static const GTypeInfo renderer_info =
{
sizeof (GimpViewRendererPaletteClass),
NULL, /* base_init */
NULL, /* base_finalize */
(GClassInitFunc) gimp_view_renderer_palette_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GimpViewRendererPalette),
0, /* n_preallocs */
(GInstanceInitFunc) gimp_view_renderer_palette_init,
};
renderer_type = g_type_register_static (GIMP_TYPE_VIEW_RENDERER,
"GimpViewRendererPalette",
&renderer_info, 0);
}
return renderer_type;
}
static void
gimp_view_renderer_palette_class_init (GimpViewRendererPaletteClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GimpViewRendererClass *renderer_class = GIMP_VIEW_RENDERER_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
object_class->finalize = gimp_view_renderer_palette_finalize;
renderer_class->render = gimp_view_renderer_palette_render;
}
static void
gimp_view_renderer_palette_init (GimpViewRendererPalette *renderer)
{
}
static void
gimp_view_renderer_palette_finalize (GObject *object)
{
GimpViewRendererPalette *renderer = GIMP_VIEW_RENDERER_PALETTE (object);
G_OBJECT_CLASS (parent_class)->finalize (object);
}
static void
gimp_view_renderer_palette_render (GimpViewRenderer *renderer,
GtkWidget *widget)
{
GimpViewRendererPalette *renderpal = GIMP_VIEW_RENDERER_PALETTE (renderer);
GimpPalette *palette;
palette = GIMP_PALETTE (renderer->viewable);
GIMP_VIEW_RENDERER_CLASS (parent_class)->render (renderer, widget);
}
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* gimpviewrendererpalette.h
* Copyright (C) 2005 Michael Natterer <mitch@gimp.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __GIMP_VIEW_RENDERER_PALETTE_H__
#define __GIMP_VIEW_RENDERER_PALETTE_H__
#include "gimpviewrenderer.h"
#define GIMP_TYPE_VIEW_RENDERER_PALETTE (gimp_view_renderer_palette_get_type ())
#define GIMP_VIEW_RENDERER_PALETTE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_VIEW_RENDERER_PALETTE, GimpViewRendererPalette))
#define GIMP_VIEW_RENDERER_PALETTE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_VIEW_RENDERER_PALETTE, GimpViewRendererPaletteClass))
#define GIMP_IS_VIEW_RENDERER_PALETTE(obj) (G_TYPE_CHECK_INSTANCE_TYPE (obj, GIMP_TYPE_VIEW_RENDERER_PALETTE))
#define GIMP_IS_VIEW_RENDERER_PALETTE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_VIEW_RENDERER_PALETTE))
#define GIMP_VIEW_RENDERER_PALETTE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_VIEW_RENDERER_PALETTE, GimpViewRendererPaletteClass))
typedef struct _GimpViewRendererPaletteClass GimpViewRendererPaletteClass;
struct _GimpViewRendererPalette
{
GimpViewRenderer parent_instance;
};
struct _GimpViewRendererPaletteClass
{
GimpViewRendererClass parent_class;
};
GType gimp_view_renderer_palette_get_type (void) G_GNUC_CONST;
#endif /* __GIMP_VIEW_RENDERER_PALETTE_H__ */
......@@ -184,6 +184,7 @@ typedef struct _GimpViewRendererBrush GimpViewRendererBrush;
typedef struct _GimpViewRendererBuffer GimpViewRendererBuffer;
typedef struct _GimpViewRendererDrawable GimpViewRendererDrawable;
typedef struct _GimpViewRendererGradient GimpViewRendererGradient;
typedef struct _GimpViewRendererPalette GimpViewRendererPalette;
typedef struct _GimpViewRendererLayer GimpViewRendererLayer;
typedef struct _GimpViewRendererImage GimpViewRendererImage;
typedef struct _GimpViewRendererImagefile GimpViewRendererImagefile;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment