This commit is contained in:
Nishi 2026-04-17 19:42:14 +09:00
commit ae7df4cb63
Signed by: nishi
GPG key ID: 27EF69B208EB9343
52 changed files with 1818 additions and 39 deletions

21
.clang-format Normal file
View file

@ -0,0 +1,21 @@
---
UseTab: Always
TabWidth: 8
AlignConsecutiveAssignments:
Enabled: true
AlignConsecutiveDeclarations:
Enabled: true
IndentAccessModifiers: true
NamespaceIndentation: All
IndentWidth: 8
PointerAlignment: Left
ColumnLimit: 0
AllowShortIfStatementsOnASingleLine: Always
AllowShortBlocksOnASingleLine: Never
AllowShortFunctionsOnASingleLine: Empty
AllowShortLoopsOnASingleLine: true
SpaceBeforeParens: Never
AlignEscapedNewlines: DontAlign
SortIncludes: false
AllowShortEnumsOnASingleLine: false
#IndentPPDirectives: AfterHash

View file

@ -1,20 +1,26 @@
MILSKO = ../milsko
XEMIL = ../xemil
CXX = g++ -std=c++98
CXX = g++
LIB = lib
SO = .so
EXEC =
.PHONY: all clean
.PHONY: all format clean
.SUFFIXES: .cxx .o
all: libMwCXX$(SO)
format:
clang-format --verbose -i `find . -name "*.cxx" -or -name "*.h"`
OBJS = src/core.o src/widget/base.o
include objs.mk
src/widget/base.o: src/widget/base.cxx src/widget/baseauto.cxx
bindgen$(EXEC): bindgen.o
$(CXX) -L$(XEMIL)/lib -L$(XEMIL)/src -o $@ bindgen.o -lxemil
@ -22,7 +28,7 @@ libMwCXX$(SO): $(OBJS)
$(CXX) -shared -L$(MILSKO)/lib -L$(MILSKO)/src -o $@ $(OBJS) -lMw
.cxx.o:
$(CXX) -c -I$(MILSKO)/include -I$(XEMIL)/include -o $@ $<
$(CXX) -fPIC -c -Iinclude -I$(MILSKO)/include -I$(XEMIL)/include -o $@ $<
clean:
rm -f *.so *.dll *.o *.exe bindgen.exe
rm -f *.so *.dll *.o */*.o */*/*.o *.exe bindgen.exe

View file

@ -3,92 +3,387 @@
#include <map>
#include <string>
#include <fstream>
#include <sstream>
#include <locale>
struct property {
std::string type;
std::string struct_name;
int common;
struct typeinfo {
std::string type;
std::string name;
std::string struct_name;
int pointer;
};
std::ofstream objs;
struct property {
typeinfo type;
int common;
typeinfo arg_type;
};
std::map<std::string, std::ofstream> files;
std::map<std::string, property> props;
std::map<std::string, std::string> types;
static std::string prop_type(std::string name){
if(types.find(props[name].type) == types.end()) return "V" + name;
std::locale locale;
return types[props[name].type] + name;
static std::string get_ctype(typeinfo type, int name = 1) {
std::string ret = "";
if(type.type == "integer") {
ret += "int";
} else if(type.type == "string") {
ret += "MwCXX::String";
} else if(type.type == "pixmap") {
ret += "MwLLPixmap";
} else if(type.type == "pointer") {
ret += "void*";
} else if(type.type == "struct") {
ret += type.struct_name;
}
if(type.pointer) ret += "*";
if(name && type.name != "") {
ret += " " + type.name;
}
return ret;
}
static void scan_property(xl_node_t* node){
property prop;
char* s;
static std::string get_type(typeinfo type) {
if(type.type == "integer") {
return "Integer";
} else if(type.type == "string") {
return "Text";
}
return "Void";
}
static std::string uppercase(std::string str) {
std::string r = str;
for(int i = 0; i < r.size(); i++) {
r[i] = std::toupper(r[i], locale);
}
return r;
}
static std::string lowercase(std::string str) {
std::string r = str;
for(int i = 0; i < r.size(); i++) {
r[i] = std::tolower(r[i], locale);
}
return r;
}
#define ATTR_TO_BOOL(node, x) ((s = xl_get_attribute(node, (x))) != NULL) && (strcmp(s, "no") != 0);
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.pointer = ATTR_TO_BOOL(node, "pointer");
return ret;
}
static std::string first_upper(std::string str) {
return uppercase(str.substr(0, 1)) + str.substr(1);
}
static void scan_property(xl_node_t* node) {
property prop;
char* s;
xl_node_t* child = node->first_child;
if(node->type != XL_NODE_NODE) return;
prop.type = node->name;
prop.struct_name = ((s = xl_get_attribute(node, "defname")) != NULL) ? s : "";
prop.common = ((s = xl_get_attribute(node, "common")) != NULL) && (strcmp(s, "yes") == 0);
prop.type = xml_to_type(node);
prop.common = ATTR_TO_BOOL(node, "common");
while(child != NULL) {
if(child->type == XL_NODE_NODE) prop.arg_type = xml_to_type(child);
child = child->next;
}
props[xl_get_attribute(node, "name")] = prop;
}
static void scan_properties(xl_node_t* node){
static void scan_properties(xl_node_t* node) {
xl_node_t* child = node->first_child;
while(child != NULL){
while(child != NULL) {
scan_property(child);
child = child->next;
}
}
int main(int argc, char** argv){
xemil_t* h;
int fail = 0;
static std::string widget_property_header(std::string name, std::string indent = "") {
std::stringstream strm;
if(argc < 2){
strm << indent + get_ctype(props[name].type, 0) + " Get" + first_upper(name) + "();" << std::endl;
strm << indent + "void Set" + first_upper(name) + "(" + get_ctype(props[name].type, 0) + " value);" << std::endl;
return strm.str();
}
static std::string widget_property_source(std::string widget, std::string name) {
std::stringstream strm;
strm << get_ctype(props[name].type, 0) + " MwCXX::" + widget + "::Get" + first_upper(name) + "() {" << std::endl;
strm << " return (" + get_ctype(props[name].type, 0) + ")MwGet" + get_type(props[name].type) + "(this->widget, MwN" + name + ");" << std::endl;
strm << "}" << std::endl;
strm << std::endl;
strm << "void MwCXX::" + widget + "::Set" + first_upper(name) + "(" + get_ctype(props[name].type, 0) + " value) {" << std::endl;
if(props[name].type.type == "string") {
strm << "#ifndef MWCXX_USE_C_STRING" << std::endl;
strm << " MwSetText(this->widget, MwN" + name + ", value.c_str());" << std::endl;
strm << "#else" << std::endl;
}
strm << " MwSet" + get_type(props[name].type) + "(this->widget, MwN" + name + ", (" + get_ctype(props[name].type, 0) + ")value);" << std::endl;
if(props[name].type.type == "string") {
strm << "#endif" << std::endl;
}
strm << "}" << std::endl;
strm << std::endl;
return strm.str();
}
static std::string scan_widget_property_header(xl_node_t* node, std::string indent) {
xl_node_t* child = node->first_child;
if(node->type != XL_NODE_NODE) return "";
return widget_property_header(xl_get_attribute(node, "name"), indent);
}
static std::string scan_widget_properties_header(xl_node_t* node, std::string indent) {
std::string r = "";
xl_node_t* child = node->first_child;
while(child != NULL) {
r += scan_widget_property_header(child, indent);
child = child->next;
}
return r;
}
static std::string scan_widget_property_source(xl_node_t* node, std::string name) {
xl_node_t* child = node->first_child;
if(node->type != XL_NODE_NODE) return "";
return widget_property_source(name, xl_get_attribute(node, "name"));
}
static std::string scan_widget_properties_source(xl_node_t* node, std::string name) {
std::string r = "";
xl_node_t* child = node->first_child;
while(child != NULL) {
r += scan_widget_property_source(child, name);
child = child->next;
}
return r;
}
static void scan_widget(xl_node_t* node) {
std::string name;
xl_node_t** nodes;
int i;
if(node->type != XL_NODE_NODE) return;
nodes = xl_get_path(node, "properties");
name = xl_get_attribute(node, "name");
#define OFS files["W" + name + ".h"]
OFS = std::ofstream("include/MwCXX/Widget/" + name + ".h");
OFS << "#ifndef __MWCXX_WIDGET_" + uppercase(name) + "_H__" << std::endl;
OFS << "#define __MWCXX_WIDGET_" + uppercase(name) + "_H__" << std::endl;
OFS << std::endl;
OFS << "#include <MwCXX/MachDep.h>" << std::endl;
OFS << "#include <MwCXX/Widget/Base.h>" << std::endl;
OFS << std::endl;
OFS << "#include <Mw/Widget/" + name + ".h>" << std::endl;
OFS << std::endl;
OFS << "namespace MwCXX {" << std::endl;
OFS << " class " + name + " : public MwCXX::Base {" << std::endl;
OFS << " public:" << std::endl;
OFS << " " + name + "(MwWidget widget);" << std::endl;
OFS << " " + name + "(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height);" << std::endl;
if(nodes != NULL) {
std::string r = "";
for(i = 0; nodes[i] != NULL; i++) {
r += scan_widget_properties_header(nodes[i], "\t\t\t");
}
if(r != "") OFS << std::endl
<< r;
}
OFS << " };" << std::endl;
OFS << "}; // namespace MwCXX" << std::endl;
OFS << std::endl;
OFS << "#endif" << std::endl;
#undef OFS
#define OFS files["W" + name + ".cxx"]
OFS = std::ofstream("src/widget/" + lowercase(name) + ".cxx");
if(name == "OpenGL" || name == "Vulkan") OFS << "#define MW_" + uppercase(name) + "_NO_INCLUDE" << std::endl;
OFS << "#include <MwCXX/Widget/" + name + ".h>" << std::endl;
OFS << std::endl;
OFS << "MwCXX::" + name + "::" + name + "(MwWidget widget) : MwCXX::Base(widget) {" << std::endl;
OFS << "}" << std::endl;
OFS << std::endl;
OFS << "MwCXX::" + name + "::" + name + "(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height) : MwCXX::Base(Mw" + name + "Class, name, parent, x, y, width, height) {" << std::endl;
OFS << "}" << std::endl;
OFS << std::endl;
if(nodes != NULL) {
for(i = 0; nodes[i] != NULL; i++) {
OFS << scan_widget_properties_source(nodes[i], name);
}
}
#undef OFS
if(nodes != NULL) free(nodes);
files["objs"] << " src/widget/" + lowercase(name) + ".o";
}
static void scan_widgets(xl_node_t* node) {
xl_node_t* child = node->first_child;
while(child != NULL) {
scan_widget(child);
child = child->next;
}
}
static void base_widget() {
std::string r = "";
#define OFS files["WBaseAuto.h"]
OFS = std::ofstream("include/MwCXX/Widget/BaseAuto.h");
for(auto p = props.begin(); p != props.end(); p++) {
if(!p->second.common) continue;
OFS << widget_property_header(p->first);
}
#undef OFS
#define OFS files["WBaseAuto.cxx"]
OFS = std::ofstream("src/widget/baseauto.cxx");
OFS << "#include <MwCXX/Widget/Base.h>" << std::endl;
for(auto p = props.begin(); p != props.end(); p++) {
if(!p->second.common) continue;
r += widget_property_source("Base", p->first);
}
if(r != "") OFS << std::endl
<< r;
#undef OFS
files["objs"] << " src/widget/baseauto.o";
}
int main(int argc, char** argv) {
xemil_t* h;
int fail = 0;
if(argc < 2) {
printf("Usage: %s XML\n", argv[0]);
return 1;
}
locale = std::locale::classic();
h = xl_open_file(argv[1]);
if(h != NULL){
if(h != NULL) {
h->param.new_text = 1;
if(xl_parse(h)) {
xl_node_t** nodes;
int i;
objs = std::ofstream("objs.mk");
files["objs"] = std::ofstream("objs.mk");
objs << "OBJS = ";
files["objs"] << "OBJS +=";
types["integer"] = "I";
types["string" ] = "S";
types["handler"] = "C";
if((nodes = xl_get_path(h->root, "properties")) != NULL){
for(i = 0; nodes[i] != NULL; i++){
if((nodes = xl_get_path(h->root, "properties")) != NULL) {
for(int i = 0; nodes[i] != NULL; i++) {
scan_properties(nodes[i]);
}
free(nodes);
}
objs << std::endl;
base_widget();
objs.close();
}else{
if((nodes = xl_get_path(h->root, "widgets")) != NULL) {
for(int i = 0; nodes[i] != NULL; i++) {
scan_widgets(nodes[i]);
}
free(nodes);
}
files["objs"] << std::endl;
for(auto f = files.begin(); f != files.end(); f++) {
f->second.close();
}
} else {
fail = 1;
}
xl_close(h);
}else{
} else {
fail = 1;
}
if(fail){
if(fail) {
fprintf(stderr, "Failed to parse XML\n");
return 1;

13
include/MwCXX/Core.h Normal file
View file

@ -0,0 +1,13 @@
#ifndef __MWCXX_CORE_H__
#define __MWCXX_CORE_H__
#include <MwCXX/MachDep.h>
#include <MwCXX/Widget/Base.h>
#define MWCXX_CONSTRUCTOR(name, parent_class) name(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height) : parent_class(name, parent, x, y, width, height)
namespace MwCXX {
void Init();
}; // namespace MwCXX
#endif

18
include/MwCXX/MachDep.h Normal file
View file

@ -0,0 +1,18 @@
#ifndef __MWCXX_MACHDEP_H__
#define __MWCXX_MACHDEP_H__
#include <Mw/Milsko.h>
#include <string>
// #define MWCXX_USE_C_STRING
namespace MwCXX {
#ifdef MWCXX_USE_C_STRING
typedef char* String;
#else
typedef std::string String;
#endif
}; // namespace MwCXX
#endif

View file

@ -0,0 +1,21 @@
#ifndef __MWCXX_WIDGET_BASE_H__
#define __MWCXX_WIDGET_BASE_H__
#include <MwCXX/MachDep.h>
namespace MwCXX {
class Base {
protected:
MwWidget widget;
public:
Base(MwWidget widget);
Base(MwClass widget_class, MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height);
void Loop();
#include <MwCXX/Widget/BaseAuto.h>
};
}; // namespace MwCXX
#endif

View file

@ -0,0 +1,58 @@
MwCXX::String GetBackground();
void SetBackground(MwCXX::String value);
MwLLPixmap GetBackgroundPixmap();
void SetBackgroundPixmap(MwLLPixmap value);
int GetBitmapFont();
void SetBitmapFont(int value);
int GetBorderWidth();
void SetBorderWidth(int value);
GetClipboard();
void SetClipboard( value);
GetDarkTheme();
void SetDarkTheme( value);
int GetFixedSize();
void SetFixedSize(int value);
GetFocusIn();
void SetFocusIn( value);
GetFocusOut();
void SetFocusOut( value);
int GetForceInverted();
void SetForceInverted(int value);
MwCXX::String GetForeground();
void SetForeground(MwCXX::String value);
int GetHeight();
void SetHeight(int value);
int GetIsRounded();
void SetIsRounded(int value);
GetKey();
void SetKey( value);
GetKeyRelease();
void SetKeyRelease( value);
int GetModernLook();
void SetModernLook(int value);
GetMouseDown();
void SetMouseDown( value);
GetMouseMove();
void SetMouseMove( value);
GetMouseUp();
void SetMouseUp( value);
int GetRatio();
void SetRatio(int value);
GetResize();
void SetResize( value);
MwCXX::String GetSubBackground();
void SetSubBackground(MwCXX::String value);
MwCXX::String GetSubForeground();
void SetSubForeground(MwCXX::String value);
GetTick();
void SetTick( value);
int GetUseMonospace();
void SetUseMonospace(int value);
int GetWaitMS();
void SetWaitMS(int value);
int GetWidth();
void SetWidth(int value);
int GetX();
void SetX(int value);
int GetY();
void SetY(int value);

View file

@ -0,0 +1,28 @@
#ifndef __MWCXX_WIDGET_BOX_H__
#define __MWCXX_WIDGET_BOX_H__
#include <MwCXX/MachDep.h>
#include <MwCXX/Widget/Base.h>
#include <Mw/Widget/Box.h>
namespace MwCXX {
class Box : public MwCXX::Base {
public:
Box(MwWidget widget);
Box(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height);
int GetOrientation();
void SetOrientation(int value);
int GetMargin();
void SetMargin(int value);
int GetPadding();
void SetPadding(int value);
int GetHasBorder();
void SetHasBorder(int value);
int GetInverted();
void SetInverted(int value);
};
}; // namespace MwCXX
#endif

View file

@ -0,0 +1,28 @@
#ifndef __MWCXX_WIDGET_BUTTON_H__
#define __MWCXX_WIDGET_BUTTON_H__
#include <MwCXX/MachDep.h>
#include <MwCXX/Widget/Base.h>
#include <Mw/Widget/Button.h>
namespace MwCXX {
class Button : public MwCXX::Base {
public:
Button(MwWidget widget);
Button(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height);
MwLLPixmap GetPixmap();
void SetPixmap(MwLLPixmap value);
MwCXX::String GetText();
void SetText(MwCXX::String value);
int GetFlat();
void SetFlat(int value);
int GetPadding();
void SetPadding(int value);
int GetFillArea();
void SetFillArea(int value);
};
}; // namespace MwCXX
#endif

View file

@ -0,0 +1,20 @@
#ifndef __MWCXX_WIDGET_CHECKBOX_H__
#define __MWCXX_WIDGET_CHECKBOX_H__
#include <MwCXX/MachDep.h>
#include <MwCXX/Widget/Base.h>
#include <Mw/Widget/CheckBox.h>
namespace MwCXX {
class CheckBox : public MwCXX::Base {
public:
CheckBox(MwWidget widget);
CheckBox(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height);
int GetChecked();
void SetChecked(int value);
};
}; // namespace MwCXX
#endif

View file

@ -0,0 +1,22 @@
#ifndef __MWCXX_WIDGET_COMBOBOX_H__
#define __MWCXX_WIDGET_COMBOBOX_H__
#include <MwCXX/MachDep.h>
#include <MwCXX/Widget/Base.h>
#include <Mw/Widget/ComboBox.h>
namespace MwCXX {
class ComboBox : public MwCXX::Base {
public:
ComboBox(MwWidget widget);
ComboBox(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height);
int GetAreaShown();
void SetAreaShown(int value);
int GetValue();
void SetValue(int value);
};
}; // namespace MwCXX
#endif

View file

@ -0,0 +1,22 @@
#ifndef __MWCXX_WIDGET_ENTRY_H__
#define __MWCXX_WIDGET_ENTRY_H__
#include <MwCXX/MachDep.h>
#include <MwCXX/Widget/Base.h>
#include <Mw/Widget/Entry.h>
namespace MwCXX {
class Entry : public MwCXX::Base {
public:
Entry(MwWidget widget);
Entry(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height);
MwCXX::String GetText();
void SetText(MwCXX::String value);
int GetHideInput();
void SetHideInput(int value);
};
}; // namespace MwCXX
#endif

View file

@ -0,0 +1,22 @@
#ifndef __MWCXX_WIDGET_FRAME_H__
#define __MWCXX_WIDGET_FRAME_H__
#include <MwCXX/MachDep.h>
#include <MwCXX/Widget/Base.h>
#include <Mw/Widget/Frame.h>
namespace MwCXX {
class Frame : public MwCXX::Base {
public:
Frame(MwWidget widget);
Frame(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height);
int GetHasBorder();
void SetHasBorder(int value);
int GetInverted();
void SetInverted(int value);
};
}; // namespace MwCXX
#endif

View file

@ -0,0 +1,26 @@
#ifndef __MWCXX_WIDGET_IMAGE_H__
#define __MWCXX_WIDGET_IMAGE_H__
#include <MwCXX/MachDep.h>
#include <MwCXX/Widget/Base.h>
#include <Mw/Widget/Image.h>
namespace MwCXX {
class Image : public MwCXX::Base {
public:
Image(MwWidget widget);
Image(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height);
MwLLPixmap GetPixmap();
void SetPixmap(MwLLPixmap value);
int GetHasBorder();
void SetHasBorder(int value);
int GetInverted();
void SetInverted(int value);
int GetFillArea();
void SetFillArea(int value);
};
}; // namespace MwCXX
#endif

View file

@ -0,0 +1,30 @@
#ifndef __MWCXX_WIDGET_LABEL_H__
#define __MWCXX_WIDGET_LABEL_H__
#include <MwCXX/MachDep.h>
#include <MwCXX/Widget/Base.h>
#include <Mw/Widget/Label.h>
namespace MwCXX {
class Label : public MwCXX::Base {
public:
Label(MwWidget widget);
Label(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height);
MwCXX::String GetText();
void SetText(MwCXX::String value);
int GetAlignment();
void SetAlignment(int value);
int GetBold();
void SetBold(int value);
int GetSevenSegment();
void SetSevenSegment(int value);
int GetLength();
void SetLength(int value);
int GetLeftPadding();
void SetLeftPadding(int value);
};
}; // namespace MwCXX
#endif

View file

@ -0,0 +1,24 @@
#ifndef __MWCXX_WIDGET_LISTBOX_H__
#define __MWCXX_WIDGET_LISTBOX_H__
#include <MwCXX/MachDep.h>
#include <MwCXX/Widget/Base.h>
#include <Mw/Widget/ListBox.h>
namespace MwCXX {
class ListBox : public MwCXX::Base {
public:
ListBox(MwWidget widget);
ListBox(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height);
int GetLeftPadding();
void SetLeftPadding(int value);
int GetHasHeading();
void SetHasHeading(int value);
int GetSingleClickSelectable();
void SetSingleClickSelectable(int value);
};
}; // namespace MwCXX
#endif

View file

@ -0,0 +1,17 @@
#ifndef __MWCXX_WIDGET_MENU_H__
#define __MWCXX_WIDGET_MENU_H__
#include <MwCXX/MachDep.h>
#include <MwCXX/Widget/Base.h>
#include <Mw/Widget/Menu.h>
namespace MwCXX {
class Menu : public MwCXX::Base {
public:
Menu(MwWidget widget);
Menu(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height);
};
}; // namespace MwCXX
#endif

View file

@ -0,0 +1,20 @@
#ifndef __MWCXX_WIDGET_NUMBERENTRY_H__
#define __MWCXX_WIDGET_NUMBERENTRY_H__
#include <MwCXX/MachDep.h>
#include <MwCXX/Widget/Base.h>
#include <Mw/Widget/NumberEntry.h>
namespace MwCXX {
class NumberEntry : public MwCXX::Base {
public:
NumberEntry(MwWidget widget);
NumberEntry(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height);
MwCXX::String GetText();
void SetText(MwCXX::String value);
};
}; // namespace MwCXX
#endif

View file

@ -0,0 +1,17 @@
#ifndef __MWCXX_WIDGET_OPENGL_H__
#define __MWCXX_WIDGET_OPENGL_H__
#include <MwCXX/MachDep.h>
#include <MwCXX/Widget/Base.h>
#include <Mw/Widget/OpenGL.h>
namespace MwCXX {
class OpenGL : public MwCXX::Base {
public:
OpenGL(MwWidget widget);
OpenGL(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height);
};
}; // namespace MwCXX
#endif

View file

@ -0,0 +1,24 @@
#ifndef __MWCXX_WIDGET_PROGRESSBAR_H__
#define __MWCXX_WIDGET_PROGRESSBAR_H__
#include <MwCXX/MachDep.h>
#include <MwCXX/Widget/Base.h>
#include <Mw/Widget/ProgressBar.h>
namespace MwCXX {
class ProgressBar : public MwCXX::Base {
public:
ProgressBar(MwWidget widget);
ProgressBar(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height);
int GetMinValue();
void SetMinValue(int value);
int GetMaxValue();
void SetMaxValue(int value);
int GetValue();
void SetValue(int value);
};
}; // namespace MwCXX
#endif

View file

@ -0,0 +1,20 @@
#ifndef __MWCXX_WIDGET_RADIOBOX_H__
#define __MWCXX_WIDGET_RADIOBOX_H__
#include <MwCXX/MachDep.h>
#include <MwCXX/Widget/Base.h>
#include <Mw/Widget/RadioBox.h>
namespace MwCXX {
class RadioBox : public MwCXX::Base {
public:
RadioBox(MwWidget widget);
RadioBox(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height);
int GetChecked();
void SetChecked(int value);
};
}; // namespace MwCXX
#endif

View file

@ -0,0 +1,30 @@
#ifndef __MWCXX_WIDGET_SCROLLBAR_H__
#define __MWCXX_WIDGET_SCROLLBAR_H__
#include <MwCXX/MachDep.h>
#include <MwCXX/Widget/Base.h>
#include <Mw/Widget/ScrollBar.h>
namespace MwCXX {
class ScrollBar : public MwCXX::Base {
public:
ScrollBar(MwWidget widget);
ScrollBar(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height);
int GetShowArrows();
void SetShowArrows(int value);
int GetAreaShown();
void SetAreaShown(int value);
int GetValue();
void SetValue(int value);
int GetMinValue();
void SetMinValue(int value);
int GetMaxValue();
void SetMaxValue(int value);
int GetOrientation();
void SetOrientation(int value);
};
}; // namespace MwCXX
#endif

View file

@ -0,0 +1,20 @@
#ifndef __MWCXX_WIDGET_SUBMENU_H__
#define __MWCXX_WIDGET_SUBMENU_H__
#include <MwCXX/MachDep.h>
#include <MwCXX/Widget/Base.h>
#include <Mw/Widget/SubMenu.h>
namespace MwCXX {
class SubMenu : public MwCXX::Base {
public:
SubMenu(MwWidget widget);
SubMenu(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height);
int GetLeftPadding();
void SetLeftPadding(int value);
};
}; // namespace MwCXX
#endif

View file

@ -0,0 +1,22 @@
#ifndef __MWCXX_WIDGET_TREEVIEW_H__
#define __MWCXX_WIDGET_TREEVIEW_H__
#include <MwCXX/MachDep.h>
#include <MwCXX/Widget/Base.h>
#include <Mw/Widget/TreeView.h>
namespace MwCXX {
class TreeView : public MwCXX::Base {
public:
TreeView(MwWidget widget);
TreeView(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height);
int GetLeftPadding();
void SetLeftPadding(int value);
int GetSingleClickSelectable();
void SetSingleClickSelectable(int value);
};
}; // namespace MwCXX
#endif

View file

@ -0,0 +1,17 @@
#ifndef __MWCXX_WIDGET_VIEWPORT_H__
#define __MWCXX_WIDGET_VIEWPORT_H__
#include <MwCXX/MachDep.h>
#include <MwCXX/Widget/Base.h>
#include <Mw/Widget/Viewport.h>
namespace MwCXX {
class Viewport : public MwCXX::Base {
public:
Viewport(MwWidget widget);
Viewport(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height);
};
}; // namespace MwCXX
#endif

View file

@ -0,0 +1,17 @@
#ifndef __MWCXX_WIDGET_VULKAN_H__
#define __MWCXX_WIDGET_VULKAN_H__
#include <MwCXX/MachDep.h>
#include <MwCXX/Widget/Base.h>
#include <Mw/Widget/Vulkan.h>
namespace MwCXX {
class Vulkan : public MwCXX::Base {
public:
Vulkan(MwWidget widget);
Vulkan(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height);
};
}; // namespace MwCXX
#endif

View file

@ -0,0 +1,30 @@
#ifndef __MWCXX_WIDGET_WINDOW_H__
#define __MWCXX_WIDGET_WINDOW_H__
#include <MwCXX/MachDep.h>
#include <MwCXX/Widget/Base.h>
#include <Mw/Widget/Window.h>
namespace MwCXX {
class Window : public MwCXX::Base {
public:
Window(MwWidget widget);
Window(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height);
MwCXX::String GetTitle();
void SetTitle(MwCXX::String value);
int GetMain();
void SetMain(int value);
MwLLPixmap GetIconPixmap();
void SetIconPixmap(MwLLPixmap value);
MwSizeHints* GetSizeHints();
void SetSizeHints(MwSizeHints* value);
int GetHasBorder();
void SetHasBorder(int value);
int GetInverted();
void SetInverted(int value);
};
}; // namespace MwCXX
#endif

View file

@ -1 +1 @@
OBJS =
OBJS += src/widget/baseauto.o src/widget/box.o src/widget/button.o src/widget/checkbox.o src/widget/entry.o src/widget/frame.o src/widget/image.o src/widget/label.o src/widget/listbox.o src/widget/menu.o src/widget/numberentry.o src/widget/scrollbar.o src/widget/submenu.o src/widget/viewport.o src/widget/window.o src/widget/progressbar.o src/widget/radiobox.o src/widget/combobox.o src/widget/treeview.o src/widget/opengl.o src/widget/vulkan.o

5
src/core.cxx Normal file
View file

@ -0,0 +1,5 @@
#include <MwCXX/Core.h>
void MwCXX::Init() {
MwLibraryInit();
}

17
src/widget/base.cxx Normal file
View file

@ -0,0 +1,17 @@
#include <MwCXX/Widget/Base.h>
MwCXX::Base::Base(MwWidget widget){
this->widget = widget;
}
MwCXX::Base::Base(MwClass widget_class, MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height){
#ifdef MWCXX_USE_C_STRING
this->widget = MwCreateWidget(widget_class, name, parent == NULL ? NULL : parent->widget, x, y, width, height);
#else
this->widget = MwCreateWidget(widget_class, name.c_str(), parent == NULL ? NULL : parent->widget, x, y, width, height);
#endif
}
void MwCXX::Base::Loop() {
MwLoop(this->widget);
}

250
src/widget/baseauto.cxx Normal file
View file

@ -0,0 +1,250 @@
#include <MwCXX/Widget/Base.h>
MwCXX::String MwCXX::Base::GetBackground() {
return (MwCXX::String)MwGetText(this->widget, MwNbackground);
}
void MwCXX::Base::SetBackground(MwCXX::String value) {
#ifndef MWCXX_USE_C_STRING
MwSetText(this->widget, MwNbackground, value.c_str());
#else
MwSetText(this->widget, MwNbackground, (MwCXX::String)value);
#endif
}
MwLLPixmap MwCXX::Base::GetBackgroundPixmap() {
return (MwLLPixmap)MwGetVoid(this->widget, MwNbackgroundPixmap);
}
void MwCXX::Base::SetBackgroundPixmap(MwLLPixmap value) {
MwSetVoid(this->widget, MwNbackgroundPixmap, (MwLLPixmap)value);
}
int MwCXX::Base::GetBitmapFont() {
return (int)MwGetInteger(this->widget, MwNbitmapFont);
}
void MwCXX::Base::SetBitmapFont(int value) {
MwSetInteger(this->widget, MwNbitmapFont, (int)value);
}
int MwCXX::Base::GetBorderWidth() {
return (int)MwGetInteger(this->widget, MwNborderWidth);
}
void MwCXX::Base::SetBorderWidth(int value) {
MwSetInteger(this->widget, MwNborderWidth, (int)value);
}
MwCXX::Base::GetClipboard() {
return ()MwGetVoid(this->widget, MwNclipboard);
}
void MwCXX::Base::SetClipboard( value) {
MwSetVoid(this->widget, MwNclipboard, ()value);
}
MwCXX::Base::GetDarkTheme() {
return ()MwGetVoid(this->widget, MwNdarkTheme);
}
void MwCXX::Base::SetDarkTheme( value) {
MwSetVoid(this->widget, MwNdarkTheme, ()value);
}
int MwCXX::Base::GetFixedSize() {
return (int)MwGetInteger(this->widget, MwNfixedSize);
}
void MwCXX::Base::SetFixedSize(int value) {
MwSetInteger(this->widget, MwNfixedSize, (int)value);
}
MwCXX::Base::GetFocusIn() {
return ()MwGetVoid(this->widget, MwNfocusIn);
}
void MwCXX::Base::SetFocusIn( value) {
MwSetVoid(this->widget, MwNfocusIn, ()value);
}
MwCXX::Base::GetFocusOut() {
return ()MwGetVoid(this->widget, MwNfocusOut);
}
void MwCXX::Base::SetFocusOut( value) {
MwSetVoid(this->widget, MwNfocusOut, ()value);
}
int MwCXX::Base::GetForceInverted() {
return (int)MwGetInteger(this->widget, MwNforceInverted);
}
void MwCXX::Base::SetForceInverted(int value) {
MwSetInteger(this->widget, MwNforceInverted, (int)value);
}
MwCXX::String MwCXX::Base::GetForeground() {
return (MwCXX::String)MwGetText(this->widget, MwNforeground);
}
void MwCXX::Base::SetForeground(MwCXX::String value) {
#ifndef MWCXX_USE_C_STRING
MwSetText(this->widget, MwNforeground, value.c_str());
#else
MwSetText(this->widget, MwNforeground, (MwCXX::String)value);
#endif
}
int MwCXX::Base::GetHeight() {
return (int)MwGetInteger(this->widget, MwNheight);
}
void MwCXX::Base::SetHeight(int value) {
MwSetInteger(this->widget, MwNheight, (int)value);
}
int MwCXX::Base::GetIsRounded() {
return (int)MwGetInteger(this->widget, MwNisRounded);
}
void MwCXX::Base::SetIsRounded(int value) {
MwSetInteger(this->widget, MwNisRounded, (int)value);
}
MwCXX::Base::GetKey() {
return ()MwGetVoid(this->widget, MwNkey);
}
void MwCXX::Base::SetKey( value) {
MwSetVoid(this->widget, MwNkey, ()value);
}
MwCXX::Base::GetKeyRelease() {
return ()MwGetVoid(this->widget, MwNkeyRelease);
}
void MwCXX::Base::SetKeyRelease( value) {
MwSetVoid(this->widget, MwNkeyRelease, ()value);
}
int MwCXX::Base::GetModernLook() {
return (int)MwGetInteger(this->widget, MwNmodernLook);
}
void MwCXX::Base::SetModernLook(int value) {
MwSetInteger(this->widget, MwNmodernLook, (int)value);
}
MwCXX::Base::GetMouseDown() {
return ()MwGetVoid(this->widget, MwNmouseDown);
}
void MwCXX::Base::SetMouseDown( value) {
MwSetVoid(this->widget, MwNmouseDown, ()value);
}
MwCXX::Base::GetMouseMove() {
return ()MwGetVoid(this->widget, MwNmouseMove);
}
void MwCXX::Base::SetMouseMove( value) {
MwSetVoid(this->widget, MwNmouseMove, ()value);
}
MwCXX::Base::GetMouseUp() {
return ()MwGetVoid(this->widget, MwNmouseUp);
}
void MwCXX::Base::SetMouseUp( value) {
MwSetVoid(this->widget, MwNmouseUp, ()value);
}
int MwCXX::Base::GetRatio() {
return (int)MwGetInteger(this->widget, MwNratio);
}
void MwCXX::Base::SetRatio(int value) {
MwSetInteger(this->widget, MwNratio, (int)value);
}
MwCXX::Base::GetResize() {
return ()MwGetVoid(this->widget, MwNresize);
}
void MwCXX::Base::SetResize( value) {
MwSetVoid(this->widget, MwNresize, ()value);
}
MwCXX::String MwCXX::Base::GetSubBackground() {
return (MwCXX::String)MwGetText(this->widget, MwNsubBackground);
}
void MwCXX::Base::SetSubBackground(MwCXX::String value) {
#ifndef MWCXX_USE_C_STRING
MwSetText(this->widget, MwNsubBackground, value.c_str());
#else
MwSetText(this->widget, MwNsubBackground, (MwCXX::String)value);
#endif
}
MwCXX::String MwCXX::Base::GetSubForeground() {
return (MwCXX::String)MwGetText(this->widget, MwNsubForeground);
}
void MwCXX::Base::SetSubForeground(MwCXX::String value) {
#ifndef MWCXX_USE_C_STRING
MwSetText(this->widget, MwNsubForeground, value.c_str());
#else
MwSetText(this->widget, MwNsubForeground, (MwCXX::String)value);
#endif
}
MwCXX::Base::GetTick() {
return ()MwGetVoid(this->widget, MwNtick);
}
void MwCXX::Base::SetTick( value) {
MwSetVoid(this->widget, MwNtick, ()value);
}
int MwCXX::Base::GetUseMonospace() {
return (int)MwGetInteger(this->widget, MwNuseMonospace);
}
void MwCXX::Base::SetUseMonospace(int value) {
MwSetInteger(this->widget, MwNuseMonospace, (int)value);
}
int MwCXX::Base::GetWaitMS() {
return (int)MwGetInteger(this->widget, MwNwaitMS);
}
void MwCXX::Base::SetWaitMS(int value) {
MwSetInteger(this->widget, MwNwaitMS, (int)value);
}
int MwCXX::Base::GetWidth() {
return (int)MwGetInteger(this->widget, MwNwidth);
}
void MwCXX::Base::SetWidth(int value) {
MwSetInteger(this->widget, MwNwidth, (int)value);
}
int MwCXX::Base::GetX() {
return (int)MwGetInteger(this->widget, MwNx);
}
void MwCXX::Base::SetX(int value) {
MwSetInteger(this->widget, MwNx, (int)value);
}
int MwCXX::Base::GetY() {
return (int)MwGetInteger(this->widget, MwNy);
}
void MwCXX::Base::SetY(int value) {
MwSetInteger(this->widget, MwNy, (int)value);
}

48
src/widget/box.cxx Normal file
View file

@ -0,0 +1,48 @@
#include <MwCXX/Widget/Box.h>
MwCXX::Box::Box(MwWidget widget) : MwCXX::Base(widget) {
}
MwCXX::Box::Box(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height) : MwCXX::Base(MwBoxClass, name, parent, x, y, width, height) {
}
int MwCXX::Box::GetOrientation() {
return (int)MwGetInteger(this->widget, MwNorientation);
}
void MwCXX::Box::SetOrientation(int value) {
MwSetInteger(this->widget, MwNorientation, (int)value);
}
int MwCXX::Box::GetMargin() {
return (int)MwGetInteger(this->widget, MwNmargin);
}
void MwCXX::Box::SetMargin(int value) {
MwSetInteger(this->widget, MwNmargin, (int)value);
}
int MwCXX::Box::GetPadding() {
return (int)MwGetInteger(this->widget, MwNpadding);
}
void MwCXX::Box::SetPadding(int value) {
MwSetInteger(this->widget, MwNpadding, (int)value);
}
int MwCXX::Box::GetHasBorder() {
return (int)MwGetInteger(this->widget, MwNhasBorder);
}
void MwCXX::Box::SetHasBorder(int value) {
MwSetInteger(this->widget, MwNhasBorder, (int)value);
}
int MwCXX::Box::GetInverted() {
return (int)MwGetInteger(this->widget, MwNinverted);
}
void MwCXX::Box::SetInverted(int value) {
MwSetInteger(this->widget, MwNinverted, (int)value);
}

52
src/widget/button.cxx Normal file
View file

@ -0,0 +1,52 @@
#include <MwCXX/Widget/Button.h>
MwCXX::Button::Button(MwWidget widget) : MwCXX::Base(widget) {
}
MwCXX::Button::Button(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height) : MwCXX::Base(MwButtonClass, name, parent, x, y, width, height) {
}
MwLLPixmap MwCXX::Button::GetPixmap() {
return (MwLLPixmap)MwGetVoid(this->widget, MwNpixmap);
}
void MwCXX::Button::SetPixmap(MwLLPixmap value) {
MwSetVoid(this->widget, MwNpixmap, (MwLLPixmap)value);
}
MwCXX::String MwCXX::Button::GetText() {
return (MwCXX::String)MwGetText(this->widget, MwNtext);
}
void MwCXX::Button::SetText(MwCXX::String value) {
#ifndef MWCXX_USE_C_STRING
MwSetText(this->widget, MwNtext, value.c_str());
#else
MwSetText(this->widget, MwNtext, (MwCXX::String)value);
#endif
}
int MwCXX::Button::GetFlat() {
return (int)MwGetInteger(this->widget, MwNflat);
}
void MwCXX::Button::SetFlat(int value) {
MwSetInteger(this->widget, MwNflat, (int)value);
}
int MwCXX::Button::GetPadding() {
return (int)MwGetInteger(this->widget, MwNpadding);
}
void MwCXX::Button::SetPadding(int value) {
MwSetInteger(this->widget, MwNpadding, (int)value);
}
int MwCXX::Button::GetFillArea() {
return (int)MwGetInteger(this->widget, MwNfillArea);
}
void MwCXX::Button::SetFillArea(int value) {
MwSetInteger(this->widget, MwNfillArea, (int)value);
}

16
src/widget/checkbox.cxx Normal file
View file

@ -0,0 +1,16 @@
#include <MwCXX/Widget/CheckBox.h>
MwCXX::CheckBox::CheckBox(MwWidget widget) : MwCXX::Base(widget) {
}
MwCXX::CheckBox::CheckBox(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height) : MwCXX::Base(MwCheckBoxClass, name, parent, x, y, width, height) {
}
int MwCXX::CheckBox::GetChecked() {
return (int)MwGetInteger(this->widget, MwNchecked);
}
void MwCXX::CheckBox::SetChecked(int value) {
MwSetInteger(this->widget, MwNchecked, (int)value);
}

24
src/widget/combobox.cxx Normal file
View file

@ -0,0 +1,24 @@
#include <MwCXX/Widget/ComboBox.h>
MwCXX::ComboBox::ComboBox(MwWidget widget) : MwCXX::Base(widget) {
}
MwCXX::ComboBox::ComboBox(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height) : MwCXX::Base(MwComboBoxClass, name, parent, x, y, width, height) {
}
int MwCXX::ComboBox::GetAreaShown() {
return (int)MwGetInteger(this->widget, MwNareaShown);
}
void MwCXX::ComboBox::SetAreaShown(int value) {
MwSetInteger(this->widget, MwNareaShown, (int)value);
}
int MwCXX::ComboBox::GetValue() {
return (int)MwGetInteger(this->widget, MwNvalue);
}
void MwCXX::ComboBox::SetValue(int value) {
MwSetInteger(this->widget, MwNvalue, (int)value);
}

28
src/widget/entry.cxx Normal file
View file

@ -0,0 +1,28 @@
#include <MwCXX/Widget/Entry.h>
MwCXX::Entry::Entry(MwWidget widget) : MwCXX::Base(widget) {
}
MwCXX::Entry::Entry(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height) : MwCXX::Base(MwEntryClass, name, parent, x, y, width, height) {
}
MwCXX::String MwCXX::Entry::GetText() {
return (MwCXX::String)MwGetText(this->widget, MwNtext);
}
void MwCXX::Entry::SetText(MwCXX::String value) {
#ifndef MWCXX_USE_C_STRING
MwSetText(this->widget, MwNtext, value.c_str());
#else
MwSetText(this->widget, MwNtext, (MwCXX::String)value);
#endif
}
int MwCXX::Entry::GetHideInput() {
return (int)MwGetInteger(this->widget, MwNhideInput);
}
void MwCXX::Entry::SetHideInput(int value) {
MwSetInteger(this->widget, MwNhideInput, (int)value);
}

24
src/widget/frame.cxx Normal file
View file

@ -0,0 +1,24 @@
#include <MwCXX/Widget/Frame.h>
MwCXX::Frame::Frame(MwWidget widget) : MwCXX::Base(widget) {
}
MwCXX::Frame::Frame(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height) : MwCXX::Base(MwFrameClass, name, parent, x, y, width, height) {
}
int MwCXX::Frame::GetHasBorder() {
return (int)MwGetInteger(this->widget, MwNhasBorder);
}
void MwCXX::Frame::SetHasBorder(int value) {
MwSetInteger(this->widget, MwNhasBorder, (int)value);
}
int MwCXX::Frame::GetInverted() {
return (int)MwGetInteger(this->widget, MwNinverted);
}
void MwCXX::Frame::SetInverted(int value) {
MwSetInteger(this->widget, MwNinverted, (int)value);
}

40
src/widget/image.cxx Normal file
View file

@ -0,0 +1,40 @@
#include <MwCXX/Widget/Image.h>
MwCXX::Image::Image(MwWidget widget) : MwCXX::Base(widget) {
}
MwCXX::Image::Image(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height) : MwCXX::Base(MwImageClass, name, parent, x, y, width, height) {
}
MwLLPixmap MwCXX::Image::GetPixmap() {
return (MwLLPixmap)MwGetVoid(this->widget, MwNpixmap);
}
void MwCXX::Image::SetPixmap(MwLLPixmap value) {
MwSetVoid(this->widget, MwNpixmap, (MwLLPixmap)value);
}
int MwCXX::Image::GetHasBorder() {
return (int)MwGetInteger(this->widget, MwNhasBorder);
}
void MwCXX::Image::SetHasBorder(int value) {
MwSetInteger(this->widget, MwNhasBorder, (int)value);
}
int MwCXX::Image::GetInverted() {
return (int)MwGetInteger(this->widget, MwNinverted);
}
void MwCXX::Image::SetInverted(int value) {
MwSetInteger(this->widget, MwNinverted, (int)value);
}
int MwCXX::Image::GetFillArea() {
return (int)MwGetInteger(this->widget, MwNfillArea);
}
void MwCXX::Image::SetFillArea(int value) {
MwSetInteger(this->widget, MwNfillArea, (int)value);
}

60
src/widget/label.cxx Normal file
View file

@ -0,0 +1,60 @@
#include <MwCXX/Widget/Label.h>
MwCXX::Label::Label(MwWidget widget) : MwCXX::Base(widget) {
}
MwCXX::Label::Label(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height) : MwCXX::Base(MwLabelClass, name, parent, x, y, width, height) {
}
MwCXX::String MwCXX::Label::GetText() {
return (MwCXX::String)MwGetText(this->widget, MwNtext);
}
void MwCXX::Label::SetText(MwCXX::String value) {
#ifndef MWCXX_USE_C_STRING
MwSetText(this->widget, MwNtext, value.c_str());
#else
MwSetText(this->widget, MwNtext, (MwCXX::String)value);
#endif
}
int MwCXX::Label::GetAlignment() {
return (int)MwGetInteger(this->widget, MwNalignment);
}
void MwCXX::Label::SetAlignment(int value) {
MwSetInteger(this->widget, MwNalignment, (int)value);
}
int MwCXX::Label::GetBold() {
return (int)MwGetInteger(this->widget, MwNbold);
}
void MwCXX::Label::SetBold(int value) {
MwSetInteger(this->widget, MwNbold, (int)value);
}
int MwCXX::Label::GetSevenSegment() {
return (int)MwGetInteger(this->widget, MwNsevenSegment);
}
void MwCXX::Label::SetSevenSegment(int value) {
MwSetInteger(this->widget, MwNsevenSegment, (int)value);
}
int MwCXX::Label::GetLength() {
return (int)MwGetInteger(this->widget, MwNlength);
}
void MwCXX::Label::SetLength(int value) {
MwSetInteger(this->widget, MwNlength, (int)value);
}
int MwCXX::Label::GetLeftPadding() {
return (int)MwGetInteger(this->widget, MwNleftPadding);
}
void MwCXX::Label::SetLeftPadding(int value) {
MwSetInteger(this->widget, MwNleftPadding, (int)value);
}

32
src/widget/listbox.cxx Normal file
View file

@ -0,0 +1,32 @@
#include <MwCXX/Widget/ListBox.h>
MwCXX::ListBox::ListBox(MwWidget widget) : MwCXX::Base(widget) {
}
MwCXX::ListBox::ListBox(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height) : MwCXX::Base(MwListBoxClass, name, parent, x, y, width, height) {
}
int MwCXX::ListBox::GetLeftPadding() {
return (int)MwGetInteger(this->widget, MwNleftPadding);
}
void MwCXX::ListBox::SetLeftPadding(int value) {
MwSetInteger(this->widget, MwNleftPadding, (int)value);
}
int MwCXX::ListBox::GetHasHeading() {
return (int)MwGetInteger(this->widget, MwNhasHeading);
}
void MwCXX::ListBox::SetHasHeading(int value) {
MwSetInteger(this->widget, MwNhasHeading, (int)value);
}
int MwCXX::ListBox::GetSingleClickSelectable() {
return (int)MwGetInteger(this->widget, MwNsingleClickSelectable);
}
void MwCXX::ListBox::SetSingleClickSelectable(int value) {
MwSetInteger(this->widget, MwNsingleClickSelectable, (int)value);
}

8
src/widget/menu.cxx Normal file
View file

@ -0,0 +1,8 @@
#include <MwCXX/Widget/Menu.h>
MwCXX::Menu::Menu(MwWidget widget) : MwCXX::Base(widget) {
}
MwCXX::Menu::Menu(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height) : MwCXX::Base(MwMenuClass, name, parent, x, y, width, height) {
}

View file

@ -0,0 +1,20 @@
#include <MwCXX/Widget/NumberEntry.h>
MwCXX::NumberEntry::NumberEntry(MwWidget widget) : MwCXX::Base(widget) {
}
MwCXX::NumberEntry::NumberEntry(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height) : MwCXX::Base(MwNumberEntryClass, name, parent, x, y, width, height) {
}
MwCXX::String MwCXX::NumberEntry::GetText() {
return (MwCXX::String)MwGetText(this->widget, MwNtext);
}
void MwCXX::NumberEntry::SetText(MwCXX::String value) {
#ifndef MWCXX_USE_C_STRING
MwSetText(this->widget, MwNtext, value.c_str());
#else
MwSetText(this->widget, MwNtext, (MwCXX::String)value);
#endif
}

9
src/widget/opengl.cxx Normal file
View file

@ -0,0 +1,9 @@
#define MW_OPENGL_NO_INCLUDE
#include <MwCXX/Widget/OpenGL.h>
MwCXX::OpenGL::OpenGL(MwWidget widget) : MwCXX::Base(widget) {
}
MwCXX::OpenGL::OpenGL(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height) : MwCXX::Base(MwOpenGLClass, name, parent, x, y, width, height) {
}

View file

@ -0,0 +1,32 @@
#include <MwCXX/Widget/ProgressBar.h>
MwCXX::ProgressBar::ProgressBar(MwWidget widget) : MwCXX::Base(widget) {
}
MwCXX::ProgressBar::ProgressBar(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height) : MwCXX::Base(MwProgressBarClass, name, parent, x, y, width, height) {
}
int MwCXX::ProgressBar::GetMinValue() {
return (int)MwGetInteger(this->widget, MwNminValue);
}
void MwCXX::ProgressBar::SetMinValue(int value) {
MwSetInteger(this->widget, MwNminValue, (int)value);
}
int MwCXX::ProgressBar::GetMaxValue() {
return (int)MwGetInteger(this->widget, MwNmaxValue);
}
void MwCXX::ProgressBar::SetMaxValue(int value) {
MwSetInteger(this->widget, MwNmaxValue, (int)value);
}
int MwCXX::ProgressBar::GetValue() {
return (int)MwGetInteger(this->widget, MwNvalue);
}
void MwCXX::ProgressBar::SetValue(int value) {
MwSetInteger(this->widget, MwNvalue, (int)value);
}

16
src/widget/radiobox.cxx Normal file
View file

@ -0,0 +1,16 @@
#include <MwCXX/Widget/RadioBox.h>
MwCXX::RadioBox::RadioBox(MwWidget widget) : MwCXX::Base(widget) {
}
MwCXX::RadioBox::RadioBox(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height) : MwCXX::Base(MwRadioBoxClass, name, parent, x, y, width, height) {
}
int MwCXX::RadioBox::GetChecked() {
return (int)MwGetInteger(this->widget, MwNchecked);
}
void MwCXX::RadioBox::SetChecked(int value) {
MwSetInteger(this->widget, MwNchecked, (int)value);
}

56
src/widget/scrollbar.cxx Normal file
View file

@ -0,0 +1,56 @@
#include <MwCXX/Widget/ScrollBar.h>
MwCXX::ScrollBar::ScrollBar(MwWidget widget) : MwCXX::Base(widget) {
}
MwCXX::ScrollBar::ScrollBar(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height) : MwCXX::Base(MwScrollBarClass, name, parent, x, y, width, height) {
}
int MwCXX::ScrollBar::GetShowArrows() {
return (int)MwGetInteger(this->widget, MwNshowArrows);
}
void MwCXX::ScrollBar::SetShowArrows(int value) {
MwSetInteger(this->widget, MwNshowArrows, (int)value);
}
int MwCXX::ScrollBar::GetAreaShown() {
return (int)MwGetInteger(this->widget, MwNareaShown);
}
void MwCXX::ScrollBar::SetAreaShown(int value) {
MwSetInteger(this->widget, MwNareaShown, (int)value);
}
int MwCXX::ScrollBar::GetValue() {
return (int)MwGetInteger(this->widget, MwNvalue);
}
void MwCXX::ScrollBar::SetValue(int value) {
MwSetInteger(this->widget, MwNvalue, (int)value);
}
int MwCXX::ScrollBar::GetMinValue() {
return (int)MwGetInteger(this->widget, MwNminValue);
}
void MwCXX::ScrollBar::SetMinValue(int value) {
MwSetInteger(this->widget, MwNminValue, (int)value);
}
int MwCXX::ScrollBar::GetMaxValue() {
return (int)MwGetInteger(this->widget, MwNmaxValue);
}
void MwCXX::ScrollBar::SetMaxValue(int value) {
MwSetInteger(this->widget, MwNmaxValue, (int)value);
}
int MwCXX::ScrollBar::GetOrientation() {
return (int)MwGetInteger(this->widget, MwNorientation);
}
void MwCXX::ScrollBar::SetOrientation(int value) {
MwSetInteger(this->widget, MwNorientation, (int)value);
}

16
src/widget/submenu.cxx Normal file
View file

@ -0,0 +1,16 @@
#include <MwCXX/Widget/SubMenu.h>
MwCXX::SubMenu::SubMenu(MwWidget widget) : MwCXX::Base(widget) {
}
MwCXX::SubMenu::SubMenu(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height) : MwCXX::Base(MwSubMenuClass, name, parent, x, y, width, height) {
}
int MwCXX::SubMenu::GetLeftPadding() {
return (int)MwGetInteger(this->widget, MwNleftPadding);
}
void MwCXX::SubMenu::SetLeftPadding(int value) {
MwSetInteger(this->widget, MwNleftPadding, (int)value);
}

24
src/widget/treeview.cxx Normal file
View file

@ -0,0 +1,24 @@
#include <MwCXX/Widget/TreeView.h>
MwCXX::TreeView::TreeView(MwWidget widget) : MwCXX::Base(widget) {
}
MwCXX::TreeView::TreeView(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height) : MwCXX::Base(MwTreeViewClass, name, parent, x, y, width, height) {
}
int MwCXX::TreeView::GetLeftPadding() {
return (int)MwGetInteger(this->widget, MwNleftPadding);
}
void MwCXX::TreeView::SetLeftPadding(int value) {
MwSetInteger(this->widget, MwNleftPadding, (int)value);
}
int MwCXX::TreeView::GetSingleClickSelectable() {
return (int)MwGetInteger(this->widget, MwNsingleClickSelectable);
}
void MwCXX::TreeView::SetSingleClickSelectable(int value) {
MwSetInteger(this->widget, MwNsingleClickSelectable, (int)value);
}

8
src/widget/viewport.cxx Normal file
View file

@ -0,0 +1,8 @@
#include <MwCXX/Widget/Viewport.h>
MwCXX::Viewport::Viewport(MwWidget widget) : MwCXX::Base(widget) {
}
MwCXX::Viewport::Viewport(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height) : MwCXX::Base(MwViewportClass, name, parent, x, y, width, height) {
}

9
src/widget/vulkan.cxx Normal file
View file

@ -0,0 +1,9 @@
#define MW_VULKAN_NO_INCLUDE
#include <MwCXX/Widget/Vulkan.h>
MwCXX::Vulkan::Vulkan(MwWidget widget) : MwCXX::Base(widget) {
}
MwCXX::Vulkan::Vulkan(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height) : MwCXX::Base(MwVulkanClass, name, parent, x, y, width, height) {
}

60
src/widget/window.cxx Normal file
View file

@ -0,0 +1,60 @@
#include <MwCXX/Widget/Window.h>
MwCXX::Window::Window(MwWidget widget) : MwCXX::Base(widget) {
}
MwCXX::Window::Window(MwCXX::String name, MwCXX::Base* parent, int x, int y, unsigned int width, unsigned int height) : MwCXX::Base(MwWindowClass, name, parent, x, y, width, height) {
}
MwCXX::String MwCXX::Window::GetTitle() {
return (MwCXX::String)MwGetText(this->widget, MwNtitle);
}
void MwCXX::Window::SetTitle(MwCXX::String value) {
#ifndef MWCXX_USE_C_STRING
MwSetText(this->widget, MwNtitle, value.c_str());
#else
MwSetText(this->widget, MwNtitle, (MwCXX::String)value);
#endif
}
int MwCXX::Window::GetMain() {
return (int)MwGetInteger(this->widget, MwNmain);
}
void MwCXX::Window::SetMain(int value) {
MwSetInteger(this->widget, MwNmain, (int)value);
}
MwLLPixmap MwCXX::Window::GetIconPixmap() {
return (MwLLPixmap)MwGetVoid(this->widget, MwNiconPixmap);
}
void MwCXX::Window::SetIconPixmap(MwLLPixmap value) {
MwSetVoid(this->widget, MwNiconPixmap, (MwLLPixmap)value);
}
MwSizeHints* MwCXX::Window::GetSizeHints() {
return (MwSizeHints*)MwGetVoid(this->widget, MwNsizeHints);
}
void MwCXX::Window::SetSizeHints(MwSizeHints* value) {
MwSetVoid(this->widget, MwNsizeHints, (MwSizeHints*)value);
}
int MwCXX::Window::GetHasBorder() {
return (int)MwGetInteger(this->widget, MwNhasBorder);
}
void MwCXX::Window::SetHasBorder(int value) {
MwSetInteger(this->widget, MwNhasBorder, (int)value);
}
int MwCXX::Window::GetInverted() {
return (int)MwGetInteger(this->widget, MwNinverted);
}
void MwCXX::Window::SetInverted(int value) {
MwSetInteger(this->widget, MwNinverted, (int)value);
}

37
test.cxx Normal file
View file

@ -0,0 +1,37 @@
#include <MwCXX/Core.h>
#include <MwCXX/Widget/Window.h>
#include <MwCXX/Widget/Button.h>
#include <iostream>
class MyButton : public MwCXX::Button {
protected:
void OnActivate() {
std::cout << "Hello" << std::endl;
}
public:
MWCXX_CONSTRUCTOR(MyButton, MwCXX::Button) {
this->SetText("Hello, world!");
}
};
class MyWindow : public MwCXX::Window {
private:
MyButton* epic;
public:
MWCXX_CONSTRUCTOR(MyWindow, MwCXX::Window) {
this->epic = new MyButton("epic app", this, 10, 10, 640 - 10 * 2, 480 - 10 * 2);
}
};
int main() {
MyWindow* wnd;
MwCXX::Init();
wnd = new MyWindow("epic app", NULL, MwDEFAULT, MwDEFAULT, 640, 480);
wnd->Loop();
}