[gnome-panel/wip/muktupavels/more-api: 2/4] panel-lockdown: add panel_lockdown_get_lockdown_flags



commit e184a1922b6ecb7f98143e671ba07b81563c5598
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Tue Apr 14 01:43:09 2020 +0300

    panel-lockdown: add panel_lockdown_get_lockdown_flags

 gnome-panel/panel-lockdown.c | 36 ++++++++++++++++++++++++++++++++++++
 gnome-panel/panel-lockdown.h |  5 +++++
 2 files changed, 41 insertions(+)
---
diff --git a/gnome-panel/panel-lockdown.c b/gnome-panel/panel-lockdown.c
index 3443bace5..db24eeb22 100644
--- a/gnome-panel/panel-lockdown.c
+++ b/gnome-panel/panel-lockdown.c
@@ -533,3 +533,39 @@ panel_lockdown_get_disable_force_quit_s (void)
 {
         return panel_lockdown_get_disable_force_quit (panel_lockdown_get ());
 }
+
+GpLockdownFlags
+panel_lockdown_get_lockdown_flags (PanelLockdown *lockdown)
+{
+        GpLockdownFlags lockdown_flags;
+
+        g_return_val_if_fail (PANEL_IS_LOCKDOWN (lockdown), GP_LOCKDOWN_FLAGS_NONE);
+
+        lockdown_flags = GP_LOCKDOWN_FLAGS_NONE;
+
+        if (lockdown->priv->disable_force_quit)
+                lockdown_flags |= GP_LOCKDOWN_FLAGS_FORCE_QUIT;
+
+        if (lockdown->priv->panels_locked_down)
+                lockdown_flags |= GP_LOCKDOWN_FLAGS_LOCKED_DOWN;
+
+        if (lockdown->priv->disable_command_line)
+                lockdown_flags |= GP_LOCKDOWN_FLAGS_COMMAND_LINE;
+
+        if (lockdown->priv->disable_lock_screen)
+                lockdown_flags |= GP_LOCKDOWN_FLAGS_LOCK_SCREEN;
+
+        if (lockdown->priv->disable_log_out)
+                lockdown_flags |= GP_LOCKDOWN_FLAGS_LOG_OUT;
+
+        if (lockdown->priv->disable_switch_user)
+                lockdown_flags |= GP_LOCKDOWN_FLAGS_USER_SWITCHING;
+
+        return lockdown_flags;
+}
+
+GpLockdownFlags
+panel_lockdown_get_lockdown_flags_s (void)
+{
+        return panel_lockdown_get_lockdown_flags (panel_lockdown_get ());
+}
diff --git a/gnome-panel/panel-lockdown.h b/gnome-panel/panel-lockdown.h
index 5ae2d64a5..e06ea4937 100644
--- a/gnome-panel/panel-lockdown.h
+++ b/gnome-panel/panel-lockdown.h
@@ -26,6 +26,8 @@
 
 #include <gio/gio.h>
 
+#include "libgnome-panel/gp-module.h"
+
 G_BEGIN_DECLS
 
 #define PANEL_TYPE_LOCKDOWN            (panel_lockdown_get_type ())
@@ -81,6 +83,9 @@ gboolean panel_lockdown_get_disable_log_out_s        (void);
 gboolean panel_lockdown_get_disable_switch_user_s    (void);
 gboolean panel_lockdown_get_disable_force_quit_s     (void);
 
+GpLockdownFlags panel_lockdown_get_lockdown_flags   (PanelLockdown *lockdown);
+GpLockdownFlags panel_lockdown_get_lockdown_flags_s (void);
+
 G_END_DECLS
 
 #endif /* __PANEL_LOCKDOWN_H__ */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]