0
#define IDC_HAND MAKEINTRESOURCE(32649)
0
+shoes_code shoes_classex_init();
0
+LRESULT CALLBACK shoes_app_win32proc(HWND, UINT, WPARAM, LPARAM);
0
+LRESULT CALLBACK shoes_slot_win32proc(HWND, UINT, WPARAM, LPARAM);
0
shoes_win32_cmdvector(const char *cmdline, char ***argv)
0
@@ -41,7 +45,7 @@ void shoes_native_quit()
0
-void shoes_
slot_mark(SHOES_SLOT_OS *slot)
0
+void shoes_
native_slot_mark(SHOES_SLOT_OS *slot)
0
rb_gc_mark_maybe(slot->controls);
0
rb_gc_mark_maybe(slot->focus);
0
@@ -87,11 +91,11 @@ int shoes_native_slot_gutter(SHOES_SLOT_OS *slot)
0
return GetSystemMetrics(SM_CXVSCROLL);
0
-void shoes_native_remove_item(SHOES_SLOT_OS *slot
)
0
+void shoes_native_remove_item(SHOES_SLOT_OS *slot
, VALUE item, char c)
0
-
i = rb_ary_index_of(slot->controls, item);
0
+
long i = rb_ary_index_of(slot->controls, item);
0
rb_ary_insert_at(slot->controls, i, 1, Qnil);
0
@@ -691,7 +695,7 @@ shoes_native_app_title(shoes_app *app, char *msg)
0
-shoes_native_app_open(shoes_app *app, char *path
)
0
+shoes_native_app_open(shoes_app *app, char *path
, int dialog)
0
shoes_code code = SHOES_OK;
0
@@ -738,7 +742,7 @@ quit:
0
-shoes_native_app_show(shoes_app *
)
0
+shoes_native_app_show(shoes_app *
app)
0
// TODO: disable parent windows of dialogs
0
// if (dialog && !NIL_P(app->owner))
0
@@ -834,28 +838,32 @@ shoes_slot_init(VALUE c, SHOES_SLOT_OS *parent, int x, int y, int width, int hei
0
-shoes_cairo_create(
SHOES_SLOT_OS *slot, shoes_canvas *parent, int width, int height, int toplevel)
0
+shoes_cairo_create(
shoes_canvas *canvas)
0
- if (slot->surface != NULL)
0
+ if (canvas->slot.surface != NULL)
0
+ if (!NIL_P(canvas->parent))
0
+ Data_Get_Struct(canvas->parent, shoes_canvas, parent);
0
HBITMAP bitmap, bitold;
0
- HDC hdc = BeginPaint(slot->window, &slot->ps);
0
+ canvas->slot.dc2 = BeginPaint(canvas->slot.window, &canvas->slot.ps);
0
+ if (canvas->slot.dc != NULL)
0
- DeleteObject(GetCurrentObject(slot->dc, OBJ_BITMAP));
0
+ DeleteObject(GetCurrentObject(canvas->slot.dc, OBJ_BITMAP));
0
+ DeleteDC(canvas->slot.dc);
0
- slot->dc = CreateCompatibleDC(hdc);
0
- bitmap = CreateCompatibleBitmap(hdc, width, height);
0
- bitold = (HBITMAP)SelectObject(slot->dc, bitmap);
0
+ canvas->slot.dc = CreateCompatibleDC(canvas->slot.dc2);
0
+ bitmap = CreateCompatibleBitmap(canvas->slot.dc2, canvas->width, canvas->height);
0
+ bitold = (HBITMAP)SelectObject(canvas->slot.dc, bitmap);
0
+ if (
DC(canvas->slot) == DC(canvas->app->slot))
0
HBRUSH bg = CreateSolidBrush(GetSysColor(COLOR_WINDOW));
0
- GetClientRect(slot->window, &rc);
0
- FillRect(slot->dc, &rc, bg);
0
+ GetClientRect(canvas->slot.window, &rc);
0
+ FillRect(canvas->slot.dc, &rc, bg);
0
@@ -863,25 +871,25 @@ shoes_cairo_create(SHOES_SLOT_OS *slot, shoes_canvas *parent, int width, int hei
0
if (parent != NULL && parent->slot.dc != NULL)
0
- GetClientRect(slot->window, &r);
0
- BitBlt(slot->dc, 0, 0, r.right - r.left, r.bottom - r.top,
0
+ GetClientRect(canvas->slot.window, &r);
0
+ BitBlt(canvas->slot.dc, 0, 0, r.right - r.left, r.bottom - r.top,
0
parent->slot.dc, canvas->place.ix, canvas->place.iy, SRCCOPY);
0
-
slot->surface = cairo_win32_surface_create(slot->dc);
0
+
canvas->slot.surface = cairo_win32_surface_create(canvas->slot.dc);
0
- cairo_t *cr = cairo_create(slot->surface);
0
- cairo_translate(cr, 0, -slot->scrolly);
0
+ cairo_t *cr = cairo_create(canvas->slot.surface);
0
+ cairo_translate(cr, 0, -canvas->slot.scrolly);
0
-void shoes_cairo_destroy(
SHOES_SLOT_OS *)
0
+void shoes_cairo_destroy(
shoes_canvas *canvas)
0
- BitBlt(hdc, 0, 0, width, height, slot->dc, 0, 0, SRCCOPY);
0
- cairo_surface_destroy(slot->surface);
0
- EndPaint(slot->window, &slot->ps);
0
+ BitBlt(canvas->slot.dc2, 0, 0, canvas->width, canvas->height, canvas->slot.dc, 0, 0, SRCCOPY);
0
+ cairo_surface_destroy(canvas->slot.surface);
0
+ canvas->slot.surface = NULL;
0
+ EndPaint(canvas->slot.window, &canvas->slot.ps);
0
@@ -936,7 +944,7 @@ shoes_native_control_repaint(SHOES_CONTROL_REF ref, shoes_place *p1,
0
p2->iy -= canvas->slot.scrolly;
0
- shoes_native_control_position(ref,
canvas, place);
0
+ shoes_native_control_position(ref,
p1, Qnil, canvas, p2);
0
p2->iy += canvas->slot.scrolly;
0
@@ -955,7 +963,6 @@ shoes_native_control_remove(SHOES_CONTROL_REF ref, shoes_canvas *canvas)
0
shoes_native_control_free(SHOES_CONTROL_REF ref)
0
inline void shoes_win32_control_font(int id, HWND hwnd)
0
@@ -987,7 +994,7 @@ shoes_native_surface_position(SHOES_CONTROL_REF ref, shoes_place *p1,
0
shoes_native_surface_remove(shoes_canvas *canvas, SHOES_CONTROL_REF ref)
0
- DestroyWindow(
self_t->ref);
0
@@ -1286,10 +1293,8 @@ shoes_ask_win32proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
Comments
No one has commented yet.