1 /* GIMP - The GNU Image Manipulation Program
2  * Copyright (C) 1995 Spencer Kimball and Peter Mattis
3  *
4  * gimpdashboard.h
5  * Copyright (C) 2017 Ell
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program.  If not, see <https://www.gnu.org/licenses/>.
19  */
20 
21 #ifndef __GIMP_DASHBOARD_H__
22 #define __GIMP_DASHBOARD_H__
23 
24 
25 #include "gimpeditor.h"
26 
27 
28 struct _GimpDashboardLogParams
29 {
30   gint     sample_frequency;
31   gboolean backtrace;
32   gboolean messages;
33   gboolean progressive;
34 };
35 
36 
37 #define GIMP_TYPE_DASHBOARD            (gimp_dashboard_get_type ())
38 #define GIMP_DASHBOARD(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_DASHBOARD, GimpDashboard))
39 #define GIMP_DASHBOARD_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_DASHBOARD, GimpDashboardClass))
40 #define GIMP_IS_DASHBOARD(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_DASHBOARD))
41 #define GIMP_IS_DASHBOARD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_DASHBOARD))
42 #define GIMP_DASHBOARD_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_DASHBOARD, GimpDashboardClass))
43 
44 
45 typedef struct _GimpDashboardPrivate GimpDashboardPrivate;
46 typedef struct _GimpDashboardClass   GimpDashboardClass;
47 
48 struct _GimpDashboard
49 {
50   GimpEditor            parent_instance;
51 
52   GimpDashboardPrivate *priv;
53 };
54 
55 struct _GimpDashboardClass
56 {
57   GimpEditorClass  parent_class;
58 };
59 
60 
61 GType                          gimp_dashboard_get_type                   (void) G_GNUC_CONST;
62 
63 GtkWidget                    * gimp_dashboard_new                        (Gimp                          *gimp,
64                                                                           GimpMenuFactory               *menu_factory);
65 
66 gboolean                       gimp_dashboard_log_start_recording        (GimpDashboard                 *dashboard,
67                                                                           GFile                         *file,
68                                                                           const GimpDashboardLogParams  *params,
69                                                                           GError                       **error);
70 gboolean                       gimp_dashboard_log_stop_recording         (GimpDashboard                 *dashboard,
71                                                                           GError                       **error);
72 gboolean                       gimp_dashboard_log_is_recording           (GimpDashboard                 *dashboard);
73 const GimpDashboardLogParams * gimp_dashboard_log_get_default_params     (GimpDashboard                 *dashboard);
74 void                           gimp_dashboard_log_add_marker             (GimpDashboard                 *dashboard,
75                                                                           const gchar                   *description);
76 
77 void                           gimp_dashboard_reset                      (GimpDashboard                 *dashboard);
78 
79 void                           gimp_dashboard_set_update_interval        (GimpDashboard                 *dashboard,
80                                                                           GimpDashboardUpdateInteval     update_interval);
81 GimpDashboardUpdateInteval     gimp_dashboard_get_update_interval        (GimpDashboard                 *dashboard);
82 
83 void                           gimp_dashboard_set_history_duration       (GimpDashboard                 *dashboard,
84                                                                           GimpDashboardHistoryDuration   history_duration);
85 GimpDashboardHistoryDuration   gimp_dashboard_get_history_duration       (GimpDashboard                 *dashboard);
86 
87 void                           gimp_dashboard_set_low_swap_space_warning (GimpDashboard                 *dashboard,
88                                                                           gboolean                       low_swap_space_warning);
89 gboolean                       gimp_dashboard_get_low_swap_space_warning (GimpDashboard                 *dashboard);
90 
91 void                           gimp_dashboard_menu_setup                 (GimpUIManager                 *manager,
92                                                                           const gchar                   *ui_path);
93 
94 
95 #endif  /*  __GIMP_DASHBOARD_H__  */
96