From bed3bd2dcbf3818d789c38b573af034b7ddfc1ea Mon Sep 17 00:00:00 2001 From: Liu Chao Date: Tue, 29 Nov 2016 23:22:18 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20LinkedListNode=5FDelete()?= =?UTF-8?q?=E3=80=81=E6=94=B9=E7=94=A8=E5=AE=8F=E4=BB=A3=E6=9B=BF=E9=BC=A0?= =?UTF-8?q?=E6=A0=87=E9=94=AE=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/LCUI/util/linkedlist.h | 1 + src/platform/windows/windows_mouse.c | 9 +++++---- src/util/linkedlist.c | 5 +++++ 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/include/LCUI/util/linkedlist.h b/include/LCUI/util/linkedlist.h index adc0577d..2334969f 100644 --- a/include/LCUI/util/linkedlist.h +++ b/include/LCUI/util/linkedlist.h @@ -77,6 +77,7 @@ LCUI_API void LinkedList_AppendNode( LinkedList *list, LinkedListNode *node ); LCUI_API void LinkedList_InsertNode( LinkedList *list, int pos, LinkedListNode *node ); LCUI_API void LinkedList_ClearEx( LinkedList *list, void(*on_destroy)(void*), int free_node ); LCUI_API void LinkedList_Concat( LinkedList *list1, LinkedList *list2 ); +LCUI_API void LinkedListNode_Delete( LinkedListNode *node ); #define LinkedList_Clear(list, func) LinkedList_ClearEx( list, func, 1 ) #define LinkedList_ClearData(list, func) LinkedList_ClearEx( list, func, 0 ) diff --git a/src/platform/windows/windows_mouse.c b/src/platform/windows/windows_mouse.c index 75e5b4cf..55581c20 100644 --- a/src/platform/windows/windows_mouse.c +++ b/src/platform/windows/windows_mouse.c @@ -2,6 +2,7 @@ #include #ifdef LCUI_BUILD_IN_WIN32 #include +#include #include #include LCUI_EVENTS_H #include LCUI_MOUSE_H @@ -28,28 +29,28 @@ static void OnMouseMessage( LCUI_Event ev, void *arg ) } case WM_LBUTTONDOWN: sys_ev.type = LCUI_MOUSEDOWN; - sys_ev.button.button = 1; + sys_ev.button.button = LCUIKEY_LEFTBUTTON; sys_ev.button.x = mouse_pos.x; sys_ev.button.y = mouse_pos.y; SetCapture( msg->hwnd ); break; case WM_LBUTTONUP: sys_ev.type = LCUI_MOUSEUP; - sys_ev.button.button = 1; + sys_ev.button.button = LCUIKEY_LEFTBUTTON; sys_ev.button.x = mouse_pos.x; sys_ev.button.y = mouse_pos.y; ReleaseCapture(); break; case WM_RBUTTONDOWN: sys_ev.type = LCUI_MOUSEDOWN; - sys_ev.button.button = 2; + sys_ev.button.button = LCUIKEY_RIGHTBUTTON; sys_ev.button.x = mouse_pos.x; sys_ev.button.y = mouse_pos.y; SetCapture( msg->hwnd ); break; case WM_RBUTTONUP: sys_ev.type = LCUI_MOUSEUP; - sys_ev.button.button = 2; + sys_ev.button.button = LCUIKEY_RIGHTBUTTON; sys_ev.button.x = mouse_pos.x; sys_ev.button.y = mouse_pos.y; ReleaseCapture(); diff --git a/src/util/linkedlist.c b/src/util/linkedlist.c index 7d7dd06c..32136217 100644 --- a/src/util/linkedlist.c +++ b/src/util/linkedlist.c @@ -191,6 +191,11 @@ LinkedListNode *LinkedList_Append( LinkedList *list, void *data ) return node; } +void LinkedListNode_Delete( LinkedListNode *node ) +{ + free( node ); +} + void LinkedList_Concat( LinkedList *list1, LinkedList *list2 ) { if( !list2->head.next ) {