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



179
180
181
182
183
184
185
186
187
# File 'ext/cairo/rb_cairo_pattern.c', line 179

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__



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

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

#filterObject



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

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

#matrixObject



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

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



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

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



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

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



363
364
365
366
367
368
369
# File 'ext/cairo/rb_cairo_pattern.c', line 363

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;
}