Class: Cairo::Pattern

Inherits:
Object
  • Object
show all
Defined in:
lib/cairo/pattern.rb,
ext/cairo/rb_cairo_pattern.c

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeObject



187
188
189
190
191
192
193
194
195
# File 'ext/cairo/rb_cairo_pattern.c', line 187

static VALUE
cr_pattern_initialize (int argc, VALUE *argv, VALUE self)
{
  rb_raise(rb_eNotImpError,
           "%s class instantiation isn't supported on this cairo installation",
           rb_obj_classname(self));

  return Qnil;
}

Class Method Details

.gradient_supported?Boolean

Returns:

  • (Boolean)


98
99
100
101
102
# File 'ext/cairo/rb_cairo_pattern.c', line 98

static VALUE
cr_pattern_gradient_supported_p (VALUE klass)
{
  return Qtrue;
}

.linear_supported?Boolean

Returns:

  • (Boolean)


104
105
106
107
108
# File 'ext/cairo/rb_cairo_pattern.c', line 104

static VALUE
cr_pattern_linear_supported_p (VALUE klass)
{
  return Qtrue;
}

.mesh_supported?Boolean

Returns:

  • (Boolean)


116
117
118
119
120
121
122
123
124
# File 'ext/cairo/rb_cairo_pattern.c', line 116

static VALUE
cr_pattern_mesh_supported_p (VALUE klass)
{
#ifdef RB_CAIRO_HAS_MESH_PATTERN
  return Qtrue;
#else
  return Qfalse;
#endif
}

.radial_supported?Boolean

Returns:

  • (Boolean)


110
111
112
113
114
# File 'ext/cairo/rb_cairo_pattern.c', line 110

static VALUE
cr_pattern_radial_supported_p (VALUE klass)
{
  return Qtrue;
}

.raster_source_supported?Boolean

Returns:

  • (Boolean)


126
127
128
129
130
131
132
133
134
# File 'ext/cairo/rb_cairo_pattern.c', line 126

static VALUE
cr_pattern_raster_source_supported_p (VALUE klass)
{
#ifdef RB_CAIRO_HAS_RASTER_SOURCE_PATTERN
  return Qtrue;
#else
  return Qfalse;
#endif
}

.solid_supported?Boolean

Returns:

  • (Boolean)


86
87
88
89
90
# File 'ext/cairo/rb_cairo_pattern.c', line 86

static VALUE
cr_pattern_solid_supported_p (VALUE klass)
{
  return Qtrue;
}

.supported?(type) ⇒ Boolean

Returns:

  • (Boolean)


4
5
6
7
8
9
# File 'lib/cairo/pattern.rb', line 4

def supported?(type)
  type = type.to_s.gsub(/([a-z])([A-Z])/, '\\1_\\2').downcase
  supported_predicate = "#{type}_supported?"
  return false unless respond_to?(supported_predicate)
  send(supported_predicate)
end

.surface_supported?Boolean

Returns:

  • (Boolean)


92
93
94
95
96
# File 'ext/cairo/rb_cairo_pattern.c', line 92

static VALUE
cr_pattern_surface_supported_p (VALUE klass)
{
  return Qtrue;
}

Instance Method Details

#extendObject Also known as: __extend__



396
397
398
399
400
# File 'ext/cairo/rb_cairo_pattern.c', line 396

static VALUE
cr_pattern_get_extend (VALUE self)
{
  return INT2NUM (cairo_pattern_get_extend (_SELF (self)));
}

#filterObject



410
411
412
413
414
# File 'ext/cairo/rb_cairo_pattern.c', line 410

static VALUE
cr_pattern_get_filter (VALUE self)
{
  return INT2NUM (cairo_pattern_get_filter (_SELF (self)));
}

#matrixObject



379
380
381
382
383
384
385
386
# File 'ext/cairo/rb_cairo_pattern.c', line 379

static VALUE
cr_pattern_get_matrix (VALUE self)
{
  cairo_matrix_t matrix;
  cairo_pattern_get_matrix (_SELF (self), &matrix);
  cr_pattern_check_status (_SELF (self));
  return CRMATRIX2RVAL (&matrix);
}

#set_extendObject



388
389
390
391
392
393
394
# File 'ext/cairo/rb_cairo_pattern.c', line 388

static VALUE
cr_pattern_set_extend (VALUE self, VALUE extend)
{
  cairo_pattern_set_extend (_SELF (self), RVAL2CREXTEND (extend));
  cr_pattern_check_status (_SELF (self));
  return self;
}

#set_filterObject



402
403
404
405
406
407
408
# File 'ext/cairo/rb_cairo_pattern.c', line 402

static VALUE
cr_pattern_set_filter (VALUE self, VALUE filter)
{
  cairo_pattern_set_filter (_SELF (self), RVAL2CRFILTER (filter));
  cr_pattern_check_status (_SELF (self));
  return self;
}

#set_matrixObject

Cairo::Pattern



371
372
373
374
375
376
377
# File 'ext/cairo/rb_cairo_pattern.c', line 371

static VALUE
cr_pattern_set_matrix (VALUE self, VALUE matrix)
{
  cairo_pattern_set_matrix (_SELF (self), RVAL2CRMATRIX (matrix));
  cr_pattern_check_status (_SELF (self));
  return self;
}