Skip to content
This repository
tree: 7e824d2287
Fetching contributors…

Cannot retrieve contributors at this time

file 75 lines (58 sloc) 2.397 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
#include "IoClutterInputDevice.h"
//metadoc ClutterInputDevice category UserInterface
//metadoc ClutterInputDevice description For more detailed docs see <a href="http://clutter-project.org/docs/clutter/stable/ClutterInputDevice.html">Clutter documentation</a>.

static const char *protoId = "ClutterInputDevice";

/*** Initalisation functions ***/
IoTag *IoClutterInputDevice_newTag(void *state) {
  IoTag *tag = IoTag_newWithName_(protoId);

  IoTag_state_(tag, state);
  IoTag_freeFunc_(tag, (IoTagFreeFunc *)IoClutterInputDevice_free);
  IoTag_cloneFunc_(tag, (IoTagCloneFunc *)IoClutterInputDevice_rawClone);

  return tag;
}

IoClutterInputDevice *IoClutterInputDevice_proto(void *state) {
  IoObject *self = IoObject_new(state);
  IoObject_tag_(self, IoClutterInputDevice_newTag(state));

  IoState_registerProtoWithFunc_(state, self, IoClutterInputDevice_proto);

  {
    IoMethodTable methodTable[] = {
      {"deviceId", IoClutterInputDevice_getId},
      {"deviceType", IoClutterInputDevice_getType},
      {NULL, NULL}
    };
    IoObject_addMethodTable_(self, methodTable);
  }

  return self;
}

IoClutterInputDevice *IoClutterInputDevice_rawClone(IoClutterInputDevice *proto) {
  IoClutterInputDevice *self = IoObject_rawClonePrimitive(proto);
  return self;
}

IoClutterInputDevice *IoClutterInputDevice_new(void *state) {
  IoObject *proto = IoState_protoWithId_((IoState *)state, protoId);
  return IOCLONE(proto);
}

IoClutterInputDevice *IoClutterInputDevice_newWithDevice(void *state, ClutterInputDevice *device) {
  IoClutterInputDevice *self = IoClutterInputDevice_new(state);
  IoObject_setDataPointer_(self, device);
  return self;
}

void IoClutterInputDevice_free(IoClutterInputDevice *self) {
  //io_free(IoObject_dataPointer(self));
}

IoObject *IoMessage_locals_clutterDeviceArgAt_(IoMessage *self, IoObject *locals, int n) {
  IoObject *v = IoMessage_locals_valueArgAt_(self, locals, n);

  if(!ISCLUTTERINPUTDEVICE(v)) {
    IoMessage_locals_numberArgAt_errorForType_(self, locals, n, "ClutterInputDevice");
  }

  return v;
}

/*** Object functions ***/
//doc ClutterInputDevice deviceId
IO_METHOD(IoClutterInputDevice, getId) {
  return IONUMBER(clutter_input_device_get_device_id(IOCIDEVICE(self)));
}

//doc ClutterInputDevice deviceType
IO_METHOD(IoClutterInputDevice, getType) {
  return IONUMBER(clutter_input_device_get_device_type(IOCIDEVICE(self)));
}
Something went wrong with that request. Please try again.