~bregma/geis/lp-785321

« back to all changes in this revision

Viewing changes to libutouch-geis/backend/xcb/geis_xcb_backend.c

  • Committer: Stephen M. Webb
  • Date: 2011-10-18 20:30:02 UTC
  • mfrom: (158.1.42 client-arch)
  • Revision ID: stephen.webb@canonical.com-20111018203002-ne8h3n25fbey3fqr
Merged client-arch branch.

Provided a new DBus-client back end and a dbus-server facility.  Included a test driver for the server.  Made the DBus client the default back-end with an automatic fall back to the XCB back end for seamless support of existing client software.

Show diffs side-by-side

added added

removed removed

Lines of Context:
105
105
static void _construct(void *mem, Geis geis);
106
106
static void _finalize(GeisBackend g);
107
107
static GeisBackendToken _create_token(GeisBackend be, GeisBackendTokenInitState);
108
 
static void _fd_callback(int fd, GeisBackendMultiplexorEvent ev, void *ctx);
 
108
static void _fd_callback(int fd, GeisBackendMultiplexorActivity ev, void *ctx);
109
109
 
110
110
 
111
111
static struct GeisBackendVtable be_vtbl = {
116
116
 
117
117
 
118
118
/* A handy little table to map grail types to geis gesture classes. */
119
 
struct GrailTypeToGeisClass
 
119
static struct GrailTypeToGeisClass
120
120
{
121
121
  GeisInteger      grail_type;
122
122
  GeisGestureClass geis_class;
156
156
  { GRAIL_TYPE_MTOUCH, NULL }
157
157
};
158
158
 
159
 
GeisSize s_grail_type_map_size = sizeof(s_grail_type_map) / sizeof(struct GrailTypeToGeisClass);
 
159
static GeisSize s_grail_type_map_size = sizeof(s_grail_type_map)
 
160
                                      / sizeof(struct GrailTypeToGeisClass);
160
161
 
161
162
static void
162
163
_set_grail_type_class(GeisInteger grail_type, GeisGestureClass geis_class)
653
654
  }
654
655
 
655
656
  be->xcb_fd = xcb_get_file_descriptor(be->xcb_connection);
656
 
  geis_multiplex_fd(be->geis, be->xcb_fd, _fd_callback, be);
 
657
  geis_multiplex_fd(be->geis, be->xcb_fd, GEIS_BE_MX_READ_AVAILABLE,
 
658
                    _fd_callback, be);
657
659
 
658
660
  be->sub_table = geis_xcb_backend_sub_table_new();
659
661
 
933
935
 
934
936
/** @todo implement this */
935
937
void
936
 
_fd_callback(int                          fd GEIS_UNUSED,
937
 
             GeisBackendMultiplexorEvent  ev GEIS_UNUSED,
938
 
             void                        *ctx)
 
938
_fd_callback(int                             fd GEIS_UNUSED,
 
939
             GeisBackendMultiplexorActivity  ev GEIS_UNUSED,
 
940
             void                           *ctx)
939
941
{
940
942
  GeisXcbBackend be = (GeisXcbBackend)ctx;
941
943
  _xcb_dispatch(be);
1022
1024
__attribute__((constructor))
1023
1025
static void _register_xcb_backend()
1024
1026
{
1025
 
  geis_register_backend(GEIS_INIT_UTOUCH_XCB,
 
1027
  geis_register_backend(GEIS_INIT_UTOUCH_XCB_BACKEND,
1026
1028
                        sizeof(struct GeisXcbBackend),
1027
1029
                        &be_vtbl);
1028
1030
}