0
#include "shoes/version.h"
0
-VALUE cShoes, cApp, cDialog, cShoesWindow, cMouse, cCanvas, cFlow, cStack, cMask, cWidget, cShape, cImage, cImageBlock, cEffect, cBlur, cShadow, c
Video, cTimerBase, cTimer, cEvery, cAnim, cPattern, cBorder, cBackground, cTextBlock, cPara, cBanner, cTitle, cSubtitle, cTagline, cCaption, cInscription, cTextClass, cSpan, cDel, cStrong, cSub, cSup, cCode, cEm, cIns, cLinkUrl, cNative, cButton, cCheck, cRadio, cEditLine, cEditBox, cListBox, cProgress, cColor, cColors, cLink, cLinkHover, ssNestSlot;
0
+VALUE cShoes, cApp, cDialog, cShoesWindow, cMouse, cCanvas, cFlow, cStack, cMask, cWidget, cShape, cImage, cImageBlock, cEffect, cBlur, cShadow, c
Glow, cVideo, cTimerBase, cTimer, cEvery, cAnim, cPattern, cBorder, cBackground, cTextBlock, cPara, cBanner, cTitle, cSubtitle, cTagline, cCaption, cInscription, cTextClass, cSpan, cDel, cStrong, cSub, cSup, cCode, cEm, cIns, cLinkUrl, cNative, cButton, cCheck, cRadio, cEditLine, cEditBox, cListBox, cProgress, cColor, cColors, cLink, cLinkHover, ssNestSlot;
0
VALUE eVlcError, eImageError, eNotImpl;
0
VALUE reHEX_SOURCE, reHEX3_SOURCE, reRGB_SOURCE, reRGBA_SOURCE, reGRAY_SOURCE, reGRAYA_SOURCE;
0
VALUE symAltQuest, symAltSlash, symAltDot;
0
-ID s_aref, s_mult, s_perc, s_bind, s_keys, s_update, s_new, s_run, s_to_pattern, s_to_i, s_to_s, s_angle, s_arrow, s_autoplay, s_begin, s_call, s_center, s_change, s_choose, s_click, s_corner, s_distance, s_displace_left, s_displace_top, s_downcase, s_draw, s_end, s_f
ont, s_hand, s_hidden, s_hover, s_href, s_insert, s_items, s_release, s_scroll, s_attach, s_leading, s_leave, s_match, s_text, s_title, s_top, s_right, s_bottom, s_left, s_height, s_resizable, s_remove, s_strokewidth, s_width, s_margin, s_margin_left, s_margin_right, s_margin_top, s_margin_bottom, s_radius, s_secret, s_now, s_debug, s_error, s_warn, s_info;
0
+ID s_aref, s_mult, s_perc, s_bind, s_keys, s_update, s_new, s_run, s_to_pattern, s_to_i, s_to_s, s_angle, s_arrow, s_autoplay, s_begin, s_call, s_center, s_change, s_choose, s_click, s_corner, s_distance, s_displace_left, s_displace_top, s_downcase, s_draw, s_end, s_f
ill, s_font, s_hand, s_hidden, s_hover, s_href, s_inner, s_insert, s_items, s_release, s_scroll, s_attach, s_leading, s_leave, s_match, s_text, s_title, s_top, s_right, s_bottom, s_left, s_height, s_resizable, s_remove, s_strokewidth, s_width, s_margin, s_margin_left, s_margin_right, s_margin_top, s_margin_bottom, s_radius, s_secret, s_now, s_debug, s_error, s_warn, s_info;
0
// Mauricio's instance_eval hack (he bested my cloaker back in 06 Jun 2006)
0
@@ -1076,7 +1076,7 @@ shoes_gaussian_blur_filter(cairo_t *cr, void *data)
0
shoes_effect *fx = (shoes_effect *)data;
0
- float blur_d = ATTR2(dbl, fx->attr, radius,
1.);
0
+ float blur_d = ATTR2(dbl, fx->attr, radius,
2.);
0
float blur_x = ATTR2(dbl, fx->attr, width, blur_d);
0
float blur_y = ATTR2(dbl, fx->attr, height, blur_d);
0
@@ -1137,25 +1137,35 @@ shoes_gaussian_blur_filter(cairo_t *cr, void *data)
0
-shoes_shadow_filter(cairo_t *cr, void *data)
0
+shoes_layer_blur_filter(cairo_t *cr, void *data, cairo_operator_t blur_op,
0
+ cairo_operator_t merge_op, int distance)
0
shoes_effect *fx = (shoes_effect *)data;
0
cairo_surface_t *source = cairo_get_target(cr);
0
int width = cairo_image_surface_get_width(source);
0
int height = cairo_image_surface_get_height(source);
0
- int distance = ATTR2(int, fx->attr, distance, 4);
0
+ VALUE fill = ATTR(fx->attr, fill);
0
+ Data_Get_Struct(fx->parent, shoes_canvas, canvas);
0
cairo_surface_t *target = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, width, height);
0
cairo_t *cr2 = cairo_create(target);
0
cairo_set_source_surface(cr2, source, distance, distance);
0
- cairo_set_operator(cr2, CAIRO_OPERATOR_IN);
0
- cairo_set_source_rgb(cr2, 0., 0., 0.);
0
+ cairo_set_operator(cr2, blur_op);
0
+ if (NIL_P(canvas->bg))
0
+ cairo_set_source_rgb(cr2, 0., 0., 0.);
0
+ shoes_pattern *pattern;
0
+ Data_Get_Struct(canvas->bg, shoes_pattern, pattern);
0
+ cairo_set_source(cr2, pattern->pattern);
0
cairo_rectangle(cr2, 0, 0, width, height);
0
cairo_t *cr3 = shoes_gaussian_blur_filter(cr2, data);
0
- cairo_set_operator(cr3,
CAIRO_OPERATOR_OVER);
0
+ cairo_set_operator(cr3,
merge_op);
0
cairo_set_source_surface(cr3, source, 0, 0);
0
@@ -1163,6 +1173,28 @@ shoes_shadow_filter(cairo_t *cr, void *data)
0
+shoes_shadow_filter(cairo_t *cr, void *data)
0
+ shoes_effect *fx = (shoes_effect *)data;
0
+ int distance = ATTR2(int, fx->attr, distance, 4);
0
+ return shoes_layer_blur_filter(cr, data, CAIRO_OPERATOR_IN, CAIRO_OPERATOR_OVER, distance);
0
+shoes_glow_filter(cairo_t *cr, void *data)
0
+ shoes_effect *fx = (shoes_effect *)data;
0
+ cairo_operator_t blur_op = CAIRO_OPERATOR_IN;
0
+ cairo_operator_t merge_op = CAIRO_OPERATOR_OVER;
0
+ if (RTEST(ATTR(fx->attr, inner)))
0
+ blur_op = CAIRO_OPERATOR_OUT;
0
+ merge_op = CAIRO_OPERATOR_DEST_ATOP;
0
+ return shoes_layer_blur_filter(cr, data, blur_op, merge_op, 0);
0
shoes_image_motion(VALUE self, int x, int y, int *touch)
0
@@ -1251,6 +1283,8 @@ shoes_effect_new(VALUE klass, VALUE attr, VALUE parent)
0
fx->filter = &shoes_gaussian_blur_filter;
0
else if (klass == cShadow)
0
fx->filter = &shoes_shadow_filter;
0
+ else if (klass == cGlow)
0
+ fx->filter = &shoes_glow_filter;
0
@@ -4238,12 +4272,14 @@ shoes_ruby_init()
0
s_downcase = rb_intern("downcase");
0
s_draw = rb_intern("draw");
0
s_end = rb_intern("end");
0
+ s_fill = rb_intern("fill");
0
s_font = rb_intern("font");
0
s_hand = rb_intern("hand");
0
s_hidden = rb_intern("hidden");
0
s_hover = rb_intern("hover");
0
s_href = rb_intern("href");
0
s_insert = rb_intern("insert");
0
+ s_inner = rb_intern("inner");
0
s_items = rb_intern("items");
0
s_match = rb_intern("match");
0
s_leading = rb_intern("leading");
0
@@ -4401,6 +4437,7 @@ shoes_ruby_init()
0
rb_define_method(cEffect, "remove", CASTHOOK(shoes_effect_remove), 0);
0
cBlur = rb_define_class_under(cShoes, "Blur", cEffect);
0
cShadow = rb_define_class_under(cShoes, "Shadow", cEffect);
0
+ cGlow = rb_define_class_under(cShoes, "Glow", cEffect);
0
cVideo = rb_define_class_under(cShoes, "Video", rb_cObject);
Comments
No one has commented yet.