2
* Copyright (C) 2020 Alberts Muktupāvels
4
* This program is free software: you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License as published by
6
* the Free Software Foundation, either version 3 of the License, or
7
* (at your option) any later version.
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with this program. If not, see <http://www.gnu.org/licenses/>.
19
#include "indicator-applet-session.h"
21
#include <glib/gi18n-lib.h>
23
struct _IndicatorAppletSession
25
IndicatorApplet parent;
28
G_DEFINE_TYPE (IndicatorAppletSession,
29
indicator_applet_session,
30
INDICATOR_TYPE_APPLET)
33
indicator_applet_session_get_name (void)
35
return _("Indicator Applet Session");
39
indicator_applet_session_get_description (void)
41
return _("A place to adjust your status, change users or exit your session.");
45
indicator_applet_session_get_indicator_env (void)
47
return "indicator-applet-session";
51
indicator_applet_session_load_module (const char *name)
53
return g_strcmp0 (name, "libsession.so") == 0 ||
54
g_strcmp0 (name, "libme.so") == 0;
58
indicator_applet_session_load_indicator (const char *name)
60
return g_strcmp0 (name, "com.canonical.indicator.session") == 0 ||
61
g_strcmp0 (name, "com.canonical.indicator.me") == 0;
65
indicator_applet_session_get_hotkey_keycode (void)
71
indicator_applet_session_class_init (IndicatorAppletSessionClass *self_class)
73
IndicatorAppletClass *applet_class;
75
applet_class = INDICATOR_APPLET_CLASS (self_class);
77
applet_class->get_name = indicator_applet_session_get_name;
78
applet_class->get_description = indicator_applet_session_get_description;
79
applet_class->get_indicator_env = indicator_applet_session_get_indicator_env;
80
applet_class->load_module = indicator_applet_session_load_module;
81
applet_class->load_indicator = indicator_applet_session_load_indicator;
83
applet_class->get_hotkey_keycode = indicator_applet_session_get_hotkey_keycode;
87
indicator_applet_session_init (IndicatorAppletSession *self)
89
AtkObject *atk_object;
91
atk_object = gtk_widget_get_accessible (GTK_WIDGET (self));
92
atk_object_set_name (atk_object, "indicator-applet-session");