コード例 #1
0
ファイル: IoCairoGlyph.c プロジェクト: AlexGensek/io
IoCairoGlyph *IoCairoGlyph_proto(void *state)
{
	IoObject *self = IoObject_new(state);
	IoObject_tag_(self, IoCairoGlyph_newTag(state));

	IoObject_setDataPointer_(self, calloc(1, sizeof(cairo_glyph_t)));

	IoState_registerProtoWithFunc_(state, self, IoCairoGlyph_proto);

	{
		IoMethodTable methodTable[] = {
			{"setIndex", IoCairoGlyph_setIndex},
			{"index", IoCairoGlyph_index},

			{"setX", IoCairoGlyph_setX},
			{"x", IoCairoGlyph_x},

			{"setY", IoCairoGlyph_setY},
			{"y", IoCairoGlyph_y},

			{NULL, NULL},
		};
		IoObject_addMethodTable_(self, methodTable);
	}
	return self;
}
コード例 #2
0
ファイル: IoClutterEvent.c プロジェクト: BMeph/io
IoClutterEvent *IoClutterEvent_proto(void *state) {
  IoObject *self = IoObject_new(state);
  IoObject_tag_(self, IoClutterEvent_newTag(state));

  IoState_registerProtoWithFunc_(state, self, IoClutterEvent_proto);

  {
    IoMethodTable methodTable[] = {
      {"eventType",       IoClutterEvent_eventType},
      {"coords",          IoClutterEvent_getCoords},
      {"state",           IoClutterEvent_getState},
      {"time",            IoClutterEvent_getTime},
      {"source",          IoClutterEvent_getSource},
      //{"stage",     IoClutterEvent_getStage},
      {"flags",           IoClutterEvent_getFlags},
      {"peek",            IoClutterEvent_peek},
      {"put",             IoClutterEvent_put},
      {"putBack",         IoClutterEvent_putBack},
      {"hasPending",      IoClutterEvent_hasPending},
      {"button",          IoClutterEvent_getButton},
      {"clickCount",      IoClutterEvent_getClickCount},
      {"keySymbol",       IoClutterEvent_getKeySymbol},
      {"keyCode",         IoClutterEvent_getKeyCode},
      {"keyUnicode",      IoClutterEvent_getKeyUnicode},
      {"relatedActor",    IoClutterEvent_getRelatedActor},
      {"scrollDirecton",  IoClutterEvent_getScrollDirection},
      {"device",          IoClutterEvent_getDevice},

      {NULL, NULL}
    };
    IoObject_addMethodTable_(self, methodTable);
  }

  return self;
}
コード例 #3
0
ファイル: IoYajlGen.c プロジェクト: draftcode/io
IoYajlGen *IoYajlGen_proto(void *state)
{
	IoYajlGen *self = IoObject_new(state);
	IoObject_tag_(self, IoYajlGen_newTag(state));

	yajl_gen yg = yajl_gen_alloc(NULL);
	//yajl_gen_config(yg, yajl_gen_beautify, 0);

	IoObject_setDataPointer_(self, yg);

	IoState_registerProtoWithFunc_(state, self, protoId);

	{
		IoMethodTable methodTable[] =
		{
			{"pushNull", IoYajlGen_pushNull},
			{"pushString", IoYajlGen_pushString},
			{"pushInteger", IoYajlGen_pushInteger},
			{"pushDouble", IoYajlGen_pushDouble},
			{"pushNumberString", IoYajlGen_pushNumberString},
			{"pushBool", IoYajlGen_pushBool},
			{"openMap", IoYajlGen_openMap},
			{"closeMap", IoYajlGen_closeMap},
			{"openArray", IoYajlGen_openArray},
			{"closeArray", IoYajlGen_closeArray},
			{"generate", IoYajlGen_generate},
			{NULL, NULL},
		};
		IoObject_addMethodTable_(self, methodTable);
	}

	return self;
}
コード例 #4
0
ファイル: IoAudioDevice.c プロジェクト: Akiyah/io
IoAudioDevice *IoAudioDevice_proto(void *state)
{
	IoObject *self = IoObject_new(state);
	IoObject_tag_(self, IoAudioDevice_newTag(state));

	IoObject_setDataPointer_(self, calloc(1, sizeof(IoAudioDeviceData)));

	DATA(self)->writeBuffer = IoSeq_new(state);
	DATA(self)->readBuffer = IoSeq_new(state);
	DATA(self)->audioDevice = AudioDevice_new();
	IoState_registerProtoWithFunc_(state, self, IoAudioDevice_proto);

	{
	IoMethodTable methodTable[] = {
	{"open", IoAudioDevice_open},
	{"openForReadingAndWriting", IoAudioDevice_openForReadingAndWriting},
	{"close", IoAudioDevice_close},
	{"asyncWrite", IoAudioDevice_asyncWrite},
	{"asyncRead", IoAudioDevice_read},
	{"error", IoAudioDevice_error},
	{"isActive", IoAudioDevice_isActive},
	{"streamTime", IoAudioDevice_streamTime},
	{"needsData", IoAudioDevice_needsData},
	{"writeBufferIsEmpty", IoAudioDevice_writeBufferIsEmpty},
	{NULL, NULL},
	};
	IoObject_addMethodTable_(self, methodTable);
	}
	return self;
}
コード例 #5
0
ファイル: IoEvDNSRequest.c プロジェクト: Akiyah/io
IoEvDNSRequest *IoEvDNSRequest_proto(void *state)
{
	IoObject *self = IoObject_new(state);

	IoObject_tag_(self, IoEvDNSRequest_newTag(state));
	IoObject_setDataPointer_(self, 0x0);

	IoState_registerProtoWithFunc_((IoState *)state, self, IoEvDNSRequest_proto);

	{
		IoMethodTable methodTable[] = {
		{"resolveIPv4", IoEvDNSRequest_resolveIPv4},
		/*
		{"resolveIPv6", IoEvDNSRequest_resolveIPv6},
		{"resolveReverseIPv4", IoEvDNSRequest_resolveReverseIPv4},
		{"resolveReverseIPv6", IoEvDNSRequest_resolveReverseIPv6},
		*/
		{NULL, NULL},
		};

		IoObject_addMethodTable_(self, methodTable);
	} 


	return self;
}
コード例 #6
0
ファイル: IoFont.c プロジェクト: Teslos/io
IoFont *IoFont_proto( void *state )
{
	IoObject *self = IoObject_new(state);
	IoObject_tag_(self, IoFont_newTag(state));

	IoObject_setDataPointer_(self, calloc(1, sizeof(IoFontData)));
	DATA(self)->path = IOSYMBOL(".");
	DATA(self)->font = GLFont_new();
	DATA(self)->isProto = 1;
	IoState_registerProtoWithId_(state, self, protoId);

	{
		IoMethodTable methodTable[] = {
		{"open", IoFont_open},

		{"setPath", IoFont_setPath},
		{"path", IoFont_path},

		{"setPixelSize", IoFont_setPixelSize},
		{"pixelSize", IoFont_pixelSize},

		{"drawString", IoFont_drawString},
		{"widthOfString", IoFont_lengthOfString},
		{"widthOfCharacter", IoFont_lengthOfCharacter},
		{"pixelHeight", IoFont_fontHeight},
		{"isTextured", IoFont_isTextured},
		{"error", IoFont_error},
		{"stringIndexAtWidth", IoFont_stringIndexAtWidth},
		{NULL, NULL},
		};
		IoObject_addMethodTable_(self, methodTable);
	}
	GLFont_init();
	return self;
}
コード例 #7
0
ファイル: IoClutterColor.c プロジェクト: BMeph/io
IoClutterColor *IoClutterColor_proto(void *state) {
  IoObject *self = IoObject_new(state);
  IoObject_tag_(self, IoClutterColor_newTag(state));

  IoObject_setDataPointer_(self, calloc(1, sizeof(IoClutterColorData)));
  IoState_registerProtoWithFunc_(state, self, IoClutterColor_proto);

  {
    IoMethodTable methodTable[] = {
      {"==",              IoClutterColor_equals},
      {"!=",              IoClutterColor_notEquals},

      {"with",            IoClutterColor_fromString},
      {"asString",        IoClutterColor_asString},
      {"withHLS",         IoClutterColor_fromHLS},
      {"toHLS",           IoClutterColor_toHLS},
      {"withPixel",       IoClutterColor_fromPixel},
      {"toPixel",         IoClutterColor_toPixel},

      {"+",               IoClutterColor_add},
      {"-",               IoClutterColor_subtract},
      {"addInPlace",      IoClutterColor_addInPlace},
      {"subtractInPlace", IoClutterColor_subtractInPlace},

      {"lighten",         IoClutterColor_lighten},
      {"darken",          IoClutterColor_darken},
      {"shade",           IoClutterColor_shade},

      {NULL, NULL}
    };
    IoObject_addMethodTable_(self, methodTable);
  }

  return self;
}
コード例 #8
0
ファイル: IoMemcached.c プロジェクト: ADTSH/io
IoObject *IoMemcached_proto(void *state)
{
	IoMemcached *self = IoObject_new(state);
	IoObject_tag_(self, IoMemcached_newTag(state));

	IoObject_setDataPointer_(self, calloc(1, sizeof(IoMemcachedData)));

	IoState_registerProtoWithFunc_(state, self, IoMemcached_proto);

	{
		IoMethodTable methodTable[] = {
		{"addServer",  IoMemcached_addServer},
		{"set",        IoMemcached_set},
		{"add",        IoMemcached_add},
		{"replace",    IoMemcached_replace},
		{"append",     IoMemcached_append},
		{"prepend",    IoMemcached_prepend},
		{"get",        IoMemcached_get},
		{"getMulti",   IoMemcached_getMulti},
		{"delete",     IoMemcached_delete},
		{"flushAll",   IoMemcached_flushAll},
		{"incr",       IoMemcached_incr},
		{"decr",       IoMemcached_decr},
		{"stats",      IoMemcached_stats},
		{NULL, NULL},
		};
		IoObject_addMethodTable_(self, methodTable);
	}

	return self;
}
コード例 #9
0
// _proto creates the first-ever instance of the prototype 
IoObject *IoCInvokeStructureInstance_proto(void *state)
{
        // First we allocate a new IoObject
        IoCInvokeStructureInstance *self = IoObject_new(state);

        // Then tag it
        IoObject_tag_(self, IoCInvokeStructureInstance_newTag(state));
	    IoObject_setDataPointer_(self, calloc(1, sizeof(IoCInvokeStructureInstanceData)));
        
	    // then register this proto generator
        IoState_registerProtoWithFunc_(state, self, IoCInvokeStructureInstance_proto);

        // and finally, define the table of methods this proto supports
        // we just have one method here, returnSelf, then terminate the array
        // with NULLs
        {
                IoMethodTable methodTable[] = {
			        {"setValue", IoCInvokeStructureInstance_setValue},
			        {"setLibrary", IoCInvokeStructureInstance_setLibrary},
                    {"getValue", IoCInvokeStructureInstance_getValue},
                	{NULL, NULL},
                };
                IoObject_addMethodTable_(self, methodTable);
        }

        return self;
}
コード例 #10
0
ファイル: IoCairoFontOptions.c プロジェクト: AlexGensek/io
IoCairoFontOptions *IoCairoFontOptions_proto(void *state)
{
	IoObject *self = IoObject_new(state);
	IoObject_tag_(self, IoCairoFontOptions_newTag(state));

	IoState_registerProtoWithFunc_(state, self, IoCairoFontOptions_proto);

	{
		IoMethodTable methodTable[] = {
			{"create", IoCairoFontOptions_create},
			{"merge", IoCairoFontOptions_merge},

			{"setAntialias", IoCairoFontOptions_setAntialias},
			{"getAntialias", IoCairoFontOptions_getAntialias},

			{"getSubpixelOrder", IoCairoFontOptions_getSubpixelOrder},
			{"setSubpixelOrder", IoCairoFontOptions_setSubpixelOrder},

			{"setHintStyle", IoCairoFontOptions_setHintStyle},
			{"getHintStyle", IoCairoFontOptions_getHintStyle},

			{"setHintMetrics", IoCairoFontOptions_setHintMetrics},
			{"getHintMetrics", IoCairoFontOptions_getHintMetrics},

			{NULL, NULL},
		};

		IoObject_addMethodTable_(self, methodTable);
	}

	return self;
}
コード例 #11
0
ファイル: IoSkipDBM.c プロジェクト: anthem/io
IoSkipDBM *IoSkipDBM_proto(void *state)
{
	IoMethodTable methodTable[] = {
	{"setPath",  IoSkipDBM_setPath},
	{"path",  IoSkipDBM_path},
	{"open",     IoSkipDBM_open},
	{"close",    IoSkipDBM_close},
	{"isOpen",   IoSkipDBM_isOpen},
	{"delete",   IoSkipDBM_delete},
	{"root",     IoSkipDBM_root},
	{"begin",     IoSkipDBM_beginTransaction},
	{"commit",     IoSkipDBM_commitnTransaction},
	//{"at",       IoSkipDBM_at},
	{"compact",  IoSkipDBM_compact},
	{NULL, NULL},
	};

	IoObject *self = IoObject_new(state);
	IoObject_tag_(self, IoSkipDBM_newTag(state));

	IoObject_setDataPointer_(self, SkipDBM_new());
	IoState_registerProtoWithFunc_((IoState *)state, self, IoSkipDBM_proto);

	IoObject_addMethodTable_(self, methodTable);
	return self;
}
コード例 #12
0
ファイル: IoMessage_opShuffle.c プロジェクト: cdcarter/io
Levels *Levels_new(IoMessage *msg)
{
	Levels *self = io_calloc(1, sizeof(Levels));

	IoState *state = IoObject_state(msg);
	IoSymbol *operatorTableSymbol = IoState_symbolWithCString_(state, "OperatorTable");

	// Be ultra flexable, and try to use the first message's operator table.
	IoObject *opTable = IoObject_rawGetSlot_(msg, operatorTableSymbol);

	// Otherwise, use Core OperatorTable, and if that doesn't exist, create it.
	if (opTable == NULL)
	{
		// There is a chance the message didn't have it, but the core did---due
		// to the Core not being part of the message's protos. Use Core
		// Message's OperatorTable
		opTable = IoObject_rawGetSlot_(state->core, operatorTableSymbol);

		// If Core doesn't have an OperatorTable, then create it.
		if (opTable == NULL)
		{
			opTable = IoObject_new(state);
			IoObject_setSlot_to_(state->core, operatorTableSymbol, opTable);
			IoObject_setSlot_to_(opTable, IoState_symbolWithCString_(state, "precedenceLevelCount"), IoState_numberWithDouble_(state, IO_OP_MAX_LEVEL));
		}
	}

	self->operatorTable = getOpTable(opTable, "operators", IoState_createOperatorTable);
	self->assignOperatorTable = getOpTable(opTable, "assignOperators", IoState_createAssignOperatorTable);

	self->stack = List_new();
	Levels_reset(self);
	return self;
}
コード例 #13
0
ファイル: IoSVN.c プロジェクト: omf/iosvnnative
// _proto creates the first-ever instance of the prototype 
IoObject *IoSVN_proto(void *state)
{
	printf("IoSVN_proto\n");

	// First we allocate a new IoObject
	IoSVNObject *self = IoObject_new(state);

	// Then tag it
	IoObject_tag_(self, IoSVN_newTag(state));
	SVN_init();

	// then register this proto generator
	IoState_registerProtoWithFunc_(state, self, IoSVN_proto);

	// and finally, define the table of methods this proto supports
	// we just have one method here, returnSelf, then terminate the array
	// with NULLs
	{
		IoMethodTable methodTable[] = {
		{NULL, NULL},
		};
		IoObject_addMethodTable_(self, methodTable);
	}

    //IoObject_setSlog_to_(self, IOSYMBOIL("HEAD"), IONUMBER());

	return self;
}
コード例 #14
0
ファイル: IoRegexMatch.c プロジェクト: AlexGensek/io
IoRegexMatch *IoRegexMatch_proto(void *state)
{
	IoObject *self = IoObject_new(state);
	IoObject_tag_(self, IoRegexMatch_newTag(state));

	IoObject_setDataPointer_(self, calloc(1, sizeof(IoRegexMatchData)));
	DATA(self)->regex = IONIL(self);
	DATA(self)->subject = IOSYMBOL("");
	DATA(self)->ranges = IoList_new(state);

	IoState_registerProtoWithFunc_(state, self, IoRegexMatch_proto);

	{
		IoMethodTable methodTable[] = {
			{"regex", IoRegexMatch_regex},
			{"subject", IoRegexMatch_subject},
			{"ranges", IoRegexMatch_ranges},
			{0, 0},
		};

		IoObject_addMethodTable_(self, methodTable);
	}

	return self;
}
コード例 #15
0
ファイル: IoTagDB.c プロジェクト: Akiyah/io
IoTagDB *IoTagDB_proto(void *state)
{
	IoObject *self = IoObject_new(state);
	IoObject_tag_(self, IoTagDB_newTag(state));

	IoState_registerProtoWithFunc_(state, self, IoTagDB_proto);

	{
		IoMethodTable methodTable[] = {
		{"setPath", IoTagDB_setPath},
		{"open", IoTagDB_open},
		{"close", IoTagDB_close},
		{"atKeyPutTags", IoTagDB_atKeyPutTags},
		{"tagsAtKey", IoTagDB_tagsAtKey},
		{"removeKey", IoTagDB_removeKey},
		{"keysForTags", IoTagDB_keysForTags},
		{"size", IoTagDB_size},
		{"symbolForId", IoTagDB_symbolForId},
		{"idForSymbol", IoTagDB_idForSymbol},
		{"keyAtIndex", IoTagDB_keyAtIndex},
		{"delete", IoTagDB_delete},
		{"allUniqueTagIds", IoTagDB_allUniqueTagIds},
		{NULL, NULL},
		};
		IoObject_addMethodTable_(self, methodTable);
	}

	IoObject_setDataPointer_(self, TagDB_new());

	return self;
}
コード例 #16
0
ファイル: IoODEBox.c プロジェクト: ADTSH/io
IoODEBox *IoODEBox_proto(void *state)
{
	IoObject *self = IoObject_new(state);
	IoObject_tag_(self, IoODEBox_newTag(state));

	IoObject_setDataPointer_(self, calloc(1, sizeof(IoODEBoxData)));

	GEOMID = 0;

	IoState_registerProtoWithId_(state, self, protoId);

	{
		IoMethodTable methodTable[] = {
		{"geomId", IoODEBox_geomId},
		{"lengths", IoODEBox_lengths},
		{"setLengths", IoODEBox_setLengths},
		{"pointDepth", IoODEBox_pointDepth},
		{"body", IoODEBox_body},
		{"setBody", IoODEBox_setBody},
		{"collide", IoODEGeom_collide},

		{NULL, NULL},
		};
		IoObject_addMethodTable_(self, methodTable);
	}
	return self;
}
コード例 #17
0
ファイル: IoGLScissor.c プロジェクト: Akiyah/io
IoGLScissor *IoGLScissor_proto(void *state)
{
	IoObject *self = IoObject_new(state);
	IoObject_tag_(self, IoGLScissor_newTag(state));

	IoObject_setDataPointer_(self, calloc(1, sizeof(IoGLScissorData)));

	DATA(self)->rect    = IoBox_new(state);
	DATA(self)->tmpRect = IoBox_new(state);

	IoState_registerProtoWithFunc_(state, self, IoGLScissor_proto);

	{
	IoMethodTable methodTable[] = {
	{"sync", IoGLScissor_sync},
	{"set", IoGLScissor_set},
	{"on", IoGLScissor_on},
	{"off", IoGLScissor_off},
	{"isOn", IoGLScissor_isOn},
	{"push", IoGLScissor_push},
	{"pop", IoGLScissor_pop},
	{"isVisible", IoGLScissor_isVisible},

	{"rect", IoGLScissor_rect},
	{"setRect", IoGLScissor_setScreenRect},
	{"setViewRect", IoGLScissor_setViewRect},
	{"unionWithViewRect", IoGLScissor_unionWithViewRect},
	{"unionWithScreenRect", IoGLScissor_unionWithScreenRect},
	{NULL, NULL},
	};
	IoObject_addMethodTable_(self, methodTable);
	}
	return self;
}
コード例 #18
0
ファイル: IoAsyncRequest.c プロジェクト: Akiyah/io
IoAsyncRequest *IoAsyncRequest_proto(void *state)
{
	IoAsyncRequest *self = IoObject_new(state);
	IoObject_tag_(self, IoAsyncRequest_newTag(state));

	IoObject_setDataPointer_(self, calloc(1, sizeof(struct aiocb)));

	IoState_registerProtoWithFunc_(state, self, IoAsyncRequest_proto);

	{
		IoMethodTable methodTable[] = {
		{"setDescriptor", IoAsyncRequest_setDescriptor},
		{"descriptor", IoAsyncRequest_descriptor},
		{"numberOfBytes", IoAsyncRequest_numberOfBytes},
		{"read", IoAsyncRequest_read},
		{"write", IoAsyncRequest_write},
		{"isDone", IoAsyncRequest_isDone},
		{"error", IoAsyncRequest_error},
		{"cancel", IoAsyncRequest_cancel},
		{"sync", IoAsyncRequest_sync},
		{"copyBufferTo", IoAsyncRequest_copyBufferTo},
		{NULL, NULL},
		};
		IoObject_addMethodTable_(self, methodTable);
	}

	return self;
}
コード例 #19
0
ファイル: IoTokyoCabinetPrefixCursor.c プロジェクト: ADTSH/io
IoTokyoCabinetPrefixCursor *IoTokyoCabinetPrefixCursor_proto(void *state)
{
	IoMethodTable methodTable[] = {
	{"close",     IoTokyoCabinetPrefixCursor_close},
	{"first",  IoTokyoCabinetPrefixCursor_first},
	{"last",  IoTokyoCabinetPrefixCursor_last},
	{"previous",  IoTokyoCabinetPrefixCursor_previous},
	{"next",  IoTokyoCabinetPrefixCursor_next},
	{"jump",  IoTokyoCabinetPrefixCursor_jump},
	{"key",  IoTokyoCabinetPrefixCursor_key},
	{"value",  IoTokyoCabinetPrefixCursor_value},
	{"put",  IoTokyoCabinetPrefixCursor_put},
	{"remove",  IoTokyoCabinetPrefixCursor_remove},

	{NULL, NULL},
	};

	IoObject *self = IoObject_new(state);
	IoObject_tag_(self, IoTokyoCabinetPrefixCursor_newTag(state));

	IoObject_setDataPointer_(self, NULL);
	IoState_registerProtoWithId_((IoState *)state, self, protoId);

	IoObject_addMethodTable_(self, methodTable);
	return self;
}
コード例 #20
0
ファイル: IoMP3Decoder.c プロジェクト: Akiyah/io
IoMP3Decoder *IoMP3Decoder_proto(void *state)
{
	IoObject *self = IoObject_new(state);
	IoObject_tag_(self, IoMP3Decoder_newTag(state));
	
	IoObject_setDataPointer_(self, calloc(1, sizeof(IoMP3DecoderData)));
	
	//DATA(self)->outSound = 0x0;
	DATA(self)->willProcessMessage = IoMessage_newWithName_label_(state, IOSYMBOL("willProcess"), IOSYMBOL("[MP3Decoder]"));
	DATA(self)->didProcessMessage = IoMessage_newWithName_label_(state, IOSYMBOL("didProcess"), IOSYMBOL("[MP3Decoder]"));
	DATA(self)->inputBuffer  = IoSeq_new(state);
	DATA(self)->outputBuffer = IoSeq_new(state);
	DATA(self)->tmpInputBa = UArray_new();
	
	IoState_registerProtoWithFunc_(state, self, IoMP3Decoder_proto);
	
	{
		IoMethodTable methodTable[] = {
		{"start", IoMP3Decoder_start},
		{"stop",  IoMP3Decoder_stop},
		{"inputBuffer",  IoMP3Decoder_inputBuffer},
		{"outputBuffer",  IoMP3Decoder_outputBuffer},
		
		{NULL, NULL},
		};
		IoObject_addMethodTable_(self, methodTable);
	}
	return self;
}
コード例 #21
0
ファイル: IoMP3Encoder.c プロジェクト: Akiyah/io
IoMP3Encoder *IoMP3Encoder_proto(void *state)
{
    IoObject *self = IoObject_new(state);
    IoObject_tag_(self, IoMP3Encoder_newTag(state));
    
    self->data = calloc(1, sizeof(IoMP3EncoderData));
    DATA(self)->outBuffer = IoBuffer_new(state);
    DATA(self)->encoder = MP3Encoder_new();
    MP3Encoder_setExternalOutputUArray_(DATA(self)->encoder, 
					   IoBuffer_rawUArray(DATA(self)->outBuffer));
    
    
    IoState_registerProtoWithFunc_(state, self, IoMP3Encoder_proto);
    
    {
	IoMethodTable methodTable[] = {
	{"encode", IoMP3Encoder_encode},
	{"end",  IoMP3Encoder_end},
	{"outBuffer",  IoMP3Encoder_outBuffer},
	{"setBitRate",  IoMP3Encoder_setBitRate},
	{"setSampleRate",  IoMP3Encoder_setSampleRate},
	{"setQuality",  IoMP3Encoder_setQuality},
	{"setCompressionRatio",  IoMP3Encoder_setCompressionRatio},
	{NULL, NULL},
	};
	IoObject_addMethodTable_(self, methodTable);
    }
    
    return self;
}
コード例 #22
0
ファイル: IoODEHinge.c プロジェクト: ADTSH/io
IoODEHinge *IoODEHinge_proto(void *state)
{
	IoObject *self = IoObject_new(state);
	IoObject_tag_(self, IoODEHinge_newTag(state));

	IoODEJoint_protoCommon(self);

	IoState_registerProtoWithId_(state, self, protoId);

	{
		IoMethodTable methodTable[] = {
				ODE_COMMON_JOINT_METHODS
#define PARAM(X, _N, _SETN) \
		{#_N, IoODEHinge_##_N}, \
		{#_SETN, IoODEHinge_##_SETN},
PARAMS
#undef PARAM

		{"anchor", IoODEHinge_anchor},
		{"setAnchor", IoODEHinge_setAnchor},
		{"anchor2", IoODEHinge_anchor2},
		{"axis", IoODEHinge_axis},
		{"setAxis", IoODEHinge_setAxis},
		{"angle", IoODEHinge_angle},
		{"angleRate", IoODEHinge_angleRate},
				{"addTorque", IoODEHinge_addTorque},

		{NULL, NULL},
		};
		IoObject_addMethodTable_(self, methodTable);
	}
	return self;
}
コード例 #23
0
ファイル: IoDynLib.c プロジェクト: asymmetric/io
IoObject *IoDynLib_proto(void *state)
{
	IoMethodTable methodTable[] = {
	{"setPath", IoDynLib_setPath},
	{"path", IoDynLib_path},
	{"setInitFuncName", IoDynLib_setInitFuncName},
	{"initFuncName", IoDynLib_initFuncName},
	{"setFreeFuncName", IoDynLib_setFreeFuncName},
	{"freeFuncName", IoDynLib_freeFuncName},
	{"open", IoDynLib_open},
	{"close", IoDynLib_close},
	{"isOpen", IoDynLib_isOpen},
	{"call", IoDynLib_call},
	{"voidCall", IoDynLib_voidCall},
	{"callPluginInit", IoDynLib_callPluginInitFunc},
	//{"returnsString", IoDynLib_returnsString},
	{NULL, NULL},
	};

	IoObject *self = IoObject_new(state);
	IoObject_tag_(self, IoDynLib_newTag(state));
	IoObject_setDataPointer_(self, DynLib_new());
	DynLib_setInitArg_(DATA(self), state);
	DynLib_setFreeArg_(DATA(self), state);
	IoState_registerProtoWithFunc_((IoState *)state, self, protoId);

	IoObject_addMethodTable_(self, methodTable);
	return self;
}
コード例 #24
0
ファイル: IoCertificate.c プロジェクト: anthem/io
IoObject *IoCertificate_attributes(IoCertificate *self, IoObject *locals, IoMessage *m)
{
	IoObject *map = IoObject_new(IoObject_state(self));
	const EVP_PKEY *pkey = X509_extract_key(X509(self));
	int i;
	for(i = 0; i < EVP_PKEY_get_attr_count(pkey); i++)
	{
		IoList *list = IoList_new(IoObject_state(self));
		X509_ATTRIBUTE *attr = EVP_PKEY_get_attr(pkey, i);
		const char *key = (const char *)OBJ_nid2ln(OBJ_obj2nid(X509_ATTRIBUTE_get0_object(attr)));
		int j;
		for(j = 0; j < X509_ATTRIBUTE_count(attr); j++)
		{
			ASN1_TYPE *attrType = X509_ATTRIBUTE_get0_type(attr, j);
			ASN1_OBJECT *attrData = X509_ATTRIBUTE_get0_data(attr, j, attrType->type, NULL);
			//consider switching on attrType instead; 
			//really, that would be wiser, so that dates, 
			//numbers, etc can be happy
			/*
			switch(attrType->type) {
				case V_ASN1_OCTET_STRING:
			...
			*/
			int len = i2t_ASN1_OBJECT(NULL, 0, attrData);
			char *value = calloc(len, sizeof(char));
			i2t_ASN1_OBJECT(value, len, attrData);
			IoList_rawAppend_(list, IoSeq_newWithCString_(IoObject_state(self), value));
		}
		IoObject_setSlot_to_(map, IOSYMBOL(key), list);
	}
	return map;
}
コード例 #25
0
IoDirectory *IoDirectory_proto(void *state)
{
    IoObject *self = IoObject_new(state);
    IoObject_tag_(self, IoDirectory_newTag(state));

    IoObject_setDataPointer_(self, io_calloc(1, sizeof(IoDirectoryData)));
    DATA(self)->path = IOSYMBOL(".");

    IoState_registerProtoWithFunc_((IoState *)state, self, IoDirectory_proto);

    {
        IoMethodTable methodTable[] = {
            {"setPath", IoDirectory_setPath},
            {"path", IoDirectory_path},
            {"name", IoDirectory_name},
            {"exists", IoDirectory_exists},
            {"items", IoDirectory_items},
            {"at", IoDirectory_at},
            {"size", IoDirectory_size},
            {"create", IoDirectory_create},
            {"createSubdirectory", IoDirectory_createSubdirectory},
            {"currentWorkingDirectory", IoDirectory_currentWorkingDirectory},
            {"setCurrentWorkingDirectory", IoDirectory_setCurrentWorkingDirectory},
            {NULL, NULL},
        };

        IoObject_addMethodTable_(self, methodTable);
    }
    return self;
}
コード例 #26
0
ファイル: IoCertificate.c プロジェクト: anthem/io
IoCertificate *IoCertificate_proto(void *state)
{
	IoObject *self = IoObject_new(state);
	
	IoObject_tag_(self, IoCertificate_newTag(state));

	IoState_registerProtoWithFunc_((IoState *)state, self, IoCertificate_proto);
	
	IoObject_setSlot_to_(self, IOSYMBOL("PEMType"), IONUMBER(X509_FILETYPE_PEM));
	IoObject_setSlot_to_(self, IOSYMBOL("ASN1Type"), IONUMBER(X509_FILETYPE_ASN1));
	
	{
		IoMethodTable methodTable[] = {
		{"version", IoCertificate_version},
		{"serialNumber", IoCertificate_serialNumber},
		{"notBefore", IoCertificate_notBefore},
		{"notAfter", IoCertificate_notAfter},
		{"extensions", IoCertificate_extensions},
		{"attributes", IoCertificate_attributes},
		{"issuerName", IoCertificate_issuerName},
		{"subjectName", IoCertificate_subjectName},
		{NULL, NULL}
		};
		IoObject_addMethodTable_(self, methodTable);
	}
	
	IoObject_setDataPointer_(self, calloc(1, sizeof(Certificate)));
	
	return self;
}
コード例 #27
0
ファイル: IoCairoSurfacePattern.c プロジェクト: cdcarter/io
IoCairoSurfacePattern *IoCairoSurfacePattern_proto(void *state)
{
	IoObject *self = IoObject_new(state);
	IoObject_tag_(self, IoCairoSurfacePattern_newTag(state));

	IoState_registerProtoWithFunc_(state, self, IoCairoSurfacePattern_proto);

	IoCairoPattern_addMethods(self);
	{
		IoMethodTable methodTable[] = {
			{"create", IoCairoSurfacePattern_create},

			{"getSurface", IoCairoSurfacePattern_getSurface},

			{"setExtend", IoCairoSurfacePattern_setExtend},
			{"getExtend", IoCairoSurfacePattern_getExtend},

			{"setFilter", IoCairoSurfacePattern_setFilter},
			{"getFilter", IoCairoSurfacePattern_getFilter},

			{NULL, NULL},
		};
		IoObject_addMethodTable_(self, methodTable);
	}
	return self;
}
コード例 #28
0
ファイル: IoAppleSensors.c プロジェクト: Alessandroo/io
IoAppleSensors *IoAppleSensors_proto(void *state)
{
	IoAppleSensors *self = IoObject_new(state);
	IoObject_tag_(self, IoAppleSensors_newTag(state));

	//IoObject_setDataPointer_(self, calloc(1, sizeof(IoAppleSensorsData)));

	IoState_registerProtoWithId_(state, self, protoId);

	{
		IoMethodTable methodTable[] = {
			{"getLeftLightSensor", IoAppleSensors_getLeftLightSensor},
			{"getRightLightSensor", IoAppleSensors_getRightLightSensor},
			{"getDisplayBrightness", IoAppleSensors_getDisplayBrightness},
			{"setDisplayBrightness", IoAppleSensors_setDisplayBrightness},
			{"getKeyboardBrightness", IoAppleSensors_getKeyboardBrightness},
			{"setKeyboardBrightness", IoAppleSensors_setKeyboardBrightness},
			{"getCPUTemperature", IoAppleSensors_getCPUTemperature},
			{"getGPUTemperature", IoAppleSensors_getGPUTemperature},
			{"getPalmTemperature", IoAppleSensors_getPalmTemperature},
			{"getBatteryTemperature", IoAppleSensors_getBatteryTemperature},
			{"getPowerTemperature", IoAppleSensors_getPowerTemperature},
			{"getPCHTemperature", IoAppleSensors_getPCHTemperature},
			{"getRAMTemperature", IoAppleSensors_getRAMTemperature},
			//{"smsDetect", IoAppleSensors_smsDetect},
			{"smsVector", IoAppleSensors_smsVector},
			{NULL, NULL},
		};
		IoObject_addMethodTable_(self, methodTable);
	}

	return self;
}
コード例 #29
0
ファイル: IoODEJointGroup.c プロジェクト: Akiyah/io
IoODEJointGroup *IoODEJointGroup_proto(void *state)
{
	IoObject *self = IoObject_new(state);
	IoObject_tag_(self, IoODEJointGroup_newTag(state));

	IoObject_setDataPointer_(self, calloc(1, sizeof(IoODEJointGroupData)));

	JOINTGROUPID = 0;
	WORLD = 0L;
	DATA(self)->joints = 0L;

	IoState_registerProtoWithFunc_(state, self, IoODEJointGroup_proto);

	{
		IoMethodTable methodTable[] = {
		{"jointGroupId", IoODEJointGroup_jointGroupId},
		{"world", IoODEJointGroup_world},
		{"empty", IoODEJointGroup_empty},
		{"joints", IoODEJointGroup_joints},
		{"createContact", IoODEJointGroup_createContact},
		{NULL, NULL},
		};
		IoObject_addMethodTable_(self, methodTable);
	}
	return self;
}
コード例 #30
0
ファイル: IoLoudmouth.c プロジェクト: ADTSH/io
IoLoudmouth *IoLoudmouth_proto(void *state) {
  IoObject *self = IoObject_new(state);
  IoObject_tag_(self, IoLoudmouth_newTag(state));

  IoState_registerProtoWithFunc_(state, self, IoLoudmouth_proto);

  {
    IoMethodTable methodTable[] = {
      {"connect",         IoLoudmouth_connect},
      {"disconnect",      IoLoudmouth_disconnect},
      {"isConnected",     IoLoudmouth_isConnected},
      {"status",          IoLoudmouth_status},

      {"send",            IoLoudmouth_send},
      {"sendRaw",         IoLoudmouth_sendRaw},
      {"updatePresenceAndStatusMsg", IoLoudmouth_setPresence},

      {"startMainLoop",   IoLoudmouth_startMainLoop},
      {"stopMainLoop",    IoLoudmouth_stopMainLoop},
      {"isSslSupported",  IoLoudmouth_isSSLSupported},

      {NULL, NULL},
    };
    IoObject_addMethodTable_(self, methodTable);
  }

  return self;
}