Branch data Line data Source code
1 : : /* GIO - GLib Input, Output and Streaming Library
2 : : *
3 : : * Copyright 2025 Red Hat, Inc.
4 : : *
5 : : * SPDX-License-Identifier: LGPL-2.1-or-later
6 : : *
7 : : * This library is free software; you can redistribute it and/or
8 : : * modify it under the terms of the GNU Lesser General Public
9 : : * License as published by the Free Software Foundation; either
10 : : * version 2.1 of the License, or (at your option) any later version.
11 : : *
12 : : * This library 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 GNU
15 : : * Lesser General Public License for more details.
16 : : *
17 : : * You should have received a copy of the GNU Lesser General
18 : : * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
19 : : */
20 : :
21 : : #ifndef __G_MEMORY_MONITOR_BASE_H__
22 : : #define __G_MEMORY_MONITOR_BASE_H__
23 : :
24 : : #include <glib-object.h>
25 : :
26 : : G_BEGIN_DECLS
27 : :
28 : : #define G_TYPE_MEMORY_MONITOR_BASE (g_memory_monitor_base_get_type ())
29 : :
30 : 6 : G_DECLARE_DERIVABLE_TYPE (GMemoryMonitorBase, g_memory_monitor_base, G, MEMORY_MONITOR_BASE, GObject)
31 : :
32 : : typedef enum
33 : : {
34 : : G_MEMORY_MONITOR_LOW_MEMORY_LEVEL_INVALID = -1,
35 : : G_MEMORY_MONITOR_LOW_MEMORY_LEVEL_LOW = 0,
36 : : G_MEMORY_MONITOR_LOW_MEMORY_LEVEL_MEDIUM,
37 : : G_MEMORY_MONITOR_LOW_MEMORY_LEVEL_CRITICAL,
38 : : G_MEMORY_MONITOR_LOW_MEMORY_LEVEL_COUNT
39 : : } GMemoryMonitorLowMemoryLevel;
40 : :
41 : : struct _GMemoryMonitorBaseClass
42 : : {
43 : : GObjectClass parent_class;
44 : : };
45 : :
46 : : void g_memory_monitor_base_send_event_to_user (GMemoryMonitorBase *monitor,
47 : : GMemoryMonitorLowMemoryLevel warning_level);
48 : : GMemoryMonitorWarningLevel g_memory_monitor_base_level_enum_to_byte (GMemoryMonitorLowMemoryLevel level);
49 : : gdouble g_memory_monitor_base_query_mem_ratio (void);
50 : :
51 : : G_END_DECLS
52 : :
53 : : #endif /* __G_MEMORY_MONITOR_BASE_H__ */
|