mirror of
https://gitea.nishi.boats/pyrite-dev/milsko
synced 2026-01-07 01:49:47 +00:00
add stuff
git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@207 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
@@ -8,6 +8,7 @@ namespace MwOO {
|
|||||||
class Menu : public MwOO::Base {
|
class Menu : public MwOO::Base {
|
||||||
public:
|
public:
|
||||||
Menu(const char* widget_name, MwOO::Base* parent, int x, int y, int w, int h);
|
Menu(const char* widget_name, MwOO::Base* parent, int x, int y, int w, int h);
|
||||||
|
MwMenu Add(MwMenu menu, const char* name);
|
||||||
};
|
};
|
||||||
} // namespace MwOO
|
} // namespace MwOO
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,9 @@ namespace MwOO {
|
|||||||
class OpenGL : public MwOO::Base {
|
class OpenGL : public MwOO::Base {
|
||||||
public:
|
public:
|
||||||
OpenGL(const char* widget_name, MwOO::Base* parent, int x, int y, int w, int h);
|
OpenGL(const char* widget_name, MwOO::Base* parent, int x, int y, int w, int h);
|
||||||
|
void MakeCurrent(void);
|
||||||
|
void* GetProcAddress(const char* name);
|
||||||
|
void SwapBuffer(void);
|
||||||
};
|
};
|
||||||
} // namespace MwOO
|
} // namespace MwOO
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ namespace MwOO {
|
|||||||
class ScrollBar : public MwOO::Base {
|
class ScrollBar : public MwOO::Base {
|
||||||
public:
|
public:
|
||||||
ScrollBar(const char* widget_name, MwOO::Base* parent, int x, int y, int w, int h);
|
ScrollBar(const char* widget_name, MwOO::Base* parent, int x, int y, int w, int h);
|
||||||
|
int GetVisibleLength(void);
|
||||||
void SetAreaShown(int value);
|
void SetAreaShown(int value);
|
||||||
int GetAreaShown(void);
|
int GetAreaShown(void);
|
||||||
void SetValue(int value);
|
void SetValue(int value);
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ namespace MwOO {
|
|||||||
class SubMenu : public MwOO::Base {
|
class SubMenu : public MwOO::Base {
|
||||||
public:
|
public:
|
||||||
SubMenu(const char* widget_name, MwOO::Base* parent, int x, int y, int w, int h);
|
SubMenu(const char* widget_name, MwOO::Base* parent, int x, int y, int w, int h);
|
||||||
|
void Appear(MwMenu menu, MwPoint* point);
|
||||||
};
|
};
|
||||||
} // namespace MwOO
|
} // namespace MwOO
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,11 @@ namespace MwOO {
|
|||||||
class Vulkan : public MwOO::Base {
|
class Vulkan : public MwOO::Base {
|
||||||
public:
|
public:
|
||||||
Vulkan(const char* widget_name, MwOO::Base* parent, int x, int y, int w, int h);
|
Vulkan(const char* widget_name, MwOO::Base* parent, int x, int y, int w, int h);
|
||||||
|
void EnableExtension(void);
|
||||||
|
void EnableLayer(void);
|
||||||
|
void Configure(void);
|
||||||
|
void* GetField(MwVulkanField field, MwErrorEnum* out);
|
||||||
|
VkBool32 Supported(void);
|
||||||
};
|
};
|
||||||
} // namespace MwOO
|
} // namespace MwOO
|
||||||
|
|
||||||
|
|||||||
@@ -5,3 +5,6 @@
|
|||||||
MwOO::Menu::Menu(const char* widget_name, MwOO::Base* parent, int x, int y, int w, int h) : MwOO::Base(MwMenuClass, widget_name, parent, x, y, w, h){
|
MwOO::Menu::Menu(const char* widget_name, MwOO::Base* parent, int x, int y, int w, int h) : MwOO::Base(MwMenuClass, widget_name, parent, x, y, w, h){
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MwMenu MwOO::Menu::Add(MwMenu menu, const char* name){
|
||||||
|
return MwMenuAdd(this->widget, menu, name);
|
||||||
|
}
|
||||||
|
|||||||
@@ -5,3 +5,12 @@
|
|||||||
MwOO::OpenGL::OpenGL(const char* widget_name, MwOO::Base* parent, int x, int y, int w, int h) : MwOO::Base(MwOpenGLClass, widget_name, parent, x, y, w, h){
|
MwOO::OpenGL::OpenGL(const char* widget_name, MwOO::Base* parent, int x, int y, int w, int h) : MwOO::Base(MwOpenGLClass, widget_name, parent, x, y, w, h){
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MwOO::OpenGL::MakeCurrent(void){
|
||||||
|
MwOpenGLMakeCurrent(this->widget);
|
||||||
|
}
|
||||||
|
void* MwOO::OpenGL::GetProcAddress(const char* name){
|
||||||
|
return MwOpenGLGetProcAddress(this->widget, name);
|
||||||
|
}
|
||||||
|
void MwOO::OpenGL::SwapBuffer(void){
|
||||||
|
MwOpenGLSwapBuffer(this->widget);
|
||||||
|
}
|
||||||
|
|||||||
@@ -5,6 +5,9 @@
|
|||||||
MwOO::ScrollBar::ScrollBar(const char* widget_name, MwOO::Base* parent, int x, int y, int w, int h) : MwOO::Base(MwScrollBarClass, widget_name, parent, x, y, w, h){
|
MwOO::ScrollBar::ScrollBar(const char* widget_name, MwOO::Base* parent, int x, int y, int w, int h) : MwOO::Base(MwScrollBarClass, widget_name, parent, x, y, w, h){
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int MwOO::ScrollBar::GetVisibleLength(void){
|
||||||
|
return MwScrollBarGetVisibleLength(this->widget);
|
||||||
|
}
|
||||||
void MwOO::ScrollBar::SetAreaShown(int value){
|
void MwOO::ScrollBar::SetAreaShown(int value){
|
||||||
MwSetInteger(this->widget, MwNareaShown, value);
|
MwSetInteger(this->widget, MwNareaShown, value);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,3 +5,6 @@
|
|||||||
MwOO::SubMenu::SubMenu(const char* widget_name, MwOO::Base* parent, int x, int y, int w, int h) : MwOO::Base(MwSubMenuClass, widget_name, parent, x, y, w, h){
|
MwOO::SubMenu::SubMenu(const char* widget_name, MwOO::Base* parent, int x, int y, int w, int h) : MwOO::Base(MwSubMenuClass, widget_name, parent, x, y, w, h){
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MwOO::SubMenu::Appear(MwMenu menu, MwPoint* point){
|
||||||
|
MwSubMenuAppear(this->widget, menu, point);
|
||||||
|
}
|
||||||
|
|||||||
@@ -5,3 +5,18 @@
|
|||||||
MwOO::Vulkan::Vulkan(const char* widget_name, MwOO::Base* parent, int x, int y, int w, int h) : MwOO::Base(MwVulkanClass, widget_name, parent, x, y, w, h){
|
MwOO::Vulkan::Vulkan(const char* widget_name, MwOO::Base* parent, int x, int y, int w, int h) : MwOO::Base(MwVulkanClass, widget_name, parent, x, y, w, h){
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MwOO::Vulkan::EnableExtension(void){
|
||||||
|
MwVulkanEnableExtension(this->widget);
|
||||||
|
}
|
||||||
|
void MwOO::Vulkan::EnableLayer(void){
|
||||||
|
MwVulkanEnableLayer(this->widget);
|
||||||
|
}
|
||||||
|
void MwOO::Vulkan::Configure(void){
|
||||||
|
MwVulkanConfigure(this->widget);
|
||||||
|
}
|
||||||
|
void* MwOO::Vulkan::GetField(MwVulkanField field, MwErrorEnum* out){
|
||||||
|
return MwVulkanGetField(this->widget, field, out);
|
||||||
|
}
|
||||||
|
VkBool32 MwOO::Vulkan::Supported(void){
|
||||||
|
return MwVulkanSupported(this->widget);
|
||||||
|
}
|
||||||
|
|||||||
@@ -46,6 +46,10 @@ foreach my $f (@files) {
|
|||||||
|
|
||||||
my $name = $1;
|
my $name = $1;
|
||||||
my @props = ();
|
my @props = ();
|
||||||
|
my @methods = ();
|
||||||
|
my @omethods = ();
|
||||||
|
my @names = ();
|
||||||
|
my @args = ();
|
||||||
|
|
||||||
open(IN, "include/Mw/Widget/$f");
|
open(IN, "include/Mw/Widget/$f");
|
||||||
while (my $l = <IN>) {
|
while (my $l = <IN>) {
|
||||||
@@ -54,6 +58,34 @@ foreach my $f (@files) {
|
|||||||
if ($l =~ /%prop[ \t]+(.+)$/) {
|
if ($l =~ /%prop[ \t]+(.+)$/) {
|
||||||
@props = split(/[ \t]+/, $1);
|
@props = split(/[ \t]+/, $1);
|
||||||
}
|
}
|
||||||
|
elsif ($l =~
|
||||||
|
/^MWDECL[ \t]+(.+)[ \t]+Mw${name}([^ \t]+)[ \t]*\([^,\)]+(?:,(.*))?\);$/
|
||||||
|
)
|
||||||
|
{
|
||||||
|
my $arg = $3;
|
||||||
|
my $ret = $1;
|
||||||
|
my $nam = $2;
|
||||||
|
|
||||||
|
$arg =~ s/^[ \t]+//;
|
||||||
|
$arg =~ s/[ \t]+$//;
|
||||||
|
|
||||||
|
if (!$arg) {
|
||||||
|
$arg = "void";
|
||||||
|
}
|
||||||
|
|
||||||
|
push(@methods, "$ret $nam($arg)");
|
||||||
|
push(@omethods, "$ret MwOO::${name}::$nam($arg)");
|
||||||
|
push(@names, $nam);
|
||||||
|
|
||||||
|
my @al = split(/[ \t]*,[ \t]*/, $arg);
|
||||||
|
my $i = 0;
|
||||||
|
foreach my $dummy (@al) {
|
||||||
|
$al[$i] =~ s/^.+[ \t]+([^ \t]+)$/\1/g;
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
|
||||||
|
push(@args, join(", ", @al));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
close(IN);
|
close(IN);
|
||||||
|
|
||||||
@@ -71,6 +103,10 @@ foreach my $f (@files) {
|
|||||||
" ${name}(const char* widget_name, MwOO::Base* parent, int x, int y, int w, int h);\n"
|
" ${name}(const char* widget_name, MwOO::Base* parent, int x, int y, int w, int h);\n"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
foreach my $m (@methods) {
|
||||||
|
print(OUT " $m;\n");
|
||||||
|
}
|
||||||
|
|
||||||
foreach my $prop (@props) {
|
foreach my $prop (@props) {
|
||||||
my $type = "";
|
my $type = "";
|
||||||
my %hash = ();
|
my %hash = ();
|
||||||
@@ -108,6 +144,24 @@ foreach my $f (@files) {
|
|||||||
print(OUT "}\n");
|
print(OUT "}\n");
|
||||||
print(OUT "\n");
|
print(OUT "\n");
|
||||||
|
|
||||||
|
my $i = 0;
|
||||||
|
foreach my $m (@omethods) {
|
||||||
|
print(OUT "$m\{\n");
|
||||||
|
if ($m =~ /^void[ \t]+/) {
|
||||||
|
print(OUT " Mw${name}" . $names[$i]);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
print(OUT " return Mw${name}" . $names[$i]);
|
||||||
|
}
|
||||||
|
if ($args[$i] eq "void") {
|
||||||
|
print(OUT "(this->widget);\n");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
print(OUT "(this->widget, " . $args[$i] . ");\n");
|
||||||
|
}
|
||||||
|
print(OUT "}\n");
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
foreach my $prop (@props) {
|
foreach my $prop (@props) {
|
||||||
my $type = "";
|
my $type = "";
|
||||||
my $typename = "";
|
my $typename = "";
|
||||||
|
|||||||
Reference in New Issue
Block a user