1 /* GIMP - The GNU Image Manipulation Program
2  * Copyright (C) 1995-1997 Spencer Kimball and Peter Mattis
3  *
4  * gimppluginmanager.h
5  *
6  * This program is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program.  If not, see <https://www.gnu.org/licenses/>.
18  */
19 
20 #ifndef __GIMP_PLUG_IN_MANAGER_H__
21 #define __GIMP_PLUG_IN_MANAGER_H__
22 
23 
24 #include "core/gimpobject.h"
25 
26 
27 #define GIMP_TYPE_PLUG_IN_MANAGER            (gimp_plug_in_manager_get_type ())
28 #define GIMP_PLUG_IN_MANAGER(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_PLUG_IN_MANAGER, GimpPlugInManager))
29 #define GIMP_PLUG_IN_MANAGER_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_PLUG_IN_MANAGER, GimpPlugInManagerClass))
30 #define GIMP_IS_PLUG_IN_MANAGER(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_PLUG_IN_MANAGER))
31 #define GIMP_IS_PLUG_IN_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_PLUG_IN_MANAGER))
32 
33 
34 typedef struct _GimpPlugInManagerClass GimpPlugInManagerClass;
35 
36 struct _GimpPlugInManager
37 {
38   GimpObject         parent_instance;
39 
40   Gimp              *gimp;
41 
42   GSList            *plug_in_defs;
43   gboolean           write_pluginrc;
44 
45   GSList            *plug_in_procedures;
46 
47   GSList            *load_procs;
48   GSList            *save_procs;
49   GSList            *export_procs;
50   GSList            *raw_load_procs;
51 
52   GSList            *display_load_procs;
53   GSList            *display_save_procs;
54   GSList            *display_export_procs;
55   GSList            *display_raw_load_procs;
56 
57   GSList            *menu_branches;
58   GSList            *locale_domains;
59   GSList            *help_domains;
60 
61   GimpPlugIn        *current_plug_in;
62   GSList            *open_plug_ins;
63   GSList            *plug_in_stack;
64 
65   GimpPlugInShm     *shm;
66   GimpInterpreterDB *interpreter_db;
67   GimpEnvironTable  *environ_table;
68   GimpPlugInDebug   *debug;
69   GList             *data_list;
70 };
71 
72 struct _GimpPlugInManagerClass
73 {
74   GimpObjectClass  parent_class;
75 
76   void (* plug_in_opened)    (GimpPlugInManager *manager,
77                               GimpPlugIn        *plug_in);
78   void (* plug_in_closed)    (GimpPlugInManager *manager,
79                               GimpPlugIn        *plug_in);
80 
81   void (* menu_branch_added) (GimpPlugInManager *manager,
82                               GFile             *file,
83                               const gchar       *menu_path,
84                               const gchar       *menu_label);
85 };
86 
87 
88 GType               gimp_plug_in_manager_get_type (void) G_GNUC_CONST;
89 
90 GimpPlugInManager * gimp_plug_in_manager_new      (Gimp                *gimp);
91 
92 void    gimp_plug_in_manager_initialize           (GimpPlugInManager   *manager,
93                                                    GimpInitStatusFunc   status_callback);
94 void    gimp_plug_in_manager_exit                 (GimpPlugInManager   *manager);
95 
96 /* Register a plug-in. This function is public for file load-save
97  * handlers, which are organized around the plug-in data structure.
98  * This could all be done a little better, but oh well.  -josh
99  */
100 void    gimp_plug_in_manager_add_procedure        (GimpPlugInManager   *manager,
101                                                    GimpPlugInProcedure *procedure);
102 
103 void    gimp_plug_in_manager_add_temp_proc        (GimpPlugInManager      *manager,
104                                                    GimpTemporaryProcedure *procedure);
105 void    gimp_plug_in_manager_remove_temp_proc     (GimpPlugInManager      *manager,
106                                                    GimpTemporaryProcedure *procedure);
107 
108 void    gimp_plug_in_manager_add_open_plug_in     (GimpPlugInManager   *manager,
109                                                    GimpPlugIn          *plug_in);
110 void    gimp_plug_in_manager_remove_open_plug_in  (GimpPlugInManager   *manager,
111                                                    GimpPlugIn          *plug_in);
112 
113 void    gimp_plug_in_manager_plug_in_push         (GimpPlugInManager   *manager,
114                                                    GimpPlugIn          *plug_in);
115 void    gimp_plug_in_manager_plug_in_pop          (GimpPlugInManager   *manager);
116 
117 
118 #endif  /* __GIMP_PLUG_IN_MANAGER_H__ */
119