mirror of https://github.com/GNOME/gimp.git
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:
parent
0ee649629e
commit
15183c210b
|
@ -307,6 +307,7 @@ libappcore_a_sources = \
|
||||||
gimpmybrush.h \
|
gimpmybrush.h \
|
||||||
gimpmybrush-load.c \
|
gimpmybrush-load.c \
|
||||||
gimpmybrush-load.h \
|
gimpmybrush-load.h \
|
||||||
|
gimpmybrush-private.h \
|
||||||
gimpobject.c \
|
gimpobject.c \
|
||||||
gimpobject.h \
|
gimpobject.h \
|
||||||
gimppaintinfo.c \
|
gimppaintinfo.c \
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/* GIMP - The GNU Image Manipulation Program
|
/* GIMP - The GNU Image Manipulation Program
|
||||||
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
* 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
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -28,6 +28,7 @@
|
||||||
|
|
||||||
#include "gimpmybrush.h"
|
#include "gimpmybrush.h"
|
||||||
#include "gimpmybrush-load.h"
|
#include "gimpmybrush-load.h"
|
||||||
|
#include "gimpmybrush-private.h"
|
||||||
|
|
||||||
#include "gimp-intl.h"
|
#include "gimp-intl.h"
|
||||||
|
|
||||||
|
@ -58,7 +59,8 @@ gimp_mybrush_load (GimpContext *context,
|
||||||
g_free (basename);
|
g_free (basename);
|
||||||
|
|
||||||
pixbuf = gdk_pixbuf_new_from_file_at_size (preview_filename,
|
pixbuf = gdk_pixbuf_new_from_file_at_size (preview_filename,
|
||||||
48, 48, NULL);
|
48, 48, error);
|
||||||
|
g_free (preview_filename);
|
||||||
|
|
||||||
if (pixbuf)
|
if (pixbuf)
|
||||||
{
|
{
|
||||||
|
@ -74,8 +76,6 @@ gimp_mybrush_load (GimpContext *context,
|
||||||
g_object_unref (pixbuf);
|
g_object_unref (pixbuf);
|
||||||
}
|
}
|
||||||
|
|
||||||
g_free (preview_filename);
|
|
||||||
|
|
||||||
if (! brush)
|
if (! brush)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
/* GIMP - The GNU Image Manipulation Program
|
/* GIMP - The GNU Image Manipulation Program
|
||||||
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
||||||
*
|
*
|
||||||
|
* gimpmybrush-load.h
|
||||||
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 3 of the License, or
|
* the Free Software Foundation; either version 3 of the License, or
|
||||||
|
|
|
@ -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__ */
|
|
@ -1,6 +1,8 @@
|
||||||
/* GIMP - The GNU Image Manipulation Program
|
/* GIMP - The GNU Image Manipulation Program
|
||||||
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
||||||
*
|
*
|
||||||
|
* gimpmybrush.c
|
||||||
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 3 of the License, or
|
* the Free Software Foundation; either version 3 of the License, or
|
||||||
|
@ -27,22 +29,12 @@
|
||||||
|
|
||||||
#include "gimpmybrush.h"
|
#include "gimpmybrush.h"
|
||||||
#include "gimpmybrush-load.h"
|
#include "gimpmybrush-load.h"
|
||||||
|
#include "gimpmybrush-private.h"
|
||||||
#include "gimptagged.h"
|
#include "gimptagged.h"
|
||||||
|
|
||||||
#include "gimp-intl.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_tagged_iface_init (GimpTaggedInterface *iface);
|
||||||
|
|
||||||
static void gimp_mybrush_finalize (GObject *object);
|
static void gimp_mybrush_finalize (GObject *object);
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
/* GIMP - The GNU Image Manipulation Program
|
/* GIMP - The GNU Image Manipulation Program
|
||||||
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
||||||
*
|
*
|
||||||
|
* gimpmybrush.h
|
||||||
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 3 of the License, or
|
* the Free Software Foundation; either version 3 of the License, or
|
||||||
|
|
Loading…
Reference in New Issue