This commit is contained in:
parent
e618144fbc
commit
150581e716
6 changed files with 29 additions and 13 deletions
|
|
@ -126,6 +126,7 @@ static MwWidget frame(const char* name, int width, int height, MwClass cl, ...)
|
|||
|
||||
MwVaApply(f,
|
||||
"VhandledWidget", w,
|
||||
MwNratio, MwGetInteger(w, MwNratio),
|
||||
NULL);
|
||||
}
|
||||
|
||||
|
|
@ -305,6 +306,18 @@ int main() {
|
|||
f = frame("Separator", -PaddingContent, -PaddingContent, MwSeparatorClass, NULL);
|
||||
add(f);
|
||||
|
||||
#if 0
|
||||
f = frame("SubWindow", -PaddingContent, -PaddingContent, MwViewportClass,
|
||||
MwNratio, 3,
|
||||
NULL);
|
||||
w = child(f);
|
||||
MwViewportSetSize(w, 512, 512);
|
||||
MwVaCreateWidget(MwSubWindowClass, "swnd", MwViewportGetViewport(w), 0, 0, 512, 512,
|
||||
MwNtitle, "Sub window",
|
||||
NULL);
|
||||
add(f);
|
||||
#endif
|
||||
|
||||
f = frame("TreeView", -PaddingContent, -PaddingContent, MwTreeViewClass, NULL);
|
||||
w = child(f);
|
||||
v = MwTreeViewAdd(w, NULL, NULL, "abc");
|
||||
|
|
|
|||
|
|
@ -264,8 +264,8 @@ void vulkan_setup(MwWidget handle) {
|
|||
swapchainCreateInfo.imageExtent = (VkExtent2D){.width = ow, .height = oh},
|
||||
swapchainCreateInfo.imageArrayLayers = 1,
|
||||
swapchainCreateInfo.imageUsage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT |
|
||||
VK_IMAGE_USAGE_TRANSFER_DST_BIT |
|
||||
VK_IMAGE_USAGE_SAMPLED_BIT;
|
||||
VK_IMAGE_USAGE_TRANSFER_DST_BIT |
|
||||
VK_IMAGE_USAGE_SAMPLED_BIT;
|
||||
// th is how we specify no transformation.
|
||||
swapchainCreateInfo.preTransform = VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR;
|
||||
swapchainCreateInfo.compositeAlpha = VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR;
|
||||
|
|
|
|||
|
|
@ -141,7 +141,7 @@ struct _MwLLHaiku {
|
|||
MwApplication* app;
|
||||
MwView* view;
|
||||
thread_id app_thread;
|
||||
int force_render;
|
||||
int force_render;
|
||||
|
||||
MwLLHaikuEvent* events;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -2,7 +2,8 @@
|
|||
|
||||
#include "../../external/stb_ds.h"
|
||||
|
||||
MwApplication::MwApplication(MwRect rc, MwLL handle) : BApplication("application/milsko-generic") {
|
||||
MwApplication::MwApplication(MwRect rc, MwLL handle)
|
||||
: BApplication("application/milsko-generic") {
|
||||
BScreen* scr = new BScreen();
|
||||
float x = (scr->Frame().Width() - rc.width) / 2;
|
||||
float y = (scr->Frame().Height() - rc.height) / 2;
|
||||
|
|
@ -47,7 +48,8 @@ void MwApplication::MessageReceived(BMessage* message) {
|
|||
}
|
||||
}
|
||||
|
||||
MwView::MwView(MwLL handle, BRect frame, uint32 resizingMode, uint32 flags) : BView(frame, NULL, resizingMode, flags | B_FRAME_EVENTS) {
|
||||
MwView::MwView(MwLL handle, BRect frame, uint32 resizingMode, uint32 flags)
|
||||
: BView(frame, NULL, resizingMode, flags | B_FRAME_EVENTS) {
|
||||
this->handle = handle;
|
||||
|
||||
this->locker = new BLocker();
|
||||
|
|
@ -185,7 +187,7 @@ void MwView::MessageReceived(BMessage* message) {
|
|||
|
||||
void MwView::PostMessage(BMessage* message) {
|
||||
BMessage copy = *message;
|
||||
MwLL top = this->handle;
|
||||
MwLL top = this->handle;
|
||||
|
||||
while(top->haiku.parent != NULL) top = top->haiku.parent;
|
||||
|
||||
|
|
@ -307,7 +309,8 @@ void MwView::SetColor(MwLLColor color) {
|
|||
this->PostMessage(&msg);
|
||||
}
|
||||
|
||||
MwWindow::MwWindow(BRect frame, window_type type, uint32 flags) : BWindow(frame, "Milsko", type, flags) {
|
||||
MwWindow::MwWindow(BRect frame, window_type type, uint32 flags)
|
||||
: BWindow(frame, "Milsko", type, flags) {
|
||||
}
|
||||
|
||||
void MwWindow::MessageReceived(BMessage* message) {
|
||||
|
|
|
|||
|
|
@ -420,8 +420,8 @@ static void redrawIfNeeded(MwWidget handle, int row) {
|
|||
static int mwListBoxSetImpl(MwWidget handle, int row, int col, const char* text) {
|
||||
MwListBox lb = handle->internal;
|
||||
MwListBoxEntry entry;
|
||||
char* t = text == NULL ? NULL : MwStringDuplicate(text);
|
||||
int new = 0;
|
||||
char* t = text == NULL ? NULL : MwStringDuplicate(text);
|
||||
int new = 0;
|
||||
if(row == -1) row = arrlen(lb->list);
|
||||
|
||||
entry.name = NULL;
|
||||
|
|
@ -449,7 +449,7 @@ static int mwListBoxSetImpl(MwWidget handle, int row, int col, const char* text)
|
|||
static void mwListBoxSetIconImpl(MwWidget handle, int index, MwLLPixmap icon) {
|
||||
MwListBox lb = handle->internal;
|
||||
MwListBoxEntry entry;
|
||||
int new = 0;
|
||||
int new = 0;
|
||||
if(index == -1) index = arrlen(lb->list);
|
||||
|
||||
entry.name = NULL;
|
||||
|
|
|
|||
|
|
@ -58,9 +58,9 @@ static void draw(MwWidget handle) {
|
|||
MwLLColor base = MwParseColor(handle, MwGetText(handle, MwNbackground));
|
||||
MwLLColor dark = MwLightenColor(handle, base, -64, -64, -64);
|
||||
MwScrollBar scr = handle->internal;
|
||||
int or;
|
||||
int uy, dy, ux, dx;
|
||||
MwLLPixmap bgpx = MwGetVoid(handle, MwNbackgroundPixmap);
|
||||
int or ;
|
||||
int uy, dy, ux, dx;
|
||||
MwLLPixmap bgpx = MwGetVoid(handle, MwNbackgroundPixmap);
|
||||
|
||||
r.x = 0;
|
||||
r.y = 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue