Back to index

unity  6.0.0
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Static Protected Member Functions | Private Member Functions | Private Attributes
GeisAdapter Class Reference

#include <GeisAdapter.h>

Inheritance diagram for GeisAdapter:
Inheritance graph
[legend]
Collaboration diagram for GeisAdapter:
Collaboration graph
[legend]

List of all members.

Classes

struct  _GeisDragData
struct  _GeisPinchData
struct  _GeisRotateData
struct  _GeisTapData
struct  _GeisTouchData

Public Types

typedef struct
GeisAdapter::_GeisTapData 
GeisTapData
typedef struct
GeisAdapter::_GeisDragData 
GeisDragData
typedef struct
GeisAdapter::_GeisRotateData 
GeisRotateData
typedef struct
GeisAdapter::_GeisPinchData 
GeisPinchData
typedef struct
GeisAdapter::_GeisTouchData 
GeisTouchData

Public Member Functions

 GeisAdapter ()
 ~GeisAdapter ()
void Run ()

Static Public Member Functions

static GeisAdapterInstance ()

Public Attributes

sigc::signal< void, GeisTapData * > tap
sigc::signal< void,
GeisDragData * > 
drag_start
sigc::signal< void,
GeisDragData * > 
drag_update
sigc::signal< void,
GeisDragData * > 
drag_finish
sigc::signal< void,
GeisRotateData * > 
rotate_start
sigc::signal< void,
GeisRotateData * > 
rotate_update
sigc::signal< void,
GeisRotateData * > 
rotate_finish
sigc::signal< void,
GeisPinchData * > 
pinch_start
sigc::signal< void,
GeisPinchData * > 
pinch_update
sigc::signal< void,
GeisPinchData * > 
pinch_finish
sigc::signal< void,
GeisTouchData * > 
touch_start
sigc::signal< void,
GeisTouchData * > 
touch_update
sigc::signal< void,
GeisTouchData * > 
touch_finish

Protected Member Functions

GeisTapDataProcessTapGesture (GeisSize attr_count, GeisGestureAttr *attrs)
GeisDragDataProcessDragGesture (GeisSize attr_count, GeisGestureAttr *attrs)
GeisPinchDataProcessPinchGesture (GeisSize attr_count, GeisGestureAttr *attrs)
GeisRotateDataProcessRotateGesture (GeisSize attr_count, GeisGestureAttr *attrs)
GeisTouchDataProcessTouchGesture (GeisSize attr_count, GeisGestureAttr *attrs)

Static Protected Member Functions

static gboolean OnWatchIn (GIOChannel *source, GIOCondition condition, gpointer data)
static void InputDeviceAdded (void *cookie, GeisInputDeviceId device_id, void *attrs)
static void InputDeviceChanged (void *cookie, GeisInputDeviceId device_id, void *attrs)
static void InputDeviceRemoved (void *cookie, GeisInputDeviceId device_id, void *attrs)
static void GestureAdded (void *cookie, GeisGestureType gesture_type, GeisGestureId gesture_id, GeisSize attr_count, GeisGestureAttr *attrs)
static void GestureRemoved (void *cookie, GeisGestureType gesture_type, GeisGestureId gesture_id, GeisSize attr_count, GeisGestureAttr *attrs)
static void GestureStart (void *cookie, GeisGestureType gesture_type, GeisGestureId gesture_id, GeisSize attr_count, GeisGestureAttr *attrs)
static void GestureUpdate (void *cookie, GeisGestureType gesture_type, GeisGestureId gesture_id, GeisSize attr_count, GeisGestureAttr *attrs)
static void GestureFinish (void *cookie, GeisGestureType gesture_type, GeisGestureId gesture_id, GeisSize attr_count, GeisGestureAttr *attrs)

Private Member Functions

void RegisterRootInstance ()

Private Attributes

GeisInstance _root_instance
guint _watch_id

Detailed Description

