mirror of https://github.com/GNOME/gimp.git
73 lines
1.9 KiB
C
73 lines
1.9 KiB
C
/* The GIMP -- an image manipulation program
|
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
|
*
|
|
* 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 2 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, write to the Free Software
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
*/
|
|
|
|
#include "config.h"
|
|
|
|
#include <gtk/gtk.h>
|
|
|
|
#include "apptypes.h"
|
|
|
|
#include "context_manager.h"
|
|
#include "brushes.h"
|
|
#include "gimpbrush.h"
|
|
#include "gimpbrushgenerated.h"
|
|
#include "gimpbrushpipe.h"
|
|
#include "gimpdatafactory.h"
|
|
#include "gimpdatalist.h"
|
|
#include "gimprc.h"
|
|
|
|
|
|
/* public functions */
|
|
|
|
void
|
|
brushes_init (gboolean no_data)
|
|
{
|
|
brushes_free ();
|
|
|
|
if (brush_path != NULL && !no_data)
|
|
{
|
|
gimp_data_list_load (GIMP_DATA_LIST (global_brush_factory->container),
|
|
brush_path,
|
|
|
|
(GimpDataObjectLoaderFunc) gimp_brush_load,
|
|
GIMP_BRUSH_FILE_EXTENSION,
|
|
|
|
(GimpDataObjectLoaderFunc) gimp_brush_load,
|
|
GIMP_BRUSH_PIXMAP_FILE_EXTENSION,
|
|
|
|
(GimpDataObjectLoaderFunc) gimp_brush_generated_load,
|
|
GIMP_BRUSH_GENERATED_FILE_EXTENSION,
|
|
|
|
(GimpDataObjectLoaderFunc) gimp_brush_pipe_load,
|
|
GIMP_BRUSH_PIPE_FILE_EXTENSION,
|
|
|
|
NULL);
|
|
}
|
|
}
|
|
|
|
void
|
|
brushes_free (void)
|
|
{
|
|
if (gimp_container_num_children (global_brush_factory->container) == 0)
|
|
return;
|
|
|
|
gimp_data_list_save_and_clear
|
|
(GIMP_DATA_LIST (global_brush_factory->container),
|
|
brush_path);
|
|
}
|