# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1672102738 0 # Node ID 3fe7641f027c1a73d6d3d267a857345f00cac194 # Parent 1567f787b965e818ec0bca5a033a656e13cba932 WARNING: Fix an API inconsistency in dw_notebook_page_destroy/set() These two APIs incorrectly referenced the page ID as an int not long. This change may cause ABI problems with programs that use these on some platforms. Recompile your apps that use these functions for safety. diff -r 1567f787b965 -r 3fe7641f027c android/dw.cpp --- a/android/dw.cpp Tue Dec 27 00:33:29 2022 +0000 +++ b/android/dw.cpp Tue Dec 27 00:58:58 2022 +0000 @@ -5591,7 +5591,7 @@ * handle: Handle to the notebook widget. * pageid: ID of the page to be destroyed. */ -void API dw_notebook_page_destroy(HWND handle, unsigned int pageid) +void API dw_notebook_page_destroy(HWND handle, unsigned long pageid) { JNIEnv *env; @@ -5640,7 +5640,7 @@ * handle: Handle to the notebook widget. * pageid: ID of the page to be made visible. */ -void API dw_notebook_page_set(HWND handle, unsigned int pageid) +void API dw_notebook_page_set(HWND handle, unsigned long pageid) { JNIEnv *env; diff -r 1567f787b965 -r 3fe7641f027c dw.h --- a/dw.h Tue Dec 27 00:33:29 2022 +0000 +++ b/dw.h Tue Dec 27 00:58:58 2022 +0000 @@ -2127,10 +2127,10 @@ unsigned long API dw_color_depth_get(void); HWND API dw_notebook_new(unsigned long id, int top); unsigned long API dw_notebook_page_new(HWND handle, unsigned long flags, int front); -void API dw_notebook_page_destroy(HWND handle, unsigned int pageid); +void API dw_notebook_page_destroy(HWND handle, unsigned long pageid); void API dw_notebook_page_set_text(HWND handle, unsigned long pageid, const char *text); void API dw_notebook_page_set_status_text(HWND handle, unsigned long pageid, const char *text); -void API dw_notebook_page_set(HWND handle, unsigned int pageid); +void API dw_notebook_page_set(HWND handle, unsigned long pageid); unsigned long API dw_notebook_page_get(HWND handle); void API dw_notebook_pack(HWND handle, unsigned long pageid, HWND page); HWND API dw_splitbar_new(int type, HWND topleft, HWND bottomright, unsigned long id); diff -r 1567f787b965 -r 3fe7641f027c gtk/dw.c --- a/gtk/dw.c Tue Dec 27 00:33:29 2022 +0000 +++ b/gtk/dw.c Tue Dec 27 00:58:58 2022 +0000 @@ -11508,7 +11508,7 @@ * handle: Handle to the notebook widget. * pageid: ID of the page to be destroyed. */ -void dw_notebook_page_destroy(HWND handle, unsigned int pageid) +void dw_notebook_page_destroy(HWND handle, unsigned long pageid) { int realpage, _dw_locked_by_me = FALSE; GtkWidget **pagearray; @@ -11547,7 +11547,7 @@ * handle: Handle to the notebook widget. * pageid: ID of the page to be made visible. */ -void dw_notebook_page_set(HWND handle, unsigned int pageid) +void dw_notebook_page_set(HWND handle, unsigned long pageid) { int realpage, _dw_locked_by_me = FALSE; diff -r 1567f787b965 -r 3fe7641f027c gtk3/dw.c --- a/gtk3/dw.c Tue Dec 27 00:33:29 2022 +0000 +++ b/gtk3/dw.c Tue Dec 27 00:58:58 2022 +0000 @@ -10395,7 +10395,7 @@ * handle: Handle to the notebook widget. * pageid: ID of the page to be destroyed. */ -void dw_notebook_page_destroy(HWND handle, unsigned int pageid) +void dw_notebook_page_destroy(HWND handle, unsigned long pageid) { int realpage, _dw_locked_by_me = FALSE; GtkWidget **pagearray; @@ -10434,7 +10434,7 @@ * handle: Handle to the notebook widget. * pageid: ID of the page to be made visible. */ -void dw_notebook_page_set(HWND handle, unsigned int pageid) +void dw_notebook_page_set(HWND handle, unsigned long pageid) { int realpage, _dw_locked_by_me = FALSE; diff -r 1567f787b965 -r 3fe7641f027c gtk4/dw.c --- a/gtk4/dw.c Tue Dec 27 00:33:29 2022 +0000 +++ b/gtk4/dw.c Tue Dec 27 00:58:58 2022 +0000 @@ -9124,7 +9124,7 @@ * handle: Handle to the notebook widget. * pageid: ID of the page to be destroyed. */ -DW_FUNCTION_DEFINITION(dw_notebook_page_destroy, void, HWND handle, unsigned int pageid) +DW_FUNCTION_DEFINITION(dw_notebook_page_destroy, void, HWND handle, unsigned long pageid) DW_FUNCTION_ADD_PARAM2(handle, pageid) DW_FUNCTION_NO_RETURN(dw_notebook_page_destroy) DW_FUNCTION_RESTORE_PARAM2(handle, HWND, pageid, unsigned int) @@ -9164,7 +9164,7 @@ * handle: Handle to the notebook widget. * pageid: ID of the page to be made visible. */ -DW_FUNCTION_DEFINITION(dw_notebook_page_set, void, HWND handle, unsigned int pageid) +DW_FUNCTION_DEFINITION(dw_notebook_page_set, void, HWND handle, unsigned long pageid) DW_FUNCTION_ADD_PARAM2(handle, pageid) DW_FUNCTION_NO_RETURN(dw_notebook_page_set) DW_FUNCTION_RESTORE_PARAM2(handle, HWND, pageid, unsigned int) diff -r 1567f787b965 -r 3fe7641f027c ios/dw.m --- a/ios/dw.m Tue Dec 27 00:33:29 2022 +0000 +++ b/ios/dw.m Tue Dec 27 00:58:58 2022 +0000 @@ -9096,10 +9096,10 @@ * handle: Handle to the notebook widget. * pageid: ID of the page to be destroyed. */ -DW_FUNCTION_DEFINITION(dw_notebook_page_destroy, void, HWND handle, unsigned int pageid) +DW_FUNCTION_DEFINITION(dw_notebook_page_destroy, void, HWND handle, unsigned long pageid) DW_FUNCTION_ADD_PARAM2(handle, pageid) DW_FUNCTION_NO_RETURN(dw_notebook_page_destroy) -DW_FUNCTION_RESTORE_PARAM2(handle, HWND, pageid, unsigned int) +DW_FUNCTION_RESTORE_PARAM2(handle, HWND, pageid, unsigned long) { DWNotebook *notebook = handle; DWNotebookPage *notepage = _dw_notepage_from_id(notebook, pageid); @@ -9158,10 +9158,10 @@ * handle: Handle to the notebook widget. * pageid: ID of the page to be made visible. */ -DW_FUNCTION_DEFINITION(dw_notebook_page_set, void, HWND handle, unsigned int pageid) +DW_FUNCTION_DEFINITION(dw_notebook_page_set, void, HWND handle, unsigned long pageid) DW_FUNCTION_ADD_PARAM2(handle, pageid) DW_FUNCTION_NO_RETURN(dw_notebook_page_set) -DW_FUNCTION_RESTORE_PARAM2(handle, HWND, pageid, unsigned int) +DW_FUNCTION_RESTORE_PARAM2(handle, HWND, pageid, unsigned long) { DWNotebook *notebook = handle; DWNotebookPage *notepage = _dw_notepage_from_id(notebook, pageid); diff -r 1567f787b965 -r 3fe7641f027c mac/dw.m --- a/mac/dw.m Tue Dec 27 00:33:29 2022 +0000 +++ b/mac/dw.m Tue Dec 27 00:58:58 2022 +0000 @@ -9826,7 +9826,7 @@ * handle: Handle to the notebook widget. * pageid: ID of the page to be destroyed. */ -void API dw_notebook_page_destroy(HWND handle, unsigned int pageid) +void API dw_notebook_page_destroy(HWND handle, unsigned long pageid) { DWNotebook *notebook = handle; DWNotebookPage *notepage = _dw_notepage_from_id(notebook, pageid); @@ -9857,7 +9857,7 @@ * handle: Handle to the notebook widget. * pageid: ID of the page to be made visible. */ -void API dw_notebook_page_set(HWND handle, unsigned int pageid) +void API dw_notebook_page_set(HWND handle, unsigned long pageid) { DWNotebook *notebook = handle; DWNotebookPage *notepage = _dw_notepage_from_id(notebook, pageid); diff -r 1567f787b965 -r 3fe7641f027c os2/dw.c --- a/os2/dw.c Tue Dec 27 00:33:29 2022 +0000 +++ b/os2/dw.c Tue Dec 27 00:58:58 2022 +0000 @@ -8466,7 +8466,7 @@ * handle: Handle to the notebook widget. * pageid: ID of the page to be destroyed. */ -void API dw_notebook_page_destroy(HWND handle, unsigned int pageid) +void API dw_notebook_page_destroy(HWND handle, unsigned long pageid) { HWND pagehwnd = (HWND)WinSendMsg(handle, BKM_QUERYPAGEWINDOWHWND, MPFROMLONG(pageid), 0L); @@ -8495,7 +8495,7 @@ * handle: Handle to the notebook widget. * pageid: ID of the page to be made visible. */ -void API dw_notebook_page_set(HWND handle, unsigned int pageid) +void API dw_notebook_page_set(HWND handle, unsigned long pageid) { WinSendMsg(handle, BKM_TURNTOPAGE, MPFROMLONG(pageid), 0L); } diff -r 1567f787b965 -r 3fe7641f027c template/dw.c --- a/template/dw.c Tue Dec 27 00:33:29 2022 +0000 +++ b/template/dw.c Tue Dec 27 00:58:58 2022 +0000 @@ -2542,7 +2542,7 @@ * handle: Handle to the notebook widget. * pageid: ID of the page to be destroyed. */ -void API dw_notebook_page_destroy(HWND handle, unsigned int pageid) +void API dw_notebook_page_destroy(HWND handle, unsigned long pageid) { } @@ -2564,7 +2564,7 @@ * handle: Handle to the notebook widget. * pageid: ID of the page to be made visible. */ -void API dw_notebook_page_set(HWND handle, unsigned int pageid) +void API dw_notebook_page_set(HWND handle, unsigned long pageid) { } diff -r 1567f787b965 -r 3fe7641f027c win/dw.c --- a/win/dw.c Tue Dec 27 00:33:29 2022 +0000 +++ b/win/dw.c Tue Dec 27 00:58:58 2022 +0000 @@ -8915,7 +8915,7 @@ * handle: Handle to the notebook widget. * pageid: ID of the page to be destroyed. */ -void API dw_notebook_page_destroy(HWND handle, unsigned int pageidx) +void API dw_notebook_page_destroy(HWND handle, unsigned long pageidx) { NotebookPage **array = (NotebookPage **)dw_window_get_data(handle, "_dw_array"); int newid = -1, z, pageid; @@ -8983,7 +8983,7 @@ * handle: Handle to the notebook widget. * pageid: ID of the page to be made visible. */ -void API dw_notebook_page_set(HWND handle, unsigned int pageidx) +void API dw_notebook_page_set(HWND handle, unsigned long pageidx) { NotebookPage **array = (NotebookPage **)dw_window_get_data(handle, "_dw_array"); int pageid;