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/*/*.*
*.exe
*.o
*.so
*.dll

View file

@ -147,7 +147,7 @@ struct _MwLLHandler {
void (*key_released)(MwLL handle, void* data);
void (*focus_in)(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

View file

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

View file

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

View file

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

View file

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

View file

@ -107,10 +107,11 @@ static void llfocusouthandler(MwLL handle, void* 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;
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) {
@ -143,18 +144,18 @@ MwWidget MwCreateWidget(MwClass widget_class, const char* name, MwWidget parent,
if(parent == NULL) arrput(h->tick_list, h);
if(h->lowlevel != NULL) {
h->lowlevel->common.user = h;
h->lowlevel->common.handler->draw = lldrawhandler;
h->lowlevel->common.handler->up = lluphandler;
h->lowlevel->common.handler->down = lldownhandler;
h->lowlevel->common.handler->resize = llresizehandler;
h->lowlevel->common.handler->close = llclosehandler;
h->lowlevel->common.handler->move = llmovehandler;
h->lowlevel->common.handler->key = llkeyhandler;
h->lowlevel->common.handler->key_released = llkeyrelhandler;
h->lowlevel->common.handler->focus_in = llfocusinhandler;
h->lowlevel->common.handler->focus_out = llfocusouthandler;
h->lowlevel->common.handler->clipboard_received = llclipboardreceivedhandler;
h->lowlevel->common.user = h;
h->lowlevel->common.handler->draw = lldrawhandler;
h->lowlevel->common.handler->up = lluphandler;
h->lowlevel->common.handler->down = lldownhandler;
h->lowlevel->common.handler->resize = llresizehandler;
h->lowlevel->common.handler->close = llclosehandler;
h->lowlevel->common.handler->move = llmovehandler;
h->lowlevel->common.handler->key = llkeyhandler;
h->lowlevel->common.handler->key_released = llkeyrelhandler;
h->lowlevel->common.handler->focus_in = llfocusinhandler;
h->lowlevel->common.handler->focus_out = llfocusouthandler;
h->lowlevel->common.handler->clipboard = llclipboardhandler;
}
if(parent != NULL) arrput(parent->children, h);

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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