Unfinished Wayland PR #1
4 changed files with 10 additions and 12 deletions
revert some leaks into other code files
commit
71aac9987c
|
|
@ -5,10 +5,10 @@ int main() {
|
||||||
MwWidget window;
|
MwWidget window;
|
||||||
|
|
||||||
MwLibraryInit();
|
MwLibraryInit();
|
||||||
|
|
||||||
window = MwVaCreateWidget(MwWindowClass, "test", NULL, MwDEFAULT, MwDEFAULT, 8 + 16 + 8 + 16 * 10 + 8, 8 + 16 + 8 + 16 + 8,
|
window = MwVaCreateWidget(MwWindowClass, "test", NULL, MwDEFAULT, MwDEFAULT, 8 + 16 + 8 + 16 * 10 + 8, 8 + 16 + 8 + 16 + 8,
|
||||||
MwNtitle, "checkbox",
|
MwNtitle, "checkbox",
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
MwVaCreateWidget(MwCheckBoxClass, "cb1", window, 8, 8, 16, 16,
|
MwVaCreateWidget(MwCheckBoxClass, "cb1", window, 8, 8, 16, 16,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
|
||||||
|
|
@ -56,13 +56,13 @@ void resize(MwWidget w, void* user, void* client) {
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
MwWidget window;
|
MwWidget window;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
MwLibraryInit();
|
MwLibraryInit();
|
||||||
|
|
||||||
window = MwVaCreateWidget(MwWindowClass, "window", NULL, MwDEFAULT, MwDEFAULT, (ww = 500), (wh = 500),
|
window = MwVaCreateWidget(MwWindowClass, "window", NULL, MwDEFAULT, MwDEFAULT, (ww = 500), (wh = 500),
|
||||||
MwNtitle, "rotate",
|
MwNtitle, "rotate",
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
for(i = 0; i < (int)(sizeof(buttons) / sizeof(buttons[0])); i++) {
|
for(i = 0; i < (int)(sizeof(buttons) / sizeof(buttons[0])); i++) {
|
||||||
const char* color = "";
|
const char* color = "";
|
||||||
|
|
|
||||||
|
|
@ -34,8 +34,6 @@ struct _MwLLCommon {
|
||||||
void* user;
|
void* user;
|
||||||
int copy_buffer;
|
int copy_buffer;
|
||||||
int type;
|
int type;
|
||||||
int success;
|
|
||||||
int do_redraw;
|
|
||||||
|
|
||||||
MwLLHandler handler;
|
MwLLHandler handler;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <poll.h>
|
#include <poll.h>
|
||||||
|
#include <signal.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
@ -468,7 +469,7 @@ static void setup_toplevel(MwLL r, int x, int y) {
|
||||||
r->wayland.display = wl_display_connect(NULL);
|
r->wayland.display = wl_display_connect(NULL);
|
||||||
if(r->wayland.display == NULL) {
|
if(r->wayland.display == NULL) {
|
||||||
printf("wayland: failed to create display\n");
|
printf("wayland: failed to create display\n");
|
||||||
r->common.success = MwFALSE;
|
raise(SIGTRAP);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -477,7 +478,7 @@ static void setup_toplevel(MwLL r, int x, int y) {
|
||||||
wl_registry_add_listener(r->wayland.registry, &r->wayland.registry_listener, r);
|
wl_registry_add_listener(r->wayland.registry, &r->wayland.registry_listener, r);
|
||||||
if(wl_display_roundtrip(r->wayland.display) == -1) {
|
if(wl_display_roundtrip(r->wayland.display) == -1) {
|
||||||
printf("roundtrip failed\n");
|
printf("roundtrip failed\n");
|
||||||
r->common.success = MwFALSE;
|
raise(SIGTRAP);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -488,7 +489,7 @@ static void setup_toplevel(MwLL r, int x, int y) {
|
||||||
WAYLAND_GET_INTERFACE(r->wayland, wl_seat)->context == NULL) {
|
WAYLAND_GET_INTERFACE(r->wayland, wl_seat)->context == NULL) {
|
||||||
|
|
||||||
printf("no wl_shm, wl_compositor, wl_seat, or xdg_wm_base support\n");
|
printf("no wl_shm, wl_compositor, wl_seat, or xdg_wm_base support\n");
|
||||||
r->common.success = MwFALSE;
|
raise(SIGTRAP);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -625,7 +626,6 @@ static MwLL MwLLCreateImpl(MwLL parent, int x, int y, int width, int height) {
|
||||||
r->wayland.parent = parent;
|
r->wayland.parent = parent;
|
||||||
|
|
||||||
r->wayland.force_redraw = MwFALSE;
|
r->wayland.force_redraw = MwFALSE;
|
||||||
r->common.success = MwTRUE;
|
|
||||||
r->wayland.subwidgets = NULL;
|
r->wayland.subwidgets = NULL;
|
||||||
|
|
||||||
if(parent == NULL) {
|
if(parent == NULL) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue