diff --git a/Makefile b/Makefile index e9b578e..cb82e15 100644 --- a/Makefile +++ b/Makefile @@ -19,8 +19,6 @@ format: OBJS = src/core.o src/widget/base.o include objs.mk -src/widget/base.o: src/widget/base.cc src/widget/baseauto.cc - test$(EXEC): test.o $(CXX) -L. -Wl,-R$(MILSKO)/src -Wl,-R$(MILSKO)/lib -Wl,-R. -o $@ test.o -lMwCXX diff --git a/bindgen.cc b/bindgen.cc index 9f97968..2e8e8bb 100644 --- a/bindgen.cc +++ b/bindgen.cc @@ -13,6 +13,7 @@ struct typeinfo { std::string struct_name; std::string widget_type; int pointer; + int unsigned_num; }; struct property { @@ -38,6 +39,8 @@ static std::string get_ctype(typeinfo type, int name = 1, int do_ptr = 1) { if(type.type == "integer") { ret += "int"; + } else if(type.type == "short") { + ret += "short"; } else if(type.type == "string") { ret += "MwCXX::String"; } else if(type.type == "pixmap") { @@ -54,6 +57,8 @@ static std::string get_ctype(typeinfo type, int name = 1, int do_ptr = 1) { } } + if(type.unsigned_num) ret = "unsigned " + ret; + if(do_ptr && type.pointer) ret += "*"; if(name && type.name != "") { @@ -99,11 +104,12 @@ static typeinfo xml_to_type(xl_node_t* node) { char* s; typeinfo ret; - ret.type = node->name; - ret.name = ((s = xl_get_attribute(node, "name")) != NULL) ? s : ""; - ret.struct_name = ((s = xl_get_attribute(node, "defname")) != NULL) ? s : ""; - ret.widget_type = ((s = xl_get_attribute(node, "type")) != NULL) ? s : ""; - ret.pointer = ATTR_TO_BOOL(node, "pointer"); + ret.type = node->name; + ret.name = ((s = xl_get_attribute(node, "name")) != NULL) ? s : ""; + ret.struct_name = ((s = xl_get_attribute(node, "defname")) != NULL) ? s : ""; + ret.widget_type = ((s = xl_get_attribute(node, "type")) != NULL) ? s : ""; + ret.pointer = ATTR_TO_BOOL(node, "pointer"); + ret.unsigned_num = ATTR_TO_BOOL(node, "unsigned"); return ret; } diff --git a/include/MwCXX/Dialog/MessageBox.h b/include/MwCXX/Dialog/MessageBox.h index ee95b60..661ccb0 100644 --- a/include/MwCXX/Dialog/MessageBox.h +++ b/include/MwCXX/Dialog/MessageBox.h @@ -4,7 +4,7 @@ #include namespace MwCXX { - MwCXX::Window* MessageBox(MwCXX::Base* handle, MwCXX::String text, MwCXX::String title, int flag); + MwCXX::Window* MessageBox(MwCXX::Base* handle, MwCXX::String text, MwCXX::String title, unsigned int flag); MwCXX::Button* MessageBoxGetChild(MwCXX::Window* handle, int child); void MessageBoxDestroy(MwCXX::Window* handle); }; // namespace MwCXX diff --git a/src/dialog/messagebox.cc b/src/dialog/messagebox.cc index ca5c5d7..3c3f0bb 100644 --- a/src/dialog/messagebox.cc +++ b/src/dialog/messagebox.cc @@ -1,6 +1,6 @@ #include -MwCXX::Window* MwCXX::MessageBox(MwCXX::Base* handle, MwCXX::String text, MwCXX::String title, int flag) { +MwCXX::Window* MwCXX::MessageBox(MwCXX::Base* handle, MwCXX::String text, MwCXX::String title, unsigned int flag) { return new MwCXX::Window(MwMessageBox(handle->GetWidget(), #ifdef MWCXX_USE_C_STRING text @@ -14,7 +14,7 @@ MwCXX::Window* MwCXX::MessageBox(MwCXX::Base* handle, MwCXX::String text, MwCXX: title.c_str() #endif , - (int)flag), + (unsigned int)flag), handle); } MwCXX::Button* MwCXX::MessageBoxGetChild(MwCXX::Window* handle, int child) {