Commit 15183c21 authored by Michael Natterer's avatar Michael Natterer 😴

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

Also, return the error message if the preview can't be loaded.
parent 0ee64962
......@@ -307,6 +307,7 @@ libappcore_a_sources = \
gimpmybrush.h \
gimpmybrush-load.c \
gimpmybrush-load.h \
gimpmybrush-private.h \
gimpobject.c \
gimpobject.h \
gimppaintinfo.c \
......
/* 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;
......
/* 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
......
/* 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__ */
/* 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);
......
/* 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
......
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