GitHub Sale: sign up for any paid plan this week and pay nothing until January 1, 2009!  [ hide ]

public
Description: a tiny graphical app kit for ruby
Homepage: http://code.whytheluckystiff.net/shoes
Clone URL: git://github.com/why/shoes.git
 * shoes/: switching all slots to use one pointer to a SHOES_SLOT_OS 
 struct for every actual OS window layer.  this is going to help a bit 
 with the repaint queue.
 * bugs/: closing a few solved issues.
why (author)
Tue Sep 16 22:36:08 -0700 2008
commit  00ea2ba58e70ed9750d200a525464e50a5dec7fc
tree    60025f052af31a6c32e729b33af6d6de0f52b1d2
parent  ab8a5297fc7533fe2815a8c3d239bb2f0a505874
...
7
8
9
10
11
 
 
12
13
14
...
18
19
20
 
 
 
 
...
7
8
9
 
 
10
11
12
13
14
...
18
19
20
21
22
23
24
0
@@ -7,8 +7,8 @@ type: :feature
0
 component: shoes
0
 release: Raisins
0
 reporter: _why <why@whytheluckystiff.net>
0
-status: :unstarted
0
-disposition:
0
+status: :closed
0
+disposition: :fixed
0
 creation_time: 2008-07-01 21:00:07.017988 Z
0
 references: []
0
 
0
@@ -18,3 +18,7 @@ log_events:
0
   - _why <why@whytheluckystiff.net>
0
   - created
0
   - ""
0
+- - 2008-09-16 18:43:23.591040 Z
0
+ - _why <why@whytheluckystiff.net>
0
+ - closed issue with disposition fixed
0
+ - added on july 1st, in commit c33a26dc
...
7
8
9
10
11
 
 
12
13
14
...
18
19
20
 
 
 
 
...
7
8
9
 
 
10
11
12
13
14
...
18
19
20
21
22
23
24
0
@@ -7,8 +7,8 @@ type: :bugfix
0
 component: shoes
0
 release: Raisins
0
 reporter: _why <why@whytheluckystiff.net>
0
-status: :unstarted
0
-disposition:
0
+status: :closed
0
+disposition: :fixed
0
 creation_time: 2008-07-11 13:08:40.957025 Z
0
 references: []
0
 
0
@@ -18,3 +18,7 @@ log_events:
0
   - _why <why@whytheluckystiff.net>
0
   - created
0
   - ""
0
+- - 2008-09-16 18:41:09.297777 Z
0
+ - _why <why@whytheluckystiff.net>
0
+ - closed issue with disposition fixed
0
+ - commit cb48846 on sep 8th, found a casting error in my use of deltaY.
...
14
15
16
17
 
18
19
20
...
29
30
31
 
32
33
34
...
38
39
40
 
 
 
41
42
43
...
207
208
209
210
211
 
 
212
213
214
...
299
300
301
302
 
303
304
305
...
372
373
374
375
 
376
377
378
...
418
419
420
421
 
422
423
424
...
14
15
16
 
17
18
19
20
...
29
30
31
32
33
34
35
...
39
40
41
42
43
44
45
46
47
...
211
212
213
 
 
214
215
216
217
218
...
303
304
305
 
306
307
308
309
...
376
377
378
 
379
380
381
382
...
422
423
424
 
425
426
427
428
0
@@ -14,7 +14,7 @@
0
 static void
0
 shoes_app_mark(shoes_app *app)
