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/native/windows.c: got the windows mess sorted out.  still have 
 some inconsistent dll linkage, but it works at least.
why (author)
Tue Jun 10 09:02:40 -0700 2008
commit  614b6b42addca3f8388a9bd18e4b2ffec5dce0f8
tree    51e94bdeb1291cc6906821d565e2275df5bbabd9
parent  cee4884204a24ead117c88ae58a443da722274ca
...
165
166
167
168
 
169
170
171
...
454
455
456
457
 
458
459
460
...
165
166
167
 
168
169
170
171
...
454
455
456
 
457
458
459
460
0
@@ -165,7 +165,7 @@ shoes_app_open(shoes_app *app, char *path)
0
   shoes_code code = SHOES_OK;
0
   int dialog = (rb_obj_class(app->self) == cDialog);
0
 
0
- code = shoes_native_app_open(app, path);
0
+ code = shoes_native_app_open(app, path, dialog);
0
   if (code != SHOES_OK)
0
     return code;
0
 
0
@@ -454,7 +454,7 @@ shoes_app_is_started(VALUE self)
0
 {
0
   shoes_app *app;
0
   Data_Get_Struct(self, shoes_app, app);
0
- return app->started == TRUE ? Qtrue : Qfalse;
0
+ return app->started ? Qtrue : Qfalse;
0
 }
0
 
0
 VALUE
...
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
 
141
142
143
...
149
150
151
152
 
 
 
153
154
155
156
157
158
 
159
160
161
...
1052
1053
1054
1055
 
1056
1057
1058
...
125
126
127
 
128
 
129
130
131
132
133
134
 
 
 
 
135
136
137
138
...
144
145
146
 
147
148
149
150
151
152
153
154
 
155
156
157
158
...
1049
1050
1051
 
1052
1053
1054
1055
0
@@ -125,19 +125,14 @@ shoes_canvas_paint(VALUE self)
0
   int n = 0;
0
   shoes_canvas *pc = NULL;
0
   shoes_code code = SHOES_OK;
0
-#ifdef DEBUG
0
   clock_t start = clock();
0
-#endif
0
 
0
   if (self == Qnil)
0
     return;
0
 
0
   SETUP();
0
 
0
- if (!NIL_P(canvas->parent))
0
- Data_Get_Struct(canvas->parent, shoes_canvas, pc);
0
- canvas->cr = cr = shoes_cairo_create(&canvas->slot, pc, canvas->width, canvas->height,
0
- DC(canvas->slot) == DC(canvas->app->slot));
0
+ canvas->cr = cr = shoes_cairo_create(canvas);
0
   if (cr == NULL)
0
     return;
0
 
0
@@ -149,13 +144,15 @@ shoes_canvas_paint(VALUE self)
0
   cairo_restore(cr);
0
 
0
   if (cairo_status(cr)) {
0
- QUIT("Cairo is unhappy: %s\n", cairo_status_to_string (cairo_status (cr)));
0
+ code = SHOES_FAIL;
0
+ PUTS("Cairo is unhappy: %s\n", cairo_status_to_string (cairo_status (cr)));
0
+ goto quit;
0
   }
0
 
0
   cairo_destroy(cr);
0
   canvas->cr = NULL;
0
 
0
- shoes_cairo_destroy(&canvas->slot);
0
+ shoes_cairo_destroy(canvas);
0
   INFO("PAINT: %0.6f s\n", ELAPSED);
0
   shoes_canvas_send_start(self);
0
 quit:
0
@@ -1052,7 +1049,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);
0
+ shoes_native_remove_item(&self_t->slot, item, c);
0
   if (t)
