implement MwLLGetClipboard for X11
All checks were successful
pyrite-dev/milsko/pipeline/head This commit looks good

This commit is contained in:
Nishi 2026-03-27 14:40:07 +09:00
commit f1c4a12cf3
Signed by: nishi
GPG key ID: 27EF69B208EB9343
12 changed files with 144 additions and 35 deletions

View file

@ -2,7 +2,7 @@
MwWidget window, instructions, text;
void resize(MwWidget handle, void* user_data, void* call_data) {
static void resize(MwWidget handle, void* user_data, void* call_data) {
unsigned int w, h;
(void)user_data;
@ -23,7 +23,7 @@ void resize(MwWidget handle, void* user_data, void* call_data) {
MwNheight, h - 125 - 50 * 3,
NULL);
}
void clipboard(MwWidget handle, void* user_data, void* call_data) {
static void clipboard(MwWidget handle, void* user_data, void* call_data) {
char* clipboard = call_data;
(void)handle;
@ -36,6 +36,10 @@ void clipboard(MwWidget handle, void* user_data, void* call_data) {
MwForceRender(window);
}
static void tick(MwWidget handle, void* user_data, void* call_data) {
MwGetClipboard(handle);
}
int main() {
MwLibraryInit();
@ -53,6 +57,7 @@ int main() {
MwAddUserHandler(window, MwNclipboardHandler, clipboard, NULL);
MwAddUserHandler(instructions, MwNclipboardHandler, clipboard, NULL);
MwAddUserHandler(text, MwNclipboardHandler, clipboard, NULL);
MwAddUserHandler(window, MwNtickHandler, tick, NULL);
resize(window, NULL, NULL);

View file

@ -16,8 +16,8 @@ void handler_theme(MwWidget handle, void* user_data, void* call_data) {
(void)call_data;
MwVaApply(window,
MwNdarkTheme, MwGetInteger(window, MwNdarkTheme) == 0 ? 1 : 0,
NULL);
MwNdarkTheme, MwGetInteger(window, MwNdarkTheme) == 0 ? 1 : 0,
NULL);
}
void handler_look(MwWidget handle, void* user_data, void* call_data) {
@ -26,8 +26,8 @@ void handler_look(MwWidget handle, void* user_data, void* call_data) {
(void)call_data;
MwVaApply(window,
MwNmodernLook, MwGetInteger(window, MwNmodernLook) == 0 ? 1 : 0,
NULL);
MwNmodernLook, MwGetInteger(window, MwNmodernLook) == 0 ? 1 : 0,
NULL);
}
void handler_font(MwWidget handle, void* user_data, void* call_data) {
@ -36,8 +36,8 @@ void handler_font(MwWidget handle, void* user_data, void* call_data) {
(void)call_data;
MwVaApply(window,
MwNbitmapFont, MwGetInteger(window, MwNbitmapFont) == 0 ? 1 : 0,
NULL);
MwNbitmapFont, MwGetInteger(window, MwNbitmapFont) == 0 ? 1 : 0,
NULL);
}
void resize(MwWidget handle, void* user_data, void* call_data) {