Definition at line 28 of file GeisAdapter.h.


Class Documentation

struct GeisAdapter::_GeisDragData

Definition at line 56 of file GeisAdapter.h.

Class Members
float bound_x1
float bound_x2
float bound_y1
float bound_y2
float delta_x
float delta_y
int device_id
float focus_x
float focus_y
int id
float position_x
float position_y
int timestamp
int touches
float velocity_x
float velocity_y
Window window
struct GeisAdapter::_GeisPinchData

Definition at line 95 of file GeisAdapter.h.

Class Members
float bound_x1
float bound_x2
float bound_y1
float bound_y2
int device_id
float focus_x
float focus_y
int id
float radius
float radius_delta
float radius_velocity
int timestamp
int touches
Window window
struct GeisAdapter::_GeisRotateData

Definition at line 77 of file GeisAdapter.h.

Class Members
float angle
float angle_delta
float angle_velocity
float bound_x1
float bound_x2
float bound_y1
float bound_y2
int device_id
float focus_x
float focus_y
int id
int timestamp
int touches
Window window
struct GeisAdapter::_GeisTapData

Definition at line 38 of file GeisAdapter.h.

Class Members
float bound_x1
float bound_x2
float bound_y1
float bound_y2
int device_id
float focus_x
float focus_y
int id
float position_x
float position_y
int tap_length_ms
int timestamp
int touches
Window window
struct GeisAdapter::_GeisTouchData

Definition at line 113 of file GeisAdapter.h.

Class Members
float bound_x1
float bound_x2
float bound_y1
float bound_y2
int device_id
float focus_x
float focus_y
int id
int timestamp
int touches
Window window

Member Typedef Documentation


Constructor & Destructor Documentation

Definition at line 42 of file GeisAdapter.cpp.

                         : _root_instance(nullptr)
{
  if (adaptor_instance)
  {
    LOG_ERROR(logger) << "More than one GeisAdapter created.";
  }
  else
  {
    adaptor_instance = this;
  }
  RegisterRootInstance();
}

Here is the call graph for this function:

Definition at line 55 of file GeisAdapter.cpp.

{
  if (_root_instance != nullptr)
    geis_finish(_root_instance);
  if (adaptor_instance == this)
  {
    adaptor_instance = nullptr;
  }
}

Member Function Documentation

void GeisAdapter::GestureAdded ( void *  cookie,
GeisGestureType  gesture_type,
GeisGestureId  gesture_id,
GeisSize  attr_count,
GeisGestureAttr *  attrs 
) [static, protected]

Definition at line 109 of file GeisAdapter.cpp.

{
}

Here is the caller graph for this function:

void GeisAdapter::GestureFinish ( void *  cookie,
GeisGestureType  gesture_type,
GeisGestureId  gesture_id,
GeisSize  attr_count,
GeisGestureAttr *  attrs 
) [static, protected]

Definition at line 203 of file GeisAdapter.cpp.

{
  GeisAdapter* self = static_cast<GeisAdapter*>(cookie);

  if (gesture_type == GEIS_GESTURE_PRIMITIVE_DRAG)
  {
    GeisDragData* data = self->ProcessDragGesture(count, attrs);
    data->id = gesture_id;
    self->drag_finish.emit(data);
    g_free(data);
  }
  else if (gesture_type == GEIS_GESTURE_PRIMITIVE_ROTATE)
  {
    GeisRotateData* data = self->ProcessRotateGesture(count, attrs);
    data->id = gesture_id;
    self->rotate_finish.emit(data);
    g_free(data);
  }
  else if (gesture_type == GEIS_GESTURE_PRIMITIVE_PINCH)
  {
    GeisPinchData* data = self->ProcessPinchGesture(count, attrs);
    data->id = gesture_id;
    self->pinch_finish.emit(data);
    g_free(data);
  }
  else if (gesture_type == GEIS_GESTURE_PRIMITIVE_TAP)
  {
    GeisTapData* data = self->ProcessTapGesture(count, attrs);
    data->id = gesture_id;
    self->tap.emit(data);
    g_free(data);
  }
  else if (gesture_type == GEIS_GESTURE_PRIMITIVE_TOUCH)
  {
    GeisTouchData* data = self->ProcessTouchGesture(count, attrs);
    data->id = gesture_id;
    self->touch_finish.emit(data);
    g_free(data);
  }
}

Here is the caller graph for this function:

void GeisAdapter::GestureRemoved ( void *  cookie,
GeisGestureType  gesture_type,
GeisGestureId  gesture_id,
GeisSize  attr_count,
GeisGestureAttr *  attrs 
) [static, protected]

Definition at line 114 of file GeisAdapter.cpp.

{
}

Here is the caller graph for this function:

void GeisAdapter::GestureStart ( void *  cookie,
GeisGestureType  gesture_type,
GeisGestureId  gesture_id,
GeisSize  attr_count,
GeisGestureAttr *  attrs 
) [static, protected]

Definition at line 119 of file GeisAdapter.cpp.

{
  GeisAdapter* self = static_cast<GeisAdapter*>(cookie);

  if (gesture_type == GEIS_GESTURE_PRIMITIVE_DRAG)
  {
    GeisDragData* data = self->ProcessDragGesture(count, attrs);
    data->id = gesture_id;
    self->drag_start.emit(data);
    g_free(data);
  }
  else if (gesture_type == GEIS_GESTURE_PRIMITIVE_ROTATE)
  {
    GeisRotateData* data = self->ProcessRotateGesture(count, attrs);
    data->id = gesture_id;
    self->rotate_start.emit(data);
    g_free(data);
  }
  else if (gesture_type == GEIS_GESTURE_PRIMITIVE_PINCH)
  {
    GeisPinchData* data = self->ProcessPinchGesture(count, attrs);
    data->id = gesture_id;
    self->pinch_start.emit(data);
    g_free(data);
  }
  else if (gesture_type == GEIS_GESTURE_PRIMITIVE_TAP)
  {
    GeisTapData* data = self->ProcessTapGesture(count, attrs);
    data->id = gesture_id;
    self->tap.emit(data);
    g_free(data);
  }
  else if (gesture_type == GEIS_GESTURE_PRIMITIVE_TOUCH)
  {
    GeisTouchData* data = self->ProcessTouchGesture(count, attrs);
    data->id = gesture_id;
    self->touch_start.emit(data);
    g_free(data);
  }
}

Here is the caller graph for this function:

void GeisAdapter::GestureUpdate ( void *  cookie,
GeisGestureType  gesture_type,
GeisGestureId  gesture_id,
GeisSize  attr_count,
GeisGestureAttr *  attrs 
) [static, protected]

Definition at line 161 of file GeisAdapter.cpp.

{
  GeisAdapter* self = static_cast<GeisAdapter*>(cookie);

  if (gesture_type == GEIS_GESTURE_PRIMITIVE_DRAG)
  {
    GeisDragData* data = self->ProcessDragGesture(count, attrs);
    data->id = gesture_id;
    self->drag_update.emit(data);
    g_free(data);
  }
  else if (gesture_type == GEIS_GESTURE_PRIMITIVE_ROTATE)
  {
    GeisRotateData* data = self->ProcessRotateGesture(count, attrs);
    data->id = gesture_id;
    self->rotate_update.emit(data);
    g_free(data);
  }
  else if (gesture_type == GEIS_GESTURE_PRIMITIVE_PINCH)
  {
    GeisPinchData* data = self->ProcessPinchGesture(count, attrs);
    data->id = gesture_id;
    self->pinch_update.emit(data);
    g_free(data);
  }
  else if (gesture_type == GEIS_GESTURE_PRIMITIVE_TAP)
  {
    GeisTapData* data = self->ProcessTapGesture(count, attrs);
    data->id = gesture_id;
    self->tap.emit(data);
    g_free(data);
  }
  else if (gesture_type == GEIS_GESTURE_PRIMITIVE_TOUCH)
  {
    GeisTouchData* data = self->ProcessTouchGesture(count, attrs);
    data->id = gesture_id;
    self->touch_update.emit(data);
    g_free(data);
  }
}

