添加 LinkedListNode_Delete()、改用宏代替鼠标键值

This commit is contained in:
Liu Chao
2016-11-29 23:22:18 +08:00
parent 9d8648e3cc
commit bed3bd2dcb
3 changed files with 11 additions and 4 deletions
+1
View File
@@ -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 )
+5 -4
View File
@@ -2,6 +2,7 @@
#include <LCUI_Build.h>
#ifdef LCUI_BUILD_IN_WIN32
#include <LCUI/LCUI.h>
#include <LCUI/input.h>
#include <LCUI/platform.h>
#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();
+5
View File
@@ -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 ) {