public
Description: a tiny graphical app kit for ruby
Homepage: http://code.whytheluckystiff.net/shoes
Clone URL: git://github.com/why/shoes.git
 * shoes/canvas.c: give link cursors their own ID, to distinguish between the 
 hand cursor for links that of other elements.  should allow self.cursor= to 
 work right.
why (author)
Fri Jul 11 09:33:39 -0700 2008
commit  f62ea2dc58d0c3b082a30d7072baa1cdceff127c
tree    5efbcd489dfe4c0e18d4097d5f70cf38e7762294
parent  4437cd4fd5e9fd2d7d1282575a7e1683a6b650e9
...
1972
1973
1974
1975
 
 
1976
1977
1978
...
1972
1973
1974
 
1975
1976
1977
1978
1979
0
@@ -1972,7 +1972,8 @@ shoes_canvas_send_motion(VALUE self, int x, int y, VALUE url)
0
     {
0
       shoes_canvas *self_t;
0
       Data_Get_Struct(self, shoes_canvas, self_t);
0
-      shoes_app_cursor(self_t->app, s_arrow);
0
+      if (self_t->app->cursor == s_link)
0
+        shoes_app_cursor(self_t->app, s_arrow);
0
     }
0
   }
0
 
...
564
565
566
567
 
568
569
570
...
564
565
566
 
567
568
569
570
0
@@ -564,7 +564,7 @@ shoes_app_cursor(shoes_app *app, ID cursor)
0
   if (app->os.window == NULL || app->cursor == cursor)
0
     goto done;
0
 
0
-  if (cursor == s_hand)
0
+  if (cursor == s_hand || cursor == s_link)
0
     [[NSCursor pointingHandCursor] set];
0
   else if (cursor == s_arrow)
0
     [[NSCursor arrowCursor] set];
...
379
380
381
382
 
383
384
385
...
379
380
381
 
382
383
384
385
0
@@ -379,7 +379,7 @@ shoes_app_cursor(shoes_app *app, ID cursor)
0
     goto done;
0
 
0
   GdkCursor *c;
0
-  if (cursor == s_hand)
0
+  if (cursor == s_hand || cursor == s_link)
0
   {
0
     c = gdk_cursor_new(GDK_HAND2);
0
   }
...
622
623
624
625
 
626
627
628
...
622
623
624
 
625
626
627
628
0
@@ -622,7 +622,7 @@ shoes_code
0
 shoes_app_cursor(shoes_app *app, ID cursor)
0
 {
0
   HCURSOR c;
0
-  if (cursor == s_hand)
0
+  if (cursor == s_hand || cursor == s_link)
0
   {
0
     c = LoadCursor(NULL, IDC_HAND);
0
   }
...
15
16
17
18
 
19
20
21
...
633
634
635
636
 
637
638
639
...
1119
1120
1121
1122
 
1123
1124
1125
...
2238
2239
2240
2241
 
2242
2243
2244
...
3743
3744
3745
 
3746
3747
3748
...
15
16
17
 
18
19
20
21
...
633
634
635
 
636
637
638
639
...
1119
1120
1121
 
1122
1123
1124
1125
...
2238
2239
2240
 
2241
2242
2243
2244
...
3743
3744
3745
3746
3747
3748
3749
0
@@ -15,7 +15,7 @@ VALUE cShoes, cApp, cDialog, cShoesWindow, cMouse, cCanvas, cFlow, cStack, cMask
0
 VALUE eVlcError, eImageError, eNotImpl;
0
 VALUE reHEX_SOURCE, reHEX3_SOURCE, reRGB_SOURCE, reRGBA_SOURCE, reGRAY_SOURCE, reGRAYA_SOURCE, reLF;
0
 VALUE symAltQuest, symAltSlash, symAltDot;
0
-ID s_aref, s_mult, s_perc, s_bind, s_gsub, 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_checked, s_checked_q, s_choose, s_click, s_corner, s_curve, s_distance, s_displace_left, s_displace_top, s_downcase, s_draw, s_end, s_fill, s_finish, s_font, s_group, s_hand, s_hidden, s_hover, s_href, s_inner, s_insert, s_items, s_keypress, s_motion, s_release, s_wheel, s_scroll, s_start, s_attach, s_leading, s_leave, s_match, s_text, s_title, s_top, s_right, s_bottom, s_left, s_up, s_down, 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_gsub, 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_checked, s_checked_q, s_choose, s_click, s_corner, s_curve, s_distance, s_displace_left, s_displace_top, s_downcase, s_draw, s_end, s_fill, s_finish, s_font, s_group, s_hand, s_hidden, s_hover, s_href, s_inner, s_insert, s_items, s_keypress, s_link, s_motion, s_release, s_wheel, s_scroll, s_start, s_attach, s_leading, s_leave, s_match, s_text, s_title, s_top, s_right, s_bottom, s_left, s_up, s_down, 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
 
0
 //
0
 // Mauricio's instance_eval hack (he bested my cloaker back in 06 Jun 2006)
0
@@ -633,7 +633,7 @@ shoes_shape_motion(VALUE self, int x, int y, char *touch)
0
       {
0
         shoes_canvas *canvas;
0
         Data_Get_Struct(self_t->parent, shoes_canvas, canvas);
0
-        shoes_app_cursor(canvas->app, s_hand);
0
+        shoes_app_cursor(canvas->app, s_link);
0
       }
0
       h = 1;
0
     }
