Imported Upstream version 2.66.6
[platform/upstream/glib.git] / gio / gmemorymonitor.h
1 /* GIO - GLib Input, Output and Streaming Library
2  *
3  * Copyright 2019 Red Hat, Inc.
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General
16  * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
17  */
18
19 #ifndef __G_MEMORY_MONITOR_H__
20 #define __G_MEMORY_MONITOR_H__
21
22 #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
23 #error "Only <gio/gio.h> can be included directly."
24 #endif
25
26 #include <gio/giotypes.h>
27
28 G_BEGIN_DECLS
29
30 /**
31  * G_MEMORY_MONITOR_EXTENSION_POINT_NAME:
32  *
33  * Extension point for memory usage monitoring functionality.
34  * See [Extending GIO][extending-gio].
35  *
36  * Since: 2.64
37  */
38 #define G_MEMORY_MONITOR_EXTENSION_POINT_NAME "gio-memory-monitor"
39
40 #define G_TYPE_MEMORY_MONITOR             (g_memory_monitor_get_type ())
41 GLIB_AVAILABLE_IN_2_64
42 G_DECLARE_INTERFACE(GMemoryMonitor, g_memory_monitor, g, memory_monitor, GObject)
43
44 #define G_MEMORY_MONITOR(o)               (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_MEMORY_MONITOR, GMemoryMonitor))
45 #define G_IS_MEMORY_MONITOR(o)            (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_MEMORY_MONITOR))
46 #define G_MEMORY_MONITOR_GET_INTERFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), G_TYPE_MEMORY_MONITOR, GMemoryMonitorInterface))
47
48 struct _GMemoryMonitorInterface {
49   /*< private >*/
50   GTypeInterface g_iface;
51
52   /*< public >*/
53   void     (*low_memory_warning)  (GMemoryMonitor             *monitor,
54                                    GMemoryMonitorWarningLevel  level);
55 };
56
57 GLIB_AVAILABLE_IN_2_64
58 GMemoryMonitor      *g_memory_monitor_dup_default           (void);
59
60 G_END_DECLS
61
62 #endif /* __G_MEMORY_MONITOR_H__ */