0
 {
0
- shoes_native_slot_mark(&app->slot);
0
+ shoes_native_slot_mark(app->slot);
0
   rb_gc_mark_maybe(app->title);
0
   rb_gc_mark_maybe(app->location);
0
   rb_gc_mark_maybe(app->canvas);
0
@@ -29,6 +29,7 @@ shoes_app_mark(shoes_app *app)
0
 static void
0
 shoes_app_free(shoes_app *app)
0
 {
0
+ SHOE_FREE(app->slot);
0
   cairo_destroy(app->scratch);
0
   RUBY_CRITICAL(free(app));
0
 }
0
@@ -38,6 +39,9 @@ shoes_app_alloc(VALUE klass)
0
 {
0
   shoes_app *app = SHOE_ALLOC(shoes_app);
0
   SHOE_MEMZERO(app, shoes_app, 1);
0
+ app->slot = SHOE_ALLOC(SHOES_SLOT_OS);
0
+ SHOE_MEMZERO(app->slot, SHOES_SLOT_OS, 1);
0
+ app->slot->owner = app;
0
   app->started = FALSE;
0
   app->owner = Qnil;
0
   app->location = Qnil;
0
@@ -207,8 +211,8 @@ shoes_app_open(shoes_app *app, char *path)
0
     return code;
0
 
0
   shoes_app_title(app, app->title);
0
- shoes_native_slot_reset(&app->slot);
0
- shoes_slot_init(app->canvas, &app->slot, 0, 0, app->width, app->height, TRUE, TRUE);
0
+ if (app->slot != NULL) shoes_native_slot_reset(app->slot);
0
+ shoes_slot_init(app->canvas, app->slot, 0, 0, app->width, app->height, TRUE, TRUE);
0
   code = shoes_app_goto(app, path);
0
   if (code != SHOES_OK)
0
     return code;
0
@@ -299,7 +303,7 @@ shoes_app_visit(shoes_app *app, char *path)
0
   VALUE ary = rb_ary_dup(app->extras);
0
   Data_Get_Struct(app->canvas, shoes_canvas, canvas);
0
 
0
- canvas->slot.scrolly = 0;
0
+ canvas->slot->scrolly = 0;
0
   shoes_native_slot_clear(canvas);
0
   for (i = 0; i < RARRAY_LEN(ary); i++)
0
   {
0
@@ -372,7 +376,7 @@ shoes_app_wheel(shoes_app *app, ID dir, int x, int y)
0
 {
0
   shoes_canvas *canvas;
0
   Data_Get_Struct(app->canvas, shoes_canvas, canvas);
0
- if (canvas->slot.vscroll)
0
+ if (canvas->slot->vscroll)
0
   {
0
     if (dir == s_up)
0
       shoes_slot_scroll_to(canvas, -16, 1);
0
@@ -418,7 +422,7 @@ shoes_app_goto(shoes_app *app, char *path)
0
     if (code == SHOES_OK)
0
     {
0
       shoes_app_motion(app, app->mousex, app->mousey);
0
- shoes_slot_repaint(&app->slot);
0
+ shoes_slot_repaint(app->slot);
0
     }
0
   }
0
   return code;
...
30
31
32
33
 
34
35
36
...
30
31
32
 
33
34
35
36
0
@@ -30,7 +30,7 @@
0
 //
0
 typedef struct _shoes_app {
0
   SHOES_APP_OS os;
0
- SHOES_SLOT_OS slot;
0
+ SHOES_SLOT_OS *slot;
0
   cairo_t *scratch;
0
   int width, height, mouseb, mousex, mousey,
0
     resizable, hidden, started;
...
96
97
98
99
 
100
101
102
...
126
127
128
129
 
130
131
132
...
302
303
304
 
 
305
306
307
...
370
371
372
373
 
374
375
376
...
384
385
386
387
 
388
389
 
390
391
392
393
394
395
396
397
 
 
 
 
 
 
 
398
399
400
...
1055
1056
1057
1058
 
1059
1060
1061
...
1096
1097
1098
1099
1100
1101
1102
...
1286
1287
1288
1289
 
1290
1291
 
1292
1293
1294
...
1579
1580
1581
1582
 
1583
1584
1585
...
1694
1695
1696
1697
 
1698
1699
1700
 
1701
1702
1703
...
1790
1791
1792
1793
 
1794
1795
1796
 
1797
1798
1799
...
1847
1848
1849
1850
 
1851
1852
1853
 
1854
1855
1856
...
1953
1954
1955
 
 
 
 
 
 
 
 
 
1956
1957
1958
...
1971
1972
1973
1974
1975
1976
1977
1978
1979
 
1980
1981
1982
...
96
97
98
 
99
100
101
102
...
126
127
128
 
129
130
131
132
...
302
303
304
305
306
307
308
309
...
372
373
374
 
375
376
377
378
...
386
387
388
 
389
390
 
391
392
 
 
 
 
 
 
 
393
394
395
396
397
398
399
400
401
402
...
1057
1058
1059
 
1060
1061
1062
1063
...
1098
1099
1100
 
1101
1102
1103
...
1287
1288
1289
 
1290
1291
 
1292
1293
1294
1295
...
1580
1581
1582
 
1583
1584
1585
1586
...
1695
1696
1697
 
1698
1699
1700
 
1701
1702
1703
1704
...
1791
1792
1793
 
1794
1795
1796
 
1797
1798
1799
1800
...
1848
1849
1850
 
1851
1852
1853
 
1854
1855
1856
1857
...
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
...
1981
1982
1983
 
 
 
 
 
 
1984
1985
1986
1987
0
@@ -96,7 +96,7 @@ VALUE
0
 shoes_canvas_get_scroll_top(VALUE self)
0
 {
0
   GET_STRUCT(canvas, canvas);
0
- return INT2NUM(canvas->slot.scrolly);
0
+ return INT2NUM(canvas->slot->scrolly);
0
 }
0
 
0
 VALUE
0
@@ -126,7 +126,7 @@ shoes_canvas_get_gutter_width(VALUE self)
0
 {
0
   int scrollwidth = 0;
0
   GET_STRUCT(canvas, canvas);
0
- scrollwidth = shoes_native_slot_gutter(&canvas->slot);
0
+ scrollwidth = shoes_native_slot_gutter(canvas->slot);
0
   return INT2NUM(scrollwidth);
0
 }
0
 
0
@@ -302,6 +302,8 @@ shoes_canvas_reset_transform(shoes_canvas *canvas)
0
 static void
0
 shoes_canvas_free(shoes_canvas *canvas)
0
 {
0
+ if (canvas->slot != NULL && canvas->slot->owner == canvas)
0
+ SHOE_FREE(canvas->slot);
0
   shoes_canvas_reset_transform(canvas);
0
   RUBY_CRITICAL(free(canvas));
0
 }
0
@@ -370,7 +372,7 @@ shoes_canvas_clear(VALUE self)
0
 }
0
 
0
 shoes_canvas *
0
-shoes_canvas_init(VALUE self, SHOES_SLOT_OS slot, VALUE attr, int width, int height)
0
+shoes_canvas_init(VALUE self, SHOES_SLOT_OS *slot, VALUE attr, int width, int height)
0
 {
0
   shoes_canvas *canvas;
0
   Data_Get_Struct(self, shoes_canvas, canvas);
0
@@ -384,17 +386,17 @@ void
0
 shoes_slot_scroll_to(shoes_canvas *canvas, int dy, int rel)
0
 {
0
   if (rel)
0
- canvas->slot.scrolly += dy;
0
+ canvas->slot->scrolly += dy;
0
   else
0
- canvas->slot.scrolly = dy;
0
+ canvas->slot->scrolly = dy;
0
 
0
- if (canvas->slot.scrolly > canvas->endy - canvas->height)
0
- canvas->slot.scrolly = canvas->endy - canvas->height;
0
- if (canvas->slot.scrolly < 0)
0
- canvas->slot.scrolly = 0;
0
- if (DC(canvas->app->slot) == DC(canvas->slot)) canvas->app->slot.scrolly = canvas->slot.scrolly;
0
- shoes_native_slot_scroll_top(&canvas->slot);
0
- shoes_slot_repaint(&canvas->slot);
0
+ if (canvas->slot->scrolly > canvas->endy - canvas->height)
0
+ canvas->slot->scrolly = canvas->endy - canvas->height;
0
+ if (canvas->slot->scrolly < 0)
0
+ canvas->slot->scrolly = 0;
0
+ if (DC(canvas->app->slot) == DC(canvas->slot)) canvas->app->slot->scrolly = canvas->slot->scrolly;
0
+ shoes_native_slot_scroll_top(canvas->slot);
0
+ shoes_slot_repaint(canvas->slot);
0
 }
0
 
0
 VALUE
0
@@ -1055,7 +1057,7 @@ shoes_canvas_remove_item(VALUE self, VALUE item, char c, char t)
0
   long i;
0
   shoes_canvas *self_t;
0
   Data_Get_Struct(self, shoes_canvas, self_t);
0
- shoes_native_remove_item(&self_t->slot, item, c);
0
+ shoes_native_remove_item(self_t->slot, item, c);
0
   if (t)
0
   {
0
     i = rb_ary_index_of(self_t->app->extras, item);
0
@@ -1096,7 +1098,6 @@ shoes_canvas_reflow(shoes_canvas *self_t, VALUE c)
0
   Data_Get_Struct(c, shoes_canvas, parent);
0
 
0
   self_t->cr = parent->cr;
0
- self_t->slot = parent->slot;
0
   shoes_place_decide(&self_t->place, c, self_t->attr, parent->place.iw, 0, REL_CANVAS, FALSE);
0
   self_t->width = self_t->place.w;
0
   self_t->height = self_t->place.h;
0
@@ -1286,9 +1287,9 @@ shoes_canvas_draw(VALUE self, VALUE c, VALUE actual)
0
     self_t->fully = endy;
0
     if (RTEST(actual))
0
     {
0
- self_t->slot.scrolly = min(self_t->slot.scrolly, self_t->fully - self_t->height);
0
+ self_t->slot->scrolly = min(self_t->slot->scrolly, self_t->fully - self_t->height);
0
       if (NIL_P(self_t->parent) || RTEST(ATTR(self_t->attr, scroll)))
0
- shoes_native_slot_lengthen(&self_t->slot, self_t->height, endy);
0
+ shoes_native_slot_lengthen(self_t->slot, self_t->height, endy);
0
     }
0
   }
0
   else
0
@@ -1579,7 +1580,7 @@ shoes_canvas_repaint_all(VALUE self)
0
   Data_Get_Struct(self, shoes_canvas, canvas);
0
   if (canvas->stage == CANVAS_EMPTY) return;
0
   shoes_canvas_compute(self);
0
- shoes_slot_repaint(&canvas->app->slot);
0
+ shoes_slot_repaint(canvas->app->slot);
0
 }
0
 
0
 typedef VALUE (*ccallfunc)(VALUE);
0
@@ -1694,10 +1695,10 @@ shoes_canvas_send_click2(VALUE self, int button, int x, int y, VALUE *clicked)
0
 
0
   if (ORIGIN(self_t->place))
0
   {
0
- y += self_t->slot.scrolly;
0
+ y += self_t->slot->scrolly;
0
     ox = x - self_t->place.ix + self_t->place.dx;
0
     oy = y - (self_t->place.iy + self_t->place.dy);
0
- if (oy < self_t->slot.scrolly || ox < 0 || oy > self_t->slot.scrolly + self_t->place.ih || ox > self_t->place.iw)
0
+ if (oy < self_t->slot->scrolly || ox < 0 || oy > self_t->slot->scrolly + self_t->place.ih || ox > self_t->place.iw)
0
       return Qnil;
0
   }
0
 
0
@@ -1790,10 +1791,10 @@ shoes_canvas_send_release(VALUE self, int button, int x, int y)
0
 
0
   if (ORIGIN(self_t->place))
0
   {
0
- y += self_t->slot.scrolly;
0
+ y += self_t->slot->scrolly;
0
     ox = x - self_t->place.ix + self_t->place.dx;
0
     oy = y - (self_t->place.iy + self_t->place.dy);
0
- if (oy < self_t->slot.scrolly || ox < 0 || oy > self_t->slot.scrolly + self_t->place.ih || ox > self_t->place.iw)
0
+ if (oy < self_t->slot->scrolly || ox < 0 || oy > self_t->slot->scrolly + self_t->place.ih || ox > self_t->place.iw)
0
       return;
0
   }
0
 
0
@@ -1847,10 +1848,10 @@ shoes_canvas_send_motion(VALUE self, int x, int y, VALUE url)
0
 
0
   if (ORIGIN(self_t->place))
0
   {
0
- y += self_t->slot.scrolly;
0
+ y += self_t->slot->scrolly;
0
     ox = x - self_t->place.ix + self_t->place.dx;
0
     oy = y - (self_t->place.iy + self_t->place.dy);
0
- if (oy < self_t->slot.scrolly || ox < 0 || oy > self_t->slot.scrolly + self_t->place.ih || ox > self_t->place.iw)
0
+ if (oy < self_t->slot->scrolly || ox < 0 || oy > self_t->slot->scrolly + self_t->place.ih || ox > self_t->place.iw)
0
       return Qnil;
0
   }
0
 
0
@@ -1953,6 +1954,15 @@ shoes_canvas_send_keypress(VALUE self, VALUE key)
0
   }
0
 }
0
 
0
+SHOES_SLOT_OS *
0
+shoes_slot_alloc(shoes_canvas *canvas, SHOES_SLOT_OS *parent, int toplevel)
0
+{
0
+ canvas->slot = SHOE_ALLOC(SHOES_SLOT_OS);
0
+ SHOE_MEMZERO(canvas->slot, SHOES_SLOT_OS, 1);
0
+ canvas->slot->owner = canvas;
0
+ return canvas->slot;
0
+}
0
+
0
 VALUE
0
 shoes_slot_new(VALUE klass, VALUE attr, VALUE parent)
0
 {
0
@@ -1971,12 +1981,7 @@ shoes_slot_new(VALUE klass, VALUE attr, VALUE parent)
0
     //
0
     // create the slot off-screen until it can be properly placed
0
     //
0
- shoes_slot_init(self, &pc->slot, -99, -99, 100, 100, scrolls, FALSE);
0
-#ifdef SHOES_GTK
0
- gtk_widget_show_all(self_t->slot.canvas);
0
- self_t->width = 100;
0
- self_t->height = 100;
0
-#endif
0
+ shoes_slot_init(self, pc->slot, -99, -99, 100, 100, scrolls, FALSE);
0
     self_t->place.x = self_t->place.y = 0;
0
     self_t->place.ix = self_t->place.iy = 0;
0
   }
...
208
209
210
211
 
212
213
214
...
294
295
296
297
 
298
299
300
...
326
327
328
329
 
330
331
332
...
456
457
458
 
459
460
461
...
208
209
210
 
211
212
213
214
...
294
295
296
 
297
298
299
300
...
326
327
328
 
329
330
331
332
...
456
457
458
459
460
461
462
0
@@ -208,7 +208,7 @@ typedef struct {
0
   libvlc_instance_t *vlc;
0
   int init;
0
   VALUE path;
0
- SHOES_SLOT_OS slot;
0
+ SHOES_SLOT_OS *slot;
0
 } shoes_video;
0
 #endif
0
 
0
@@ -294,7 +294,7 @@ typedef struct {
0
   int width, height; // the full height and width used by this box
0
   char hover;
0
   struct _shoes_app *app;
0
- SHOES_SLOT_OS slot;
0
+ SHOES_SLOT_OS *slot;
0
   SHOES_GROUP_OS group;
0
 } shoes_canvas;
0
 
0
@@ -326,7 +326,7 @@ void shoes_error(const char *fmt, ...);
0
 VALUE shoes_canvas_alloc(VALUE);
0
 VALUE shoes_canvas_new(VALUE, struct _shoes_app *);
0
 void shoes_canvas_clear(VALUE);
0
-shoes_canvas *shoes_canvas_init(VALUE, SHOES_SLOT_OS, VALUE, int, int);
0
+shoes_canvas *shoes_canvas_init(VALUE, SHOES_SLOT_OS *, VALUE, int, int);
0
 void shoes_slot_scroll_to(shoes_canvas *, int, int);
0
 void shoes_canvas_paint(VALUE);
0
 void shoes_apply_transformation(cairo_t *, shoes_transform *, shoes_place *, unsigned char, unsigned char);
0
@@ -456,6 +456,7 @@ VALUE shoes_canvas_dialog_plain(VALUE);
0
 VALUE shoes_canvas_snapshot(int, VALUE *, VALUE);
0
 VALUE shoes_canvas_download(int, VALUE *, VALUE);
0
 
0
+SHOES_SLOT_OS *shoes_slot_alloc(shoes_canvas *, SHOES_SLOT_OS *, int);
0
 VALUE shoes_slot_new(VALUE, VALUE, VALUE);
0
 VALUE shoes_flow_new(VALUE, VALUE);
0
 VALUE shoes_stack_new(VALUE, VALUE);
...
54
55
56
 
57
58
59
...
72
73
74
75
76
 
 
77
78
79
...
106
107
108
 
109
110
111
...
128
129
130
131
132
 
 
133
134
135
...
171
172
173
 
174
175
176
...
191
192
193
194
195
 
 
196
197
 
198
199
200
...
54
55
56
57
58
59
60
...
73
74
75
 
 
76
77
78
79
80
...
107
108
109
110
111
112
113
...
130
131
132
 
 
133
134
135
136
137
...
173
174
175
176
177
178
179
...
194
195
196
 
 
197
198
199
 
200
201
202
203
0
@@ -54,6 +54,7 @@ typedef struct {
0
   GtkWidget *vscroll, *canvas;
0
   GdkEventExpose *expose;
0
   int scrolly, scrollh, scrollw;
0
+ void *owner;
0
 } shoes_slot_gtk, SHOES_SLOT_OS;
0
 
0
 typedef struct {
0
@@ -72,8 +73,8 @@ typedef struct {
0
 #define SHOES_CONTROL_REF GtkWidget *
0
 #define SHOES_SURFACE_REF GtkWidget *
0
 #define SHOES_TIMER_REF guint
0
-#define DC(slot) slot.canvas
0
-#define HAS_DRAWABLE(slot) slot.canvas->window != 0
0
+#define DC(slot) slot->canvas
0
+#define HAS_DRAWABLE(slot) slot->canvas->window != 0
0
 #define DRAWABLE(ref) GDK_DRAWABLE_XID(ref->window)
0
 #define APP_WINDOW(app) (app == NULL ? NULL : GTK_WINDOW(app->os.window))
0
 #define SHOES_TIME struct timespec
0
@@ -106,6 +107,7 @@ typedef struct {
0
   cairo_surface_t *surface;
0
   VALUE controls;
0
   int scrolly;
0
+ void *owner;
0
 } shoes_slot_quartz, SHOES_SLOT_OS;
0
 
0
 typedef struct {
0
@@ -128,8 +130,8 @@ typedef struct {
0
 #define SHOES_CONTROL_REF NSControl *
0
 #define SHOES_SURFACE_REF CGrafPtr
0
 #define SHOES_TIMER_REF ShoesTimer *
0
-#define DC(slot) slot.view
0
-#define HAS_DRAWABLE(slot) slot.context != NULL
0
+#define DC(slot) slot->view
0
+#define HAS_DRAWABLE(slot) slot->context != NULL
0
 #define DRAWABLE(ref) ref
0
 #define SHOES_TIME struct timeval
0
 #define SHOES_DOWNLOAD_HEADERS NSDictionary *
0
@@ -171,6 +173,7 @@ typedef struct {
0
   cairo_surface_t *surface;
0
   int scrolly;
0
   char vscroll;
0
+ void *owner;
0
 } shoes_slot_win32, SHOES_SLOT_OS;
0
 
0
 typedef struct {
0
@@ -191,10 +194,10 @@ typedef struct {
0
 #define SHOES_CONTROL_REF HWND
0
 #define SHOES_SURFACE_REF HWND
0
 #define SHOES_TIMER_REF long
0
-#define DC(slot) slot.window
0
-#define HAS_DRAWABLE(slot) slot.window != NULL
0
+#define DC(slot) slot->window
0
+#define HAS_DRAWABLE(slot) slot->window != NULL
0
 #define DRAWABLE(ref) (libvlc_drawable_t)ref
0
-#define APP_WINDOW(app) (app == NULL ? NULL : app->slot.window)
0
+#define APP_WINDOW(app) (app == NULL ? NULL : app->slot->window)
0
 #define SHOES_TIME DWORD
0
 #define SHOES_DOWNLOAD_HEADERS char *
0
 #define SHOES_DOWNLOAD_ERROR DWORD
...
74
75
76
77
 
78
79
 
80
81
 
82
83
84
...
232
233
234
235
 
236
237
 
238
239
 
240
241
242
243
 
244
245
246
...
558
559
560
561
562
 
 
563
564
 
565
566
567
...
645
646
647
648
 
649
650
651
...
688
689
690
691
 
692
693
694
...
716
717
718
719
720
721
 
 
 
722
723
724
...
726
727
728
729
 
730
731
732
 
 
733
734
735
736
737
738
 
739
740
741
...
747
748
749
750
 
751
752
753
754
755
 
756
757
758
759
 
760
761
762
...
764
765
766
767
 
768
769
770
...
793
794
795
796
797
 
 
798
799
 
800
801
 
802
803
804
805
806
807
808
 
809
810
811
812
813
 
814
815
816
...
74
75
76
 
77
78
 
79
80
 
81
82
83
84
...
232
233
234
 
235
236
 
237
238
 
239
240
241
242
 
243
244
245
246
...
558
559
560
 
 
561
562
563
 
564
565
566
567
...
645
646
647
 
648
649
650
651
...
688
689
690
 
691
692
693
694
...
716
717
718
 
 
 
719
720
721
722
723
724
...
726
727
728
 
729
730
 
 
731
732
733
734
735
736
737
 
738
739
740
741
...
747
748
749
 
750
751
752
753
754
 
755
756
757
758
 
759
760
761
762
...
764
765
766
 
767
768
769
770
...
793
794
795
 
 
796
797
798
 
799
800
 
801
802
803
804
805
806
807
 
808
809
810
811
812
 
813
814
815
816
0
@@ -74,11 +74,11 @@
0
   Data_Get_Struct(app, shoes_app, a);
0
   Data_Get_Struct(a->canvas, shoes_canvas, canvas);
0
   if (type == s_motion)
0
- shoes_app_motion(a, p.x, (canvas->height - p.y) + canvas->slot.scrolly);
0
+ shoes_app_motion(a, p.x, (canvas->height - p.y) + canvas->slot->scrolly);
0
   else if (type == s_click)
0
- shoes_app_click(a, b, p.x, (canvas->height - p.y) + canvas->slot.scrolly);
0
+ shoes_app_click(a, b, p.x, (canvas->height - p.y) + canvas->slot->scrolly);
0
   else if (type == s_release)
0
- shoes_app_release(a, b, p.x, (canvas->height - p.y) + canvas->slot.scrolly);
0
+ shoes_app_release(a, b, p.x, (canvas->height - p.y) + canvas->slot->scrolly);
0
 }
0
 - (void)mouseDown: (NSEvent *)e
0
 {
0
@@ -232,15 +232,15 @@
0
 
0
   c->width = bounds.size.width;
0
   c->height = bounds.size.height;
0
- if (c->slot.vscroll)
0
+ if (c->slot->vscroll)
0
   {
0
- [c->slot.vscroll setFrame: NSMakeRect(c->width - [NSScroller scrollerWidth], 0,
0
+ [c->slot->vscroll setFrame: NSMakeRect(c->width - [NSScroller scrollerWidth], 0,
0
       [NSScroller scrollerWidth], c->height)];
0
- shoes_native_slot_lengthen(&c->slot, c->height, c->endy);
0
+ shoes_native_slot_lengthen(c->slot, c->height, c->endy);
0
   }
0
   c->place.iw = c->place.w = c->width;
0
   c->place.ih = c->place.h = c->height;
0
- c->slot.context = (CGContextRef)[[NSGraphicsContext currentContext] graphicsPort];
0
+ c->slot->context = (CGContextRef)[[NSGraphicsContext currentContext] graphicsPort];
0
   shoes_canvas_paint(canvas);
0
 }
0
 - (void)scroll: (NSScroller *)scroller
0
@@ -558,10 +558,10 @@ void shoes_native_slot_reset(SHOES_SLOT_OS *slot)
0
 
0
 void shoes_native_slot_clear(shoes_canvas *canvas)
0
 {
0
- rb_ary_clear(canvas->slot.controls);
0
- if (canvas->slot.vscroll)
0
+ rb_ary_clear(canvas->slot->controls);
0
+ if (canvas->slot->vscroll)
0
   {
0
- shoes_native_slot_lengthen(&canvas->slot, canvas->height, 1);
0
+ shoes_native_slot_lengthen(canvas->slot, canvas->height, 1);
0
   }
0
 }
0
 
0
@@ -645,7 +645,7 @@ shoes_native_app_open(shoes_app *app, char *path, int dialog)
0
   app->os.window = [[ShoesWindow alloc] initWithContentRect: NSMakeRect(0, 0, app->width, app->height)
0
     styleMask: mask backing: NSBackingStoreBuffered defer: NO];
0
   [app->os.window prepareWithApp: app->self];
0
- app->slot.view = [app->os.window contentView];
0
+ app->slot->view = [app->os.window contentView];
0
   RELEASE;
0
 
0
 quit:
0
@@ -688,7 +688,7 @@ shoes_slot_init(VALUE c, SHOES_SLOT_OS *parent, int x, int y, int width, int hei
0
   shoes_canvas *canvas;
0
   SHOES_SLOT_OS *slot;
0
   Data_Get_Struct(c, shoes_canvas, canvas);
0
- slot = &canvas->slot;
0
+ slot->canvas = gtk_fixed_new();
0
 
0
   slot->controls = parent->controls;
0
   slot->view = [[ShoesView alloc] initWithFrame: NSMakeRect(x, y, width, height) andCanvas: c];
0
@@ -716,9 +716,9 @@ void
0
 shoes_slot_destroy(shoes_canvas *canvas, shoes_canvas *pc)
0
 {
0
   INIT;
0
- if (canvas->slot.vscroll != NULL)
0
- [canvas->slot.vscroll removeFromSuperview];
0
- [canvas->slot.view removeFromSuperview];
0
+ if (canvas->slot->vscroll != NULL)
0
+ [canvas->slot->vscroll removeFromSuperview];
0
+ [canvas->slot->view removeFromSuperview];
0
   RELEASE;
0
 }
0
 
0
@@ -726,16 +726,16 @@ cairo_t *
0
 shoes_cairo_create(shoes_canvas *canvas)
0
 {
0
   cairo_t *cr;
0
- canvas->slot.surface = cairo_quartz_surface_create_for_cg_context(canvas->slot.context,
0
+ canvas->slot->surface = cairo_quartz_surface_create_for_cg_context(canvas->slot->context,
0
     canvas->width, canvas->height);
0
- cr = cairo_create(canvas->slot.surface);
0
- cairo_translate(cr, 0, 0 - canvas->slot.scrolly);
0
+ cr = cairo_create(canvas->slot->surface);
0
+ cairo_translate(cr, 0, 0 - canvas->slot->scrolly);
0
   return cr;
0
 }
0
 
0
 void shoes_cairo_destroy(shoes_canvas *canvas)
0
 {
0
- cairo_surface_destroy(canvas->slot.surface);
0
+ cairo_surface_destroy(canvas->slot->surface);
0
 }
0
 
0
 void
0
@@ -747,16 +747,16 @@ void
0
 shoes_native_canvas_place(shoes_canvas *self_t, shoes_canvas *pc)
0
 {
0
   NSRect rect, rect2;
0
- int newy = (self_t->place.iy + self_t->place.dy) - pc->slot.scrolly;
0
+ int newy = (self_t->place.iy + self_t->place.dy) - pc->slot->scrolly;
0
   rect.origin.x = (self_t->place.ix + self_t->place.dx) * 1.;
0
   rect.origin.y = ((newy) * 1.);
0
   rect.size.width = (self_t->place.iw * 1.);
0
   rect.size.height = (self_t->place.ih * 1.);
0
- rect2 = [self_t->slot.view frame];
0
+ rect2 = [self_t->slot->view frame];
0
   if (rect.origin.x != rect2.origin.x || rect.origin.y != rect2.origin.y ||
0
       rect.size.width != rect2.size.width || rect.size.height != rect2.size.height)
0
   {
0
- [self_t->slot.view setFrame: rect];
0
+ [self_t->slot->view setFrame: rect];
0
   }
0
 }
0
 
0
@@ -764,7 +764,7 @@ void
0
 shoes_native_canvas_resize(shoes_canvas *canvas)
0
 {
0
   NSSize size = {canvas->width, canvas->height};
0
- [canvas->slot.view setFrameSize: size];
0
+ [canvas->slot->view setFrameSize: size];
0
 }
0
 
0
 void
0
@@ -793,24 +793,24 @@ shoes_native_control_position(SHOES_CONTROL_REF ref, shoes_place *p1, VALUE self
0
   shoes_canvas *canvas, shoes_place *p2)
0
 {
0
   PLACE_COORDS();
0
- if (canvas->slot.vscroll)
0
- [canvas->slot.view addSubview: ref positioned: NSWindowBelow relativeTo: canvas->slot.vscroll];
0
+ if (canvas->slot->vscroll)
0
+ [canvas->slot->view addSubview: ref positioned: NSWindowBelow relativeTo: canvas->slot->vscroll];
0
   else
0
- [canvas->slot.view addSubview: ref];
0
+ [canvas->slot->view addSubview: ref];
0
   shoes_native_control_frame(ref, p2);
0
- rb_ary_push(canvas->slot.controls, self);
0
+ rb_ary_push(canvas->slot->controls, self);
0
 }
0
 
0
 void
0
 shoes_native_control_repaint(SHOES_CONTROL_REF ref, shoes_place *p1,
0
   shoes_canvas *canvas, shoes_place *p2)
0
 {
0
- p2->iy -= canvas->slot.scrolly;
0
+ p2->iy -= canvas->slot->scrolly;
0
   if (CHANGED_COORDS()) {
0
     PLACE_COORDS();
0
     shoes_native_control_frame(ref, p2);
0
   }
0
- p2->iy += canvas->slot.scrolly;
0
+ p2->iy += canvas->slot->scrolly;
0
 }
0
 
0
 void