Commit 6031629b authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

removed.

2003-09-06  Michael Natterer  <mitch@gimp.org>

	* app/widgets/gimppreviewrenderertextlayer.[ch]: removed.

	* app/widgets/gimppreviewrendererlayer.[ch]: new renderer which
	renders all kinds of layers and uses GIMP_STOCK_FLOATING_SELECTION
	for floating selections.

	* app/widgets/Makefile.am
	* app/widgets/widgets-types.h
	* app/widgets/gimppreviewrenderer-utils.c: changed accordingly.
parent 7fbfdfce
2003-09-06 Michael Natterer <mitch@gimp.org>
* app/widgets/gimppreviewrenderertextlayer.[ch]: removed.
* app/widgets/gimppreviewrendererlayer.[ch]: new renderer which
renders all kinds of layers and uses GIMP_STOCK_FLOATING_SELECTION
for floating selections.
* app/widgets/Makefile.am
* app/widgets/widgets-types.h
* app/widgets/gimppreviewrenderer-utils.c: changed accordingly.
2003-09-06 Michael Natterer <mitch@gimp.org>
* app/widgets/gimplayertreeview.[ch]: display the floating
......@@ -139,8 +139,8 @@ libappwidgets_a_sources = \
gimppreviewrenderergradient.h \
gimppreviewrendererimage.c \
gimppreviewrendererimage.h \
gimppreviewrenderertextlayer.c \
gimppreviewrenderertextlayer.h \
gimppreviewrendererlayer.c \
gimppreviewrendererlayer.h \
gimppropwidgets.c \
gimppropwidgets.h \
gimpselectioneditor.c \
......
......@@ -32,8 +32,7 @@
#include "text/gimptextlayer.h"
#include "gimppreviewrendererbrush.h"
#include "gimppreviewrendererdrawable.h"
#include "gimppreviewrenderertextlayer.h"
#include "gimppreviewrendererlayer.h"
#include "gimppreviewrenderergradient.h"
#include "gimppreviewrendererimage.h"
......@@ -54,9 +53,9 @@ gimp_preview_renderer_type_from_viewable_type (GType viewable_type)
{
type = GIMP_TYPE_PREVIEW_RENDERER_IMAGE;
}
else if (g_type_is_a (viewable_type, GIMP_TYPE_TEXT_LAYER))
else if (g_type_is_a (viewable_type, GIMP_TYPE_LAYER))
{
type = GIMP_TYPE_PREVIEW_RENDERER_TEXT_LAYER;
type = GIMP_TYPE_PREVIEW_RENDERER_LAYER;
}
else if (g_type_is_a (viewable_type, GIMP_TYPE_DRAWABLE))
{
......
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* gimppreviewrenderertextlayer.c
* gimppreviewrendererlayer.c
* Copyright (C) 2003 Michael Natterer <mitch@gimp.org>
*
* This program is free software; you can redistribute it and/or modify
......@@ -23,27 +23,26 @@
#include <gtk/gtk.h>
#include "libgimpmath/gimpmath.h"
#include "libgimpwidgets/gimpwidgets.h"
#include "widgets-types.h"
#include "core/gimpviewable.h"
#include "text/gimptextlayer.h"
#include "gimppreviewrenderertextlayer.h"
#include "gimppreviewrendererlayer.h"
static void gimp_preview_renderer_text_layer_class_init (GimpPreviewRendererTextLayerClass *klass);
static void gimp_preview_renderer_text_layer_init (GimpPreviewRendererTextLayer *renderer);
static void gimp_preview_renderer_layer_class_init (GimpPreviewRendererLayerClass *klass);
static void gimp_preview_renderer_text_layer_render (GimpPreviewRenderer *renderer,
GtkWidget *widget);
static void gimp_preview_renderer_layer_render (GimpPreviewRenderer *renderer,
GtkWidget *widget);
static GimpPreviewRendererDrawableClass *parent_class = NULL;
GType
gimp_preview_renderer_text_layer_get_type (void)
gimp_preview_renderer_layer_get_type (void)
{
static GType renderer_type = 0;
......@@ -51,19 +50,19 @@ gimp_preview_renderer_text_layer_get_type (void)
{
static const GTypeInfo renderer_info =
{
sizeof (GimpPreviewRendererTextLayerClass),
sizeof (GimpPreviewRendererLayerClass),
NULL, /* base_init */
NULL, /* base_finalize */
(GClassInitFunc) gimp_preview_renderer_text_layer_class_init,
(GClassInitFunc) gimp_preview_renderer_layer_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GimpPreviewRendererTextLayer),
sizeof (GimpPreviewRendererLayer),
0, /* n_preallocs */
(GInstanceInitFunc) gimp_preview_renderer_text_layer_init,
NULL, /* instance_init */
};
renderer_type = g_type_register_static (GIMP_TYPE_PREVIEW_RENDERER_DRAWABLE,
"GimpPreviewRendererTextLayer",
"GimpPreviewRendererLayer",
&renderer_info, 0);
}
......@@ -71,7 +70,7 @@ gimp_preview_renderer_text_layer_get_type (void)
}
static void
gimp_preview_renderer_text_layer_class_init (GimpPreviewRendererTextLayerClass *klass)
gimp_preview_renderer_layer_class_init (GimpPreviewRendererLayerClass *klass)
{
GimpPreviewRendererClass *renderer_class;
......@@ -79,21 +78,26 @@ gimp_preview_renderer_text_layer_class_init (GimpPreviewRendererTextLayerClass *
parent_class = g_type_class_peek_parent (klass);
renderer_class->render = gimp_preview_renderer_text_layer_render;
renderer_class->render = gimp_preview_renderer_layer_render;
}
static void
gimp_preview_renderer_text_layer_init (GimpPreviewRendererTextLayer *renderer)
gimp_preview_renderer_layer_render (GimpPreviewRenderer *renderer,
GtkWidget *widget)
{
}
static void
gimp_preview_renderer_text_layer_render (GimpPreviewRenderer *renderer,
GtkWidget *widget)
{
const gchar *stock_id;
const gchar *stock_id = NULL;
stock_id = gimp_viewable_get_stock_id (renderer->viewable);
if (gimp_layer_is_floating_sel (GIMP_LAYER (renderer->viewable)))
{
stock_id = GIMP_STOCK_FLOATING_SELECTION;
}
else if (GIMP_IS_TEXT_LAYER (renderer->viewable))
{
stock_id = gimp_viewable_get_stock_id (renderer->viewable);
}
gimp_preview_renderer_default_render_stock (renderer, widget, stock_id);
if (stock_id)
gimp_preview_renderer_default_render_stock (renderer, widget, stock_id);
else
GIMP_PREVIEW_RENDERER_CLASS (parent_class)->render (renderer, widget);
}
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* gimppreviewrenderertextlayer.h
* gimppreviewrendererlayer.h
* Copyright (C) 2003 Michael Natterer <mitch@gimp.org>
*
* This program is free software; you can redistribute it and/or modify
......@@ -19,33 +19,33 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __GIMP_PREVIEW_RENDERER_TEXT_LAYER_H__
#define __GIMP_PREVIEW_RENDERER_TEXT_LAYER_H__
#ifndef __GIMP_PREVIEW_RENDERER_LAYER_H__
#define __GIMP_PREVIEW_RENDERER_LAYER_H__
#include "gimppreviewrendererdrawable.h"
#define GIMP_TYPE_PREVIEW_RENDERER_TEXT_LAYER (gimp_preview_renderer_text_layer_get_type ())
#define GIMP_PREVIEW_RENDERER_TEXT_LAYER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_PREVIEW_RENDERER_TEXT_LAYER, GimpPreviewRendererTextLayer))
#define GIMP_PREVIEW_RENDERER_TEXT_LAYER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_PREVIEW_RENDERER_TEXT_LAYER, GimpPreviewRendererTextLayerClass))
#define GIMP_IS_PREVIEW_RENDERER_TEXT_LAYER(obj) (G_TYPE_CHECK_INSTANCE_TYPE (obj, GIMP_TYPE_PREVIEW_RENDERER_TEXT_LAYER))
#define GIMP_IS_PREVIEW_RENDERER_TEXT_LAYER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_PREVIEW_RENDERER_TEXT_LAYER))
#define GIMP_PREVIEW_RENDERER_TEXT_LAYER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_PREVIEW_RENDERER_TEXT_LAYER, GimpPreviewRendererTextLayerClass))
#define GIMP_TYPE_PREVIEW_RENDERER_LAYER (gimp_preview_renderer_layer_get_type ())
#define GIMP_PREVIEW_RENDERER_LAYER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_PREVIEW_RENDERER_LAYER, GimpPreviewRendererLayer))
#define GIMP_PREVIEW_RENDERER_LAYER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_PREVIEW_RENDERER_LAYER, GimpPreviewRendererLayerClass))
#define GIMP_IS_PREVIEW_RENDERER_LAYER(obj) (G_TYPE_CHECK_INSTANCE_TYPE (obj, GIMP_TYPE_PREVIEW_RENDERER_LAYER))
#define GIMP_IS_PREVIEW_RENDERER_LAYER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_PREVIEW_RENDERER_LAYER))
#define GIMP_PREVIEW_RENDERER_LAYER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_PREVIEW_RENDERER_LAYER, GimpPreviewRendererLayerClass))
typedef struct _GimpPreviewRendererTextLayerClass GimpPreviewRendererTextLayerClass;
typedef struct _GimpPreviewRendererLayerClass GimpPreviewRendererLayerClass;
struct _GimpPreviewRendererTextLayer
struct _GimpPreviewRendererLayer
{
GimpPreviewRendererDrawable parent_instance;
};
struct _GimpPreviewRendererTextLayerClass
struct _GimpPreviewRendererLayerClass
{
GimpPreviewRendererDrawableClass parent_class;
};
GType gimp_preview_renderer_text_layer_get_type (void) G_GNUC_CONST;
GType gimp_preview_renderer_layer_get_type (void) G_GNUC_CONST;
#endif /* __GIMP_PREVIEW_RENDERER_TEXT_LAYER_H__ */
#endif /* __GIMP_PREVIEW_RENDERER_LAYER_H__ */
......@@ -32,8 +32,7 @@
#include "text/gimptextlayer.h"
#include "gimppreviewrendererbrush.h"
#include "gimppreviewrendererdrawable.h"
#include "gimppreviewrenderertextlayer.h"
#include "gimppreviewrendererlayer.h"
#include "gimppreviewrenderergradient.h"
#include "gimppreviewrendererimage.h"
......@@ -54,9 +53,9 @@ gimp_preview_renderer_type_from_viewable_type (GType viewable_type)
{
type = GIMP_TYPE_PREVIEW_RENDERER_IMAGE;
}
else if (g_type_is_a (viewable_type, GIMP_TYPE_TEXT_LAYER))
else if (g_type_is_a (viewable_type, GIMP_TYPE_LAYER))
{
type = GIMP_TYPE_PREVIEW_RENDERER_TEXT_LAYER;
type = GIMP_TYPE_PREVIEW_RENDERER_LAYER;
}
else if (g_type_is_a (viewable_type, GIMP_TYPE_DRAWABLE))
{
......
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* gimppreviewrendererlayer.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 "libgimpwidgets/gimpwidgets.h"
#include "widgets-types.h"
#include "text/gimptextlayer.h"
#include "gimppreviewrendererlayer.h"
static void gimp_preview_renderer_layer_class_init (GimpPreviewRendererLayerClass *klass);
static void gimp_preview_renderer_layer_render (GimpPreviewRenderer *renderer,
GtkWidget *widget);
static GimpPreviewRendererDrawableClass *parent_class = NULL;
GType
gimp_preview_renderer_layer_get_type (void)
{
static GType renderer_type = 0;
if (! renderer_type)
{
static const GTypeInfo renderer_info =
{
sizeof (GimpPreviewRendererLayerClass),
NULL, /* base_init */
NULL, /* base_finalize */
(GClassInitFunc) gimp_preview_renderer_layer_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GimpPreviewRendererLayer),
0, /* n_preallocs */
NULL, /* instance_init */
};
renderer_type = g_type_register_static (GIMP_TYPE_PREVIEW_RENDERER_DRAWABLE,
"GimpPreviewRendererLayer",
&renderer_info, 0);
}
return renderer_type;
}
static void
gimp_preview_renderer_layer_class_init (GimpPreviewRendererLayerClass *klass)
{
GimpPreviewRendererClass *renderer_class;
renderer_class = GIMP_PREVIEW_RENDERER_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
renderer_class->render = gimp_preview_renderer_layer_render;
}
static void
gimp_preview_renderer_layer_render (GimpPreviewRenderer *renderer,
GtkWidget *widget)
{
const gchar *stock_id = NULL;
if (gimp_layer_is_floating_sel (GIMP_LAYER (renderer->viewable)))
{
stock_id = GIMP_STOCK_FLOATING_SELECTION;
}
else if (GIMP_IS_TEXT_LAYER (renderer->viewable))
{
stock_id = gimp_viewable_get_stock_id (renderer->viewable);
}
if (stock_id)
gimp_preview_renderer_default_render_stock (renderer, widget, stock_id);
else
GIMP_PREVIEW_RENDERER_CLASS (parent_class)->render (renderer, widget);
}
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* gimppreviewrendererlayer.h
* 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.
*/
#ifndef __GIMP_PREVIEW_RENDERER_LAYER_H__
#define __GIMP_PREVIEW_RENDERER_LAYER_H__
#include "gimppreviewrendererdrawable.h"
#define GIMP_TYPE_PREVIEW_RENDERER_LAYER (gimp_preview_renderer_layer_get_type ())
#define GIMP_PREVIEW_RENDERER_LAYER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_PREVIEW_RENDERER_LAYER, GimpPreviewRendererLayer))
#define GIMP_PREVIEW_RENDERER_LAYER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_PREVIEW_RENDERER_LAYER, GimpPreviewRendererLayerClass))
#define GIMP_IS_PREVIEW_RENDERER_LAYER(obj) (G_TYPE_CHECK_INSTANCE_TYPE (obj, GIMP_TYPE_PREVIEW_RENDERER_LAYER))
#define GIMP_IS_PREVIEW_RENDERER_LAYER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_PREVIEW_RENDERER_LAYER))
#define GIMP_PREVIEW_RENDERER_LAYER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_PREVIEW_RENDERER_LAYER, GimpPreviewRendererLayerClass))
typedef struct _GimpPreviewRendererLayerClass GimpPreviewRendererLayerClass;
struct _GimpPreviewRendererLayer
{
GimpPreviewRendererDrawable parent_instance;
};
struct _GimpPreviewRendererLayerClass
{
GimpPreviewRendererDrawableClass parent_class;
};
GType gimp_preview_renderer_layer_get_type (void) G_GNUC_CONST;
#endif /* __GIMP_PREVIEW_RENDERER_LAYER_H__ */
......@@ -41,7 +41,7 @@ typedef struct _GimpPreviewRenderer GimpPreviewRenderer;
typedef struct _GimpPreviewRendererBrush GimpPreviewRendererBrush;
typedef struct _GimpPreviewRendererDrawable GimpPreviewRendererDrawable;
typedef struct _GimpPreviewRendererGradient GimpPreviewRendererGradient;
typedef struct _GimpPreviewRendererTextLayer GimpPreviewRendererTextLayer;
typedef struct _GimpPreviewRendererLayer GimpPreviewRendererLayer;
typedef struct _GimpPreviewRendererImage GimpPreviewRendererImage;
......
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