rename clipboard_received to clipboard

This commit is contained in:
Nishi 2025-12-31 04:35:10 +09:00
commit 72820e87f1
Signed by: nishi
GPG key ID: 27EF69B208EB9343
28 changed files with 58 additions and 54 deletions

1
.gitignore vendored
View file

@ -5,6 +5,7 @@ examples/*/*.exe
!examples/*/ !examples/*/
!examples/*.* !examples/*.*
!examples/*/*.* !examples/*/*.*
*.exe
*.o *.o
*.so *.so
*.dll *.dll

View file

@ -147,7 +147,7 @@ struct _MwLLHandler {
void (*key_released)(MwLL handle, void* data); void (*key_released)(MwLL handle, void* data);
void (*focus_in)(MwLL handle, void* data); void (*focus_in)(MwLL handle, void* data);
void (*focus_out)(MwLL handle, void* data); void (*focus_out)(MwLL handle, void* data);
void (*clipboard_received)(MwLL handle, void* data); void (*clipboard)(MwLL handle, void* data);
}; };
#ifdef __cplusplus #ifdef __cplusplus

View file

@ -71,5 +71,6 @@
#define MwNdirectoryChosenHandler "CdirectoryChosen" /* char* */ #define MwNdirectoryChosenHandler "CdirectoryChosen" /* char* */
#define MwNcolorChosenHandler "CcolorChosen" /* MwRGB* */ #define MwNcolorChosenHandler "CcolorChosen" /* MwRGB* */
#define MwNdrawHandler "Cdraw" /* NULL */ #define MwNdrawHandler "Cdraw" /* NULL */
#define MwNclipboardHandler "Cclipboard" /* char* */
#endif #endif

View file

@ -212,7 +212,7 @@ struct _MwClass {
MwHandler resize; MwHandler resize;
MwHandler children_update; MwHandler children_update;
MwHandlerChildrenProp children_prop_change; MwHandlerChildrenProp children_prop_change;
MwHandlerClipboardReceived clipboard_received; MwHandlerClipboardReceived clipboard;
void* reserved1; void* reserved1;
void* reserved2; void* reserved2;
void* reserved3; void* reserved3;

View file

@ -122,6 +122,7 @@
<handler name="directoryChosen" /> <handler name="directoryChosen" />
<handler name="colorChosen" /> <handler name="colorChosen" />
<handler name="draw" /> <handler name="draw" />
<handler name="clipboard" />
</properties> </properties>
<enumerations> <enumerations>
<enumeration name="MwDIRECTION"> <enumeration name="MwDIRECTION">

View file

@ -404,7 +404,7 @@ static void MwLLNextEventImpl(MwLL handle) {
GlobalUnlock(hg); GlobalUnlock(hg);
CloseClipboard(); CloseClipboard();
MwLLDispatch(handle, clipboard_received, txt); MwLLDispatch(handle, clipboard, txt);
free(txt); free(txt);
} }

View file

