Commit fdb7265a authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer
Browse files

#define GIMP_VIEWABLE_MAX_PREVIEW_SIZE here.

2003-04-01  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpviewable.h: #define GIMP_VIEWABLE_MAX_PREVIEW_SIZE
	here.

	* app/widgets/gimppreview.h
	* app/widgets/gimppreviewrenderer.h: removed the #defines here.

	* app/core/gimpviewable.c (gimp_preview_get[_popup]_size): check
	the return values to be within bounds.

	* app/text/gimpfont.c
	* app/display/gimpdisplayshell-render.c: use the new constant
	instead of the magic "1024".

	* app/core/gimpdrawable-preview.c: #include our own header file.

	* app/widgets/gimpbrushfactoryview.c
	* app/widgets/gimpcomponenteditor.c
	* app/widgets/gimpcontainereditor.c
	* app/widgets/gimpcontainergridview.c
	* app/widgets/gimpcontainermenu.c
	* app/widgets/gimpcontainermenuimpl.c
	* app/widgets/gimpcontainertreeview.c
	* app/widgets/gimpcontainerview.c
	* app/widgets/gimpdatafactoryview.c
	* app/widgets/gimpitemtreeview.c
	* app/widgets/gimppreview.c
	* app/widgets/gimppreviewrenderer.c: changed accordingly.
parent 013c907b
2003-04-01 Michael Natterer <mitch@gimp.org>
* app/core/gimpviewable.h: #define GIMP_VIEWABLE_MAX_PREVIEW_SIZE
here.
* app/widgets/gimppreview.h
* app/widgets/gimppreviewrenderer.h: removed the #defines here.
* app/core/gimpviewable.c (gimp_preview_get[_popup]_size): check
the return values to be within bounds.
* app/text/gimpfont.c
* app/display/gimpdisplayshell-render.c: use the new constant
instead of the magic "1024".
* app/core/gimpdrawable-preview.c: #include our own header file.
* app/widgets/gimpbrushfactoryview.c
* app/widgets/gimpcomponenteditor.c
* app/widgets/gimpcontainereditor.c
* app/widgets/gimpcontainergridview.c
* app/widgets/gimpcontainermenu.c
* app/widgets/gimpcontainermenuimpl.c
* app/widgets/gimpcontainertreeview.c
* app/widgets/gimpcontainerview.c
* app/widgets/gimpdatafactoryview.c
* app/widgets/gimpitemtreeview.c
* app/widgets/gimppreview.c
* app/widgets/gimppreviewrenderer.c: changed accordingly.
2003-04-01 Sven Neumann <sven@gimp.org>
 