Here is the caller graph for this function:

void GeisAdapter::InputDeviceAdded ( void *  cookie,
GeisInputDeviceId  device_id,
void *  attrs 
) [static, protected]

Definition at line 92 of file GeisAdapter.cpp.

{
}

Here is the caller graph for this function:

void GeisAdapter::InputDeviceChanged ( void *  cookie,
GeisInputDeviceId  device_id,
void *  attrs 
) [static, protected]

Definition at line 98 of file GeisAdapter.cpp.

{
}

Here is the caller graph for this function:

void GeisAdapter::InputDeviceRemoved ( void *  cookie,
GeisInputDeviceId  device_id,
void *  attrs 
) [static, protected]

Definition at line 104 of file GeisAdapter.cpp.

{
}

Here is the caller graph for this function:

Definition at line 32 of file GeisAdapter.cpp.

{
  if (!adaptor_instance)
  {
    LOG_ERROR(logger) << "No GeisAdapter created yet.";
  }

  return *adaptor_instance;
}

Here is the caller graph for this function:

gboolean GeisAdapter::OnWatchIn ( GIOChannel *  source,
GIOCondition  condition,
gpointer  data 
) [static, protected]

Definition at line 84 of file GeisAdapter.cpp.

{
  GeisAdapter* self = static_cast<GeisAdapter*>(data);
  geis_event_dispatch(self->_root_instance);
  return true;
}

Here is the caller graph for this function:

GeisAdapter::GeisDragData * GeisAdapter::ProcessDragGesture ( GeisSize  attr_count,
GeisGestureAttr *  attrs 
) [protected]

Definition at line 329 of file GeisAdapter.cpp.

{
  GeisDragData* result = (GeisDragData*) g_malloc0(sizeof(GeisDragData));

  int i;
  for (i = 0; i < (int) count; i++)
  {
    GeisGestureAttr attr = attrs[i];
    if (g_str_equal(attr.name, GEIS_GESTURE_ATTRIBUTE_DEVICE_ID))
      result->device_id = attr.integer_val;
    else if (g_str_equal(attr.name, GEIS_GESTURE_ATTRIBUTE_CHILD_WINDOW_ID))
      result->window = (Window) attr.integer_val;
    else if (g_str_equal(attr.name, GEIS_GESTURE_ATTRIBUTE_TIMESTAMP))
      result->timestamp = attr.integer_val;
    else if (g_str_equal(attr.name, GEIS_GESTURE_ATTRIBUTE_FOCUS_X))
      result->focus_x = attr.float_val;
    else if (g_str_equal(attr.name, GEIS_GESTURE_ATTRIBUTE_FOCUS_Y))
      result->focus_y = attr.float_val;
    else if (g_str_equal(attr.name, GEIS_GESTURE_ATTRIBUTE_TOUCHES))
      result->touches = attr.integer_val;
    else if (g_str_equal(attr.name, GEIS_GESTURE_ATTRIBUTE_POSITION_X))
      result->position_x = attr.float_val;
    else if (g_str_equal(attr.name, GEIS_GESTURE_ATTRIBUTE_POSITION_Y))
      result->position_y = attr.float_val;
    else if (g_str_equal(attr.name, GEIS_GESTURE_ATTRIBUTE_VELOCITY_X))
      result->velocity_x = attr.float_val;
    else if (g_str_equal(attr.name, GEIS_GESTURE_ATTRIBUTE_VELOCITY_Y))
      result->velocity_y = attr.float_val;
    else if (g_str_equal(attr.name, GEIS_GESTURE_ATTRIBUTE_DELTA_X))
      result->delta_x = attr.float_val;
    else if (g_str_equal(attr.name, GEIS_GESTURE_ATTRIBUTE_DELTA_Y))
      result->delta_y = attr.float_val;
    else if (g_str_equal(attr.name, GEIS_GESTURE_ATTRIBUTE_BOUNDINGBOX_X1))
      result->bound_x1 = attr.float_val;
    else if (g_str_equal(attr.name, GEIS_GESTURE_ATTRIBUTE_BOUNDINGBOX_Y1))
      result->bound_y1 = attr.float_val;
    else if (g_str_equal(attr.name, GEIS_GESTURE_ATTRIBUTE_BOUNDINGBOX_X2))
      result->bound_x2 = attr.float_val;
    else if (g_str_equal(attr.name, GEIS_GESTURE_ATTRIBUTE_BOUNDINGBOX_Y2))
      result->bound_y2 = attr.float_val;
  }

  return result;
}
GeisAdapter::GeisPinchData * GeisAdapter::ProcessPinchGesture ( GeisSize  attr_count,
GeisGestureAttr *  attrs 
) [protected]

