2
* Copyright (C) 2001, 2002 Havoc Pennington
3
* Copyright (C) 2004 Elijah Newren
4
* Copyright (C) 2017 Red Hat
6
* This program is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU General Public License as
8
* published by the Free Software Foundation; either version 2 of the
9
* License, or (at your option) any later version.
11
* This program is distributed in the hope that it will be useful, but
12
* WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
* General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, see <http://www.gnu.org/licenses/>.
23
#include "util-private.h"
24
#include "window-private.h"
25
#include "meta/meta-inhibit-shortcuts-dialog.h"
26
#include "meta-inhibit-shortcuts-dialog-default-private.h"
28
typedef struct _MetaInhibitShortcutsDialogDefaultPrivate MetaInhibitShortcutsDialogDefaultPrivate;
30
struct _MetaInhibitShortcutsDialogDefault
32
GObject parent_instance;
42
static void meta_inhibit_shortcuts_dialog_iface_init (MetaInhibitShortcutsDialogInterface *iface);
44
G_DEFINE_TYPE_WITH_CODE (MetaInhibitShortcutsDialogDefault, meta_inhibit_shortcuts_dialog_default,
46
G_IMPLEMENT_INTERFACE (META_TYPE_INHIBIT_SHORTCUTS_DIALOG,
47
meta_inhibit_shortcuts_dialog_iface_init))
50
meta_inhibit_shortcuts_dialog_default_show (MetaInhibitShortcutsDialog *dialog)
52
/* Default to allow shortcuts inhibitor, but complain that no dialog is implemented */
53
g_warning ("No MetaInhibitShortcutDialog implementation, falling back on allowing");
54
meta_inhibit_shortcuts_dialog_response (dialog, META_INHIBIT_SHORTCUTS_DIALOG_RESPONSE_ALLOW);
58
meta_inhibit_shortcuts_dialog_default_hide (MetaInhibitShortcutsDialog *dialog)
63
meta_inhibit_shortcuts_dialog_iface_init (MetaInhibitShortcutsDialogInterface *iface)
65
iface->show = meta_inhibit_shortcuts_dialog_default_show;
66
iface->hide = meta_inhibit_shortcuts_dialog_default_hide;
70
meta_inhibit_shortcuts_dialog_default_set_property (GObject *object,
75
MetaInhibitShortcutsDialogDefault *dialog;
77
dialog = META_INHIBIT_SHORTCUTS_DIALOG_DEFAULT (object);
82
dialog->window = g_value_get_object (value);
85
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
90
meta_inhibit_shortcuts_dialog_default_get_property (GObject *object,
95
MetaInhibitShortcutsDialogDefault *dialog;
97
dialog = META_INHIBIT_SHORTCUTS_DIALOG_DEFAULT (object);
102
g_value_set_object (value, dialog->window);
105
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
110
meta_inhibit_shortcuts_dialog_default_class_init (MetaInhibitShortcutsDialogDefaultClass *klass)
112
GObjectClass *object_class = G_OBJECT_CLASS (klass);
114
object_class->set_property = meta_inhibit_shortcuts_dialog_default_set_property;
115
object_class->get_property = meta_inhibit_shortcuts_dialog_default_get_property;
117
g_object_class_override_property (object_class, PROP_WINDOW, "window");
121
meta_inhibit_shortcuts_dialog_default_init (MetaInhibitShortcutsDialogDefault *dialog)
125
MetaInhibitShortcutsDialog *
126
meta_inhibit_shortcuts_dialog_default_new (MetaWindow *window)
128
return g_object_new (META_TYPE_INHIBIT_SHORTCUTS_DIALOG_DEFAULT,