1
/* Mission Control plugin API - ChannelDispatchOperation policy hook.
3
* Copyright (C) 2009 Nokia Corporation
4
* Copyright (C) 2009 Collabora Ltd.
6
* This library is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU Lesser General Public
8
* License as published by the Free Software Foundation; either
9
* version 2.1 of the License, or (at your option) any later version.
11
* This library is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
* Lesser General Public License for more details.
16
* You should have received a copy of the GNU Lesser General Public
17
* License along with this library; if not, write to the Free Software
18
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21
#include <mission-control-plugins/mission-control-plugins.h>
23
struct _McpDispatchOperationPolicyIface {
24
GTypeInterface parent;
26
void (*check) (McpDispatchOperationPolicy *, McpDispatchOperation *);
30
mcp_dispatch_operation_policy_get_type (void)
32
static gsize once = 0;
33
static GType type = 0;
35
if (g_once_init_enter (&once))
37
static const GTypeInfo info = {
38
sizeof (McpDispatchOperationPolicyIface),
40
NULL, /* base_finalize */
41
NULL, /* class_init */
42
NULL, /* class_finalize */
43
NULL, /* class_data */
44
0, /* instance_size */
46
NULL, /* instance_init */
47
NULL /* value_table */
50
type = g_type_register_static (G_TYPE_INTERFACE,
51
"McpDispatchOperationPolicy", &info, 0);
52
g_type_interface_add_prerequisite (type, G_TYPE_OBJECT);
54
g_once_init_leave (&once, 1);
61
mcp_dispatch_operation_policy_check (McpDispatchOperationPolicy *policy,
62
McpDispatchOperation *dispatch_operation)
64
McpDispatchOperationPolicyIface *iface =
65
MCP_DISPATCH_OPERATION_POLICY_GET_IFACE (policy);
67
g_return_if_fail (iface != NULL);
69
if (iface->check != NULL)
70
iface->check (policy, dispatch_operation);
74
mcp_dispatch_operation_policy_iface_implement_check (
75
McpDispatchOperationPolicyIface *iface,
76
void (*impl) (McpDispatchOperationPolicy *, McpDispatchOperation *))