Definition at line 374 of file GeisAdapter.cpp.

{
  GeisPinchData* result = (GeisPinchData*) g_malloc0(sizeof(GeisPinchData));

  int i;
  for (i = 0; i < (int) count; i++)
  {
    GeisGestureAttr attr = attrs[i];
    if (g_str_equal(attr.name, GEIS_GESTURE_ATTRIBUTE_DEVICE_ID))
      result->device_id = attr.integer_val;
    else if (g_str_equal(attr.name, GEIS_GESTURE_ATTRIBUTE_CHILD_WINDOW_ID))
      result->window = (Window) attr.integer_val;
    else if (g_str_equal(attr.name, GEIS_GESTURE_ATTRIBUTE_TIMESTAMP))
      result->timestamp = attr.integer_val;
    else if (g_str_equal(attr.name, GEIS_GESTURE_ATTRIBUTE_FOCUS_X))
      result->focus_x = attr.float_val;
    else if (g_str_equal(attr.name, GEIS_GESTURE_ATTRIBUTE_FOCUS_Y))
      result->focus_y = attr.float_val;
    else if (g_str_equal(attr.name, GEIS_GESTURE_ATTRIBUTE_TOUCHES))
      result->touches = attr.integer_val;
    else if (g_str_equal(attr.name, GEIS_GESTURE_ATTRIBUTE_RADIUS))
      result->radius = attr.float_val;
    else if (g_str_equal(attr.name, GEIS_GESTURE_ATTRIBUTE_RADIUS_DELTA))
      result->radius_delta = attr.float_val;
    else if (g_str_equal(attr.name, GEIS_GESTURE_ATTRIBUTE_RADIAL_VELOCITY))
      result->radius_velocity = attr.float_val;
    else if (g_str_equal(attr.name, GEIS_GESTURE_ATTRIBUTE_BOUNDINGBOX_X1))
      result->bound_x1 = attr.float_val;
    else if (g_str_equal(attr.name, GEIS_GESTURE_ATTRIBUTE_BOUNDINGBOX_Y1))
      result->bound_y1 = attr.float_val;
    else if (g_str_equal(attr.name, GEIS_GESTURE_ATTRIBUTE_BOUNDINGBOX_X2))
      result->bound_x2 = attr.float_val;
    else if (g_str_equal(attr.name, GEIS_GESTURE_ATTRIBUTE_BOUNDINGBOX_Y2))
      result->bound_y2 = attr.float_val;
  }

  return result;
}
GeisAdapter::GeisRotateData * GeisAdapter::ProcessRotateGesture ( GeisSize  attr_count,
GeisGestureAttr *  attrs 
) [protected]

Definition at line 413 of file GeisAdapter.cpp.

