0
shoes_canvas_get_scroll_top(VALUE self)
0
GET_STRUCT(canvas, canvas);
0
- return INT2NUM(canvas->slot
.scrolly);
0
+ return INT2NUM(canvas->slot
->scrolly);
0
@@ -126,7 +126,7 @@ shoes_canvas_get_gutter_width(VALUE self)
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
@@ -302,6 +302,8 @@ shoes_canvas_reset_transform(shoes_canvas *canvas)
0
shoes_canvas_free(shoes_canvas *canvas)
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
@@ -370,7 +372,7 @@ shoes_canvas_clear(VALUE self)
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
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
- canvas->slot
.scrolly += dy;
0
+ canvas->slot
->scrolly += dy;
0
- canvas->slot
.scrolly = dy;
0
+ canvas->slot
->scrolly = dy;
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
@@ -1055,7 +1057,7 @@ shoes_canvas_remove_item(VALUE self, VALUE item, char c, char 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
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
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->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
@@ -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
typedef VALUE (*ccallfunc)(VALUE);
0
@@ -1694,10 +1695,10 @@ shoes_canvas_send_click2(VALUE self, int button, int x, int y, VALUE *clicked)
0
if (ORIGIN(self_t->place))
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
@@ -1790,10 +1791,10 @@ shoes_canvas_send_release(VALUE self, int button, int x, int y)
0
if (ORIGIN(self_t->place))
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
@@ -1847,10 +1848,10 @@ shoes_canvas_send_motion(VALUE self, int x, int y, VALUE url)
0
if (ORIGIN(self_t->place))
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
@@ -1953,6 +1954,15 @@ shoes_canvas_send_keypress(VALUE self, VALUE key)
0
+shoes_slot_alloc(shoes_canvas *canvas, SHOES_SLOT_OS *parent, int toplevel)
0
+ canvas->slot = SHOE_ALLOC(SHOES_SLOT_OS);
0
+ SHOE_MEMZERO(canvas->slot, SHOES_SLOT_OS, 1);
0
+ canvas->slot->owner = canvas;
0
shoes_slot_new(VALUE klass, VALUE attr, VALUE parent)
0
@@ -1971,12 +1981,7 @@ shoes_slot_new(VALUE klass, VALUE attr, VALUE parent)
0
// create the slot off-screen until it can be properly placed
0
- shoes_slot_init(self, &pc->slot, -99, -99, 100, 100, scrolls, FALSE);
0
- gtk_widget_show_all(self_t->slot.canvas);
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;