gmemorymonitor.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. #ifndef __G_MEMORY_MONITOR_H__
  19. #define __G_MEMORY_MONITOR_H__
  20. #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
  21. #error "Only <gio/gio.h> can be included directly."
  22. #endif
  23. #include <gio/giotypes.h>
  24. G_BEGIN_DECLS
  25. /**
  26. * G_MEMORY_MONITOR_EXTENSION_POINT_NAME:
  27. *
  28. * Extension point for memory usage monitoring functionality.
  29. * See [Extending GIO][extending-gio].
  30. *
  31. * Since: 2.64
  32. */
  33. #define G_MEMORY_MONITOR_EXTENSION_POINT_NAME "gio-memory-monitor"
  34. #define G_TYPE_MEMORY_MONITOR (g_memory_monitor_get_type ())
  35. GLIB_AVAILABLE_IN_2_64
  36. G_DECLARE_INTERFACE(GMemoryMonitor, g_memory_monitor, g, memory_monitor, GObject)
  37. #define G_MEMORY_MONITOR(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_MEMORY_MONITOR, GMemoryMonitor))
  38. #define G_IS_MEMORY_MONITOR(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_MEMORY_MONITOR))
  39. #define G_MEMORY_MONITOR_GET_INTERFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), G_TYPE_MEMORY_MONITOR, GMemoryMonitorInterface))
  40. struct _GMemoryMonitorInterface {
  41. /*< private >*/
  42. GTypeInterface g_iface;
  43. /*< public >*/
  44. void (*low_memory_warning) (GMemoryMonitor *monitor,
  45. GMemoryMonitorWarningLevel level);
  46. };
  47. GLIB_AVAILABLE_IN_2_64
  48. GMemoryMonitor *g_memory_monitor_dup_default (void);
  49. G_END_DECLS
  50. #endif /* __G_MEMORY_MONITOR_H__ */