{
  GeisRotateData* result = (GeisRotateData*) g_malloc0(sizeof(GeisRotateData));

  int i;
  for (i = 0; i < (int) count; i++)
  {
    GeisGestureAttr attr = attrs[i];
    if (g_str_equal(attr.name, GEIS_GESTURE_ATTRIBUTE_DEVICE_ID))
      result->device_id = attr.integer_val;
    else if (g_str_equal(attr.name, GEIS_GESTURE_ATTRIBUTE_CHILD_WINDOW_ID))
      result->window = (Window) attr.integer_val;
    else if (g_str_equal(attr.name, GEIS_GESTURE_ATTRIBUTE_TIMESTAMP))
      result->timestamp = attr.integer_val;
    else if (g_str_equal(attr.name, GEIS_GESTURE_ATTRIBUTE_FOCUS_X))
      result->focus_x = attr.float_val;
    else if (g_str_equal(attr.name, GEIS_GESTURE_ATTRIBUTE_FOCUS_Y))
      result->focus_y = attr.float_val;
    else if (g_str_equal(attr.name, GEIS_GESTURE_ATTRIBUTE_TOUCHES))
      result->touches = attr.integer_val;
    else if (g_str_equal(attr.name, GEIS_GESTURE_ATTRIBUTE_ANGLE))
      result->angle = attr.float_val;
    else if (g_str_equal(attr.name, GEIS_GESTURE_ATTRIBUTE_ANGLE_DELTA))
      result->angle_delta = attr.float_val;
    else if (g_str_equal(attr.name, GEIS_GESTURE_ATTRIBUTE_ANGULAR_VELOCITY))
      result->angle_velocity = attr.float_val;
    else if (g_str_equal(attr.name, GEIS_GESTURE_ATTRIBUTE_BOUNDINGBOX_X1))
      result->bound_x1 = attr.float_val;
    else if (g_str_equal(attr.name, GEIS_GESTURE_ATTRIBUTE_BOUNDINGBOX_Y1))
      result->bound_y1 = attr.float_val;
    else if (g_str_equal(attr.name, GEIS_GESTURE_ATTRIBUTE_BOUNDINGBOX_X2))
      result->bound_x2 = attr.float_val;
    else if (g_str_equal(attr.name, GEIS_GESTURE_ATTRIBUTE_BOUNDINGBOX_Y2))
      result->bound_y2 = attr.float_val;
  }

  return result;
}
GeisAdapter::GeisTapData * GeisAdapter::ProcessTapGesture ( GeisSize  attr_count,
GeisGestureAttr *  attrs 
) [protected]

Definition at line 244 of file GeisAdapter.cpp.

