Class: XCB::GetPropertyReply
- Inherits:
-
Object
- Object
- XCB::GetPropertyReply
- Defined in:
- ext/xproto.c
Instance Method Summary collapse
Instance Method Details
#bytes_after ⇒ Object
3301 3302 3303 3304 3305 3306 3307 |
# File 'ext/xproto.c', line 3301
static VALUE
r_XCB_GetPropertyReply_get_bytes_after(VALUE r_self)
{
xcb_get_property_reply_t *reply;
Data_Get_Struct(r_self, xcb_get_property_reply_t, reply);
return INT2FIX(reply->bytes_after);
}
|
#format ⇒ Object
3287 3288 3289 3290 3291 3292 3293 |
# File 'ext/xproto.c', line 3287
static VALUE
r_XCB_GetPropertyReply_get_format(VALUE r_self)
{
xcb_get_property_reply_t *reply;
Data_Get_Struct(r_self, xcb_get_property_reply_t, reply);
return INT2FIX(reply->format);
}
|
#type ⇒ Object
3294 3295 3296 3297 3298 3299 3300 |
# File 'ext/xproto.c', line 3294
static VALUE
r_XCB_GetPropertyReply_get_type(VALUE r_self)
{
xcb_get_property_reply_t *reply;
Data_Get_Struct(r_self, xcb_get_property_reply_t, reply);
return INT2FIX(reply->type);
}
|
#value ⇒ Object
3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 |
# File 'ext/xproto.c', line 3315
static VALUE
r_XCB_GetPropertyReply_get_value(VALUE r_self)
{
xcb_get_property_reply_t *reply;
Data_Get_Struct(r_self, xcb_get_property_reply_t, reply);
VALUE r_value;
uint8_t format = reply->format;
if (format == 0)
return Qnil;
int __value_len = xcb_get_property_value_length(reply);
void *__value = xcb_get_property_value(reply);
r_value = rb_ary_new2(__value_len);
switch (format) {
case 8:
{
uint8_t *__value8 = (uint8_t*) __value;
int i;
for (i = 0; i < __value_len; i += 1)
rb_ary_store(r_value, i, INT2FIX(__value8[i]));
break;
}
case 16:
{
uint16_t *__value16 = (uint16_t*) __value;
int i;
for (i = 0; i < __value_len; i += 1)
rb_ary_store(r_value, i, INT2FIX(__value16[i]));
break;
}
case 32:
{
uint32_t *__value32 = (uint32_t*) __value;
int i;
for (i = 0; i < __value_len; i += 1)
rb_ary_store(r_value, i, INT2FIX(__value32[i]));
break;
}
default:
rb_raise(rb_eArgError, "invalid format");
}
return r_value;
}
|
#value_len ⇒ Object
3308 3309 3310 3311 3312 3313 3314 |
# File 'ext/xproto.c', line 3308
static VALUE
r_XCB_GetPropertyReply_get_value_len(VALUE r_self)
{
xcb_get_property_reply_t *reply;
Data_Get_Struct(r_self, xcb_get_property_reply_t, reply);
return INT2FIX(reply->value_len);
}
|