* plug-ins/script-fu/scripts/tileblur.scm (script-fu-tile-blur):
......@@ -39,6 +39,7 @@
#include "gimpchannel.h"
#include "gimpimage.h"
#include "gimpdrawable.h"
#include "gimpdrawable-preview.h"
#include "gimplayer.h"
#include "gimppreviewcache.h"
......
......@@ -275,7 +275,7 @@ gimp_viewable_calc_preview_size (GimpViewable *viewable,
if (return_width) *return_width = width;
if (return_height) *return_height = height;
if (scaling_up) *scaling_up = (xratio > 1.0) || (yratio > 1.0);
if (scaling_up) *scaling_up = (xratio > 1.0) || (yratio > 1.0);
}
void
......@@ -286,14 +286,21 @@ gimp_viewable_get_preview_size (GimpViewable *viewable,
gint *width,
gint *height)
{
gint w, h;
g_return_if_fail (GIMP_IS_VIEWABLE (viewable));
g_return_if_fail (size > 0);
g_return_if_fail (width != NULL);
g_return_if_fail (height != NULL);
GIMP_VIEWABLE_GET_CLASS (viewable)->get_preview_size (viewable, size,
popup, dot_for_dot,
width, height);
&w, &h);
w = MIN (w, GIMP_VIEWABLE_MAX_PREVIEW_SIZE);
h = MIN (h, GIMP_VIEWABLE_MAX_PREVIEW_SIZE);
if (width) *width = w;
if (height) *height = h;
}
gboolean
......@@ -312,15 +319,20 @@ gimp_viewable_get_popup_size (GimpViewable *viewable,
if (viewable_class->get_popup_size)
{
gint dummy_width;
gint dummy_height;
gint w, h;
if (! popup_width) popup_width = &dummy_width;
if (! popup_height) popup_height = &dummy_height;
if (viewable_class->get_popup_size (viewable,
width, height, dot_for_dot,
&w, &h))
{
w = MIN (w, GIMP_VIEWABLE_MAX_PREVIEW_SIZE);
h = MIN (h, GIMP_VIEWABLE_MAX_PREVIEW_SIZE);
if (popup_width) *popup_width = w;
if (popup_height) *popup_height = h;
return viewable_class->get_popup_size (viewable,
width, height, dot_for_dot,
popup_width, popup_height);
return TRUE;
}
}
return FALSE;
......
......@@ -28,7 +28,8 @@
#include <gdk-pixbuf/gdk-pixbuf.h>
#define GIMP_VIEWABLE_MAX_POPUP_SIZE 256
#define GIMP_VIEWABLE_MAX_PREVIEW_SIZE 1024
#define GIMP_VIEWABLE_MAX_POPUP_SIZE 256
#define GIMP_TYPE_VIEWABLE (gimp_viewable_get_type ())
......
......@@ -237,45 +237,35 @@ render_setup_notify (gpointer config,
g_free (render_white_buf);
g_free (render_temp_buf);
#ifdef __GNUC__
#warning #define MAX_PREVIEW_SIZE 1024 /* GIMP_PREVIEW_MAX_SIZE (EEK) */
#endif
#define MAX_PREVIEW_SIZE 1024 /* GIMP_PREVIEW_MAX_SIZE (EEK) */
#define BUF_SIZE (MAX (GIMP_DISPLAY_SHELL_RENDER_BUF_WIDTH, \
GIMP_VIEWABLE_MAX_PREVIEW_SIZE) + 4)
/* calculate check buffer for previews */
if (TRUE /* preview_size */)
{
render_check_buf = g_new (guchar, (MAX_PREVIEW_SIZE + 4) * 3);
render_check_buf = g_new (guchar, BUF_SIZE * 3);
render_empty_buf = g_new0 (guchar, BUF_SIZE * 3);
render_white_buf = g_new (guchar, BUF_SIZE * 3);
render_temp_buf = g_new (guchar, BUF_SIZE * 3);
for (i = 0; i < (MAX_PREVIEW_SIZE + 4); i++)
{
if (i & 0x4)
{
render_check_buf[i * 3 + 0] = render_blend_dark_check[0];
render_check_buf[i * 3 + 1] = render_blend_dark_check[0];
render_check_buf[i * 3 + 2] = render_blend_dark_check[0];
}
else
{
render_check_buf[i * 3 + 0] = render_blend_light_check[0];
render_check_buf[i * 3 + 1] = render_blend_light_check[0];
render_check_buf[i * 3 + 2] = render_blend_light_check[0];
}
}
/* calculate check buffer for previews */
render_empty_buf = g_new0 (guchar, (MAX_PREVIEW_SIZE + 4) * 3);
render_white_buf = g_new (guchar, (MAX_PREVIEW_SIZE + 4) * 3);
render_temp_buf = g_new (guchar, (MAX_PREVIEW_SIZE + 4) * 3);
memset (render_white_buf, 255, BUF_SIZE * 3);
memset (render_white_buf, 255, (MAX_PREVIEW_SIZE + 4) * 3);
}
else
for (i = 0; i < BUF_SIZE; i++)
{
render_check_buf = NULL;
render_empty_buf = NULL;
render_white_buf = NULL;
render_temp_buf = NULL;
if (i & 0x4)
{
render_check_buf[i * 3 + 0] = render_blend_dark_check[0];
render_check_buf[i * 3 + 1] = render_blend_dark_check[0];
render_check_buf[i * 3 + 2] = render_blend_dark_check[0];
}
else
{
render_check_buf[i * 3 + 0] = render_blend_light_check[0];
render_check_buf[i * 3 + 1] = render_blend_light_check[0];
render_check_buf[i * 3 + 2] = render_blend_light_check[0];
}
}
#undef BUF_SIZE
}
......
......@@ -247,11 +247,8 @@ gimp_font_get_popup_size (GimpViewable *viewable,
pango_layout_set_text (font->popup_layout, gettext (GIMP_TEXT_PANGRAM), -1);
pango_layout_get_pixel_extents (font->popup_layout, NULL, &logical);
#ifdef __GNUC__
#warning FIXME #need to use GIMP_PREVIEW_MAX_SIZE here
#endif
*popup_width = MIN (logical.width + 6, 1024);
*popup_height = MIN (logical.height + 6, 1024);
*popup_width = MIN (logical.width + 6, GIMP_VIEWABLE_MAX_PREVIEW_SIZE);
*popup_height = MIN (logical.height + 6, GIMP_VIEWABLE_MAX_PREVIEW_SIZE);
font->popup_width = *popup_width;
font->popup_height = *popup_height;
......
......@@ -36,7 +36,6 @@
#include "gimpcontainerview.h"
#include "gimpbrushfactoryview.h"
#include "gimppreview.h"
#include "gimp-intl.h"
......@@ -160,7 +159,7 @@ gimp_brush_factory_view_new (GimpViewType view_type,
g_return_val_if_fail (GIMP_IS_DATA_FACTORY (factory), NULL);
g_return_val_if_fail (preview_size > 0 &&
preview_size <= GIMP_PREVIEW_MAX_SIZE, NULL);
preview_size <= GIMP_VIEWABLE_MAX_PREVIEW_SIZE, NULL);
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);
......
......@@ -246,7 +246,7 @@ gimp_component_editor_new (gint preview_size,
GimpComponentEditor *editor;
g_return_val_if_fail (preview_size > 0 &&
preview_size <= GIMP_PREVIEW_MAX_SIZE, NULL);
preview_size <= GIMP_VIEWABLE_MAX_PREVIEW_SIZE, NULL);
g_return_val_if_fail (GIMP_IS_MENU_FACTORY (menu_factory), NULL);
editor = g_object_new (GIMP_TYPE_COMPONENT_EDITOR, NULL);
......@@ -269,7 +269,8 @@ gimp_component_editor_set_preview_size (GimpComponentEditor *editor,
gboolean iter_valid;
g_return_if_fail (GIMP_IS_COMPONENT_EDITOR (editor));
g_return_if_fail (preview_size > 0 && preview_size <= GIMP_PREVIEW_MAX_SIZE);
g_return_if_fail (preview_size > 0 &&
preview_size <= GIMP_VIEWABLE_MAX_PREVIEW_SIZE);
tree_widget = GTK_WIDGET (editor->view);
......
......@@ -29,13 +29,13 @@
#include "core/gimpcontext.h"
#include "core/gimpcontainer.h"
#include "core/gimpviewable.h"
#include "gimpcontainereditor.h"
#include "gimpcontainergridview.h"
#include "gimpcontainertreeview.h"
#include "gimpitemfactory.h"
#include "gimpmenufactory.h"
#include "gimppreview.h"
static void gimp_container_editor_class_init (GimpContainerEditorClass *klass);
......@@ -120,7 +120,7 @@ gimp_container_editor_construct (GimpContainerEditor *editor,
g_return_val_if_fail (GIMP_IS_CONTAINER (container), FALSE);
g_return_val_if_fail (GIMP_IS_CONTEXT (context), FALSE);
g_return_val_if_fail (preview_size > 0 &&
preview_size <= GIMP_PREVIEW_MAX_SIZE, FALSE);
preview_size <= GIMP_VIEWABLE_MAX_PREVIEW_SIZE, FALSE);
g_return_val_if_fail (min_items_x <= 64, FALSE);
g_return_val_if_fail (min_items_y <= 64, FALSE);
g_return_val_if_fail (menu_factory == NULL ||
......
......@@ -33,6 +33,7 @@
#include "core/gimpcontainer.h"
#include "core/gimpcontext.h"
#include "core/gimpmarshal.h"
#include "core/gimpviewable.h"
#include "gimpcontainergridview.h"
#include "gimppreview.h"
......@@ -234,7 +235,7 @@ gimp_container_grid_view_new (GimpContainer *container,
NULL);
g_return_val_if_fail (context == NULL || GIMP_IS_CONTEXT (context), NULL);
g_return_val_if_fail (preview_size > 0 &&
preview_size <= GIMP_PREVIEW_MAX_SIZE, NULL);
preview_size <= GIMP_VIEWABLE_MAX_PREVIEW_SIZE, NULL);
g_return_val_if_fail (min_items_x <= 64, NULL);
g_return_val_if_fail (min_items_y <= 64, NULL);
......
......@@ -32,7 +32,6 @@
#include "gimpcontainermenu.h"
#include "gimpcontainerview-utils.h"
#include "gimppreview.h"
enum
......@@ -351,7 +350,8 @@ gimp_container_menu_set_preview_size (GimpContainerMenu *menu,
gint preview_size)
{
g_return_if_fail (GIMP_IS_CONTAINER_MENU (menu));
g_return_if_fail (preview_size > 0 && preview_size <= GIMP_PREVIEW_MAX_SIZE);
g_return_if_fail (preview_size > 0 &&
preview_size <= GIMP_VIEWABLE_MAX_POPUP_SIZE);
if (menu->preview_size != preview_size)
{
......
......@@ -29,6 +29,7 @@
#include "core/gimpcontainer.h"
#include "core/gimpcontext.h"
#include "core/gimpviewable.h"
#include "gimpcontainermenuimpl.h"
#include "gimpmenuitem.h"
......@@ -124,10 +125,11 @@ gimp_container_menu_new (GimpContainer *container,
GimpContainerMenuImpl *menu_impl;
GimpContainerMenu *menu;
g_return_val_if_fail (! container || GIMP_IS_CONTAINER (container), NULL);
g_return_val_if_fail (! context || GIMP_IS_CONTEXT (context), NULL);
g_return_val_if_fail (container == NULL || GIMP_IS_CONTAINER (container),
NULL);
g_return_val_if_fail (context == NULL || GIMP_IS_CONTEXT (context), NULL);
g_return_val_if_fail (preview_size > 0 &&
preview_size <= GIMP_PREVIEW_MAX_SIZE, NULL);
preview_size <= GIMP_VIEWABLE_MAX_POPUP_SIZE, NULL);
menu_impl = g_object_new (GIMP_TYPE_CONTAINER_MENU_IMPL, NULL);
......
......@@ -263,7 +263,7 @@ gimp_container_tree_view_new (GimpContainer *container,
NULL);
g_return_val_if_fail (context == NULL || GIMP_IS_CONTEXT (context), NULL);
g_return_val_if_fail (preview_size > 0 &&
preview_size <= GIMP_PREVIEW_MAX_SIZE, NULL);
preview_size <= GIMP_VIEWABLE_MAX_PREVIEW_SIZE, NULL);
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);
......
......@@ -35,7 +35,6 @@
#include "gimpcontainerview.h"
#include "gimpcontainerview-utils.h"
#include "gimpdnd.h"
#include "gimppreview.h"
enum
......@@ -353,7 +352,8 @@ gimp_container_view_construct (GimpContainerView *view,
g_return_if_fail (GIMP_IS_CONTAINER_VIEW (view));
g_return_if_fail (container == NULL || GIMP_IS_CONTAINER (container));
g_return_if_fail (context == NULL || GIMP_IS_CONTEXT (context));
g_return_if_fail (preview_size > 0 && preview_size <= GIMP_PREVIEW_MAX_SIZE);
g_return_if_fail (preview_size > 0 &&
preview_size <= GIMP_VIEWABLE_MAX_PREVIEW_SIZE);
g_return_if_fail (min_items_x <= 64);
g_return_if_fail (min_items_y <= 64);
......@@ -439,7 +439,8 @@ gimp_container_view_set_preview_size (GimpContainerView *view,
gint preview_size)
{
g_return_if_fail (GIMP_IS_CONTAINER_VIEW (view));
g_return_if_fail (preview_size > 0 && preview_size <= GIMP_PREVIEW_MAX_SIZE);
g_return_if_fail (preview_size > 0 &&
preview_size <= GIMP_VIEWABLE_MAX_PREVIEW_SIZE);
if (view->preview_size != preview_size)
{
......
......@@ -175,8 +175,8 @@ gimp_data_factory_view_construct (GimpDataFactoryView *factory_view,
g_return_val_if_fail (GIMP_IS_DATA_FACTORY_VIEW (factory_view), FALSE);
g_return_val_if_fail (GIMP_IS_DATA_FACTORY (factory), FALSE);
g_return_val_if_fail (preview_size > 0 &&
preview_size <= GIMP_PREVIEW_MAX_SIZE, FALSE);
g_return_val_if_fail (preview_size > 0 &&
preview_size <= GIMP_VIEWABLE_MAX_PREVIEW_SIZE, FALSE);
g_return_val_if_fail (min_items_x > 0 && min_items_x <= 64, FALSE);
g_return_val_if_fail (min_items_y > 0 && min_items_y <= 64, FALSE);
......
......@@ -353,9 +353,9 @@ gimp_item_tree_view_new (gint preview_size,
GimpContainerView *view;
GimpContainerTreeView *tree_view;
g_return_val_if_fail (preview_size > 0 &&
preview_size <= GIMP_PREVIEW_MAX_SIZE, NULL);
g_return_val_if_fail (! gimage || GIMP_IS_IMAGE (gimage), NULL);
g_return_val_if_fail (preview_size > 0 &&
preview_size <= GIMP_VIEWABLE_MAX_PREVIEW_SIZE, NULL);
g_return_val_if_fail (gimage == NULL || GIMP_IS_IMAGE (gimage), NULL);
g_return_val_if_fail (signal_name != NULL, NULL);
g_return_val_if_fail (new_item_func != NULL, NULL);
g_return_val_if_fail (edit_item_func != NULL, NULL);
......
......@@ -242,9 +242,9 @@ gimp_preview_size_allocate (GtkWidget *widget,
if (preview->expand)
{
width = MIN (GIMP_PREVIEW_MAX_SIZE,
width = MIN (GIMP_VIEWABLE_MAX_PREVIEW_SIZE,
allocation->width - 2 * preview->renderer->border_width);
height = MIN (GIMP_PREVIEW_MAX_SIZE,
height = MIN (GIMP_VIEWABLE_MAX_PREVIEW_SIZE,
allocation->height - 2 * preview->renderer->border_width);
if (preview->renderer->width != width ||
......@@ -260,7 +260,7 @@ gimp_preview_size_allocate (GtkWidget *widget,
gint scaled_height;
gimp_viewable_get_preview_size (preview->renderer->viewable,
GIMP_PREVIEW_MAX_SIZE,
GIMP_VIEWABLE_MAX_PREVIEW_SIZE,
preview->renderer->is_popup,
preview->renderer->dot_for_dot,
&preview_width,
......@@ -545,7 +545,8 @@ gimp_preview_new_by_types (GType preview_type,
g_return_val_if_fail (g_type_is_a (preview_type, GIMP_TYPE_PREVIEW), NULL);
g_return_val_if_fail (g_type_is_a (viewable_type, GIMP_TYPE_VIEWABLE), NULL);
g_return_val_if_fail (size > 0 && size <= GIMP_PREVIEW_MAX_SIZE, NULL);
g_return_val_if_fail (size > 0 &&
size <= GIMP_VIEWABLE_MAX_PREVIEW_SIZE, NULL);
g_return_val_if_fail (border_width >= 0 &&
border_width <= GIMP_PREVIEW_MAX_BORDER_WIDTH, NULL);
......@@ -580,8 +581,10 @@ gimp_preview_new_full_by_types (GType preview_type,
g_return_val_if_fail (g_type_is_a (preview_type, GIMP_TYPE_PREVIEW), NULL);
g_return_val_if_fail (g_type_is_a (viewable_type, GIMP_TYPE_VIEWABLE), NULL);
g_return_val_if_fail (width > 0 && width <= GIMP_PREVIEW_MAX_SIZE, NULL);
g_return_val_if_fail (height > 0 && height <= GIMP_PREVIEW_MAX_SIZE, NULL);
g_return_val_if_fail (width > 0 &&
width <= GIMP_VIEWABLE_MAX_PREVIEW_SIZE, NULL);
g_return_val_if_fail (height > 0 &&
height <= GIMP_VIEWABLE_MAX_PREVIEW_SIZE, NULL);
g_return_val_if_fail (border_width >= 0 &&
border_width <= GIMP_PREVIEW_MAX_BORDER_WIDTH, NULL);
......@@ -610,7 +613,7 @@ gimp_preview_set_viewable (GimpPreview *preview,
GType viewable_type = G_TYPE_NONE;
g_return_if_fail (GIMP_IS_PREVIEW (preview));
g_return_if_fail (! viewable || GIMP_IS_VIEWABLE (viewable));
g_return_if_fail (viewable == NULL || GIMP_IS_VIEWABLE (viewable));
if (viewable)
{
......@@ -667,7 +670,8 @@ gimp_preview_set_size (GimpPreview *preview,
gint border_width)
{
g_return_if_fail (GIMP_IS_PREVIEW (preview));
g_return_if_fail (preview_size > 0 && preview_size <= GIMP_PREVIEW_MAX_SIZE);
g_return_if_fail (preview_size > 0 &&
preview_size <= GIMP_VIEWABLE_MAX_PREVIEW_SIZE);
g_return_if_fail (border_width >= 0 &&
border_width <= GIMP_PREVIEW_MAX_BORDER_WIDTH);
......@@ -682,8 +686,10 @@ gimp_preview_set_size_full (GimpPreview *preview,
gint border_width)
{
g_return_if_fail (GIMP_IS_PREVIEW (preview));
g_return_if_fail (width > 0 && width <= GIMP_PREVIEW_MAX_SIZE);
g_return_if_fail (height > 0 && height <= GIMP_PREVIEW_MAX_SIZE);
g_return_if_fail (width > 0 &&
width <= GIMP_VIEWABLE_MAX_PREVIEW_SIZE);
g_return_if_fail (height > 0 &&
height <= GIMP_VIEWABLE_MAX_PREVIEW_SIZE);
g_return_if_fail (border_width >= 0 &&
border_width <= GIMP_PREVIEW_MAX_BORDER_WIDTH);
......
......@@ -26,10 +26,6 @@
#include <gtk/gtkdrawingarea.h>
#define GIMP_PREVIEW_MAX_SIZE 1024
#define GIMP_PREVIEW_MAX_BORDER_WIDTH 16
#define GIMP_TYPE_PREVIEW (gimp_preview_get_type ())
#define GIMP_PREVIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_PREVIEW, GimpPreview))
#define GIMP_PREVIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_PREVIEW, GimpPreviewClass))
......
......@@ -199,7 +199,8 @@ gimp_preview_renderer_new (GType viewable_type,
GimpPreviewRenderer *renderer;
g_return_val_if_fail (g_type_is_a (viewable_type, GIMP_TYPE_VIEWABLE), NULL);
g_return_val_if_fail (size > 0 && size <= GIMP_PREVIEW_MAX_SIZE, NULL);
g_return_val_if_fail (size > 0 &&
size <= GIMP_VIEWABLE_MAX_PREVIEW_SIZE, NULL);
g_return_val_if_fail (border_width >= 0 &&
border_width <= GIMP_PREVIEW_MAX_BORDER_WIDTH, NULL);
......@@ -224,8 +225,10 @@ gimp_preview_renderer_new_full (GType viewable_type,
GimpPreviewRenderer *renderer;
g_return_val_if_fail (g_type_is_a (viewable_type, GIMP_TYPE_VIEWABLE), NULL);
g_return_val_if_fail (width > 0 && width <= GIMP_PREVIEW_MAX_SIZE, NULL);
g_return_val_if_fail (height > 0 && height <= GIMP_PREVIEW_MAX_SIZE, NULL);
g_return_val_if_fail (width > 0 &&
width <= GIMP_VIEWABLE_MAX_PREVIEW_SIZE, NULL);
g_return_val_if_fail (height > 0 &&
height <= GIMP_VIEWABLE_MAX_PREVIEW_SIZE, NULL);
g_return_val_if_fail (border_width >= 0 &&
border_width <= GIMP_PREVIEW_MAX_BORDER_WIDTH, NULL);
......@@ -319,7 +322,8 @@ gimp_preview_renderer_set_size (GimpPreviewRenderer *renderer,
gint width, height;
g_return_if_fail (GIMP_IS_PREVIEW_RENDERER (renderer));
g_return_if_fail (preview_size > 0 && preview_size <= GIMP_PREVIEW_MAX_SIZE);
g_return_if_fail (preview_size > 0 &&
preview_size <= GIMP_VIEWABLE_MAX_PREVIEW_SIZE);
g_return_if_fail (border_width >= 0 &&
border_width <= GIMP_PREVIEW_MAX_BORDER_WIDTH);
......@@ -349,8 +353,10 @@ gimp_preview_renderer_set_size_full (GimpPreviewRenderer *renderer,
gint border_width)
{
g_return_if_fail (GIMP_IS_PREVIEW_RENDERER (renderer));
g_return_if_fail (width > 0 && width <= GIMP_PREVIEW_MAX_SIZE);
g_return_if_fail (height > 0 && height <= GIMP_PREVIEW_MAX_SIZE);
g_return_if_fail (width > 0 &&
width <= GIMP_VIEWABLE_MAX_PREVIEW_SIZE);
g_return_if_fail (height > 0 &&
height <= GIMP_VIEWABLE_MAX_PREVIEW_SIZE);
g_return_if_fail (border_width >= 0 &&
border_width <= GIMP_PREVIEW_MAX_BORDER_WIDTH);
......
......@@ -23,8 +23,7 @@
#define __GIMP_PREVIEW_RENDERER_H__
#define GIMP_PREVIEW_MAX_SIZE 1024
#define GIMP_PREVIEW_MAX_BORDER_WIDTH 16
#define GIMP_PREVIEW_MAX_BORDER_WIDTH 16
#define GIMP_TYPE_PREVIEW_RENDERER (gimp_preview_renderer_get_type ())
......
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