2
* @file geis_backend_protected.h
3
* @brief internal GEIS back end base class "protected" interface
5
* This file contains the implementation interface for the various GEIS v2 back
10
* Copyright 2010, 2012 Canonical Ltd.
12
* This library is free software; you can redistribute it and/or modify it under
13
* the terms of the GNU Lesser General Public License as published by the Free
14
* Software Foundation; either version 3 of the License, or (at your option) any
17
* This library is distributed in the hope that it will be useful, but WITHOUT
18
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
19
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
22
* You should have received a copy of the GNU General Public License
23
* along with this program. If not, see <http://www.gnu.org/licenses/>.
25
#ifndef GEIS_BACKEND_PROTECTED_H_
26
#define GEIS_BACKEND_PROTECTED_H_
28
#include "geis/geis.h"
29
#include "geis_backend.h"
30
#include "geis_backend_token.h"
34
* The custom dispatch table for "derived" GEIS v2 backends.
36
typedef struct GeisBackendVtable
38
void (* construct)(void *mem, Geis geis);
39
void (* finalize)(GeisBackend);
40
GeisBackendToken (* create_token)(GeisBackend, GeisBackendTokenInitState);
41
GeisStatus (* accept_gesture)(GeisBackend, GeisGroup, GeisGestureId);
42
GeisStatus (* reject_gesture)(GeisBackend, GeisGroup, GeisGestureId);
43
GeisStatus (* get_configuration)(GeisBackend, GeisSubscription, GeisString, GeisPointer);
44
GeisStatus (* set_configuration)(GeisBackend, GeisSubscription, GeisString, GeisPointer);
49
* The custom dispatch table for backend-specific tokens.
51
* Backend tokens are used when creating subscriptions (including filters and
54
typedef struct GeisBackendTokenVtable
56
GeisBackendToken (* clone)(GeisBackendToken);
57
void (* finalize)(GeisBackendToken);
58
void (* compose)(GeisBackendToken, GeisBackendToken);
59
GeisStatus (* activate)(GeisBackendToken, GeisSubscription);
60
GeisStatus (* deactivate)(GeisBackendToken, GeisSubscription);
61
} *GeisBackendTokenVtable;
64
struct GeisBackendToken
66
GeisBackendTokenVtable vtbl;
70
* Registers back ends with the API.
72
* @param[in] name The name of the back end.
73
* @param[in] size The size of the back end data structure.
74
* @param[in] vtbl A pointer to a (static) function dispatch table.
76
* This registration function should be called from a module init routine
77
* decorated with the GCC attribute((constructor)) so the back end gets
78
* registered with the API.
80
void geis_register_backend(GeisString name,
82
GeisBackendVtable vtbl);
84
#endif /* GEIS_BACKEND_PROTECTED_H_ */