0
   {
0
     i = rb_ary_index_of(self_t->app->timers, item);
...
44
45
46
47
48
49
 
50
51
52
...
89
90
91
92
93
94
 
95
96
97
...
154
155
156
157
158
159
 
160
161
162
163
 
164
165
166
...
44
45
46
 
 
47
48
49
50
51
...
88
89
90
 
 
91
92
93
94
95
...
152
153
154
 
 
155
156
157
158
159
 
160
161
162
163
0
@@ -44,9 +44,8 @@
0
 #include <gdk/gdkx.h>
0
 
0
 #define SHOES_SIGNAL
0
-#define SHOES_EXTERN
0
-#define SHOES_EXTERN_VAR extern
0
 #define SHOES_INIT_ARGS void
0
+#define SHOES_EXTERN
0
 
0
 typedef struct {
0
   GtkWidget *vscroll, *canvas;
0
@@ -89,9 +88,8 @@ typedef struct {
0
 #define SHOES_SIGNAL
0
 #define SHOES_HELP_MANUAL 3044
0
 #define SHOES_CONTROL1 3045
0
-#define SHOES_EXTERN
0
-#define SHOES_EXTERN_VAR extern
0
 #define SHOES_INIT_ARGS void
0
+#define SHOES_EXTERN
0
 
0
 typedef struct {
0
   HIViewRef view;
0
@@ -154,13 +152,12 @@ VALUE shoes_cf2rb(CFStringRef cf);
0
 #endif
0
 
0
 #define SHOES_CONTROL1 3045
0
-#define SHOES_EXTERN extern "C" __declspec(dllimport)
0
-#define SHOES_EXTERN_VAR SHOES_EXTERN
0
 #define SHOES_INIT_ARGS HINSTANCE inst, int style
0
+#define SHOES_EXTERN __declspec(dllimport)
0
 
0
 typedef struct {
0
   PAINTSTRUCT ps;
0
- HDC dc;
0
+ HDC dc, dc2;
0
   HWND window;
0
   VALUE focus;
0
   VALUE controls;
...
11
12
13
 
 
 
 
 
 
14
15
16
...
11
12
13
14
15
16
17
18
19
20
21
22
0
@@ -11,6 +11,12 @@
0
 #include "shoes/ruby.h"
0
 #include "shoes/config.h"
0
 #include "shoes/world.h"
0
+
0
+#ifdef SHOES_WIN32
0
+#undef HAVE_PROTOTYPES
0
+#undef HAVE_STDLIB_H
0
+#undef EXTERN
0
+#endif
0
 #include <jpeglib.h>
0
 #include <jerror.h>
0
 
...
27
28
29
 
30
31
32
33
34
35
36
 
37
38
39
...
27
28
29
30
31
32
33
34
35
36
 
37
38
39
40
0
@@ -27,13 +27,14 @@
0
 #ifdef SHOES_WIN32
0
 
0
 void odprintf(const char *format, ...);
0
+static inline void odignore(const char *format, ...) {}
0
 int shoes_snprintf(char* str, size_t size, const char* format, ...);
0
 #define PUTS odprintf
0
 
0
 #ifdef DEBUG
0
 #define INFO PUTS
0
 #else
0
-#define INFO(msg)
0
+#define INFO odignore
0
 #endif
0
 #define WARN PUTS
0
 #define QUIT(msg) \
...
9
10
11
12
 
13
14
15
...
18
19
20
21
 
22
23
24
25
 
26
27
28
29
30
31
32
 
 
33
34
35
...
39
40
41
 
42
43
44
...
9
10
11
 
12
13
14
15
...
18
19
20
 
21
22
23
24
 
25
26
27
28
29
30
 
 
31
32
33
34
35
...
39
40
41
42
43
44
45
0
@@ -9,7 +9,7 @@
0
 #define PLACE_COORDS() p2->h -= HEIGHT_PAD; p2->ih -= HEIGHT_PAD; *p1 = *p2
0
 
0
 void shoes_native_init();
0
-void shoes_native_cleanup();
0
+void shoes_native_cleanup(shoes_world_t *world);
0
 void shoes_native_quit();
0
 void shoes_native_slot_mark(SHOES_SLOT_OS *);
0
 void shoes_native_slot_reset(SHOES_SLOT_OS *);
0
@@ -18,18 +18,18 @@ void shoes_native_slot_paint(SHOES_SLOT_OS *);
0
 void shoes_native_slot_lengthen(SHOES_SLOT_OS *, int, int);
0
 void shoes_native_slot_scroll_top(SHOES_SLOT_OS *);
0
 int shoes_native_slot_gutter(SHOES_SLOT_OS *);
0
-void shoes_native_remove_item(SHOES_SLOT_OS *);
0
+void shoes_native_remove_item(SHOES_SLOT_OS *, VALUE, char);
0
 shoes_code shoes_app_cursor(shoes_app *, ID);
0
 void shoes_native_app_resized(shoes_app *);
0
 void shoes_native_app_title(shoes_app *, char *);
0
-shoes_code shoes_native_app_open(shoes_app *, char *);
0
+shoes_code shoes_native_app_open(shoes_app *, char *, int);
0
 void shoes_native_app_show(shoes_app *);
0
 void shoes_native_loop();
0
 void shoes_native_app_close(shoes_app *);
0
 void shoes_browser_open(char *);
0
 void shoes_slot_init(VALUE, SHOES_SLOT_OS *, int, int, int, int, int, int);
0
-cairo_t *shoes_cairo_create(SHOES_SLOT_OS *, shoes_canvas *, int, int, int);
0
-void shoes_cairo_destroy(SHOES_SLOT_OS *);
0
+cairo_t *shoes_cairo_create(shoes_canvas *);
0
+void shoes_cairo_destroy(shoes_canvas *);
0
 void shoes_group_clear(SHOES_GROUP_OS *);
0
 void shoes_native_canvas_place(shoes_canvas *, shoes_canvas *);
0
 void shoes_native_canvas_resize(shoes_canvas *);
0
@@ -39,6 +39,7 @@ void shoes_native_control_position(SHOES_CONTROL_REF, shoes_place *,
0
   VALUE, shoes_canvas *, shoes_place *);
0
 void shoes_native_control_repaint(SHOES_CONTROL_REF, shoes_place *,
0
   shoes_canvas *, shoes_place *);
0
+void shoes_native_control_focus(SHOES_CONTROL_REF);
0
 void shoes_native_control_remove(SHOES_CONTROL_REF, shoes_canvas *);
0
 void shoes_native_control_free(SHOES_CONTROL_REF);
0
 SHOES_CONTROL_REF shoes_native_surface_new(shoes_canvas *, VALUE, shoes_place *);
...
108
109
110
111
 
112
113
114
...
705
706
707
708
 
709
710
711
...
820
821
822
823
 
824
825
826
 
 
 
827
828
829
830
831
 
832
833
834
...
928
929
930
 
931
932
933
...
108
109
110
 
111
112
113
114
...
705
706
707
 
708
709
710
711
...
820
821
822
 
823
824
 
 
825
826
827
828
829
830
831
 
832
833
834
835
...
929
930
931
932
933
934
935
0
@@ -108,7 +108,7 @@ int shoes_native_slot_gutter(SHOES_SLOT_OS *slot)
0
   return scrollwidth;
0
 }
0
 
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
 {
0
   if (c)
0
   {
0
@@ -705,7 +705,7 @@ shoes_native_app_title(shoes_app *app, char *msg)
0
 }
0
 
0
 shoes_code
0
-shoes_native_app_open(shoes_app *app, char *path)
0
+shoes_native_app_open(shoes_app *app, char *path, int dialog)
0
 {
0
   shoes_code code = SHOES_OK;
0
 
0
@@ -820,15 +820,16 @@ shoes_slot_init(VALUE c, SHOES_SLOT_OS *parent, int x, int y, int width, int hei
0
 }
0
 
0
 cairo_t *
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
 {
0
- slot->surface = cairo_quartz_surface_create_for_cg_context(slot->context, width, height);
0
- return cairo_create(slot->surface);
0
+ canvas->slot.surface = cairo_quartz_surface_create_for_cg_context(canvas->slot.context,
0
+ canvas->width, canvas->height);
0
+ return cairo_create(canvas->slot.surface);
0
 }
0
 
0
 void shoes_cairo_destroy(SHOES_SLOT_OS *)
0
 {
0
- cairo_surface_destroy(slot->surface);
0
+ cairo_surface_destroy(canvas->slot.surface);
0
 }
0
 
0
 void
0
@@ -928,6 +929,7 @@ shoes_native_control_remove(SHOES_CONTROL_REF ref, shoes_canvas *canvas)
0
 void
0
 shoes_native_control_free(SHOES_CONTROL_REF ref)
0
 {
0
+ DisposeControl(ref);
0
 }
0
 
0
 SHOES_CONTROL_REF
...
78
79
80
81
 
82
83
84
...
372
373
374
375
 
376
377
378
...
465
466
467
468
 
469
470
471
 
 
472
473
474
 
 
475
476
477
 
478
479
480
481
482
483
 
484
485
486
...
78
79
80
 
81
82
83
84
...
372
373
374
 
375
376
377
378
...
465
466
467
 
468
469
 
 
470
471
472
 
 
473
474
475
476
 
477
478
479
480
481
482
 
483
484
485
486
0
@@ -78,7 +78,7 @@ int shoes_native_slot_gutter(SHOES_SLOT_OS *slot)
0
   return 0;
0
 }
0
 
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
 {
0
 }
0
 
0
@@ -372,7 +372,7 @@ shoes_native_app_title(shoes_app *app, char *msg)
0
 }
0
 
0
 shoes_code
0
-shoes_native_app_open(shoes_app *app, char *path)
0
+shoes_native_app_open(shoes_app *app, char *path, int dialog)
0
 {
0
   char icon_path[SHOES_BUFSIZE];
0
   shoes_app_gtk *gk = &app->os;
0
@@ -465,22 +465,22 @@ shoes_slot_init(VALUE c, SHOES_SLOT_OS *parent, int x, int y, int width, int hei
0
 }
0
 
0
 cairo_t *
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
 {
0
- cairo_t *cr = gdk_cairo_create(slot->canvas->window);
0
- if (slot->expose != NULL)
0
+ cairo_t *cr = gdk_cairo_create(canvas->slot.canvas->window);
0
+ if (canvas->slot.expose != NULL)
0
   {
0
- GdkRegion *region = gdk_region_rectangle(&slot->canvas->allocation);
0
- gdk_region_intersect(region, slot->expose->region);
0
+ GdkRegion *region = gdk_region_rectangle(&canvas->slot.canvas->allocation);
0
+ gdk_region_intersect(region, canvas->slot.expose->region);
0
     gdk_cairo_region(cr, region);
0
     cairo_clip(cr);
0
- cairo_translate(cr, slot->canvas->allocation.x, slot->canvas->allocation.y - slot->scrolly);
0
+ cairo_translate(cr, canvas->slot.canvas->allocation.x, canvas->slot.canvas->allocation.y - canvas->slot.scrolly);
0
   }
0
   return cr;
0
 }
0
 
0
 void
0
-shoes_cairo_destroy(SHOES_SLOT_OS *slot)
0
+shoes_cairo_destroy(shoes_canvas *canvas)
0
 {
0
 }
0
 
...
17
18
19
 
 
 
 
20
21
22
...
41
42
43
44
 
45
46
47
...
87
88
89
90
 
91
92
93
94
 
95
96
97
...
691
692
693
694
 
695
696
697
...
738
739
740
741
 
742
743
744
...
834
835
836
837
 
838
839
 
 
840
841
 
 
 
842
843
844
 
 
845
846
847
 
 
848
849
850
851
 
 
 
852
853
 
854
855
856
857
858
 
 
859
860
861
...
863
864
865
866
867
 
 
868
869
870
871
872
 
873
874
875
 
 
876
877
878
879
 
880
881
882
883
884
 
 
 
 
885
886
887
...
936
937
938
939
 
940
941
942
...
955
956
957
958
959
960
961
...
987
988
989
990
 
991
992
993
...
1286
1287
1288
1289
1290
1291
1292
 
1293
1294
1295
...
17
18
19
20
21
22
23
24
25
26
...
45
46
47
 
48
49
50
51
...
91
92
93
 
94
95
96
97
 
98
99
100
101
...
695
696
697
 
698
699
700
701
...
742
743
744
 
745
746
747
748
...
838
839
840
 
841
842
 
843
844
845
846
847
848
849
850
 
 
851
852
853
 
 
854
855
856
 
 
 
857
858
859
860
 
861
862
863
864
 
 
865
866
867
868
869
...
871
872
873
 
 
874
875
876
877
878
879
 
880
881
 
 
882
883
884
885
886
 
887
888
 
 
 
 
889
890
891
892
893
894
895
...
944
945
946
 
947
948
949
950
...
963
964
965
 
966
967
968
...
994
995
996
 
997
998
999
1000
...
1293
1294
1295
 
 
 
1296
1297
1298
1299
1300
0
@@ -17,6 +17,10 @@
0
 #define IDC_HAND MAKEINTRESOURCE(32649)
0
 #endif
0
 
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
+
0
 int
0
 shoes_win32_cmdvector(const char *cmdline, char ***argv)
0
 {
0
@@ -41,7 +45,7 @@ void shoes_native_quit()
0
   PostQuitMessage(0);
0
 }
0
 
0
-void shoes_slot_mark(SHOES_SLOT_OS *slot)
0
+void shoes_native_slot_mark(SHOES_SLOT_OS *slot)
0
 {
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
 }
0
 
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
 {
0
   if (c)
0
   {
0
- i = rb_ary_index_of(slot->controls, item);
0
+ long i = rb_ary_index_of(slot->controls, item);
0
     if (i >= 0)
0
       rb_ary_insert_at(slot->controls, i, 1, Qnil);
0
   }
0
@@ -691,7 +695,7 @@ shoes_native_app_title(shoes_app *app, char *msg)
0
 }
0
 
0
 shoes_code
0
-shoes_native_app_open(shoes_app *app, char *path)
0
+shoes_native_app_open(shoes_app *app, char *path, int dialog)
0
 {
0
   shoes_code code = SHOES_OK;
0
   RECT rect;
0
@@ -738,7 +742,7 @@ quit:
0
 }
0
 
0
 void
0
-shoes_native_app_show(shoes_app *)
0
+shoes_native_app_show(shoes_app *app)
0
 {
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
 }
0
 
0
 cairo_t *
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
 {
0
- if (slot->surface != NULL)
0
+ shoes_canvas *parent;
0
+ if (canvas->slot.surface != NULL)
0
     return NULL;
0
 
0
+ if (!NIL_P(canvas->parent))
0
+ Data_Get_Struct(canvas->parent, shoes_canvas, parent);
0
+
0
   HBITMAP bitmap, bitold;
0
- HDC hdc = BeginPaint(slot->window, &slot->ps);
0
- if (slot->dc != NULL)
0
+ canvas->slot.dc2 = BeginPaint(canvas->slot.window, &canvas->slot.ps);
0
+ if (canvas->slot.dc != NULL)
0
   {
0
- DeleteObject(GetCurrentObject(slot->dc, OBJ_BITMAP));
0
- DeleteDC(slot->dc);
0
+ DeleteObject(GetCurrentObject(canvas->slot.dc, OBJ_BITMAP));
0
+ DeleteDC(canvas->slot.dc);
0
   }
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
   DeleteObject(bitold);
0
- if (toplevel)
0
+ if (DC(canvas->slot) == DC(canvas->app->slot))
0
   {
0
     RECT rc;
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
     DeleteObject(bg);
0
   }
0
   else
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
     {
0
       RECT r;
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
     }
0
   }
0
 
0
- slot->surface = cairo_win32_surface_create(slot->dc);
0
+ canvas->slot.surface = cairo_win32_surface_create(canvas->slot.dc);
0
 
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
   return cr;
0
 }
0
 
0
-void shoes_cairo_destroy(SHOES_SLOT_OS *)
0
+void shoes_cairo_destroy(shoes_canvas *canvas)
0
 {
0
- BitBlt(hdc, 0, 0, width, height, slot->dc, 0, 0, SRCCOPY);
0
- cairo_surface_destroy(slot->surface);
0
- slot->surface = NULL;
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
 }
0
 
0
 void
0
@@ -936,7 +944,7 @@ shoes_native_control_repaint(SHOES_CONTROL_REF ref, shoes_place *p1,
0
 {
0
   p2->iy -= canvas->slot.scrolly;
0
   if (CHANGED_COORDS())
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
 }
0
 
0
@@ -955,7 +963,6 @@ shoes_native_control_remove(SHOES_CONTROL_REF ref, shoes_canvas *canvas)
0
 void
0
 shoes_native_control_free(SHOES_CONTROL_REF ref)
0
 {
0
- DisposeControl(ref);
0
 }
0
 
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
 void
0
 shoes_native_surface_remove(shoes_canvas *canvas, SHOES_CONTROL_REF ref)
0
 {
0
- DestroyWindow(self_t->ref);
0
+ DestroyWindow(ref);
0
 }
0
 
0
 SHOES_CONTROL_REF
0
@@ -1286,10 +1293,8 @@ shoes_ask_win32proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
0
     case WM_CLOSE:
0
       EndDialog(hwnd, 0);
0
       return FALSE;
0
-
0
- default:
0
- return FALSE;
0
   }
0
+ return FALSE;
0
 }
0
 
0
 VALUE
...
18
19
20
 
 
 
 
21
22
23
...
181
182
183
 
 
 
 
...
18
19
20
21
22
23
24
25
26
27
...
185
186
187
188
189
190
191
0
@@ -18,6 +18,10 @@ shoes_sigint()
0
 }
0
 #endif
0
 
0
+#ifdef __cplusplus
0
+extern "C" {
0
+#endif
0
+
0
 shoes_world_t *shoes_world = NULL;
0
 
0
 shoes_world_t *
0
@@ -181,3 +185,7 @@ shoes_final()
0
   shoes_world_free(shoes_world);
0
   return SHOES_OK;
0
 }
0
+
0
+#ifdef __cplusplus
0
+}
0
+#endif
...
11
12
13
 
 
 
 
14
15
16
...
20
21
22
23
 
24
25
26
...
30
31
32
33
34
 
 
35
36
37
...
45
46
47
 
 
 
 
48
...
11
12
13
14
15
16
17
18
19
20
...
24
25
26
 
27
28
29
30
...
34
35
36
 
 
37
38
39
40
41
...
49
50
51
52
53
54
55
56
0
@@ -11,6 +11,10 @@
0
 #include "shoes/ruby.h"
0
 #include "shoes/code.h"
0
 
0
+#ifdef __cplusplus
0
+extern "C" {
0
+#endif
0
+
0
 SHOES_EXTERN typedef struct _shoes_world_t {
0
   SHOES_WORLD_OS os;
0
   int mainloop;
0
@@ -20,7 +24,7 @@ SHOES_EXTERN typedef struct _shoes_world_t {
0
   cairo_surface_t *blank_image;
0
 } shoes_world_t;
0
 
0
-SHOES_EXTERN_VAR shoes_world_t *shoes_world;
0
+extern SHOES_EXTERN shoes_world_t *shoes_world;
0
 
0
 #define GLOBAL_APP(appvar) \
0
   shoes_app *appvar = NULL; \
0
@@ -30,8 +34,8 @@ SHOES_EXTERN_VAR shoes_world_t *shoes_world;
0
 //
0
 // Shoes World
0
 //
0
-shoes_world_t *shoes_world_alloc(void);
0
-void shoes_world_free(shoes_world_t *);
0
+SHOES_EXTERN shoes_world_t *shoes_world_alloc(void);
0
+SHOES_EXTERN void shoes_world_free(shoes_world_t *);
0
 
0
 //
0
 // Shoes
0
@@ -45,4 +49,8 @@ SHOES_EXTERN int shoes_win32_cmdvector(const char *, char ***);
0
 SHOES_EXTERN void shoes_set_argv(int, char **);
0
 SHOES_EXTERN shoes_code shoes_final(void);
0
 
0
+#ifdef __cplusplus
0
+}
0
+#endif
0
+
0
 #endif

Comments

    No one has commented yet.