0
@@ -1119,7 +1119,7 @@ shoes_image_motion(VALUE self, int x, int y, char *touch)
0
     {
0
       shoes_canvas *canvas;
0
       Data_Get_Struct(self_t->parent, shoes_canvas, canvas);
0
-      shoes_app_cursor(canvas->app, s_hand);
0
+      shoes_app_cursor(canvas->app, s_link);
0
     }
0
     h = 1;
0
   }
0
@@ -2238,7 +2238,7 @@ shoes_textblock_motion(VALUE self, int x, int y, char *t)
0
     shoes_canvas *canvas;
0
     GET_STRUCT(textblock, self_t);
0
     Data_Get_Struct(self_t->parent, shoes_canvas, canvas);
0
-    shoes_app_cursor(canvas->app, s_hand);
0
+    shoes_app_cursor(canvas->app, s_link);
0
   }
0
   return url;
0
 }
0
@@ -3743,6 +3743,7 @@ shoes_ruby_init()
0
   s_keypress = rb_intern("keypress");
0
   s_match = rb_intern("match");
0
   s_motion = rb_intern("motion");
0
+  s_link = rb_intern("link");
0
   s_leading = rb_intern("leading");
0
   s_leave = rb_intern("leave");
0
   s_release = rb_intern("release");
...
72
73
74
75
 
76
77
78
...
72
73
74
 
75
76
77
78
0
@@ -72,7 +72,7 @@ extern VALUE aMsgList;
0
 extern VALUE eNotImpl, eImageError;
0
 extern VALUE reHEX_SOURCE, reHEX3_SOURCE, reRGB_SOURCE, reRGBA_SOURCE, reGRAY_SOURCE, reGRAYA_SOURCE, reLF;
0
 extern VALUE symAltQuest, symAltSlash, symAltDot;
0
-extern ID s_aref, s_mult, s_perc, s_bind, s_gsub, 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_curve, s_distance, s_displace_left, s_displace_top, s_downcase, s_draw, s_end, s_fill, s_finish, s_font, s_group, s_hand, s_hidden, s_hover, s_href, s_inner, s_insert, s_items, s_keypress, s_motion, s_release, s_wheel, s_scroll, s_start, s_attach, s_leading, s_leave, s_match, s_text, s_title, s_top, s_right, s_bottom, s_left, s_up, s_down, 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
+extern ID s_aref, s_mult, s_perc, s_bind, s_gsub, 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_curve, s_distance, s_displace_left, s_displace_top, s_downcase, s_draw, s_end, s_fill, s_finish, s_font, s_group, s_hand, s_hidden, s_hover, s_href, s_inner, s_insert, s_items, s_keypress, s_link, s_motion, s_release, s_wheel, s_scroll, s_start, s_attach, s_leading, s_leave, s_match, s_text, s_title, s_top, s_right, s_bottom, s_left, s_up, s_down, 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
 extern VALUE instance_eval_proc;
0
 
0
 VALUE mfp_instance_eval(VALUE, VALUE);

Comments