Class: PLplot::GraphicsIn

Inherits:
Object
  • Object
show all
Defined in:
ext/rbplplot.c

Instance Method Summary collapse

Instance Method Details

#buttonInteger

Gets mouse button selected.

Returns:

  • (Integer)


4284
4285
4286
4287
4288
4289
4290
# File 'ext/rbplplot.c', line 4284

static VALUE
rb_cPLGraphicsIn_button(VALUE self)
{
  PLGraphicsIn *p;
  Data_Get_Struct(self, PLGraphicsIn, p);
  return UINT2NUM(p->button);
}

#dxFloat Also known as: dX

Gets relative device x coordinate of pointer.

Returns:

  • (Float)


4340
4341
4342
4343
4344
4345
4346
# File 'ext/rbplplot.c', line 4340

static VALUE
rb_cPLGraphicsIn_dx(VALUE self)
{
  PLGraphicsIn *p;
  Data_Get_Struct(self, PLGraphicsIn, p);
  return rb_float_new(p->dX);
}

#dyFloat Also known as: dY

Gets relative device y coordinate of pointer.

Returns:

  • (Float)


4354
4355
4356
4357
4358
4359
4360
# File 'ext/rbplplot.c', line 4354

static VALUE
rb_cPLGraphicsIn_dy(VALUE self)
{
  PLGraphicsIn *p;
  Data_Get_Struct(self, PLGraphicsIn, p);
  return rb_float_new(p->dY);
}

#inspectString

Returns a human readable string showing all attributes.

Returns:

  • (String)


4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
# File 'ext/rbplplot.c', line 4406

static VALUE
rb_cPLGraphicsIn_inspect(VALUE self)
{
  PLGraphicsIn *p;
  Data_Get_Struct(self, PLGraphicsIn, p);
  char s[1000]; /* more than enough */

  sprintf(s,
      "#<PLGraphicsIn: "
      "type=%d, state=0x%04x, keysym=%d, button=%d, subwindow=%d, "
      "p=(%d,%d), d=(%.3f,%.3f), w=(%.3f,%.3f)>",
      p->type, p->state, p->keysym, p->button, p->subwindow,
      p->pX, p->pY, p->dX, p->dY, p->wX, p->wY);

  return rb_str_new2(s);
}

#keystrnil, String

Gets keysym as a String if it is a printable character.

Returns:

  • (nil, String)


4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
# File 'ext/rbplplot.c', line 4429

static VALUE
rb_cPLGraphicsIn_keystr(VALUE self)
{
  VALUE val = Qnil;
  char c;
  PLGraphicsIn *p;
  Data_Get_Struct(self, PLGraphicsIn, p);

  if(ISPRINT(p->keysym)) {
    c = (char)p->keysym;
    val = rb_str_new(&c, 1);
  }

  return val;
}

#keysymInteger

Gets key selected.

Returns:

  • (Integer)


4270
4271
4272
4273
4274
4275
4276
# File 'ext/rbplplot.c', line 4270

static VALUE
rb_cPLGraphicsIn_keysym(VALUE self)
{
  PLGraphicsIn *p;
  Data_Get_Struct(self, PLGraphicsIn, p);
  return UINT2NUM(p->keysym);
}

#pxInteger Also known as: pX

Gets absolute device x coordinate of pointer.

Returns:

  • (Integer)


4312
4313
4314
4315
4316
4317
4318
# File 'ext/rbplplot.c', line 4312

static VALUE
rb_cPLGraphicsIn_px(VALUE self)
{
  PLGraphicsIn *p;
  Data_Get_Struct(self, PLGraphicsIn, p);
  return INT2NUM(p->pX);
}

#pyInteger Also known as: pY

Gets absolute device y coordinate of pointer.

Returns:

  • (Integer)


4326
4327
4328
4329
4330
4331
4332
# File 'ext/rbplplot.c', line 4326

static VALUE
rb_cPLGraphicsIn_py(VALUE self)
{
  PLGraphicsIn *p;
  Data_Get_Struct(self, PLGraphicsIn, p);
  return INT2NUM(p->pY);
}

#stateInteger

Gets key or button mask.

Returns:

  • (Integer)


4256
4257
4258
4259
4260
4261
4262
# File 'ext/rbplplot.c', line 4256

static VALUE
rb_cPLGraphicsIn_state(VALUE self)
{
  PLGraphicsIn *p;
  Data_Get_Struct(self, PLGraphicsIn, p);
  return UINT2NUM(p->state);
}

#stringString

Gets translated string.

Returns:

  • (String)


4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
# File 'ext/rbplplot.c', line 4451

static VALUE
rb_cPLGraphicsIn_string(VALUE self)
{
  int i;
  PLGraphicsIn *p;
  Data_Get_Struct(self, PLGraphicsIn, p);

  for(i=0; i<PL_MAXKEY; i++) {
    if(p->string[i] == '\0')
      break;
  }
  return rb_str_new(p->string, i);
}

#subwindowInteger

Gets subwindow (or subpage / subplot) number.

Returns:

  • (Integer)


4298
4299
4300
4301
4302
4303
4304
# File 'ext/rbplplot.c', line 4298

static VALUE
rb_cPLGraphicsIn_subwindow(VALUE self)
{
  PLGraphicsIn *p;
  Data_Get_Struct(self, PLGraphicsIn, p);
  return INT2NUM(p->subwindow);
}

#typeInteger

Gets type of event (currently unused?).

Returns:

  • (Integer)


4242
4243
4244
4245
4246
4247
4248
# File 'ext/rbplplot.c', line 4242

static VALUE
rb_cPLGraphicsIn_type(VALUE self)
{
  PLGraphicsIn *p;
  Data_Get_Struct(self, PLGraphicsIn, p);
  return INT2NUM(p->type);
}

#wxFloat Also known as: wX

Gets world x coordinate of pointer.

Returns:

  • (Float)


4368
4369
4370
4371
4372
4373
4374
# File 'ext/rbplplot.c', line 4368

static VALUE
rb_cPLGraphicsIn_wx(VALUE self)
{
  PLGraphicsIn *p;
  Data_Get_Struct(self, PLGraphicsIn, p);
  return rb_float_new(p->wX);
}

#wyFloat Also known as: wY

Gets world y coordinate of pointer.

Returns:

  • (Float)


4382
4383
4384
4385
4386
4387
4388
# File 'ext/rbplplot.c', line 4382

static VALUE
rb_cPLGraphicsIn_wy(VALUE self)
{
  PLGraphicsIn *p;
  Data_Get_Struct(self, PLGraphicsIn, p);
  return rb_float_new(p->wY);
}