app: move GimpMybrushPrivate to its own header, perparation for more hacking

Also, return the error message if the preview can't be loaded.
This commit is contained in:
Michael Natterer 2015-12-28 16:47:39 +01:00
parent 0ee649629e
commit 15183c210b
6 changed files with 47 additions and 15 deletions

View File

@ -307,6 +307,7 @@ libappcore_a_sources = \
gimpmybrush.h \
gimpmybrush-load.c \
gimpmybrush-load.h \
gimpmybrush-private.h \
gimpobject.c \
gimpobject.h \
gimppaintinfo.c \

View File

@ -1,7 +1,7 @@
/* GIMP - The GNU Image Manipulation Program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* gimpbrush-load.c
* gimpmybrush-load.c
*
* 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
@ -28,6 +28,7 @@
#include "gimpmybrush.h"
#include "gimpmybrush-load.h"
#include "gimpmybrush-private.h"
#include "gimp-intl.h"
@ -58,7 +59,8 @@ gimp_mybrush_load (GimpContext *context,
g_free (basename);
pixbuf = gdk_pixbuf_new_from_file_at_size (preview_filename,
48, 48, NULL);
48, 48, error);
g_free (preview_filename);
if (pixbuf)
{
@ -74,8 +76,6 @@ gimp_mybrush_load (GimpContext *context,
g_object_unref (pixbuf);
}
g_free (preview_filename);
if (! brush)
return NULL;

View File

@ -1,6 +1,8 @@
/* GIMP - The GNU Image Manipulation Program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* gimpmybrush-load.h
*
* 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 3 of the License, or

View File

@ -0,0 +1,35 @@
/* GIMP - The GNU Image Manipulation Program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* gimpmybrush-private.h
*
* 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 3 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, see <http://www.gnu.org/licenses/>.
*/
#ifndef __GIMP_MYBRUSH_PRIVATE_H__
#define __GIMP_MYBRUSH_PRIVATE_H__
struct _GimpMybrushPrivate
{
gboolean json_loaded;
gchar *brush_json;
gdouble radius;
gdouble opaque;
gdouble hardness;
};
#endif /* __GIMP_MYBRUSH_PRIVATE_H__ */

View File

@ -1,6 +1,8 @@
/* GIMP - The GNU Image Manipulation Program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* gimpmybrush.c
*
* 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 3 of the License, or
@ -27,22 +29,12 @@
#include "gimpmybrush.h"
#include "gimpmybrush-load.h"
#include "gimpmybrush-private.h"
#include "gimptagged.h"
#include "gimp-intl.h"
struct _GimpMybrushPrivate
{
gboolean json_loaded;
gchar *brush_json;
gdouble radius;
gdouble opaque;
gdouble hardness;
};
static void gimp_mybrush_tagged_iface_init (GimpTaggedInterface *iface);
static void gimp_mybrush_finalize (GObject *object);

View File

@ -1,6 +1,8 @@
/* GIMP - The GNU Image Manipulation Program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* gimpmybrush.h
*
* 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 3 of the License, or