Пример #1
0
IO_METHOD(IoObject, protoOwnsSlots)
{
  /*doc Object ownsSlots
  A debug method.
  */
	return IOBOOL(self, IoObject_ownsSlots(self));
}
Пример #2
0
Файл: IoRegex.c Проект: ADTSH/io
IoObject *IoRegex_isExtended(IoRegex *self, IoObject *locals, IoMessage *m)
{
	/*doc Regex isExtended
	Returns true if the receiver is in extended mode, false if not.
	*/
	return IOBOOL(self, DATA(self)->options & PCRE_EXTENDED);
}
Пример #3
0
Файл: IoBox.c Проект: ADTSH/io
IoObject *IoBox_containsPoint(IoBox *self, IoObject *locals, IoMessage *m)
{
	/*doc Box containsPoint(aPoint)
	Returns true if aPoint is within the receiver's bounds, false otherwise.
	*/

	int result;

	IoVector *otherPoint = IoMessage_locals_pointArgAt_(m, locals, 0);

	UArray *bo = IoSeq_rawUArray(IoBox_rawOrigin(self));
	UArray *bs = IoSeq_rawUArray(IoBox_rawSize(self));
	UArray *p  = IoSeq_rawUArray(otherPoint);

	// do a malloc since the vectors might be large

	UArray *b1 = UArray_clone(bo);
	UArray *b2 = UArray_clone(bs);

	// make bo2 the box endpoint

	UArray_add_(b2, b1);

	// ensure bo1 is on the left bottom and bo2 is on the top right

	UArray_Min(b1, b2);
	UArray_Max(b2, bo);

	result = UArray_greaterThanOrEqualTo_(p, b1) && UArray_greaterThanOrEqualTo_(b2, p);

	UArray_free(b1);
	UArray_free(b2);

	return IOBOOL(self, result);
}
Пример #4
0
IoObject *IoRegexMatches_allowsEmptyMatches(IoRegexMatches *self, IoObject *locals, IoMessage *m)
{
	/*doc RegexMatches allowsEmptyMatches
	Returns true if the receiver allows empty matches, false if not.
	*/
	return IOBOOL(self, DATA(self)->options & PCRE_NOTEMPTY);
}
Пример #5
0
//doc ClutterUnits ==(otherUnit)
IO_METHOD(IoClutterUnits, equals) {
  IoClutterUnits *other = IoMessage_locals_clutterUnitsArgAt_(m, locals, 0);
  int self_in_pixels = clutter_units_to_pixels(&IOCUNITS(self)),
      other_in_pixels = clutter_units_to_pixels(&IOCUNITS(other));

  return IOBOOL(self, self_in_pixels == other_in_pixels);
}
Пример #6
0
//doc ClutterActorBox contains(x1, y1)
IO_METHOD(IoClutterActorBox, contains) {
  float x = IoMessage_locals_floatArgAt_(m, locals, 0),
        y = IoMessage_locals_floatArgAt_(m, locals, 1);
  int contains = clutter_actor_box_contains(IOCABOX(self), x, y);

  return IOBOOL(self, contains);
}
Пример #7
0
IoObject *IoObject_protoOwnsSlots(IoObject *self, IoObject *locals, IoMessage *m)
{
  /*doc Object ownsSlots
  A debug method.
  */
	return IOBOOL(self, IoObject_ownsSlots(self));
}
Пример #8
0
//doc Loudmouth sendRaw(body) Sends raw text over XMPP stream. Returns <code>true</code> if no errors occur.
IoObject *IoLoudmouth_sendRaw(IoLoudmouth *self, IoObject *locals, IoMessage *m) {
  char *seq = IoMessage_locals_cStringArgAt_(m, locals, 0);
  int success = lm_connection_send_raw(LMCONN(self), seq, NULL);
  free(seq);

  return IOBOOL(self, success);
}
Пример #9
0
IoObject* IoMySQL_connected(IoObject* self, IoObject* locals, IoMessage* m)
{
    /*doc MySQL connected
    Returns true if connected to the database, false otherwise.
    */
    return IOBOOL(self, DATA(self)->connected);
}
Пример #10
0
IoObject *IoSQLite3_isOpen(IoSQLite3 *self, IoObject *locals, IoMessage *m)
{
	/*doc SQLite3 isOpen
	Returns true if the database is open, false otherwise.
	*/

	return IOBOOL(self, DATA(self)->db != NULL);
}
Пример #11
0
IoObject *IoFile_isSocket(IoFile *self, IoObject *locals, IoMessage *m)
{
	/*doc File isSocket
	Returns true if the receiver's file descriptor is a Socket, false otherwise.
	*/

	return IOBOOL(self, S_ISSOCK(IoFile_statPointer(self, locals, m)->st_mode));
}
Пример #12
0
IoObject *IoFile_isRegularFile(IoFile *self, IoObject *locals, IoMessage *m)
{
	/*doc File isRegularFile
	Returns true if the receiver's file descriptor is a regular file, false otherwise.
	*/

	return IOBOOL(self, S_ISREG(IoFile_statPointer(self, locals, m)->st_mode));
}
Пример #13
0
IoObject *IoImage_isRGBA8(IoImage *self, IoObject *locals, IoMessage *m)
{
	/*doc Image isRGBA8
	Returns true if the receiver is in RGBA8 format, false otherwise.
	*/

	return IOBOOL(self, Image_isRGBA8(DATA(self)->image));
}
Пример #14
0
IoDynLib *IoDynLib_isOpen(IoDynLib *self, IoObject *locals, IoMessage *m)
{
	/*doc DynLib isOpen
	Returns true if the library is open, or false otherwise.
	*/

	return IOBOOL(self, DynLib_isOpen(DATA(self)));
}
Пример #15
0
IO_METHOD(IoSeq, isEmpty)
{
	/*doc Sequence isEmpty
	Returns true if the size of the receiver is 0, false otherwise.
	*/

	return IOBOOL(self, UArray_size(DATA(self)) == 0);
}
Пример #16
0
IoObject *IoAudioDevice_writeBufferIsEmpty(IoAudioDevice *self, IoObject *locals, IoMessage *m)
{
	/*doc AudioDevice writeBufferIsEmpty
	Returns the true if the audio buffer is empty, false otherwise.
	*/
	
	return IOBOOL(self, DATA(self)->audioDevice->writeBufferIsEmpty);
}
Пример #17
0
IoObject *IoAudioDevice_needsData(IoAudioDevice *self, IoObject *locals, IoMessage *m)
{
	/*doc AudioDevice needsData
	Returns true if the receiver can read more data.
	*/
	
	return IOBOOL(self, DATA(self)->audioDevice->needsData == 1);
}
Пример #18
0
Файл: IoDate.c Проект: bomma/io
IO_METHOD(IoDate, isPast)
{
	/*doc Date isPast
	Returns true if the receiver is a date in the past. 
	*/

	return IOBOOL(self, Date_secondsSinceNow(DATA(self)) > 0);
}
Пример #19
0
Файл: IoDate.c Проект: bomma/io
IO_METHOD(IoDate, isDaylightSavingsTime)
{
	/*doc Date isDaylightSavingsTime
	Returns self if Daylight Saving Time is in effect for the receiver, otherwise returns Nil. 
	*/

	return IOBOOL(self, Date_isDaylightSavingsTime(DATA(self)));
}
Пример #20
0
IoObject *IoImage_isLA8(IoImage *self, IoObject *locals, IoMessage *m)
{
	/*doc Image isLA8
	Returns true if the receiver is in LA8 (8bit Luminance-Alpha) format, false otherwise.
	*/

	return IOBOOL(self, Image_componentCount(DATA(self)->image) == 2);
}
Пример #21
0
IoObject *IoImage_isL8(IoImage *self, IoObject *locals, IoMessage *m)
{
	/*doc Image isL8
	Returns true if the receiver is in L8 (8bit Luminance) format, false otherwise.
	*/

	return IOBOOL(self, Image_isL8(DATA(self)->image));
}
Пример #22
0
IO_METHOD(IoCoroutine, isCurrent)
{
  /*doc Coroutine isCurrent 
  Returns true if the receiver is currently running coroutine.
  */
	IoObject *v = IOBOOL(self, self == IoState_currentCoroutine(IOSTATE));
	return v;
}
Пример #23
0
IO_METHOD(IoSeq, isMutable)
{
	/*doc Sequence isMutable
	Returns true if the receiver is a mutable Sequence or false otherwise.
	*/

	return IOBOOL(self, !ISSYMBOL(self));
}
Пример #24
0
IoObject *IoCurses_hasColors(IoCurses *self, IoObject *locals, IoMessage *m)
{
	/*doc Curses hasColors
	Returns true if the terminal supports color, false otherwise.
	*/

	return IOBOOL(self, has_colors());
}
Пример #25
0
IO_METHOD(IoSeq, isZero)
{
	/*doc Sequence isZero
	Returns true if all elements are 0, false otherwise.
	*/

	return IOBOOL(self, UArray_isZero(DATA(self)));
}
Пример #26
0
IoObject *IoFile_isDirectory(IoFile *self, IoObject *locals, IoMessage *m)
{
	/*doc File isDirectory
	Returns true if the receiver's path points to a directory, false otherwise.
	*/

	return IOBOOL(self, S_ISDIR(IoFile_statPointer(self, locals, m)->st_mode));
}
Пример #27
0
IoObject *IoRandom_flip(IoObject *self, IoObject *locals, IoMessage *m)
{
	/*doc Random flip
	Returns a random bit as a true or false object.
	*/
	int r = RandomGen_randomInt(DATA(self));
	return IOBOOL(self, r & 0x1);
}
Пример #28
0
IoObject *IoFile_isPipe(IoFile *self, IoObject *locals, IoMessage *m)
{
	/*doc File isPipe
	Returns true if the receiver is a pipe, false otherwise.
	*/

	return IOBOOL(self, S_ISFIFO(IoFile_statPointer(self, locals, m)->st_mode));
}
Пример #29
0
IO_METHOD(IoMessage, isEOL)
{
	/*doc Message isEndOfLine
	Returns true if the message marks the end of the line. A ';' message.
	*/

	return IOBOOL(self, IoMessage_rawIsEOL(self));
}
Пример #30
0
//doc ClutterActor event(clutterEvent, capture)
IO_METHOD(IoClutterActor, event) {
  int success = clutter_actor_event(
    IOCACTOR(self),
    IOCEVENT(IoMessage_locals_clutterEventArgAt_(m, locals, 0)),
    IoMessage_locals_boolArgAt_(m, locals, 1));

  return IOBOOL(self, success);
}