comparison mac/dw.m @ 1956:2924bc788170

Mac: Added code to avoid unused variable/parameter warnings.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Wed, 24 Jul 2019 18:51:57 +0000
parents 91541efcea10
children c15af2f757e2
comparison
equal deleted inserted replaced
1955:91541efcea10 1956:2924bc788170
16 #include <sys/un.h> 16 #include <sys/un.h>
17 #include <sys/mman.h> 17 #include <sys/mman.h>
18 #include <sys/time.h> 18 #include <sys/time.h>
19 #include <sys/stat.h> 19 #include <sys/stat.h>
20 #include <math.h> 20 #include <math.h>
21
22 /* This may move to dw.h for use on all platforms in the future */
23 #define __DW_UNUSED__ __attribute__((unused))
21 24
22 /* Create a define to let us know to include Snow Leopard specific features */ 25 /* Create a define to let us know to include Snow Leopard specific features */
23 #if defined(MAC_OS_X_VERSION_10_6) && ((defined(MAC_OS_X_VERSION_MAX_ALLOWED) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6) || !defined(MAC_OS_X_VERSION_MAX_ALLOWED)) 26 #if defined(MAC_OS_X_VERSION_10_6) && ((defined(MAC_OS_X_VERSION_MAX_ALLOWED) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6) || !defined(MAC_OS_X_VERSION_MAX_ALLOWED))
24 #define BUILDING_FOR_SNOW_LEOPARD 27 #define BUILDING_FOR_SNOW_LEOPARD
25 #endif 28 #endif
1876 <NSSplitViewDelegate> 1879 <NSSplitViewDelegate>
1877 #endif 1880 #endif
1878 { 1881 {
1879 void *userdata; 1882 void *userdata;
1880 float percent; 1883 float percent;
1884 NSInteger Tag;
1881 } 1885 }
1882 -(void)splitViewDidResizeSubviews:(NSNotification *)aNotification; 1886 -(void)splitViewDidResizeSubviews:(NSNotification *)aNotification;
1887 -(void)setTag:(NSInteger)tag;
1883 -(void *)userdata; 1888 -(void *)userdata;
1884 -(void)setUserdata:(void *)input; 1889 -(void)setUserdata:(void *)input;
1885 -(float)percent; 1890 -(float)percent;
1886 -(void)setPercent:(float)input; 1891 -(void)setPercent:(float)input;
1887 @end 1892 @end
1902 _do_resize(box, size.width, size.height); 1907 _do_resize(box, size.width, size.height);
1903 _handle_resize_events(box); 1908 _handle_resize_events(box);
1904 } 1909 }
1905 } 1910 }
1906 } 1911 }
1912 -(void)setTag:(NSInteger)tag { self.Tag = tag; }
1907 -(void *)userdata { return userdata; } 1913 -(void *)userdata { return userdata; }
1908 -(void)setUserdata:(void *)input { userdata = input; } 1914 -(void)setUserdata:(void *)input { userdata = input; }
1909 -(float)percent { return percent; } 1915 -(float)percent { return percent; }
1910 -(void)setPercent:(float)input { percent = input; } 1916 -(void)setPercent:(float)input { percent = input; }
1911 -(void)dealloc { UserData *root = userdata; _remove_userdata(&root, NULL, TRUE); dw_signal_disconnect_by_window(self); [super dealloc]; } 1917 -(void)dealloc { UserData *root = userdata; _remove_userdata(&root, NULL, TRUE); dw_signal_disconnect_by_window(self); [super dealloc]; }
6846 * item: Handle of the item to be modified. 6852 * item: Handle of the item to be modified.
6847 */ 6853 */
6848 DW_FUNCTION_DEFINITION(dw_tree_get_title, char *, HWND handle, HTREEITEM item) 6854 DW_FUNCTION_DEFINITION(dw_tree_get_title, char *, HWND handle, HTREEITEM item)
6849 DW_FUNCTION_ADD_PARAM2(handle, item) 6855 DW_FUNCTION_ADD_PARAM2(handle, item)
6850 DW_FUNCTION_RETURN(dw_tree_get_title, char *) 6856 DW_FUNCTION_RETURN(dw_tree_get_title, char *)
6851 DW_FUNCTION_RESTORE_PARAM2(handle, HWND, item, HTREEITEM) 6857 DW_FUNCTION_RESTORE_PARAM2(__DW_UNUSED__ handle, HWND, item, HTREEITEM)
6852 { 6858 {
6853 DW_FUNCTION_INIT; 6859 DW_FUNCTION_INIT;
6854 char *retval = NULL; 6860 char *retval = NULL;
6855 NSMutableArray *array = (NSMutableArray *)item; 6861 NSMutableArray *array = (NSMutableArray *)item;
6856 NSString *nstr = (NSString *)[array objectAtIndex:1]; 6862 NSString *nstr = (NSString *)[array objectAtIndex:1];
6919 * itemdata: User defined data to be associated with item. 6925 * itemdata: User defined data to be associated with item.
6920 */ 6926 */
6921 DW_FUNCTION_DEFINITION(dw_tree_item_set_data, void, HWND handle, HTREEITEM item, void *itemdata) 6927 DW_FUNCTION_DEFINITION(dw_tree_item_set_data, void, HWND handle, HTREEITEM item, void *itemdata)
6922 DW_FUNCTION_ADD_PARAM3(handle, item, itemdata) 6928 DW_FUNCTION_ADD_PARAM3(handle, item, itemdata)
6923 DW_FUNCTION_NO_RETURN(dw_tree_item_set_data) 6929 DW_FUNCTION_NO_RETURN(dw_tree_item_set_data)
6924 DW_FUNCTION_RESTORE_PARAM3(handle, HWND, item, HTREEITEM, itemdata, void *) 6930 DW_FUNCTION_RESTORE_PARAM3(__DW_UNUSED__ handle, HWND, item, HTREEITEM, itemdata, void *)
6925 { 6931 {
6926 DW_FUNCTION_INIT; 6932 DW_FUNCTION_INIT;
6927 NSMutableArray *array = (NSMutableArray *)item; 6933 NSMutableArray *array = (NSMutableArray *)item;
6928 [array replaceObjectAtIndex:2 withObject:[NSValue valueWithPointer:itemdata]]; 6934 [array replaceObjectAtIndex:2 withObject:[NSValue valueWithPointer:itemdata]];
6929 DW_FUNCTION_RETURN_NOTHING; 6935 DW_FUNCTION_RETURN_NOTHING;
6936 * item: Handle of the item to be modified. 6942 * item: Handle of the item to be modified.
6937 */ 6943 */
6938 DW_FUNCTION_DEFINITION(dw_tree_item_get_data, void *, HWND handle, HTREEITEM item) 6944 DW_FUNCTION_DEFINITION(dw_tree_item_get_data, void *, HWND handle, HTREEITEM item)
6939 DW_FUNCTION_ADD_PARAM2(handle, item) 6945 DW_FUNCTION_ADD_PARAM2(handle, item)
6940 DW_FUNCTION_RETURN(dw_tree_item_get_data, void *) 6946 DW_FUNCTION_RETURN(dw_tree_item_get_data, void *)
6941 DW_FUNCTION_RESTORE_PARAM2(handle, HWND, item, HTREEITEM) 6947 DW_FUNCTION_RESTORE_PARAM2(__DW_UNUSED__ handle, HWND, item, HTREEITEM)
6942 { 6948 {
6943 DW_FUNCTION_INIT; 6949 DW_FUNCTION_INIT;
6944 void *result = NULL; 6950 void *result = NULL;
6945 NSMutableArray *array = (NSMutableArray *)item; 6951 NSMutableArray *array = (NSMutableArray *)item;
6946 NSValue *value = [array objectAtIndex:2]; 6952 NSValue *value = [array objectAtIndex:2];
7071 * (this item may only be used in OS/2) 7077 * (this item may only be used in OS/2)
7072 */ 7078 */
7073 DW_FUNCTION_DEFINITION(dw_container_setup, int, HWND handle, unsigned long *flags, char **titles, int count, int separator) 7079 DW_FUNCTION_DEFINITION(dw_container_setup, int, HWND handle, unsigned long *flags, char **titles, int count, int separator)
7074 DW_FUNCTION_ADD_PARAM5(handle, flags, titles, count, separator) 7080 DW_FUNCTION_ADD_PARAM5(handle, flags, titles, count, separator)
7075 DW_FUNCTION_RETURN(dw_container_setup, int) 7081 DW_FUNCTION_RETURN(dw_container_setup, int)
7076 DW_FUNCTION_RESTORE_PARAM5(handle, HWND, flags, unsigned long *, titles, char **, count, int, separator, int) 7082 DW_FUNCTION_RESTORE_PARAM5(handle, HWND, flags, unsigned long *, titles, char **, count, int, __DW_UNUSED__ separator, int)
7077 { 7083 {
7078 DW_FUNCTION_INIT; 7084 DW_FUNCTION_INIT;
7079 int z, retval = DW_ERROR_NONE; 7085 int z, retval = DW_ERROR_NONE;
7080 DWContainer *cont = handle; 7086 DWContainer *cont = handle;
7081 7087
7517 * rowcount: The number of rows to be inserted. 7523 * rowcount: The number of rows to be inserted.
7518 */ 7524 */
7519 DW_FUNCTION_DEFINITION(dw_container_insert, void, HWND handle, void *pointer, int rowcount) 7525 DW_FUNCTION_DEFINITION(dw_container_insert, void, HWND handle, void *pointer, int rowcount)
7520 DW_FUNCTION_ADD_PARAM3(handle, pointer, rowcount) 7526 DW_FUNCTION_ADD_PARAM3(handle, pointer, rowcount)
7521 DW_FUNCTION_NO_RETURN(dw_container_insert) 7527 DW_FUNCTION_NO_RETURN(dw_container_insert)
7522 DW_FUNCTION_RESTORE_PARAM3(handle, HWND, pointer, void *, rowcount, int) 7528 DW_FUNCTION_RESTORE_PARAM3(handle, HWND, __DW_UNUSED__ pointer, void *, __DW_UNUSED__ rowcount, int)
7523 { 7529 {
7524 DW_FUNCTION_INIT; 7530 DW_FUNCTION_INIT;
7525 DWContainer *cont = handle; 7531 DWContainer *cont = handle;
7526 [cont reloadData]; 7532 [cont reloadData];
7527 DW_FUNCTION_RETURN_NOTHING; 7533 DW_FUNCTION_RETURN_NOTHING;
8036 { 8042 {
8037 [split setVertical:YES]; 8043 [split setVertical:YES];
8038 } 8044 }
8039 /* Set the default percent to 50% split */ 8045 /* Set the default percent to 50% split */
8040 [split setPercent:50.0]; 8046 [split setPercent:50.0];
8041 /* [split setTag:cid]; Why doesn't this work? */ 8047 [split setTag:cid];
8042 DW_FUNCTION_RETURN_THIS(split); 8048 DW_FUNCTION_RETURN_THIS(split);
8043 } 8049 }
8044 8050
8045 /* 8051 /*
8046 * Sets the position of a splitbar (pecentage). 8052 * Sets the position of a splitbar (pecentage).
8651 * id: An ID to be used with dw_window_from_id() or 0L. 8657 * id: An ID to be used with dw_window_from_id() or 0L.
8652 */ 8658 */
8653 DW_FUNCTION_DEFINITION(dw_html_new, HWND, ULONG cid) 8659 DW_FUNCTION_DEFINITION(dw_html_new, HWND, ULONG cid)
8654 DW_FUNCTION_ADD_PARAM1(cid) 8660 DW_FUNCTION_ADD_PARAM1(cid)
8655 DW_FUNCTION_RETURN(dw_html_new, HWND) 8661 DW_FUNCTION_RETURN(dw_html_new, HWND)
8656 DW_FUNCTION_RESTORE_PARAM1(cid, ULONG) 8662 DW_FUNCTION_RESTORE_PARAM1(__DW_UNUSED__ cid, ULONG)
8657 { 8663 {
8658 DW_FUNCTION_INIT; 8664 DW_FUNCTION_INIT;
8659 DWWebView *web = [[DWWebView alloc] init]; 8665 DWWebView *web = [[DWWebView alloc] init];
8660 /* [web setTag:cid]; Why doesn't this work? */ 8666 /* [web setTag:cid]; Why doesn't this work? */
8661 DW_FUNCTION_RETURN_THIS(web); 8667 DW_FUNCTION_RETURN_THIS(web);