Commit 78b4a1df authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann
Browse files

app/widgets/gimpbrushfactoryview.c app/widgets/gimpcontainereditor.c

2003-01-04  Sven Neumann  <sven@gimp.org>

	* app/widgets/gimpbrushfactoryview.c
	* app/widgets/gimpcontainereditor.c
	* app/widgets/gimpcontainergridview.c
	* app/widgets/gimpcontainerlistview.c
	* app/widgets/gimpcontainermenuimpl.c
	* app/widgets/gimpcontainerview.c
	* app/widgets/gimpdatafactoryview.c
	* app/widgets/gimpitemlistview.c: check preview sizes to be
	smaller than GIMP_PREVIEW_MAX_SIZE instead of using a hardcoded
	and much too small value of 64.

	* app/widgets/gimpdialogfactory.c: check that the preview size is
	in range of the GimpPreviewSize enum when parsing the sessionrc.
parent 23054985
2003-01-04 Sven Neumann <sven@gimp.org>
* app/widgets/gimpbrushfactoryview.c
* app/widgets/gimpcontainereditor.c
* app/widgets/gimpcontainergridview.c
* app/widgets/gimpcontainerlistview.c
* app/widgets/gimpcontainermenuimpl.c
* app/widgets/gimpcontainerview.c
* app/widgets/gimpdatafactoryview.c
* app/widgets/gimpitemlistview.c: check preview sizes to be
smaller than GIMP_PREVIEW_MAX_SIZE instead of using a hardcoded
and much too small value of 64.
* app/widgets/gimpdialogfactory.c: check that the preview size is
in range of the GimpPreviewSize enum when parsing the sessionrc.
2003-01-04 Sven Neumann <sven@gimp.org>
 
* app/base/tile-swap.c (tile_swap_find_offset): use off_t to
......
......@@ -36,6 +36,7 @@
#include "gimpcontainerview.h"
#include "gimpbrushfactoryview.h"
#include "gimppreview.h"
#include "libgimp/gimpintl.h"
......@@ -158,7 +159,8 @@ gimp_brush_factory_view_new (GimpViewType view_type,
GimpContainerEditor *editor;
g_return_val_if_fail (GIMP_IS_DATA_FACTORY (factory), NULL);
g_return_val_if_fail (preview_size > 0 && preview_size <= 64, NULL);
g_return_val_if_fail (preview_size > 0 &&
preview_size <= GIMP_PREVIEW_MAX_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,6 +35,7 @@
#include "gimpcontainerlistview.h"
#include "gimpdnd.h"
#include "gimpitemfactory.h"
#include "gimppreview.h"
static void gimp_container_editor_class_init (GimpContainerEditorClass *klass);
......@@ -144,7 +145,8 @@ gimp_container_editor_construct (GimpContainerEditor *editor,
g_return_val_if_fail (GIMP_IS_CONTEXT (context), FALSE);
g_return_val_if_fail (GIMP_IS_ITEM_FACTORY (item_factory), FALSE);
g_return_val_if_fail (preview_size > 0 && preview_size <= 64, FALSE);
g_return_val_if_fail (preview_size > 0 &&
preview_size <= GIMP_PREVIEW_MAX_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);
......
......@@ -185,7 +185,8 @@ gimp_container_grid_view_new (GimpContainer *container,
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 (preview_size > 0 && preview_size <= 64, NULL);
g_return_val_if_fail (preview_size > 0 &&
preview_size <= GIMP_PREVIEW_MAX_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);
......
......@@ -168,7 +168,8 @@ gimp_container_list_view_new (GimpContainer *container,
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 (preview_size > 0 && preview_size <= 64, NULL);
g_return_val_if_fail (preview_size > 0 &&
preview_size <= GIMP_PREVIEW_MAX_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);
......
......@@ -125,7 +125,8 @@ gimp_container_menu_new (GimpContainer *container,
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 (preview_size > 0 && preview_size <= 64, NULL);
g_return_val_if_fail (preview_size > 0 &&
preview_size <= GIMP_PREVIEW_MAX_SIZE, NULL);
menu_impl = g_object_new (GIMP_TYPE_CONTAINER_MENU_IMPL, NULL);
......
......@@ -35,6 +35,7 @@
#include "gimpcontainerview.h"
#include "gimpcontainerview-utils.h"
#include "gimpdnd.h"
#include "gimppreview.h"
enum
......@@ -395,7 +396,7 @@ 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 <= 256 /* FIXME: 64 */);
g_return_if_fail (preview_size > 0 && preview_size <= GIMP_PREVIEW_MAX_SIZE);
if (view->preview_size != preview_size)
{
......
......@@ -42,6 +42,7 @@
#include "gimpcontainergridview.h"
#include "gimpcontainerlistview.h"
#include "gimpdnd.h"
#include "gimppreview.h"
#include "gimpwidgets-utils.h"
#include "libgimp/gimpintl.h"
......@@ -167,7 +168,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 <= 64, FALSE);
g_return_val_if_fail (preview_size > 0 &&
preview_size <= GIMP_PREVIEW_MAX_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);
......
......@@ -431,7 +431,7 @@ gimp_dialog_factory_dialog_new_internal (GimpDialogFactory *factory,
* - the factory's context, which happens when raising a toplevel
* dialog was the original request.
*/
if (preview_size < 16)
if (preview_size < GIMP_PREVIEW_SIZE_TINY)
preview_size = entry->preview_size;
if (context)
......@@ -1104,7 +1104,7 @@ gimp_dialog_factories_save_foreach (gchar *name,
view = gimp_container_view_get_by_dockable (dockable);
if (view && view->preview_size >= 16)
if (view && view->preview_size >= GIMP_PREVIEW_SIZE_TINY)
{
preview_size = view->preview_size;
}
......@@ -1202,7 +1202,8 @@ gimp_dialog_factories_restore_foreach (gchar *name,
preview_size = atoi (substring + 1);
if (preview_size < 16)
if (preview_size < GIMP_PREVIEW_SIZE_TINY ||
preview_size > GIMP_PREVIEW_SIZE_GIGANTIC)
preview_size = -1;
}
......
......@@ -294,7 +294,8 @@ gimp_item_list_view_new (gint preview_size,
GimpItemListView *list_view;
GimpContainerView *view;
g_return_val_if_fail (preview_size > 0 && preview_size <= 64, NULL);
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 (signal_name != NULL, NULL);
g_return_val_if_fail (get_container_func != NULL, NULL);
......
......@@ -294,7 +294,8 @@ gimp_item_list_view_new (gint preview_size,
GimpItemListView *list_view;
GimpContainerView *view;
g_return_val_if_fail (preview_size > 0 && preview_size <= 64, NULL);
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 (signal_name != NULL, NULL);
g_return_val_if_fail (get_container_func != NULL, NULL);
......
Supports Markdown
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