@ -107,10 +107,11 @@ static void llfocusouthandler(MwLL handle, void* data) {
MwDispatchUserHandler(h, MwNfocusOutHandler, data); MwDispatchUserHandler(h, MwNfocusOutHandler, data);
} }
static void llclipboardreceivedhandler(MwLL handle, void* data) { static void llclipboardhandler(MwLL handle, void* data) {
MwWidget h = (MwWidget)handle->common.user; MwWidget h = (MwWidget)handle->common.user;
MwDispatch3(h, clipboard_received, data); MwDispatch3(h, clipboard, data);
MwDispatchUserHandler(h, MwNclipboardHandler, data);
} }
MwWidget MwCreateWidget(MwClass widget_class, const char* name, MwWidget parent, int x, int y, unsigned int width, unsigned int height) { MwWidget MwCreateWidget(MwClass widget_class, const char* name, MwWidget parent, int x, int y, unsigned int width, unsigned int height) {
@ -143,18 +144,18 @@ MwWidget MwCreateWidget(MwClass widget_class, const char* name, MwWidget parent,
if(parent == NULL) arrput(h->tick_list, h); if(parent == NULL) arrput(h->tick_list, h);
if(h->lowlevel != NULL) { if(h->lowlevel != NULL) {
h->lowlevel->common.user = h; h->lowlevel->common.user = h;
h->lowlevel->common.handler->draw = lldrawhandler; h->lowlevel->common.handler->draw = lldrawhandler;
h->lowlevel->common.handler->up = lluphandler; h->lowlevel->common.handler->up = lluphandler;
h->lowlevel->common.handler->down = lldownhandler; h->lowlevel->common.handler->down = lldownhandler;
h->lowlevel->common.handler->resize = llresizehandler; h->lowlevel->common.handler->resize = llresizehandler;
h->lowlevel->common.handler->close = llclosehandler; h->lowlevel->common.handler->close = llclosehandler;
h->lowlevel->common.handler->move = llmovehandler; h->lowlevel->common.handler->move = llmovehandler;
h->lowlevel->common.handler->key = llkeyhandler; h->lowlevel->common.handler->key = llkeyhandler;
h->lowlevel->common.handler->key_released = llkeyrelhandler; h->lowlevel->common.handler->key_released = llkeyrelhandler;
h->lowlevel->common.handler->focus_in = llfocusinhandler; h->lowlevel->common.handler->focus_in = llfocusinhandler;
h->lowlevel->common.handler->focus_out = llfocusouthandler; h->lowlevel->common.handler->focus_out = llfocusouthandler;
h->lowlevel->common.handler->clipboard_received = llclipboardreceivedhandler; h->lowlevel->common.handler->clipboard = llclipboardhandler;
} }
if(parent != NULL) arrput(parent->children, h); if(parent != NULL) arrput(parent->children, h);

View file

@ -114,7 +114,7 @@ MwClassRec MwBoxClassRec = {
resize, /* resize */ resize, /* resize */
children_update, /* children_update */ children_update, /* children_update */
children_prop_change, /* children_prop_change */ children_prop_change, /* children_prop_change */
NULL, /* clipboard_received */ NULL, /* clipboard */
NULL, NULL,
NULL, NULL,
NULL, NULL,

View file

@ -107,7 +107,7 @@ MwClassRec MwButtonClassRec = {
NULL, /* resize */ NULL, /* resize */
NULL, /* children_update */ NULL, /* children_update */
NULL, /* children_prop_change */ NULL, /* children_prop_change */
NULL, /* clipboard_received */ NULL, /* clipboard */
NULL, NULL,
NULL, NULL,
NULL, NULL,

View file

@ -53,7 +53,7 @@ MwClassRec MwCheckBoxClassRec = {
NULL, /* resize */ NULL, /* resize */
NULL, /* children_update */ NULL, /* children_update */
NULL, /* children_prop_change */ NULL, /* children_prop_change */
NULL, /* clipboard_received */ NULL, /* clipboard */
NULL, NULL,
NULL, NULL,
NULL, NULL,

View file

@ -204,7 +204,7 @@ MwClassRec MwComboBoxClassRec = {
NULL, /* resize */ NULL, /* resize */
NULL, /* children_update */ NULL, /* children_update */
NULL, /* children_prop_change */ NULL, /* children_prop_change */
NULL, /* clipboard_received */ NULL, /* clipboard */
NULL, NULL,
NULL, NULL,
NULL, NULL,

View file

@ -144,7 +144,7 @@ static void prop_change(MwWidget handle, const char* prop) {
} }
} }
static void clipboard_received(MwWidget handle, const char* data) { static void clipboard(MwWidget handle, const char* data) {
MwEntry t = handle->internal; MwEntry t = handle->internal;
const char* str = MwGetText(handle, MwNtext); const char* str = MwGetText(handle, MwNtext);
char* out = malloc(strlen(str) + strlen(data) + 1); char* out = malloc(strlen(str) + strlen(data) + 1);
@ -162,22 +162,22 @@ static void clipboard_received(MwWidget handle, const char* data) {
} }
MwClassRec MwEntryClassRec = { MwClassRec MwEntryClassRec = {
create, /* create */ create, /* create */
destroy, /* destroy */ destroy, /* destroy */
draw, /* draw */ draw, /* draw */
NULL, /* click */ NULL, /* click */
NULL, /* parent_resize */ NULL, /* parent_resize */
prop_change, /* prop_change */ prop_change, /* prop_change */
NULL, /* mouse_move */ NULL, /* mouse_move */
MwForceRender2, /* mouse_up */ MwForceRender2, /* mouse_up */
MwForceRender2, /* mouse_down */ MwForceRender2, /* mouse_down */
key, /* key */ key, /* key */
NULL, /* execute */ NULL, /* execute */
NULL, /* tick */ NULL, /* tick */
NULL, /* resize */ NULL, /* resize */
NULL, /* children_update */ NULL, /* children_update */
NULL, /* children_prop_change */ NULL, /* children_prop_change */
clipboard_received, /* clipboard_received */ clipboard, /* clipboard */
NULL, NULL,
NULL, NULL,
NULL, NULL,

View file

@ -61,7 +61,7 @@ MwClassRec MwFrameClassRec = {
NULL, /* resize */ NULL, /* resize */
NULL, /* children_update */ NULL, /* children_update */
NULL, /* children_prop_change */ NULL, /* children_prop_change */
NULL, /* clipboard_received */ NULL, /* clipboard */
NULL, NULL,
NULL, NULL,
NULL, NULL,

View file

@ -57,7 +57,7 @@ MwClassRec MwImageClassRec = {
NULL, /* resize */ NULL, /* resize */
NULL, /* children_update */ NULL, /* children_update */
NULL, /* children_prop_change */ NULL, /* children_prop_change */
NULL, /* clipboard_received */ NULL, /* clipboard */
NULL, NULL,
NULL, NULL,
NULL, NULL,

View file

@ -375,7 +375,7 @@ MwClassRec MwLabelClassRec = {
NULL, /* resize */ NULL, /* resize */
NULL, /* children_update */ NULL, /* children_update */
NULL, /* children_prop_change */ NULL, /* children_prop_change */
NULL, /* clipboard_received */ NULL, /* clipboard */
NULL, NULL,
NULL, NULL,
NULL, NULL,

View file

@ -608,7 +608,7 @@ MwClassRec MwListBoxClassRec = {
NULL, /* resize */ NULL, /* resize */
NULL, /* children_update */ NULL, /* children_update */
NULL, /* children_prop_change */ NULL, /* children_prop_change */
NULL, /* clipboard_received */ NULL, /* clipboard */
NULL, NULL,
NULL, NULL,
NULL, NULL,

View file

@ -204,7 +204,7 @@ MwClassRec MwMenuClassRec = {
NULL, /* resize */ NULL, /* resize */
NULL, /* children_update */ NULL, /* children_update */
NULL, /* children_prop_change */ NULL, /* children_prop_change */
NULL, /* clipboard_received */ NULL, /* clipboard */
NULL, NULL,
NULL, NULL,
NULL, NULL,

View file

@ -143,7 +143,7 @@ MwClassRec MwNumberEntryClassRec = {
NULL, /* resize */ NULL, /* resize */
NULL, /* children_update */ NULL, /* children_update */
NULL, /* children_prop_change */ NULL, /* children_prop_change */
NULL, /* clipboard_received */ NULL, /* clipboard */
NULL, NULL,
NULL, NULL,
NULL, NULL,

View file

@ -244,7 +244,7 @@ MwClassRec MwOpenGLClassRec = {
NULL, /* resize */ NULL, /* resize */
NULL, /* children_update */ NULL, /* children_update */
NULL, /* children_prop_change */ NULL, /* children_prop_change */
NULL, /* clipboard_received */ NULL, /* clipboard */
NULL, NULL,
NULL, NULL,
NULL, NULL,

View file

@ -61,7 +61,7 @@ MwClassRec MwProgressBarClassRec = {
NULL, /* resize */ NULL, /* resize */
NULL, /* children_update */ NULL, /* children_update */
NULL, /* children_prop_change */ NULL, /* children_prop_change */
NULL, /* clipboard_received */ NULL, /* clipboard */
NULL, NULL,
NULL, NULL,
NULL, NULL,

View file

@ -62,7 +62,7 @@ MwClassRec MwRadioBoxClassRec = {
NULL, /* resize */ NULL, /* resize */
NULL, /* children_update */ NULL, /* children_update */
NULL, /* children_prop_change */ NULL, /* children_prop_change */
NULL, /* clipboard_received */ NULL, /* clipboard */
NULL, NULL,
NULL, NULL,
NULL, NULL,

View file

@ -272,7 +272,7 @@ MwClassRec MwScrollBarClassRec = {
NULL, /* resize */ NULL, /* resize */
NULL, /* children_update */ NULL, /* children_update */
NULL, /* children_prop_change */ NULL, /* children_prop_change */
NULL, /* clipboard_received */ NULL, /* clipboard */
NULL, NULL,
NULL, NULL,
NULL, NULL,

View file

@ -50,7 +50,7 @@ MwClassRec MwSeparatorClassRec = {
NULL, /* resize */ NULL, /* resize */
NULL, /* children_update */ NULL, /* children_update */
NULL, /* children_prop_change */ NULL, /* children_prop_change */
NULL, /* clipboard_received */ NULL, /* clipboard */
NULL, NULL,
NULL, NULL,
NULL, NULL,

View file

@ -253,7 +253,7 @@ MwClassRec MwSubMenuClassRec = {
NULL, /* resize */ NULL, /* resize */
NULL, /* children_update */ NULL, /* children_update */
NULL, /* children_prop_change */ NULL, /* children_prop_change */
NULL, /* clipboard_received */ NULL, /* clipboard */
NULL, NULL,
NULL, NULL,
NULL, NULL,

View file

@ -496,7 +496,7 @@ MwClassRec MwTreeViewClassRec = {
NULL, /* resize */ NULL, /* resize */
NULL, /* children_update */ NULL, /* children_update */
NULL, /* children_prop_change */ NULL, /* children_prop_change */
NULL, /* clipboard_received */ NULL, /* clipboard */
NULL, NULL,
NULL, NULL,
NULL, NULL,

View file

@ -191,7 +191,7 @@ MwClassRec MwViewportClassRec = {
NULL, /* resize */ NULL, /* resize */
NULL, /* children_update */ NULL, /* children_update */
NULL, /* children_prop_change */ NULL, /* children_prop_change */
NULL, /* clipboard_received */ NULL, /* clipboard */
NULL, NULL,
NULL, NULL,
NULL, NULL,

View file

@ -524,7 +524,7 @@ MwClassRec MwVulkanClassRec = {
NULL, /* resize */ NULL, /* resize */
NULL, /* children_update */ NULL, /* children_update */
NULL, /* children_prop_change */ NULL, /* children_prop_change */
NULL, /* clipboard_received */ NULL, /* clipboard */
NULL, NULL,
NULL, NULL,
NULL, NULL,

View file

@ -59,7 +59,7 @@ MwClassRec MwWindowClassRec = {
NULL, /* resize */ NULL, /* resize */
NULL, /* children_update */ NULL, /* children_update */
NULL, /* children_prop_change */ NULL, /* children_prop_change */
NULL, /* clipboard_received */ NULL, /* clipboard */
NULL, NULL,
NULL, NULL,
NULL, NULL,