• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Frequently used words (click to add to your profile)

javaandroidc++linuxc#objective-ccocoa誰得qtrubypythongamewindowsbathyscaphephpguic翻訳omegattwitterframeworktestbtronarduinovb.net計画中(planning stage)directxpreviewerゲームエンジンdom

BTRONのウィンドウを扱うmrbgemの開発用


Commit MetaInfo

Revisione9c2d165b34c85a2fc902ea811434c937a9161f5 (tree)
Time2017-06-14 01:45:11
Authorornse01 <ornse01@user...>
Commiterornse01

Log Message

add open/close system call

Change Summary

Incremental Difference

--- a/src/window.c
+++ b/src/window.c
@@ -1,12 +1,20 @@
11 #include "mruby.h"
2+
23 #include <bstdio.h>
4+#include <btron/btron.h>
5+#include <btron/hmi.h>
36
47 static mrb_value
58 mrb_opn_wnd(mrb_state *mrb, mrb_value self)
69 {
10+ PAT bgpat = {{0, 16, 16, 0x10FFFFFF, 0x10FFFFFF, FILL100}};
11+ RECT r = {{0, 0, 100, 100}};
12+ WID wid = wopn_wnd(WA_NORMAL, 0, &r, NULL, 0, NULL, &bgpat, NULL);
13+
714 struct RClass* wid_class = mrb_class_get(mrb, "WID");
815 mrb_value wid_value = mrb_obj_value(wid_class);
9- mrb_value real_value = mrb_fixnum_value(25);
16+ mrb_value real_value = mrb_fixnum_value(wid);
17+
1018 return mrb_funcall(mrb, wid_value, "new", 1, real_value);
1119 }
1220
@@ -14,13 +22,16 @@ static mrb_value
1422 mrb_cls_wnd(mrb_state *mrb, mrb_value self)
1523 {
1624 mrb_value s2, id_value;
17- mrb_int real_value;
25+ mrb_int wid;
1826
1927 mrb_get_args(mrb, "o", &s2);
2028
2129 id_value = mrb_funcall(mrb, s2, "id", 0);
22- real_value = mrb_fixnum(id_value);
23- printf("fixnum: %d\n", real_value);
30+ wid = mrb_fixnum(id_value);
31+
32+ wcls_wnd(wid, CLR);
33+ printf("fixnum: %d\n", wid);
34+
2435 return self;
2536 }
2637