{
  GeisTapData* result = (GeisTapData*) g_malloc0(sizeof(GeisTapData));

  int i;
  for (i = 0; i < (int) count; i++)
  {
    GeisGestureAttr attr = attrs[i];
    if (g_str_equal(attr.name, GEIS_GESTURE_ATTRIBUTE_DEVICE_ID))
      result->device_id = attr.integer_val;
    else if (g_str_equal(attr.name, GEIS_GESTURE_ATTRIBUTE_CHILD_WINDOW_ID))
      result->window = (Window) attr.integer_val;
    else if (g_str_equal(attr.name, GEIS_GESTURE_ATTRIBUTE_TIMESTAMP))
      result->timestamp = attr.integer_val;
    else if (g_str_equal(attr.name, GEIS_GESTURE_ATTRIBUTE_FOCUS_X))
      result->focus_x = attr.float_val;
    else if (g_str_equal(attr.name, GEIS_GESTURE_ATTRIBUTE_FOCUS_Y))
      result->focus_y = attr.float_val;
    else if (g_str_equal (attr.name, GEIS_GESTURE_ATTRIBUTE_TOUCHES))
      result->touches = attr.integer_val;
    else if (g_str_equal(attr.name, GEIS_GESTURE_ATTRIBUTE_GESTURE_NAME))
    {
      if (!g_strcmp0(attr.string_val, GEIS_GESTURE_TYPE_TAP1))
        result->touches = 1;
      else if (!g_strcmp0(attr.string_val, GEIS_GESTURE_TYPE_TAP2))
        result->touches = 2;
      else if (!g_strcmp0(attr.string_val, GEIS_GESTURE_TYPE_TAP3))
        result->touches = 3;
      else if (!g_strcmp0(attr.string_val, GEIS_GESTURE_TYPE_TAP4))
        result->touches = 4;
      else if (!g_strcmp0(attr.string_val, GEIS_GESTURE_TYPE_TAP5))
        result->touches = 5;
    }
    else if (g_str_equal(attr.name, GEIS_GESTURE_ATTRIBUTE_TAP_TIME))
      result->tap_length_ms = attr.integer_val;
    else if (g_str_equal(attr.name, GEIS_GESTURE_ATTRIBUTE_POSITION_X))
      result->position_x = attr.float_val;
    else if (g_str_equal(attr.name, GEIS_GESTURE_ATTRIBUTE_POSITION_Y))
      result->position_y = attr.float_val;
    else if (g_str_equal(attr.name, GEIS_GESTURE_ATTRIBUTE_BOUNDINGBOX_X1))
      result->bound_x1 = attr.float_val;
    else if (g_str_equal(attr.name, GEIS_GESTURE_ATTRIBUTE_BOUNDINGBOX_Y1))
      result->bound_y1 = attr.float_val;
    else if (g_str_equal(attr.name, GEIS_GESTURE_ATTRIBUTE_BOUNDINGBOX_X2))
      result->bound_x2 = attr.float_val;
    else if (g_str_equal(attr.name, GEIS_GESTURE_ATTRIBUTE_BOUNDINGBOX_Y2))
      result->bound_y2 = attr.float_val;
  }

  return result;
}
GeisAdapter::GeisTouchData * GeisAdapter::ProcessTouchGesture ( GeisSize  attr_count,
GeisGestureAttr *  attrs 
) [protected]

Definition at line 296 of file GeisAdapter.cpp.

{
  GeisTouchData* result = (GeisTouchData*) g_malloc0(sizeof(GeisTouchData));

  int i;
  for (i = 0; i < (int) count; i++)
  {
    GeisGestureAttr attr = attrs[i];
    if (g_str_equal(attr.name, GEIS_GESTURE_ATTRIBUTE_DEVICE_ID))
      result->device_id = attr.integer_val;
    else if (g_str_equal(attr.name, GEIS_GESTURE_ATTRIBUTE_CHILD_WINDOW_ID))
      result->window = (Window) attr.integer_val;
    else if (g_str_equal(attr.name, GEIS_GESTURE_ATTRIBUTE_TIMESTAMP))
      result->timestamp = attr.integer_val;
    else if (g_str_equal(attr.name, GEIS_GESTURE_ATTRIBUTE_FOCUS_X))
      result->focus_x = attr.float_val;
    else if (g_str_equal(attr.name, GEIS_GESTURE_ATTRIBUTE_FOCUS_Y))
      result->focus_y = attr.float_val;
    else if (g_str_equal(attr.name, GEIS_GESTURE_ATTRIBUTE_TOUCHES))
      result->touches = attr.integer_val;
    else if (g_str_equal(attr.name, GEIS_GESTURE_ATTRIBUTE_BOUNDINGBOX_X1))
      result->bound_x1 = attr.float_val;
    else if (g_str_equal(attr.name, GEIS_GESTURE_ATTRIBUTE_BOUNDINGBOX_Y1))
      result->bound_y1 = attr.float_val;
    else if (g_str_equal(attr.name, GEIS_GESTURE_ATTRIBUTE_BOUNDINGBOX_X2))
      result->bound_x2 = attr.float_val;
    else if (g_str_equal(attr.name, GEIS_GESTURE_ATTRIBUTE_BOUNDINGBOX_Y2))
      result->bound_y2 = attr.float_val;
  }

  return result;
}

