2013-08-14 06:50:48 -04:00
|
|
|
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Copyright 2013 Red Hat, Inc.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License as
|
|
|
|
* published by the Free Software Foundation; either version 2 of the
|
|
|
|
* License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful, but
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2014-01-11 20:42:06 -05:00
|
|
|
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
2013-08-14 06:50:48 -04:00
|
|
|
*/
|
|
|
|
|
2023-07-21 09:37:20 -04:00
|
|
|
#pragma once
|
2013-08-14 06:50:48 -04:00
|
|
|
|
|
|
|
#include <glib-object.h>
|
2024-01-05 04:15:20 -05:00
|
|
|
|
|
|
|
#include "meta/types.h"
|
2013-08-14 06:50:48 -04:00
|
|
|
|
2021-04-19 10:16:04 -04:00
|
|
|
#define META_TYPE_IDLE_MONITOR (meta_idle_monitor_get_type ())
|
2019-01-22 21:25:35 -05:00
|
|
|
META_EXPORT
|
2021-04-19 10:16:04 -04:00
|
|
|
G_DECLARE_FINAL_TYPE (MetaIdleMonitor, meta_idle_monitor,
|
|
|
|
META, IDLE_MONITOR,
|
|
|
|
GObject)
|
2013-08-14 06:50:48 -04:00
|
|
|
|
|
|
|
typedef void (*MetaIdleMonitorWatchFunc) (MetaIdleMonitor *monitor,
|
|
|
|
guint watch_id,
|
|
|
|
gpointer user_data);
|
|
|
|
|
2019-01-22 21:25:35 -05:00
|
|
|
META_EXPORT
|
2013-08-14 06:50:48 -04:00
|
|
|
guint meta_idle_monitor_add_idle_watch (MetaIdleMonitor *monitor,
|
|
|
|
guint64 interval_msec,
|
|
|
|
MetaIdleMonitorWatchFunc callback,
|
|
|
|
gpointer user_data,
|
|
|
|
GDestroyNotify notify);
|
|
|
|
|
2019-01-22 21:25:35 -05:00
|
|
|
META_EXPORT
|
2013-08-14 06:50:48 -04:00
|
|
|
guint meta_idle_monitor_add_user_active_watch (MetaIdleMonitor *monitor,
|
|
|
|
MetaIdleMonitorWatchFunc callback,
|
|
|
|
gpointer user_data,
|
|
|
|
GDestroyNotify notify);
|
|
|
|
|
2019-01-22 21:25:35 -05:00
|
|
|
META_EXPORT
|
2013-08-14 06:50:48 -04:00
|
|
|
void meta_idle_monitor_remove_watch (MetaIdleMonitor *monitor,
|
|
|
|
guint id);
|
2019-01-22 21:25:35 -05:00
|
|
|
|
|
|
|
META_EXPORT
|
2013-08-14 06:50:48 -04:00
|
|
|
gint64 meta_idle_monitor_get_idletime (MetaIdleMonitor *monitor);
|