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



commit 15183c210b68232a6b93bc8e295f0be7224a5d6a
Author: Michael Natterer <mitch gimp org>
Date:   Mon Dec 28 16:47:39 2015 +0100

    app: move GimpMybrushPrivate to its own header, perparation for more hacking
    
    Also, return the error message if the preview can't be loaded.

 app/core/Makefile.am           |    1 +
 app/core/gimpmybrush-load.c    |    8 ++++----
 app/core/gimpmybrush-load.h    |    2 ++
 app/core/gimpmybrush-private.h |   35 +++++++++++++++++++++++++++++++++++
 app/core/gimpmybrush.c         |   14 +++-----------
 app/core/gimpmybrush.h         |    2 ++
 6 files changed, 47 insertions(+), 15 deletions(-)
---
diff --git a/app/core/Makefile.am b/app/core/Makefile.am
index eb78fdb..1038e49 100644
--- a/app/core/Makefile.am
+++ b/app/core/Makefile.am
@@ -307,6 +307,7 @@ libappcore_a_sources = \
        gimpmybrush.h                           \
        gimpmybrush-load.c                      \
        gimpmybrush-load.h                      \
+       gimpmybrush-private.h                   \
        gimpobject.c                            \
        gimpobject.h                            \
        gimppaintinfo.c                         \
diff --git a/app/core/gimpmybrush-load.c b/app/core/gimpmybrush-load.c
index 1a25e6b..4b3f6c9 100644
--- a/app/core/gimpmybrush-load.c
+++ b/app/core/gimpmybrush-load.c
@@ -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;
 
diff --git a/app/core/gimpmybrush-load.h b/app/core/gimpmybrush-load.h
index c277a64..117c92b 100644
--- a/app/core/gimpmybrush-load.h
+++ b/app/core/gimpmybrush-load.h
@@ -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
diff --git a/app/core/gimpmybrush-private.h b/app/core/gimpmybrush-private.h
new file mode 100644
index 0000000..c89978d
--- /dev/null
+++ b/app/core/gimpmybrush-private.h
@@ -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__ */
diff --git a/app/core/gimpmybrush.c b/app/core/gimpmybrush.c
index cf0d1fc..53199fc 100644
--- a/app/core/gimpmybrush.c
+++ b/app/core/gimpmybrush.c
@@ -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);
diff --git a/app/core/gimpmybrush.h b/app/core/gimpmybrush.h
index 252e576..fc91a3b 100644
--- a/app/core/gimpmybrush.h
+++ b/app/core/gimpmybrush.h
@@ -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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]