Definition at line 461 of file GeisAdapter.cpp.

{
  static GeisInputFuncs input_funcs =
  {
    &GeisAdapter::InputDeviceAdded,
    &GeisAdapter::InputDeviceChanged,
    &GeisAdapter::InputDeviceRemoved
  };

  static GeisGestureFuncs gesture_funcs =
  {
    &GeisAdapter::GestureAdded,
    &GeisAdapter::GestureRemoved,
    &GeisAdapter::GestureStart,
    &GeisAdapter::GestureUpdate,
    &GeisAdapter::GestureFinish
  };

  GeisStatus status = GEIS_UNKNOWN_ERROR;

  GeisXcbWinInfo xcb_win_info;
  xcb_win_info.display_name  = NULL,
               xcb_win_info.screenp       = NULL,
                            xcb_win_info.window_id     = gdk_x11_get_default_root_xwindow();

  GeisWinInfo win_info =
  {
    GEIS_XCB_FULL_WINDOW,
    &xcb_win_info
  };
  GeisInstance instance;

  status = geis_init(&win_info, &instance);
  if (status != GEIS_STATUS_SUCCESS)
  {
    fprintf(stderr, "error in geis_init\n");
    return;
  }

  status = geis_input_devices(instance, &input_funcs, this);
  if (status != GEIS_STATUS_SUCCESS)
  {
    fprintf(stderr, "error subscribing to input devices\n");
    geis_finish(instance);
    return;
  }

  status = geis_subscribe(instance,
                          GEIS_ALL_INPUT_DEVICES,
                          s_gestures,
                          &gesture_funcs,
                          this);
  if (status != GEIS_STATUS_SUCCESS)
  {
    fprintf(stderr, "error subscribing to gestures\n");
    geis_finish(instance);
    return;
  }

  _root_instance = instance;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void GeisAdapter::Run ( )

Definition at line 66 of file GeisAdapter.cpp.

{
  int fd = -1;
  GeisStatus status = GEIS_STATUS_NOT_SUPPORTED;

  if (_root_instance != nullptr)
    status = geis_configuration_get_value(_root_instance, GEIS_CONFIG_UNIX_FD, &fd);

  if (status != GEIS_STATUS_SUCCESS)
    return;

  _watch_id = g_io_add_watch(g_io_channel_unix_new(fd),
                             G_IO_IN,
                             &GeisAdapter::OnWatchIn,
                             this);
}

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

GeisInstance GeisAdapter::_root_instance [private]

Definition at line 168 of file GeisAdapter.h.

guint GeisAdapter::_watch_id [private]

Definition at line 169 of file GeisAdapter.h.

sigc::signal<void, GeisDragData*> GeisAdapter::drag_finish

Definition at line 132 of file GeisAdapter.h.

sigc::signal<void, GeisDragData*> GeisAdapter::drag_start

Definition at line 130 of file GeisAdapter.h.

sigc::signal<void, GeisDragData*> GeisAdapter::drag_update

Definition at line 131 of file GeisAdapter.h.

Definition at line 140 of file GeisAdapter.h.

Definition at line 138 of file GeisAdapter.h.

Definition at line 139 of file GeisAdapter.h.

Definition at line 136 of file GeisAdapter.h.

Definition at line 134 of file GeisAdapter.h.

Definition at line 135 of file GeisAdapter.h.

sigc::signal<void, GeisTapData*> GeisAdapter::tap

Definition at line 128 of file GeisAdapter.h.

Definition at line 144 of file GeisAdapter.h.

Definition at line 142 of file GeisAdapter.h.

Definition at line 143 of file GeisAdapter.h.


The documentation for this class was generated from the following files: