# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1038747564 0 # Node ID 75bf3051235f17decd504cf6ce0da7c8eb312d59 # Parent c2b5d0019ec3cca459844f00073f47cace493bcd Fixes so you can mix compilers. diff -r c2b5d0019ec3 -r 75bf3051235f compat.h --- a/compat.h Sun Dec 01 11:18:14 2002 +0000 +++ b/compat.h Sun Dec 01 12:59:24 2002 +0000 @@ -1,5 +1,8 @@ /* $Id$ */ +#ifndef _COMPAT_H +#define _COMPAT_H + /* This header includes and defines everything needed for a given OS/compiler */ #ifdef __UNIX__ #include "config.h" @@ -58,6 +61,10 @@ #define INCL_DEV #define INCL_DOSERRORS +#if defined(__IBMC__) && !defined(API) +#define API _System +#endif + #define msleep(a) DosSleep(a) #ifdef __EMX__ @@ -123,6 +130,10 @@ #endif #include +#if defined(MSVC) && !defined(API) +#define API _stdcall +#endif + #if defined(__CYGWIN32__) || defined(__MINGW32__) #include #endif /* __CYGWIN32__ || __MINGW32__ */ @@ -192,26 +203,30 @@ #define FOPEN_WRITE_BINARY "wb" #define FOPEN_APPEND_BINARY "ab" +#ifndef API +#define API +#endif + /* Compatibility layer for IBM C/Winsock */ -int sockread (int a, void *b, int c, int d); -int sockwrite (int a, void *b, int c, int d); -int sockclose(int a); -int socksprintf(int fd, char *format, ...); -int sockpipe(int *pipes); -void sockinit(void); -void sockshutdown(void); -int makedir(char *path); -void nonblock(int fd); -void block(int fd); -void setfileinfo(char *filename, char *url, char *logfile); -long double drivesize(int drive); -long double drivefree(int drive); -int isdrive(int drive); -void getfsname(int drive, char *buf, int len); -FILE *fsopen(char *path, char *modes); -int fsclose(FILE *fp); -char *fsgets(char *str, int size, FILE *stream); -int fsseek(FILE *stream, long offset, int whence); -int locale_init(char *filename, int my_locale); -char *locale_string(char *default_text, int message); - +int API sockread (int a, void *b, int c, int d); +int API sockwrite (int a, void *b, int c, int d); +int API sockclose(int a); +int API socksprintf(int fd, char *format, ...); +int API sockpipe(int *pipes); +void API sockinit(void); +void API sockshutdown(void); +int API makedir(char *path); +void API nonblock(int fd); +void API block(int fd); +void API setfileinfo(char *filename, char *url, char *logfile); +long double API drivesize(int drive); +long double API drivefree(int drive); +int API isdrive(int drive); +void API getfsname(int drive, char *buf, int len); +FILE * API fsopen(char *path, char *modes); +int API fsclose(FILE *fp); +char * API fsgets(char *str, int size, FILE *stream); +int API fsseek(FILE *stream, long offset, int whence); +int API locale_init(char *filename, int my_locale); +char * API locale_string(char *default_text, int message); +#endif diff -r c2b5d0019ec3 -r 75bf3051235f dw.h --- a/dw.h Sun Dec 01 11:18:14 2002 +0000 +++ b/dw.h Sun Dec 01 12:59:24 2002 +0000 @@ -11,6 +11,10 @@ #if defined(__OS2__) || defined(__WIN32__) || defined(WINNT) || defined(__EMX__) /* OS/2 or Windows */ +#if defined(__IBMC__) && !defined(API) +#define API _System +#endif + /* Used internally */ #define TYPEBOX 0 #define TYPEITEM 1 @@ -70,6 +74,10 @@ #define DW_CLR_BROWN CLR_BROWN #define DW_CLR_PALEGRAY CLR_PALEGRAY +#ifndef FCF_CLOSEBUTTON +#define FCF_CLOSEBUTTON 0x04000000L +#endif + #define DW_FCF_TITLEBAR FCF_TITLEBAR #define DW_FCF_SYSMENU (FCF_SYSMENU | FCF_CLOSEBUTTON) #define DW_FCF_MENU FCF_MENU @@ -169,6 +177,10 @@ #define UDM_GETPOS32 (WM_USER+114) #endif +#if defined(MSVC) && !defined(API) +#define API _stdcall +#endif + /* Lets make some platform independent defines :) */ #define DW_DT_LEFT SS_LEFT #define DW_DT_QUERYEXTENT 0 @@ -603,199 +615,203 @@ #define DW_OS2_RGB(a) ((DW_RED_VALUE(a) << 16) | (DW_GREEN_VALUE(a) << 8) | DW_BLUE_VALUE(a)) #endif +#ifndef API +#define API +#endif + /* Public function prototypes */ -void dw_box_pack_start(HWND box, HWND item, int width, int height, int hsize, int vsize, int pad); -void dw_box_pack_end(HWND box, HWND item, int width, int height, int hsize, int vsize, int pad); +void API dw_box_pack_start(HWND box, HWND item, int width, int height, int hsize, int vsize, int pad); +void API dw_box_pack_end(HWND box, HWND item, int width, int height, int hsize, int vsize, int pad); #if !defined(__OS2__) && !defined(__WIN32__) && !defined(__EMX__) -int dw_int_init(DWResources *res, int newthread, int *argc, char **argv[]); +int API dw_int_init(DWResources *res, int newthread, int *argc, char **argv[]); #define dw_init(a, b, c) dw_int_init(&_resources, a, &b, &c) #else -int dw_init(int newthread, int argc, char *argv[]); +int API dw_init(int newthread, int argc, char *argv[]); #endif -void dw_main(void); -void dw_main_sleep(int seconds); -void dw_free(void *ptr); -int dw_window_show(HWND handle); -int dw_window_hide(HWND handle); -int dw_window_minimize(HWND handle); -int dw_window_raise(HWND handle); -int dw_window_lower(HWND handle); -int dw_window_destroy(HWND handle); -void dw_window_redraw(HWND handle); -int dw_window_set_font(HWND handle, char *fontname); -int dw_window_set_color(HWND handle, unsigned long fore, unsigned long back); -HWND dw_window_new(HWND hwndOwner, char *title, unsigned long flStyle); -HWND dw_box_new(int type, int pad); -HWND dw_groupbox_new(int type, int pad, char *title); -HWND dw_mdi_new(unsigned long id); -HWND dw_bitmap_new(unsigned long id); -HWND dw_bitmapbutton_new(char *text, unsigned long id); -HWND dw_container_new(unsigned long id); -HWND dw_tree_new(unsigned long id); -HWND dw_text_new(char *text, unsigned long id); -HWND dw_status_text_new(char *text, unsigned long id); -HWND dw_mle_new(unsigned long id); -HWND dw_entryfield_new(char *text, unsigned long id); -HWND dw_entryfield_password_new(char *text, ULONG id); -HWND dw_combobox_new(char *text, unsigned long id); -HWND dw_button_new(char *text, unsigned long id); -HWND dw_spinbutton_new(char *text, unsigned long id); -HWND dw_radiobutton_new(char *text, ULONG id); -HWND dw_percent_new(unsigned long id); -HWND dw_slider_new(int vertical, int increments, ULONG id); -HWND dw_checkbox_new(char *text, unsigned long id); -HWND dw_listbox_new(unsigned long id, int multi); -void dw_listbox_append(HWND handle, char *text); -void dw_listbox_clear(HWND handle); -int dw_listbox_count(HWND handle); -void dw_listbox_set_top(HWND handle, int top); -void dw_listbox_select(HWND handle, int index, int state); -void dw_listbox_delete(HWND handle, int index); -void dw_listbox_query_text(HWND handle, unsigned int index, char *buffer, unsigned int length); -void dw_listbox_set_text(HWND handle, unsigned int index, char *buffer); -unsigned int dw_listbox_selected(HWND handle); -int dw_listbox_selected_multi(HWND handle, int where); -unsigned int dw_percent_query_range(HWND handle); -void dw_percent_set_pos(HWND handle, unsigned int position); -unsigned int dw_slider_query_pos(HWND handle); -void dw_slider_set_pos(HWND handle, unsigned int position); -void dw_window_set_pos(HWND handle, unsigned long x, unsigned long y); -void dw_window_set_usize(HWND handle, unsigned long width, unsigned long height); -void dw_window_set_pos_size(HWND handle, unsigned long x, unsigned long y, unsigned long width, unsigned long height); -void dw_window_get_pos_size(HWND handle, unsigned long *x, unsigned long *y, unsigned long *width, unsigned long *height); -void dw_window_set_style(HWND handle, unsigned long style, unsigned long mask); -void dw_window_set_icon(HWND handle, unsigned long id); -void dw_window_set_bitmap(HWND handle, unsigned long id); -char *dw_window_get_text(HWND handle); -void dw_window_set_text(HWND handle, char *text); -int dw_window_set_border(HWND handle, int border); -void dw_window_disable(HWND handle); -void dw_window_enable(HWND handle); -void dw_window_capture(HWND handle); -void dw_window_release(void); -void dw_window_reparent(HWND handle, HWND newparent); -void dw_window_pointer(HWND handle, int pointertype); -void dw_window_default(HWND window, HWND defaultitem); -void dw_window_click_default(HWND window, HWND next); -unsigned int dw_mle_import(HWND handle, char *buffer, int startpoint); -void dw_mle_export(HWND handle, char *buffer, int startpoint, int length); -void dw_mle_query(HWND handle, unsigned long *bytes, unsigned long *lines); -void dw_mle_delete(HWND handle, int startpoint, int length); -void dw_mle_clear(HWND handle); -void dw_mle_freeze(HWND handle); -void dw_mle_thaw(HWND handle); -void dw_mle_set(HWND handle, int point); -void dw_mle_set_visible(HWND handle, int line); -void dw_mle_set_editable(HWND handle, int state); -void dw_mle_set_word_wrap(HWND handle, int state); -int dw_mle_search(HWND handle, char *text, int point, unsigned long flags); -void dw_spinbutton_set_pos(HWND handle, long position); -void dw_spinbutton_set_limits(HWND handle, long upper, long lower); -void dw_entryfield_set_limit(HWND handle, ULONG limit); -long dw_spinbutton_query(HWND handle); -int dw_checkbox_query(HWND handle); -void dw_checkbox_set(HWND handle, int value); -HWND dw_tree_insert(HWND handle, char *title, unsigned long icon, HWND parent, void *itemdata); -HWND dw_tree_insert_after(HWND handle, HWND item, char *title, unsigned long icon, HWND parent, void *itemdata); -void dw_tree_clear(HWND handle); -void dw_tree_delete(HWND handle, HWND item); -void dw_tree_set(HWND handle, HWND item, char *title, unsigned long icon); -void dw_tree_expand(HWND handle, HWND item); -void dw_tree_collapse(HWND handle, HWND item); -void dw_tree_item_select(HWND handle, HWND item); -void dw_tree_set_data(HWND handle, HWND item, void *itemdata); -int dw_container_setup(HWND handle, unsigned long *flags, char **titles, int count, int separator); -unsigned long dw_icon_load(unsigned long module, unsigned long id); -void dw_icon_free(unsigned long handle); -void *dw_container_alloc(HWND handle, int rowcount); -void dw_container_set_item(HWND handle, void *pointer, int column, int row, void *data); -void dw_container_change_item(HWND handle, int column, int row, void *data); -void dw_container_set_column_width(HWND handle, int column, int width); -void dw_container_set_row_title(void *pointer, int row, char *title); -void dw_container_insert(HWND handle, void *pointer, int rowcount); -void dw_container_clear(HWND handle, int redraw); -void dw_container_delete(HWND handle, int rowcount); -void dw_container_set_view(HWND handle, unsigned long flags, int iconwidth, int iconheight); -char *dw_container_query_start(HWND handle, unsigned long flags); -char *dw_container_query_next(HWND handle, unsigned long flags); -void dw_container_scroll(HWND handle, int direction, long rows); -void dw_container_cursor(HWND handle, char *text); -void dw_container_delete_row(HWND handle, char *text); -void dw_container_optimize(HWND handle); -int dw_filesystem_setup(HWND handle, unsigned long *flags, char **titles, int count); -void dw_filesystem_set_item(HWND handle, void *pointer, int column, int row, void *data); -void dw_filesystem_set_file(HWND handle, void *pointer, int row, char *filename, unsigned long icon); -int dw_screen_width(void); -int dw_screen_height(void); -unsigned long dw_color_depth(void); -HWND dw_notebook_new(unsigned long id, int top); -unsigned long dw_notebook_page_new(HWND handle, unsigned long flags, int front); -void dw_notebook_page_destroy(HWND handle, unsigned int pageid); -void dw_notebook_page_set_text(HWND handle, unsigned long pageid, char *text); -void dw_notebook_page_set_status_text(HWND handle, unsigned long pageid, char *text); -void dw_notebook_page_set(HWND handle, unsigned int pageid); -unsigned int dw_notebook_page_query(HWND handle); -void dw_notebook_pack(HWND handle, unsigned long pageid, HWND page); -HWND dw_splitbar_new(int type, HWND topleft, HWND bottomright, unsigned long id); -void dw_splitbar_set(HWND handle, float percent); -float dw_splitbar_get(HWND handle); -HMENUI dw_menu_new(unsigned long id); -HMENUI dw_menubar_new(HWND location); -HWND dw_menu_append_item(HMENUI menu, char *title, unsigned long id, unsigned long flags, int end, int check, HMENUI submenu); -void dw_menu_item_set_check(HMENUI menu, unsigned long id, int check); -void dw_menu_popup(HMENUI *menu, HWND parent, int x, int y); -void dw_menu_destroy(HMENUI *menu); -void dw_pointer_query_pos(long *x, long *y); -void dw_pointer_set_pos(long x, long y); -void dw_window_function(HWND handle, void *function, void *data); -HWND dw_window_from_id(HWND handle, int id); -HMTX dw_mutex_new(void); -void dw_mutex_close(HMTX mutex); -void dw_mutex_lock(HMTX mutex); -void dw_mutex_unlock(HMTX mutex); -HEV dw_event_new(void); -int dw_event_reset(HEV eve); -int dw_event_post(HEV eve); -int dw_event_wait(HEV eve, unsigned long timeout); -int dw_event_close (HEV *eve); -DWTID dw_thread_new(void *func, void *data, int stack); -void dw_thread_end(void); -DWTID dw_thread_id(void); -void dw_exit(int exitcode); -HWND dw_render_new(unsigned long id); -void dw_color_foreground_set(unsigned long value); -void dw_color_background_set(unsigned long value); -void dw_draw_point(HWND handle, HPIXMAP pixmap, int x, int y); -void dw_draw_line(HWND handle, HPIXMAP pixmap, int x1, int y1, int x2, int y2); -void dw_draw_rect(HWND handle, HPIXMAP pixmap, int fill, int x, int y, int width, int height); -void dw_draw_text(HWND handle, HPIXMAP pixmap, int x, int y, char *text); -void dw_font_text_extents(HWND handle, HPIXMAP pixmap, char *text, int *width, int *height); -void dw_flush(void); -void dw_pixmap_bitblt(HWND dest, HPIXMAP destp, int xdest, int ydest, int width, int height, HWND src, HPIXMAP srcp, int xsrc, int ysrc); -HPIXMAP dw_pixmap_new(HWND handle, unsigned long width, unsigned long height, int depth); -HPIXMAP dw_pixmap_grab(HWND handle, ULONG id); -void dw_pixmap_destroy(HPIXMAP pixmap); -void dw_beep(int freq, int dur); -int dw_messagebox(char *title, char *format, ...); -int dw_yesno(char *title, char *text); -void dw_environment_query(DWEnv *env); -int dw_exec(char *program, int type, char **params); -int dw_browse(char *url); -char *dw_file_browse(char *title, char *defpath, char *ext, int flags); -char *dw_user_dir(void); -DWDialog *dw_dialog_new(void *data); -int dw_dialog_dismiss(DWDialog *dialog, void *result); -void *dw_dialog_wait(DWDialog *dialog); -void dw_window_set_data(HWND window, char *dataname, void *data); -void *dw_window_get_data(HWND window, char *dataname); -int dw_module_load(char *name, HMOD *handle); -int dw_module_symbol(HMOD handle, char *name, void**func); -int dw_module_close(HMOD handle); +void API dw_main(void); +void API dw_main_sleep(int seconds); +void API dw_free(void *ptr); +int API dw_window_show(HWND handle); +int API dw_window_hide(HWND handle); +int API dw_window_minimize(HWND handle); +int API dw_window_raise(HWND handle); +int API dw_window_lower(HWND handle); +int API dw_window_destroy(HWND handle); +void API dw_window_redraw(HWND handle); +int API dw_window_set_font(HWND handle, char *fontname); +int API dw_window_set_color(HWND handle, unsigned long fore, unsigned long back); +HWND API dw_window_new(HWND hwndOwner, char *title, unsigned long flStyle); +HWND API dw_box_new(int type, int pad); +HWND API dw_groupbox_new(int type, int pad, char *title); +HWND API dw_mdi_new(unsigned long id); +HWND API dw_bitmap_new(unsigned long id); +HWND API dw_bitmapbutton_new(char *text, unsigned long id); +HWND API dw_container_new(unsigned long id); +HWND API dw_tree_new(unsigned long id); +HWND API dw_text_new(char *text, unsigned long id); +HWND API dw_status_text_new(char *text, unsigned long id); +HWND API dw_mle_new(unsigned long id); +HWND API dw_entryfield_new(char *text, unsigned long id); +HWND API dw_entryfield_password_new(char *text, ULONG id); +HWND API dw_combobox_new(char *text, unsigned long id); +HWND API dw_button_new(char *text, unsigned long id); +HWND API dw_spinbutton_new(char *text, unsigned long id); +HWND API dw_radiobutton_new(char *text, ULONG id); +HWND API dw_percent_new(unsigned long id); +HWND API dw_slider_new(int vertical, int increments, ULONG id); +HWND API dw_checkbox_new(char *text, unsigned long id); +HWND API dw_listbox_new(unsigned long id, int multi); +void API dw_listbox_append(HWND handle, char *text); +void API dw_listbox_clear(HWND handle); +int API dw_listbox_count(HWND handle); +void API dw_listbox_set_top(HWND handle, int top); +void API dw_listbox_select(HWND handle, int index, int state); +void API dw_listbox_delete(HWND handle, int index); +void API dw_listbox_query_text(HWND handle, unsigned int index, char *buffer, unsigned int length); +void API dw_listbox_set_text(HWND handle, unsigned int index, char *buffer); +unsigned int API dw_listbox_selected(HWND handle); +int API dw_listbox_selected_multi(HWND handle, int where); +unsigned int API dw_percent_query_range(HWND handle); +void API dw_percent_set_pos(HWND handle, unsigned int position); +unsigned int API dw_slider_query_pos(HWND handle); +void API dw_slider_set_pos(HWND handle, unsigned int position); +void API dw_window_set_pos(HWND handle, unsigned long x, unsigned long y); +void API dw_window_set_usize(HWND handle, unsigned long width, unsigned long height); +void API dw_window_set_pos_size(HWND handle, unsigned long x, unsigned long y, unsigned long width, unsigned long height); +void API dw_window_get_pos_size(HWND handle, unsigned long *x, unsigned long *y, unsigned long *width, unsigned long *height); +void API dw_window_set_style(HWND handle, unsigned long style, unsigned long mask); +void API dw_window_set_icon(HWND handle, unsigned long id); +void API dw_window_set_bitmap(HWND handle, unsigned long id); +char * API dw_window_get_text(HWND handle); +void API dw_window_set_text(HWND handle, char *text); +int API dw_window_set_border(HWND handle, int border); +void API dw_window_disable(HWND handle); +void API dw_window_enable(HWND handle); +void API dw_window_capture(HWND handle); +void API dw_window_release(void); +void API dw_window_reparent(HWND handle, HWND newparent); +void API dw_window_pointer(HWND handle, int pointertype); +void API dw_window_default(HWND window, HWND defaultitem); +void API dw_window_click_default(HWND window, HWND next); +unsigned int API dw_mle_import(HWND handle, char *buffer, int startpoint); +void API dw_mle_export(HWND handle, char *buffer, int startpoint, int length); +void API dw_mle_query(HWND handle, unsigned long *bytes, unsigned long *lines); +void API dw_mle_delete(HWND handle, int startpoint, int length); +void API dw_mle_clear(HWND handle); +void API dw_mle_freeze(HWND handle); +void API dw_mle_thaw(HWND handle); +void API dw_mle_set(HWND handle, int point); +void API dw_mle_set_visible(HWND handle, int line); +void API dw_mle_set_editable(HWND handle, int state); +void API dw_mle_set_word_wrap(HWND handle, int state); +int API dw_mle_search(HWND handle, char *text, int point, unsigned long flags); +void API dw_spinbutton_set_pos(HWND handle, long position); +void API dw_spinbutton_set_limits(HWND handle, long upper, long lower); +void API dw_entryfield_set_limit(HWND handle, ULONG limit); +long API dw_spinbutton_query(HWND handle); +int API dw_checkbox_query(HWND handle); +void API dw_checkbox_set(HWND handle, int value); +HWND API dw_tree_insert(HWND handle, char *title, unsigned long icon, HWND parent, void *itemdata); +HWND API dw_tree_insert_after(HWND handle, HWND item, char *title, unsigned long icon, HWND parent, void *itemdata); +void API dw_tree_clear(HWND handle); +void API dw_tree_delete(HWND handle, HWND item); +void API dw_tree_set(HWND handle, HWND item, char *title, unsigned long icon); +void API dw_tree_expand(HWND handle, HWND item); +void API dw_tree_collapse(HWND handle, HWND item); +void API dw_tree_item_select(HWND handle, HWND item); +void API dw_tree_set_data(HWND handle, HWND item, void *itemdata); +int API dw_container_setup(HWND handle, unsigned long *flags, char **titles, int count, int separator); +unsigned long API dw_icon_load(unsigned long module, unsigned long id); +void API dw_icon_free(unsigned long handle); +void * API dw_container_alloc(HWND handle, int rowcount); +void API dw_container_set_item(HWND handle, void *pointer, int column, int row, void *data); +void API dw_container_change_item(HWND handle, int column, int row, void *data); +void API dw_container_set_column_width(HWND handle, int column, int width); +void API dw_container_set_row_title(void *pointer, int row, char *title); +void API dw_container_insert(HWND handle, void *pointer, int rowcount); +void API dw_container_clear(HWND handle, int redraw); +void API dw_container_delete(HWND handle, int rowcount); +void API dw_container_set_view(HWND handle, unsigned long flags, int iconwidth, int iconheight); +char * API dw_container_query_start(HWND handle, unsigned long flags); +char * API dw_container_query_next(HWND handle, unsigned long flags); +void API dw_container_scroll(HWND handle, int direction, long rows); +void API dw_container_cursor(HWND handle, char *text); +void API dw_container_delete_row(HWND handle, char *text); +void API dw_container_optimize(HWND handle); +int API dw_filesystem_setup(HWND handle, unsigned long *flags, char **titles, int count); +void API dw_filesystem_set_item(HWND handle, void *pointer, int column, int row, void *data); +void API dw_filesystem_set_file(HWND handle, void *pointer, int row, char *filename, unsigned long icon); +int API dw_screen_width(void); +int API dw_screen_height(void); +unsigned long API dw_color_depth(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_set_text(HWND handle, unsigned long pageid, char *text); +void API dw_notebook_page_set_status_text(HWND handle, unsigned long pageid, char *text); +void API dw_notebook_page_set(HWND handle, unsigned int pageid); +unsigned int API dw_notebook_page_query(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); +void API dw_splitbar_set(HWND handle, float percent); +float API dw_splitbar_get(HWND handle); +HMENUI API dw_menu_new(unsigned long id); +HMENUI API dw_menubar_new(HWND location); +HWND API dw_menu_append_item(HMENUI menu, char *title, unsigned long id, unsigned long flags, int end, int check, HMENUI submenu); +void API dw_menu_item_set_check(HMENUI menu, unsigned long id, int check); +void API dw_menu_popup(HMENUI *menu, HWND parent, int x, int y); +void API dw_menu_destroy(HMENUI *menu); +void API dw_pointer_query_pos(long *x, long *y); +void API dw_pointer_set_pos(long x, long y); +void API dw_window_function(HWND handle, void *function, void *data); +HWND API dw_window_from_id(HWND handle, int id); +HMTX API dw_mutex_new(void); +void API dw_mutex_close(HMTX mutex); +void API dw_mutex_lock(HMTX mutex); +void API dw_mutex_unlock(HMTX mutex); +HEV API dw_event_new(void); +int API dw_event_reset(HEV eve); +int API dw_event_post(HEV eve); +int API dw_event_wait(HEV eve, unsigned long timeout); +int API dw_event_close (HEV *eve); +DWTID API dw_thread_new(void *func, void *data, int stack); +void API dw_thread_end(void); +DWTID API dw_thread_id(void); +void API dw_exit(int exitcode); +HWND API dw_render_new(unsigned long id); +void API dw_color_foreground_set(unsigned long value); +void API dw_color_background_set(unsigned long value); +void API dw_draw_point(HWND handle, HPIXMAP pixmap, int x, int y); +void API dw_draw_line(HWND handle, HPIXMAP pixmap, int x1, int y1, int x2, int y2); +void API dw_draw_rect(HWND handle, HPIXMAP pixmap, int fill, int x, int y, int width, int height); +void API dw_draw_text(HWND handle, HPIXMAP pixmap, int x, int y, char *text); +void API dw_font_text_extents(HWND handle, HPIXMAP pixmap, char *text, int *width, int *height); +void API dw_flush(void); +void API dw_pixmap_bitblt(HWND dest, HPIXMAP destp, int xdest, int ydest, int width, int height, HWND src, HPIXMAP srcp, int xsrc, int ysrc); +HPIXMAP API dw_pixmap_new(HWND handle, unsigned long width, unsigned long height, int depth); +HPIXMAP API dw_pixmap_grab(HWND handle, ULONG id); +void API dw_pixmap_destroy(HPIXMAP pixmap); +void API dw_beep(int freq, int dur); +int API dw_messagebox(char *title, char *format, ...); +int API dw_yesno(char *title, char *text); +void API dw_environment_query(DWEnv *env); +int API dw_exec(char *program, int type, char **params); +int API dw_browse(char *url); +char * API dw_file_browse(char *title, char *defpath, char *ext, int flags); +char * API dw_user_dir(void); +DWDialog * API dw_dialog_new(void *data); +int API dw_dialog_dismiss(DWDialog *dialog, void *result); +void * API dw_dialog_wait(DWDialog *dialog); +void API dw_window_set_data(HWND window, char *dataname, void *data); +void * API dw_window_get_data(HWND window, char *dataname); +int API dw_module_load(char *name, HMOD *handle); +int API dw_module_symbol(HMOD handle, char *name, void**func); +int API dw_module_close(HMOD handle); #ifndef NO_SIGNALS -void dw_signal_connect(HWND window, char *signame, void *sigfunc, void *data); -void dw_signal_disconnect_by_window(HWND window); -void dw_signal_disconnect_by_data(HWND window, void *data); -void dw_signal_disconnect_by_name(HWND window, char *signame); +void API dw_signal_connect(HWND window, char *signame, void *sigfunc, void *data); +void API dw_signal_disconnect_by_window(HWND window); +void API dw_signal_disconnect_by_data(HWND window, void *data); +void API dw_signal_disconnect_by_name(HWND window, char *signame); #endif #endif diff -r c2b5d0019ec3 -r 75bf3051235f dwcompat.def --- a/dwcompat.def Sun Dec 01 11:18:14 2002 +0000 +++ b/dwcompat.def Sun Dec 01 12:59:24 2002 +0000 @@ -25,12 +25,12 @@ getfsname @26 block @27 - opendir @30 - openxdir @31 - readdir @32 - seekdir @33 - telldir @34 - closedir @35 + _opendir @30 + _openxdir @31 + _readdir @32 + _seekdir @33 + _telldir @34 + _closedir @35 fsopen @40 fsclose @41 diff -r c2b5d0019ec3 -r 75bf3051235f dwcompate.def --- a/dwcompate.def Sun Dec 01 11:18:14 2002 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -LIBRARY DWCOMPAT INITINSTANCE TERMINSTANCE - -PROTMODE - -DESCRIPTION 'Dynamic Windows Compatibility Module for OS/2 EMX' - -CODE LOADONCALL -DATA NONSHARED LOADONCALL - -EXPORTS - sockread @10 - sockwrite @11 - sockclose @12 - socksprintf @13 - sockpipe @14 - sockinit @15 - sockshutdown @16 - - makedir @20 - nonblock @21 - setfileinfo @22 - drivefree @23 - isdrive @24 - - fsopen @40 - fsclose @41 - fsgets @42 - fsseek @43 diff -r c2b5d0019ec3 -r 75bf3051235f dwcompatw.def --- a/dwcompatw.def Sun Dec 01 11:18:14 2002 +0000 +++ b/dwcompatw.def Sun Dec 01 12:59:24 2002 +0000 @@ -20,12 +20,12 @@ getfsname @26 block @27 - opendir @30 - openxdir @31 - readdir @32 - seekdir @33 - telldir @34 - closedir @35 + _opendir @30 + _openxdir @31 + _readdir @32 + _seekdir @33 + _telldir @34 + _closedir @35 fsopen @40 fsclose @41 diff -r c2b5d0019ec3 -r 75bf3051235f makefile.emx --- a/makefile.emx Sun Dec 01 11:18:14 2002 +0000 +++ b/makefile.emx Sun Dec 01 12:59:24 2002 +0000 @@ -16,8 +16,8 @@ RCFLAGS = -r -COMPATOBJECTS = compat.obj -COMPATSOURCES = compat.c +COMPATOBJECTS = compat.obj dirent.obj +COMPATSOURCES = compat.c dirent.c all: dw.dll dwcompat.dll @@ -28,16 +28,21 @@ $(CC) $(CFLAGS) -c $< dw.dll: - $(CC) $(CFLAGS) $(DEFS) -o dll/dw.dll os2/dw.c $(LDFLAGS) dw.def - emximp -o lib/dw.lib dw.def - + $(CC) $(CFLAGS) $(DEFS) -o dw.dll os2/dw.c $(LDFLAGS) dw.def + emximp -o dw.lib dw.def + cp -f dw.dll ../dll + cp -f dw.lib ../lib + dwcompat.dll: $(COMPATOBJECTS) - $(CC) $(CFLAGS) $(DEFS) -o dll/dwcompat.dll $(COMPATOBJECTS) $(LDFLAGS) -lsocket dwcompate.def - emximp -o lib/dwcompat.lib dwcompate.def + $(CC) $(CFLAGS) $(DEFS) -o dwcompat.dll $(COMPATOBJECTS) $(LDFLAGS) -lsocket dwcompat.def + emximp -o dwcompat.lib dwcompat.def + cp -f dwcompat.dll dll + cp -f dwcompat.lib lib clean: $(RM) $(OBJECTS) handyftp.exe handyftp.res dw.obj: dw.c compat.obj: compat.c +dirent.obj: os2/dirent.c diff -r c2b5d0019ec3 -r 75bf3051235f makefile.wpm --- a/makefile.wpm Sun Dec 01 11:18:14 2002 +0000 +++ b/makefile.wpm Sun Dec 01 12:59:24 2002 +0000 @@ -14,7 +14,7 @@ all: dw.dll dwcompat.dll dwcompat.dll: compat.obj - wlink name dwcompat.dll system os2v2_pm library so32dll,tcp32dll d a option symf f $[@ + wlink name dwcompat.dll system os2v2_pm d a library so32dll,tcp32dll option symf f $[@ dw.dll: dw.obj wlink name dw.dll system os2v2_pm d a option symf f $[@ diff -r c2b5d0019ec3 -r 75bf3051235f os2/dirent.c --- a/os2/dirent.c Sun Dec 01 11:18:14 2002 +0000 +++ b/os2/dirent.c Sun Dec 01 12:59:24 2002 +0000 @@ -1,5 +1,3 @@ -#ifdef OS2 - #include #include #include @@ -100,7 +98,7 @@ } char * -abs_path(const char *name, char *buffer, int len) +_abs_path(const char *name, char *buffer, int len) { char buf[4]; if (isalpha(name[0]) && name[1] == ':' && name[2] == '\0') { @@ -116,7 +114,7 @@ } DIR * -openxdir(const char *path, unsigned att_mask) +_openxdir(const char *path, unsigned att_mask) { DIR *dir; char name[MAXPATHLEN+3]; @@ -174,13 +172,13 @@ } DIR * -opendir(const char *pathname) +_opendir(const char *pathname) { return openxdir(pathname, 0); } struct dirent * -readdir(DIR *dir) +_readdir(DIR *dir) { static int dummy_ino = 2; @@ -228,13 +226,13 @@ } long -telldir(DIR *dir) +_telldir(DIR *dir) { return dir->number; } void -seekdir(DIR *dir, long off) +_seekdir(DIR *dir, long off) { if (dir->number > off) { char name[MAXPATHLEN+2]; @@ -268,7 +266,7 @@ } void -closedir(DIR *dir) +_closedir(DIR *dir) { DosFindClose(dir->handle); free(dir); @@ -301,5 +299,3 @@ #endif -#endif /* OS2 */ - diff -r c2b5d0019ec3 -r 75bf3051235f os2/dw.c --- a/os2/dw.c Sun Dec 01 11:18:14 2002 +0000 +++ b/os2/dw.c Sun Dec 01 12:59:24 2002 +0000 @@ -2934,7 +2934,7 @@ * newthread: True if this is the only thread. * False if there is already a message loop running. */ -int dw_init(int newthread, int argc, char *argv[]) +int API dw_init(int newthread, int argc, char *argv[]) { APIRET rc; @@ -2956,7 +2956,7 @@ /* * Runs a message loop for Dynamic Windows. */ -void dw_main(void) +void API dw_main(void) { QMSG qmsg; @@ -2974,7 +2974,7 @@ * Parameters: * milliseconds: Number of milliseconds to run the loop for. */ -void dw_main_sleep(int milliseconds) +void API dw_main_sleep(int milliseconds) { QMSG qmsg; double start = (double)clock(); @@ -2997,7 +2997,7 @@ * ptr: Pointer to dynamic windows allocated * memory to be free()'d. */ -void dw_free(void *ptr) +void API dw_free(void *ptr) { free(ptr); } @@ -3007,7 +3007,7 @@ * Parameters: * data: User defined data to be passed to functions. */ -DWDialog *dw_dialog_new(void *data) +DWDialog * API dw_dialog_new(void *data) { DWDialog *tmp = malloc(sizeof(DWDialog)); @@ -3027,7 +3027,7 @@ * dialog: Pointer to a dialog struct aquired by dw_dialog_new). * result: Data to be returned by dw_dialog_wait(). */ -int dw_dialog_dismiss(DWDialog *dialog, void *result) +int API dw_dialog_dismiss(DWDialog *dialog, void *result) { dialog->result = result; dw_event_post(dialog->eve); @@ -3041,7 +3041,7 @@ * Parameters: * dialog: Pointer to a dialog struct aquired by dw_dialog_new). */ -void *dw_dialog_wait(DWDialog *dialog) +void * API dw_dialog_wait(DWDialog *dialog) { QMSG qmsg; void *tmp; @@ -3066,7 +3066,7 @@ * format: printf style format string. * ...: Additional variables for use in the format. */ -int dw_messagebox(char *title, char *format, ...) +int API dw_messagebox(char *title, char *format, ...) { va_list args; char outbuf[1024]; @@ -3088,7 +3088,7 @@ * Returns: * True if YES False of NO. */ -int dw_yesno(char *title, char *text) +int API dw_yesno(char *title, char *text) { if(WinMessageBox(HWND_DESKTOP, HWND_DESKTOP, text, title, 0, MB_YESNO | MB_INFORMATION | MB_MOVEABLE | MB_SYSTEMMODAL)==MBID_YES) return TRUE; @@ -3100,7 +3100,7 @@ * Parameters: * handle: The window handle to make topmost. */ -int dw_window_raise(HWND handle) +int API dw_window_raise(HWND handle) { return WinSetWindowPos(handle, HWND_TOP, 0, 0, 0, 0, SWP_ZORDER); } @@ -3110,7 +3110,7 @@ * Parameters: * handle: The window handle to make bottommost. */ -int dw_window_lower(HWND handle) +int API dw_window_lower(HWND handle) { return WinSetWindowPos(handle, HWND_BOTTOM, 0, 0, 0, 0, SWP_ZORDER); } @@ -3120,7 +3120,7 @@ * Parameters: * handle: The window handle to make visible. */ -int dw_window_show(HWND handle) +int API dw_window_show(HWND handle) { int rc = WinSetWindowPos(handle, NULLHANDLE, 0, 0, 0, 0, SWP_SHOW); HSWITCH hswitch; @@ -3177,7 +3177,7 @@ * Parameters: * handle: The window handle to minimize. */ -int dw_window_minimize(HWND handle) +int API dw_window_minimize(HWND handle) { HWND hwndclient = WinWindowFromID(handle, FID_CLIENT); @@ -3200,7 +3200,7 @@ * Parameters: * handle: The window handle to make visible. */ -int dw_window_hide(HWND handle) +int API dw_window_hide(HWND handle) { HSWITCH hswitch; SWCNTRL swcntrl; @@ -3221,7 +3221,7 @@ * Parameters: * handle: The window handle to destroy. */ -int dw_window_destroy(HWND handle) +int API dw_window_destroy(HWND handle) { HWND parent = WinQueryWindow(handle, QW_PARENT); Box *thisbox = WinQueryWindowPtr(parent, QWP_USER); @@ -3267,7 +3267,7 @@ * Parameters: * handle: Toplevel window handle to be redrawn. */ -void dw_window_redraw(HWND handle) +void API dw_window_redraw(HWND handle) { HWND client = WinWindowFromID(handle, FID_CLIENT); HWND window = client ? client : handle; @@ -3291,7 +3291,7 @@ * handle: The window handle to destroy. * newparent: The window's new parent window. */ -void dw_window_reparent(HWND handle, HWND newparent) +void API dw_window_reparent(HWND handle, HWND newparent) { HWND blah = WinWindowFromID(newparent, FID_CLIENT); WinSetParent(handle, blah ? blah : newparent, TRUE); @@ -3303,7 +3303,7 @@ * handle: The window (widget) handle. * fontname: Name and size of the font in the form "size.fontname" */ -int dw_window_set_font(HWND handle, char *fontname) +int API dw_window_set_font(HWND handle, char *fontname) { return WinSetPresParam(handle, PP_FONTNAMESIZE, strlen(fontname)+1, fontname); } @@ -3362,7 +3362,7 @@ * fore: Foreground color in DW_RGB format or a default color index. * back: Background color in DW_RGB format or a default color index. */ -int dw_window_set_color(HWND handle, ULONG fore, ULONG back) +int API dw_window_set_color(HWND handle, ULONG fore, ULONG back) { dw_window_set_data(handle, "_dw_fore", (void *)fore); dw_window_set_data(handle, "_dw_back", (void *)back); @@ -3376,7 +3376,7 @@ * handle: The window (widget) handle. * border: Size of the window border in pixels. */ -int dw_window_set_border(HWND handle, int border) +int API dw_window_set_border(HWND handle, int border) { WinSendMsg(handle, WM_SETBORDERSIZE, MPFROMSHORT(border), MPFROMSHORT(border)); return 0; @@ -3387,7 +3387,7 @@ * Parameters: * handle: Handle to receive mouse input. */ -void dw_window_capture(HWND handle) +void API dw_window_capture(HWND handle) { WinSetCapture(HWND_DESKTOP, handle); } @@ -3395,7 +3395,7 @@ /* * Releases previous mouse capture. */ -void dw_window_release(void) +void API dw_window_release(void) { WinSetCapture(HWND_DESKTOP, NULLHANDLE); } @@ -3405,7 +3405,7 @@ * Parameters: * handle: Handle to frame to be tracked. */ -void dw_window_track(HWND handle) +void API dw_window_track(HWND handle) { WinSendMsg(handle, WM_TRACKFRAME, MPFROMSHORT(TF_MOVE), 0); } @@ -3416,7 +3416,7 @@ * handle: Handle to widget for which to change. * cursortype: ID of the pointer you want. */ -void dw_window_pointer(HWND handle, int pointertype) +void API dw_window_pointer(HWND handle, int pointertype) { WinSetPointer(handle, WinQuerySysPointer(HWND_DESKTOP, @@ -3431,7 +3431,7 @@ * title: The Window title. * flStyle: Style flags, see the PM reference. */ -HWND dw_window_new(HWND hwndOwner, char *title, ULONG flStyle) +HWND API dw_window_new(HWND hwndOwner, char *title, ULONG flStyle) { HWND hwndclient = 0, hwndframe; Box *newbox = calloc(1, sizeof(Box)); @@ -3468,7 +3468,7 @@ * type: Either BOXVERT (vertical) or BOXHORZ (horizontal). * pad: Number of pixels to pad around the box. */ -HWND dw_box_new(int type, int pad) +HWND API dw_box_new(int type, int pad) { Box *newbox = calloc(1, sizeof(Box)); HWND hwndframe; @@ -3503,7 +3503,7 @@ * pad: Number of pixels to pad around the box. * title: Text to be displayined in the group outline. */ -HWND dw_groupbox_new(int type, int pad, char *title) +HWND API dw_groupbox_new(int type, int pad, char *title) { Box *newbox = calloc(1, sizeof(Box)); HWND hwndframe; @@ -3548,7 +3548,7 @@ * Parameters: * id: An ID to be used with dw_window_from_id or 0L. */ -HWND dw_mdi_new(unsigned long id) +HWND API dw_mdi_new(unsigned long id) { HWND hwndframe; @@ -3571,7 +3571,7 @@ * Parameters: * id: An ID to be used with WinWindowFromID() or 0L. */ -HWND dw_bitmap_new(ULONG id) +HWND API dw_bitmap_new(ULONG id) { return WinCreateWindow(HWND_OBJECT, WC_STATIC, @@ -3591,7 +3591,7 @@ * id: An ID to be used for getting the resource from the * resource file. */ -HWND dw_notebook_new(ULONG id, int top) +HWND API dw_notebook_new(ULONG id, int top) { ULONG flags; HWND tmp; @@ -3631,7 +3631,7 @@ * id: An ID to be used for getting the resource from the * resource file. */ -HMENUI dw_menu_new(ULONG id) +HMENUI API dw_menu_new(ULONG id) { HMENUI tmp = malloc(sizeof(struct _hmenui)); @@ -3656,7 +3656,7 @@ * Parameters: * location: Handle of a window frame to be attached to. */ -HMENUI dw_menubar_new(HWND location) +HMENUI API dw_menubar_new(HWND location) { HMENUI tmp = malloc(sizeof(struct _hmenui)); @@ -3681,7 +3681,7 @@ * Parameters: * menu: Handle of a menu. */ -void dw_menu_destroy(HMENUI *menu) +void API dw_menu_destroy(HMENUI *menu) { if(menu && *menu) { @@ -3702,7 +3702,7 @@ * check: If TRUE menu is "check"able. * submenu: Handle to an existing menu to be a submenu or NULL. */ -HWND dw_menu_append_item(HMENUI menux, char *title, ULONG id, ULONG flags, int end, int check, HMENUI submenu) +HWND API dw_menu_append_item(HMENUI menux, char *title, ULONG id, ULONG flags, int end, int check, HMENUI submenu) { MENUITEM miSubMenu; HWND menu; @@ -3740,7 +3740,7 @@ * id: Menuitem id. * check: TRUE for checked FALSE for not checked. */ -void dw_menu_item_set_check(HMENUI menux, unsigned long id, int check) +void API dw_menu_item_set_check(HMENUI menux, unsigned long id, int check) { HWND menu; @@ -3765,7 +3765,7 @@ * x: X coordinate. * y: Y coordinate. */ -void dw_menu_popup(HMENUI *menu, HWND parent, int x, int y) +void API dw_menu_popup(HMENUI *menu, HWND parent, int x, int y) { if(menu && *menu) { @@ -3782,7 +3782,7 @@ * x: Pointer to variable to store X coordinate. * y: Pointer to variable to store Y coordinate. */ -void dw_pointer_query_pos(long *x, long *y) +void API dw_pointer_query_pos(long *x, long *y) { POINTL ptl; @@ -3800,7 +3800,7 @@ * x: X coordinate. * y: Y coordinate. */ -void dw_pointer_set_pos(long x, long y) +void API dw_pointer_set_pos(long x, long y) { WinSetPointerPos(HWND_DESKTOP, x, dw_screen_height() - y); } @@ -3811,7 +3811,7 @@ * id: An ID to be used for getting the resource from the * resource file. */ -HWND dw_container_new(ULONG id) +HWND API dw_container_new(ULONG id) { WindowData *blah = calloc(1, sizeof(WindowData)); HWND tmp = WinCreateWindow(HWND_OBJECT, @@ -3838,7 +3838,7 @@ * id: An ID to be used for getting the resource from the * resource file. */ -HWND dw_tree_new(ULONG id) +HWND API dw_tree_new(ULONG id) { CNRINFO cnrinfo; WindowData *blah = calloc(1, sizeof(WindowData)); @@ -3875,7 +3875,7 @@ * text: The text to be display by the static text widget. * id: An ID to be used with WinWindowFromID() or 0L. */ -HWND dw_text_new(char *text, ULONG id) +HWND API dw_text_new(char *text, ULONG id) { HWND tmp = WinCreateWindow(HWND_OBJECT, WC_STATIC, @@ -3898,7 +3898,7 @@ * text: The text to be display by the static text widget. * id: An ID to be used with WinWindowFromID() or 0L. */ -HWND dw_status_text_new(char *text, ULONG id) +HWND API dw_status_text_new(char *text, ULONG id) { WindowData *blah = calloc(sizeof(WindowData), 1); HWND tmp = WinCreateWindow(HWND_OBJECT, @@ -3928,7 +3928,7 @@ * Parameters: * id: An ID to be used with WinWindowFromID() or 0L. */ -HWND dw_mle_new(ULONG id) +HWND API dw_mle_new(ULONG id) { WindowData *blah = calloc(1, sizeof(WindowData)); HWND tmp = WinCreateWindow(HWND_OBJECT, @@ -3956,7 +3956,7 @@ * text: The default text to be in the entryfield widget. * id: An ID to be used with WinWindowFromID() or 0L. */ -HWND dw_entryfield_new(char *text, ULONG id) +HWND API dw_entryfield_new(char *text, ULONG id) { WindowData *blah = calloc(1, sizeof(WindowData)); @@ -3984,7 +3984,7 @@ * text: The default text to be in the entryfield widget. * id: An ID to be used with WinWindowFromID() or 0L. */ -HWND dw_entryfield_password_new(char *text, ULONG id) +HWND API dw_entryfield_password_new(char *text, ULONG id) { WindowData *blah = calloc(1, sizeof(WindowData)); HWND tmp = WinCreateWindow(HWND_OBJECT, @@ -4011,7 +4011,7 @@ * text: The default text to be in the combpbox widget. * id: An ID to be used with WinWindowFromID() or 0L. */ -HWND dw_combobox_new(char *text, ULONG id) +HWND API dw_combobox_new(char *text, ULONG id) { WindowData *blah = calloc(1, sizeof(WindowData)); HWND tmp = WinCreateWindow(HWND_OBJECT, @@ -4048,7 +4048,7 @@ * text: The text to be display by the static text widget. * id: An ID to be used with WinWindowFromID() or 0L. */ -HWND dw_button_new(char *text, ULONG id) +HWND API dw_button_new(char *text, ULONG id) { BubbleButton *bubble = calloc(sizeof(BubbleButton), 1); @@ -4112,7 +4112,7 @@ * text: Bubble help text to be displayed. * id: An ID of a bitmap in the resource file. */ -HWND dw_bitmapbutton_new(char *text, ULONG id) +HWND API dw_bitmapbutton_new(char *text, ULONG id) { char idbuf[256]; HWND tmp; @@ -4148,7 +4148,7 @@ * text: The text to be display by the static text widget. * id: An ID to be used with WinWindowFromID() or 0L. */ -HWND dw_spinbutton_new(char *text, ULONG id) +HWND API dw_spinbutton_new(char *text, ULONG id) { WindowData *blah = calloc(sizeof(WindowData), 1); HWND tmp = WinCreateWindow(HWND_OBJECT, @@ -4178,7 +4178,7 @@ * text: The text to be display by the static text widget. * id: An ID to be used with WinWindowFromID() or 0L. */ -HWND dw_radiobutton_new(char *text, ULONG id) +HWND API dw_radiobutton_new(char *text, ULONG id) { WindowData *blah = calloc(sizeof(WindowData), 1); HWND tmp = WinCreateWindow(HWND_OBJECT, @@ -4207,7 +4207,7 @@ * increments: Number of increments available. * id: An ID to be used with WinWindowFromID() or 0L. */ -HWND dw_slider_new(int vertical, int increments, ULONG id) +HWND API dw_slider_new(int vertical, int increments, ULONG id) { WindowData *blah = calloc(1, sizeof(WindowData)); SLDCDATA sldcData = { 0, 0, 0, 0, 0 }; @@ -4236,7 +4236,7 @@ * Parameters: * id: An ID to be used with WinWindowFromID() or 0L. */ -HWND dw_percent_new(ULONG id) +HWND API dw_percent_new(ULONG id) { WindowData *blah = calloc(1, sizeof(WindowData)); HWND tmp = WinCreateWindow(HWND_OBJECT, @@ -4262,7 +4262,7 @@ * text: The text to be display by the static text widget. * id: An ID to be used with WinWindowFromID() or 0L. */ -HWND dw_checkbox_new(char *text, ULONG id) +HWND API dw_checkbox_new(char *text, ULONG id) { BubbleButton *bubble = calloc(sizeof(BubbleButton), 1); HWND tmp = WinCreateWindow(HWND_OBJECT, @@ -4290,7 +4290,7 @@ * id: An ID to be used with WinWindowFromID() or 0L. * multi: Multiple select TRUE or FALSE. */ -HWND dw_listbox_new(ULONG id, int multi) +HWND API dw_listbox_new(ULONG id, int multi) { WindowData *blah = calloc(sizeof(WindowData), 1); HWND tmp = WinCreateWindow(HWND_OBJECT, @@ -4317,7 +4317,7 @@ * handle: Handle to the window. * id: An ID to be used to specify the icon. */ -void dw_window_set_icon(HWND handle, ULONG id) +void API dw_window_set_icon(HWND handle, ULONG id) { HPOINTER icon; @@ -4331,7 +4331,7 @@ * handle: Handle to the window. * id: An ID to be used to specify the icon. */ -void dw_window_set_bitmap(HWND handle, ULONG id) +void API dw_window_set_bitmap(HWND handle, ULONG id) { HBITMAP hbm; HPS hps = WinGetPS(handle); @@ -4349,7 +4349,7 @@ * handle: Handle to the window. * text: The text associsated with a given window. */ -void dw_window_set_text(HWND handle, char *text) +void API dw_window_set_text(HWND handle, char *text) { WinSetWindowText(handle, text); } @@ -4361,7 +4361,7 @@ * Returns: * text: The text associsated with a given window. */ -char *dw_window_get_text(HWND handle) +char * API dw_window_get_text(HWND handle) { int len = WinQueryWindowTextLength(handle); char *tempbuf = calloc(1, len + 2); @@ -4376,7 +4376,7 @@ * Parameters: * handle: Handle to the window. */ -void dw_window_disable(HWND handle) +void API dw_window_disable(HWND handle) { char tmpbuf[100]; @@ -4421,7 +4421,7 @@ * Parameters: * handle: Handle to the window. */ -void dw_window_enable(HWND handle) +void API dw_window_enable(HWND handle) { ULONG fore = (ULONG)dw_window_get_data(handle, "_dw_fore"); ULONG back = (ULONG)dw_window_get_data(handle, "_dw_back"); @@ -4442,7 +4442,7 @@ * handle: Handle to the parent window. * id: Integer ID of the child. */ -HWND dw_window_from_id(HWND handle, int id) +HWND API dw_window_from_id(HWND handle, int id) { HENUM henum; HWND child; @@ -4482,7 +4482,7 @@ * vsize: TRUE if the window (widget) should expand vertically to fill space given. * pad: Number of pixels of padding around the item. */ -void dw_box_pack_end(HWND box, HWND item, int width, int height, int hsize, int vsize, int pad) +void API dw_box_pack_end(HWND box, HWND item, int width, int height, int hsize, int vsize, int pad) { Box *thisbox; @@ -4581,7 +4581,7 @@ * width: New width in pixels. * height: New height in pixels. */ -void dw_window_set_usize(HWND handle, ULONG width, ULONG height) +void API dw_window_set_usize(HWND handle, ULONG width, ULONG height) { WinSetWindowPos(handle, NULLHANDLE, 0, 0, width, height, SWP_SHOW | SWP_SIZE); } @@ -4589,7 +4589,7 @@ /* * Returns the width of the screen. */ -int dw_screen_width(void) +int API dw_screen_width(void) { return WinQuerySysValue(HWND_DESKTOP,SV_CXSCREEN); } @@ -4597,13 +4597,13 @@ /* * Returns the height of the screen. */ -int dw_screen_height(void) +int API dw_screen_height(void) { return WinQuerySysValue(HWND_DESKTOP,SV_CYSCREEN); } /* This should return the current color depth */ -unsigned long dw_color_depth(void) +unsigned long API dw_color_depth(void) { HDC hdc = WinOpenWindowDC(HWND_DESKTOP); long colors; @@ -4621,7 +4621,7 @@ * x: X location from the bottom left. * y: Y location from the bottom left. */ -void dw_window_set_pos(HWND handle, ULONG x, ULONG y) +void API dw_window_set_pos(HWND handle, ULONG x, ULONG y) { int myy = _get_frame_height(handle) - (y + _get_height(handle)); @@ -4637,7 +4637,7 @@ * width: Width of the widget. * height: Height of the widget. */ -void dw_window_set_pos_size(HWND handle, ULONG x, ULONG y, ULONG width, ULONG height) +void API dw_window_set_pos_size(HWND handle, ULONG x, ULONG y, ULONG width, ULONG height) { int myy = _get_frame_height(handle) - (y + height); @@ -4653,7 +4653,7 @@ * width: Width of the widget. * height: Height of the widget. */ -void dw_window_get_pos_size(HWND handle, ULONG *x, ULONG *y, ULONG *width, ULONG *height) +void API dw_window_get_pos_size(HWND handle, ULONG *x, ULONG *y, ULONG *width, ULONG *height) { SWP swp; WinQueryWindowPos(handle, &swp); @@ -4674,7 +4674,7 @@ * width: New width in pixels. * height: New height in pixels. */ -void dw_window_set_style(HWND handle, ULONG style, ULONG mask) +void API dw_window_set_style(HWND handle, ULONG style, ULONG mask) { WinSetWindowBits(handle, QWL_STYLE, style, mask); } @@ -4686,7 +4686,7 @@ * flags: Any additional page creation flags. * front: If TRUE page is added at the beginning. */ -ULONG dw_notebook_page_new(HWND handle, ULONG flags, int front) +unsigned long API dw_notebook_page_new(HWND handle, ULONG flags, int front) { if(front) return (ULONG)WinSendMsg(handle, BKM_INSERTPAGE, 0L, @@ -4701,7 +4701,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 API dw_notebook_page_destroy(HWND handle, unsigned int pageid) { WinSendMsg(handle, BKM_DELETEPAGE, MPFROMLONG(pageid), (MPARAM)BKA_SINGLE); @@ -4712,7 +4712,7 @@ * Parameters: * handle: Handle to the notebook widget. */ -unsigned int dw_notebook_page_query(HWND handle) +unsigned int API dw_notebook_page_query(HWND handle) { return (int)WinSendMsg(handle, BKM_QUERYPAGEID,0L, MPFROM2SHORT(BKA_TOP, BKA_MAJOR)); } @@ -4723,7 +4723,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 API dw_notebook_page_set(HWND handle, unsigned int pageid) { WinSendMsg(handle, BKM_TURNTOPAGE, MPFROMLONG(pageid), 0L); } @@ -4735,7 +4735,7 @@ * pageid: Page ID of the tab to set. * text: Pointer to the text to set. */ -void dw_notebook_page_set_text(HWND handle, ULONG pageid, char *text) +void API dw_notebook_page_set_text(HWND handle, ULONG pageid, char *text) { WinSendMsg(handle, BKM_SETTABTEXT, MPFROMLONG(pageid), MPFROMP(text)); @@ -4748,7 +4748,7 @@ * pageid: Page ID of the tab to set. * text: Pointer to the text to set. */ -void dw_notebook_page_set_status_text(HWND handle, ULONG pageid, char *text) +void API dw_notebook_page_set_status_text(HWND handle, ULONG pageid, char *text) { WinSendMsg(handle, BKM_SETSTATUSLINETEXT, MPFROMLONG(pageid), MPFROMP(text)); @@ -4761,7 +4761,7 @@ * pageid: Page ID in the notebook which is being packed. * page: Box handle to be packed. */ -void dw_notebook_pack(HWND handle, ULONG pageid, HWND page) +void API dw_notebook_pack(HWND handle, ULONG pageid, HWND page) { HWND tmpbox = dw_box_new(BOXVERT, 0); @@ -4777,7 +4777,7 @@ * handle: Handle to the listbox to be appended to. * text: Text to append into listbox. */ -void dw_listbox_append(HWND handle, char *text) +void API dw_listbox_append(HWND handle, char *text) { WinSendMsg(handle, LM_INSERTITEM, @@ -4790,7 +4790,7 @@ * Parameters: * handle: Handle to the listbox to be cleared. */ -void dw_listbox_clear(HWND handle) +void API dw_listbox_clear(HWND handle) { WinSendMsg(handle, LM_DELETEALL, 0L, 0L); @@ -4801,7 +4801,7 @@ * Parameters: * handle: Handle to the listbox to be cleared. */ -int dw_listbox_count(HWND handle) +int API dw_listbox_count(HWND handle) { return (int)WinSendMsg(handle, LM_QUERYITEMCOUNT,0L, 0L); @@ -4813,7 +4813,7 @@ * handle: Handle to the listbox to be cleared. * top: Index to the top item. */ -void dw_listbox_set_top(HWND handle, int top) +void API dw_listbox_set_top(HWND handle, int top) { WinSendMsg(handle, LM_SETTOPINDEX, @@ -4829,7 +4829,7 @@ * buffer: Buffer where text will be copied. * length: Length of the buffer (including NULL). */ -void dw_listbox_query_text(HWND handle, unsigned int index, char *buffer, unsigned int length) +void API dw_listbox_query_text(HWND handle, unsigned int index, char *buffer, unsigned int length) { WinSendMsg(handle, LM_QUERYITEMTEXT, MPFROM2SHORT(index, length), (MPARAM)buffer); } @@ -4841,7 +4841,7 @@ * index: Index into the list to be queried. * buffer: Buffer where text will be copied. */ -void dw_listbox_set_text(HWND handle, unsigned int index, char *buffer) +void API dw_listbox_set_text(HWND handle, unsigned int index, char *buffer) { WinSendMsg(handle, LM_SETITEMTEXT, MPFROMSHORT(index), (MPARAM)buffer); } @@ -4851,7 +4851,7 @@ * Parameters: * handle: Handle to the listbox to be queried. */ -unsigned int dw_listbox_selected(HWND handle) +unsigned int API dw_listbox_selected(HWND handle) { return (unsigned int)WinSendMsg(handle, LM_QUERYSELECTION, @@ -4865,7 +4865,7 @@ * handle: Handle to the listbox to be queried. * where: Either the previous return or -1 to restart. */ -int dw_listbox_selected_multi(HWND handle, int where) +int API dw_listbox_selected_multi(HWND handle, int where) { int place = where; @@ -4887,7 +4887,7 @@ * index: Item index. * state: TRUE if selected FALSE if unselected. */ -void dw_listbox_select(HWND handle, int index, int state) +void API dw_listbox_select(HWND handle, int index, int state) { char tmpbuf[100]; @@ -4906,7 +4906,7 @@ * handle: Handle to the listbox to be set. * index: Item index. */ -void dw_listbox_delete(HWND handle, int index) +void API dw_listbox_delete(HWND handle, int index) { WinSendMsg(handle, LM_DELETEITEM, MPFROMSHORT(index), 0); } @@ -4918,7 +4918,7 @@ * buffer: Text buffer to be imported. * startpoint: Point to start entering text. */ -unsigned int dw_mle_import(HWND handle, char *buffer, int startpoint) +unsigned int API dw_mle_import(HWND handle, char *buffer, int startpoint) { unsigned long point = startpoint; PBYTE mlebuf; @@ -4957,7 +4957,7 @@ * startpoint: Point to start grabbing text. * length: Amount of text to be grabbed. */ -void dw_mle_export(HWND handle, char *buffer, int startpoint, int length) +void API dw_mle_export(HWND handle, char *buffer, int startpoint, int length) { PBYTE mlebuf; @@ -4996,7 +4996,7 @@ * bytes: A pointer to a variable to return the total bytes. * lines: A pointer to a variable to return the number of lines. */ -void dw_mle_query(HWND handle, unsigned long *bytes, unsigned long *lines) +void API dw_mle_query(HWND handle, unsigned long *bytes, unsigned long *lines) { if(bytes) *bytes = (unsigned long)WinSendMsg(handle, MLM_QUERYTEXTLENGTH, 0, 0); @@ -5011,7 +5011,7 @@ * startpoint: Point to start deleting text. * length: Amount of text to be deleted. */ -void dw_mle_delete(HWND handle, int startpoint, int length) +void API dw_mle_delete(HWND handle, int startpoint, int length) { char *buf = malloc(length+1); int z, dellen = length; @@ -5032,7 +5032,7 @@ * Parameters: * handle: Handle to the MLE to be cleared. */ -void dw_mle_clear(HWND handle) +void API dw_mle_clear(HWND handle) { unsigned long bytes; @@ -5047,7 +5047,7 @@ * handle: Handle to the MLE to be positioned. * line: Line to be visible. */ -void dw_mle_set_visible(HWND handle, int line) +void API dw_mle_set_visible(HWND handle, int line) { int tmppnt = (int)WinSendMsg(handle, MLM_CHARFROMLINE, MPFROMLONG(line), 0); WinSendMsg(handle, MLM_SETSEL, MPFROMLONG(tmppnt), MPFROMLONG(tmppnt)); @@ -5059,7 +5059,7 @@ * handle: Handle to the MLE. * state: TRUE if it can be edited, FALSE for readonly. */ -void dw_mle_set_editable(HWND handle, int state) +void API dw_mle_set_editable(HWND handle, int state) { WinSendMsg(handle, MLM_SETREADONLY, MPFROMLONG(state ? FALSE : TRUE), 0); } @@ -5070,7 +5070,7 @@ * handle: Handle to the MLE. * state: TRUE if it wraps, FALSE if it doesn't. */ -void dw_mle_set_word_wrap(HWND handle, int state) +void API dw_mle_set_word_wrap(HWND handle, int state) { WinSendMsg(handle, MLM_SETWRAP, MPFROMLONG(state), 0); } @@ -5081,7 +5081,7 @@ * handle: Handle to the MLE to be positioned. * point: Point to position cursor. */ -void dw_mle_set(HWND handle, int point) +void API dw_mle_set(HWND handle, int point) { WinSendMsg(handle, MLM_SETSEL, MPFROMLONG(point), MPFROMLONG(point)); } @@ -5094,7 +5094,7 @@ * point: Start point of search. * flags: Search specific flags. */ -int dw_mle_search(HWND handle, char *text, int point, unsigned long flags) +int API dw_mle_search(HWND handle, char *text, int point, unsigned long flags) { MLE_SEARCHDATA msd; @@ -5119,7 +5119,7 @@ * Parameters: * handle: Handle to the MLE to freeze. */ -void dw_mle_freeze(HWND handle) +void API dw_mle_freeze(HWND handle) { WinSendMsg(handle, MLM_DISABLEREFRESH, 0, 0); } @@ -5129,7 +5129,7 @@ * Parameters: * handle: Handle to the MLE to thaw. */ -void dw_mle_thaw(HWND handle) +void API dw_mle_thaw(HWND handle) { WinSendMsg(handle, MLM_ENABLEREFRESH, 0, 0); } @@ -5139,7 +5139,7 @@ * Parameters: * handle: Handle to the percent bar to be queried. */ -unsigned int dw_percent_query_range(HWND handle) +unsigned int API dw_percent_query_range(HWND handle) { return SHORT2FROMMP(WinSendMsg(handle, SLM_QUERYSLIDERINFO, MPFROM2SHORT(SMA_SLIDERARMPOSITION,SMA_RANGEVALUE), 0)); } @@ -5150,7 +5150,7 @@ * handle: Handle to the percent bar to be set. * position: Position of the percent bar withing the range. */ -void dw_percent_set_pos(HWND handle, unsigned int position) +void API dw_percent_set_pos(HWND handle, unsigned int position) { _dw_int_set(handle, position); WinSendMsg(handle, SLM_SETSLIDERINFO, MPFROM2SHORT(SMA_SLIDERARMPOSITION,SMA_RANGEVALUE), (MPARAM)position); @@ -5161,7 +5161,7 @@ * Parameters: * handle: Handle to the slider to be queried. */ -unsigned int dw_slider_query_pos(HWND handle) +unsigned int API dw_slider_query_pos(HWND handle) { return (unsigned int)WinSendMsg(handle, SLM_QUERYSLIDERINFO, MPFROM2SHORT(SMA_SLIDERARMPOSITION, SMA_INCREMENTVALUE), 0); } @@ -5172,7 +5172,7 @@ * handle: Handle to the slider to be set. * position: Position of the slider withing the range. */ -void dw_slider_set_pos(HWND handle, unsigned int position) +void API dw_slider_set_pos(HWND handle, unsigned int position) { dw_window_set_data(handle, "_dw_slider_value", (void *)position); WinSendMsg(handle, SLM_SETSLIDERINFO, MPFROM2SHORT(SMA_SLIDERARMPOSITION, SMA_INCREMENTVALUE), (MPARAM)position); @@ -5184,7 +5184,7 @@ * handle: Handle to the spinbutton to be set. * position: Current value of the spinbutton. */ -void dw_spinbutton_set_pos(HWND handle, long position) +void API dw_spinbutton_set_pos(HWND handle, long position) { WinSendMsg(handle, SPBM_SETCURRENTVALUE, MPFROMLONG((long)position), 0L); } @@ -5196,7 +5196,7 @@ * upper: Upper limit. * lower: Lower limit. */ -void dw_spinbutton_set_limits(HWND handle, long upper, long lower) +void API dw_spinbutton_set_limits(HWND handle, long upper, long lower) { WinSendMsg(handle, SPBM_SETLIMITS, MPFROMLONG(upper), MPFROMLONG(lower)); } @@ -5207,7 +5207,7 @@ * handle: Handle to the spinbutton to be set. * limit: Number of characters the entryfield will take. */ -void dw_entryfield_set_limit(HWND handle, ULONG limit) +void API dw_entryfield_set_limit(HWND handle, ULONG limit) { WinSendMsg(handle, EM_SETTEXTLIMIT, (MPARAM)limit, (MPARAM)0); } @@ -5218,7 +5218,7 @@ * Parameters: * handle: Handle to the spinbutton to be queried. */ -long dw_spinbutton_query(HWND handle) +long API dw_spinbutton_query(HWND handle) { long tmpval = 0L; @@ -5231,7 +5231,7 @@ * Parameters: * handle: Handle to the checkbox to be queried. */ -int dw_checkbox_query(HWND handle) +int API dw_checkbox_query(HWND handle) { return (int)WinSendMsg(handle,BM_QUERYCHECK,0,0); } @@ -5242,7 +5242,7 @@ * handle: Handle to the checkbox to be queried. * value: TRUE for checked, FALSE for unchecked. */ -void dw_checkbox_set(HWND handle, int value) +void API dw_checkbox_set(HWND handle, int value) { WinSendMsg(handle,BM_SETCHECK,MPFROMSHORT(value),0); } @@ -5257,7 +5257,7 @@ * parent: Parent handle or 0 if root. * itemdata: Item specific data. */ -HWND dw_tree_insert_after(HWND handle, HWND item, char *title, unsigned long icon, HWND parent, void *itemdata) +HWND API dw_tree_insert_after(HWND handle, HWND item, char *title, unsigned long icon, HWND parent, void *itemdata) { ULONG cbExtra; PCNRITEM pci; @@ -5314,7 +5314,7 @@ * parent: Parent handle or 0 if root. * itemdata: Item specific data. */ -HWND dw_tree_insert(HWND handle, char *title, unsigned long icon, HWND parent, void *itemdata) +HWND API dw_tree_insert(HWND handle, char *title, unsigned long icon, HWND parent, void *itemdata) { return dw_tree_insert_after(handle, (HWND)CMA_END, title, icon, parent, itemdata); } @@ -5327,7 +5327,7 @@ * title: The text title of the entry. * icon: Handle to coresponding icon. */ -void dw_tree_set(HWND handle, HWND item, char *title, unsigned long icon) +void API dw_tree_set(HWND handle, HWND item, char *title, unsigned long icon) { PCNRITEM pci = (PCNRITEM)item; @@ -5352,7 +5352,7 @@ * item: Handle of the item to be modified. * itemdata: User defined data to be associated with item. */ -void dw_tree_set_data(HWND handle, HWND item, void *itemdata) +void API dw_tree_set_data(HWND handle, HWND item, void *itemdata) { PCNRITEM pci = (PCNRITEM)item; @@ -5368,7 +5368,7 @@ * handle: Handle to the tree window (widget) to be selected. * item: Handle to the item to be selected. */ -void dw_tree_item_select(HWND handle, HWND item) +void API dw_tree_item_select(HWND handle, HWND item) { PRECORDCORE pCore = WinSendMsg(handle, CM_QUERYRECORD, (MPARAM)0L, MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER)); @@ -5388,7 +5388,7 @@ * Parameters: * handle: Handle to the window (widget) to be cleared. */ -void dw_tree_clear(HWND handle) +void API dw_tree_clear(HWND handle) { WinSendMsg(handle, CM_REMOVERECORD, (MPARAM)0L, MPFROM2SHORT(0, CMA_INVALIDATE | CMA_FREE)); } @@ -5399,7 +5399,7 @@ * handle: Handle to the tree window (widget). * item: Handle to node to be expanded. */ -void dw_tree_expand(HWND handle, HWND item) +void API dw_tree_expand(HWND handle, HWND item) { WinSendMsg(handle, CM_EXPANDTREE, MPFROMP(item), 0); } @@ -5410,7 +5410,7 @@ * handle: Handle to the tree window (widget). * item: Handle to node to be collapsed. */ -void dw_tree_collapse(HWND handle, HWND item) +void API dw_tree_collapse(HWND handle, HWND item) { WinSendMsg(handle, CM_COLLAPSETREE, MPFROMP(item), 0); } @@ -5421,7 +5421,7 @@ * handle: Handle to the window (widget) to be cleared. * item: Handle to node to be deleted. */ -void dw_tree_delete(HWND handle, HWND item) +void API dw_tree_delete(HWND handle, HWND item) { PCNRITEM pci = (PCNRITEM)item; @@ -5454,7 +5454,7 @@ * separator: The column number that contains the main separator. * (this item may only be used in OS/2) */ -int dw_container_setup(HWND handle, unsigned long *flags, char **titles, int count, int separator) +int API dw_container_setup(HWND handle, unsigned long *flags, char **titles, int count, int separator) { PFIELDINFO details, first, left = NULL; FIELDINFOINSERT detin; @@ -5547,7 +5547,7 @@ * titles: An array of strings with column text titles. * count: The number of columns (this should match the arrays). */ -int dw_filesystem_setup(HWND handle, unsigned long *flags, char **titles, int count) +int API dw_filesystem_setup(HWND handle, unsigned long *flags, char **titles, int count) { char **newtitles = malloc(sizeof(char *) * (count + 2)); unsigned long *newflags = malloc(sizeof(unsigned long) * (count + 2)); @@ -5576,7 +5576,7 @@ * Windows, on GTK this is converted to a pointer * to an embedded XPM. */ -unsigned long dw_icon_load(unsigned long module, unsigned long id) +unsigned long API dw_icon_load(unsigned long module, unsigned long id) { return WinLoadPointer(HWND_DESKTOP,module,id); } @@ -5586,7 +5586,7 @@ * Parameters: * handle: Handle to icon returned by dw_icon_load(). */ -void dw_icon_free(unsigned long handle) +void API dw_icon_free(unsigned long handle) { WinDestroyPointer(handle); } @@ -5597,7 +5597,7 @@ * handle: Handle to the container window (widget). * rowcount: The number of items to be populated. */ -void *dw_container_alloc(HWND handle, int rowcount) +void * API dw_container_alloc(HWND handle, int rowcount) { WindowData *wd = (WindowData *)WinQueryWindowPtr(handle, QWP_USER); ULONG *flags = wd ? wd->data : 0; @@ -5725,7 +5725,7 @@ * row: Zero based row of data being set. * data: Pointer to the data to be added. */ -void dw_container_set_item(HWND handle, void *pointer, int column, int row, void *data) +void API dw_container_set_item(HWND handle, void *pointer, int column, int row, void *data) { ContainerInfo *ci = (ContainerInfo *)pointer; @@ -5743,7 +5743,7 @@ * row: Zero based row of data being set. * data: Pointer to the data to be added. */ -void dw_container_change_item(HWND handle, int column, int row, void *data) +void API dw_container_change_item(HWND handle, int column, int row, void *data) { PRECORDCORE pCore = WinSendMsg(handle, CM_QUERYRECORD, (MPARAM)0L, MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER)); int count = 0; @@ -5770,7 +5770,7 @@ * row: Zero based row of data being set. * data: Pointer to the data to be added. */ -void dw_filesystem_set_file(HWND handle, void *pointer, int row, char *filename, unsigned long icon) +void API dw_filesystem_set_file(HWND handle, void *pointer, int row, char *filename, unsigned long icon) { dw_container_set_item(handle, pointer, 0, row, (void *)&icon); dw_container_set_item(handle, pointer, 1, row, (void *)&filename); @@ -5785,7 +5785,7 @@ * row: Zero based row of data being set. * data: Pointer to the data to be added. */ -void dw_filesystem_set_item(HWND handle, void *pointer, int column, int row, void *data) +void API dw_filesystem_set_item(HWND handle, void *pointer, int column, int row, void *data) { dw_container_set_item(handle, pointer, column + 2, row, data); } @@ -5797,7 +5797,7 @@ * column: Zero based column of width being set. * width: Width of column in pixels. */ -void dw_container_set_column_width(HWND handle, int column, int width) +void API dw_container_set_column_width(HWND handle, int column, int width) { } @@ -5808,7 +5808,7 @@ * row: Zero based row of data being set. * title: String title of the item. */ -void dw_container_set_row_title(void *pointer, int row, char *title) +void API dw_container_set_row_title(void *pointer, int row, char *title) { ContainerInfo *ci = (ContainerInfo *)pointer; PRECORDCORE temp; @@ -5846,7 +5846,7 @@ * pointer: Pointer to the allocated memory in dw_container_alloc(). * rowcount: The number of rows to be inserted. */ -void dw_container_insert(HWND handle, void *pointer, int rowcount) +void API dw_container_insert(HWND handle, void *pointer, int rowcount) { RECORDINSERT recin; ContainerInfo *ci = (ContainerInfo *)pointer; @@ -5881,7 +5881,7 @@ * handle: Handle to the window (widget) to be cleared. * redraw: TRUE to cause the container to redraw immediately. */ -void dw_container_clear(HWND handle, int redraw) +void API dw_container_clear(HWND handle, int redraw) { int z = 0; @@ -5900,7 +5900,7 @@ * handle: Handle to the window (widget) to be deleted from. * rowcount: The number of rows to be deleted. */ -void dw_container_delete(HWND handle, int rowcount) +void API dw_container_delete(HWND handle, int rowcount) { RECORDCORE *last, **prc = malloc(sizeof(RECORDCORE *) * rowcount); int current = 1, z; @@ -5934,7 +5934,7 @@ * DW_SCROLL_BOTTOM. (rows is ignored for last two) * rows: The number of rows to be scrolled. */ -void dw_container_scroll(HWND handle, int direction, long rows) +void API dw_container_scroll(HWND handle, int direction, long rows) { switch(direction) { @@ -5952,7 +5952,7 @@ * Parameters: * handle: Handle to the window (widget) to be cleared. */ -void dw_container_set_view(HWND handle, unsigned long flags, int iconwidth, int iconheight) +void API dw_container_set_view(HWND handle, unsigned long flags, int iconwidth, int iconheight) { CNRINFO cnrinfo; @@ -5971,7 +5971,7 @@ * return items that are currently selected. Otherwise * it will return all records in the container. */ -char *dw_container_query_start(HWND handle, unsigned long flags) +char * API dw_container_query_start(HWND handle, unsigned long flags) { pCore = WinSendMsg(handle, CM_QUERYRECORD, (MPARAM)0L, MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER)); if(pCore) @@ -5999,7 +5999,7 @@ * return items that are currently selected. Otherwise * it will return all records in the container. */ -char *dw_container_query_next(HWND handle, unsigned long flags) +char * API dw_container_query_next(HWND handle, unsigned long flags) { pCore = WinSendMsg(handle, CM_QUERYRECORD, (MPARAM)pCore, MPFROM2SHORT(CMA_NEXT, CMA_ITEMORDER)); if(pCore) @@ -6026,7 +6026,7 @@ * handle: Handle to the window (widget) to be queried. * text: Text usually returned by dw_container_query(). */ -void dw_container_cursor(HWND handle, char *text) +void API dw_container_cursor(HWND handle, char *text) { RECTL viewport, item; @@ -6064,7 +6064,7 @@ * handle: Handle to the window (widget). * text: Text usually returned by dw_container_query(). */ -void dw_container_delete_row(HWND handle, char *text) +void API dw_container_delete_row(HWND handle, char *text) { PRECORDCORE pCore = WinSendMsg(handle, CM_QUERYRECORD, (MPARAM)0L, MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER)); @@ -6084,7 +6084,7 @@ * Parameters: * handle: Handle to the window (widget) to be optimized. */ -void dw_container_optimize(HWND handle) +void API dw_container_optimize(HWND handle) { WindowData *blah = (WindowData *)WinQueryWindowPtr(handle, QWP_USER); RECTL item; @@ -6133,7 +6133,7 @@ * Returns: * A handle to the widget or NULL on failure. */ -HWND dw_render_new(unsigned long id) +HWND API dw_render_new(unsigned long id) { HWND hwndframe = WinCreateWindow(HWND_OBJECT, WC_FRAME, @@ -6156,7 +6156,7 @@ * green: green value. * blue: blue value. */ -void dw_color_foreground_set(unsigned long value) +void API dw_color_foreground_set(unsigned long value) { _foreground = DW_RED_VALUE(value) << 16 | DW_GREEN_VALUE(value) << 8 | DW_BLUE_VALUE(value); } @@ -6167,7 +6167,7 @@ * green: green value. * blue: blue value. */ -void dw_color_background_set(unsigned long value) +void API dw_color_background_set(unsigned long value) { _background = DW_RED_VALUE(value) << 16 | DW_GREEN_VALUE(value) << 8 | DW_BLUE_VALUE(value); } @@ -6207,7 +6207,7 @@ * x: X coordinate. * y: Y coordinate. */ -void dw_draw_point(HWND handle, HPIXMAP pixmap, int x, int y) +void API dw_draw_point(HWND handle, HPIXMAP pixmap, int x, int y) { HPS hps; int height; @@ -6243,7 +6243,7 @@ * x2: Second X coordinate. * y2: Second Y coordinate. */ -void dw_draw_line(HWND handle, HPIXMAP pixmap, int x1, int y1, int x2, int y2) +void API dw_draw_line(HWND handle, HPIXMAP pixmap, int x1, int y1, int x2, int y2) { HPS hps; int height; @@ -6305,7 +6305,7 @@ * y: Y coordinate. * text: Text to be displayed. */ -void dw_draw_text(HWND handle, HPIXMAP pixmap, int x, int y, char *text) +void API dw_draw_text(HWND handle, HPIXMAP pixmap, int x, int y, char *text) { HPS hps; int size = 9, z, height; @@ -6357,7 +6357,7 @@ * width: Pointer to a variable to be filled in with the width. * height Pointer to a variable to be filled in with the height. */ -void dw_font_text_extents(HWND handle, HPIXMAP pixmap, char *text, int *width, int *height) +void API dw_font_text_extents(HWND handle, HPIXMAP pixmap, char *text, int *width, int *height) { HPS hps; POINTL aptl[TXTBOX_COUNT]; @@ -6399,7 +6399,7 @@ * width: Width of rectangle. * height: Height of rectangle. */ -void dw_draw_rect(HWND handle, HPIXMAP pixmap, int fill, int x, int y, int width, int height) +void API dw_draw_rect(HWND handle, HPIXMAP pixmap, int fill, int x, int y, int width, int height) { HPS hps; int thisheight; @@ -6433,7 +6433,7 @@ /* Call this after drawing to the screen to make sure * anything you have drawn is visible. */ -void dw_flush(void) +void API dw_flush(void) { } @@ -6447,7 +6447,7 @@ * Returns: * A handle to a pixmap or NULL on failure. */ -HPIXMAP dw_pixmap_new(HWND handle, unsigned long width, unsigned long height, int depth) +HPIXMAP API dw_pixmap_new(HWND handle, unsigned long width, unsigned long height, int depth) { BITMAPINFOHEADER bmih; SIZEL sizl = { 0, 0 }; @@ -6505,7 +6505,7 @@ * Returns: * A handle to a pixmap or NULL on failure. */ -HPIXMAP dw_pixmap_grab(HWND handle, ULONG id) +HPIXMAP API dw_pixmap_grab(HWND handle, ULONG id) { BITMAPINFOHEADER bmih; SIZEL sizl = { 0, 0 }; @@ -6544,7 +6544,7 @@ * pixmap: Handle to a pixmap returned by * dw_pixmap_new.. */ -void dw_pixmap_destroy(HPIXMAP pixmap) +void API dw_pixmap_destroy(HPIXMAP pixmap) { GpiSetBitmap(pixmap->hps, NULLHANDLE); GpiDeleteBitmap(pixmap->hbm); @@ -6568,7 +6568,7 @@ * xsrc: X coordinate of source. * ysrc: Y coordinate of source. */ -void dw_pixmap_bitblt(HWND dest, HPIXMAP destp, int xdest, int ydest, int width, int height, HWND src, HPIXMAP srcp, int xsrc, int ysrc) +void API dw_pixmap_bitblt(HWND dest, HPIXMAP destp, int xdest, int ydest, int width, int height, HWND src, HPIXMAP srcp, int xsrc, int ysrc) { HPS hpsdest; HPS hpssrc; @@ -6628,7 +6628,7 @@ * freq: Frequency. * dur: Duration. */ -void dw_beep(int freq, int dur) +void API dw_beep(int freq, int dur) { DosBeep(freq, dur); } @@ -6639,7 +6639,7 @@ * handle: Pointer to a module handle, * will be filled in with the handle. */ -int dw_module_load(char *name, HMOD *handle) +int API dw_module_load(char *name, HMOD *handle) { char objnamebuf[300] = ""; @@ -6653,7 +6653,7 @@ * func: A pointer to a function pointer, to obtain * the address. */ -int dw_module_symbol(HMOD handle, char *name, void**func) +int API dw_module_symbol(HMOD handle, char *name, void**func) { return DosQueryProcAddr(handle, 0, name, (PFN*)func); } @@ -6662,7 +6662,7 @@ * Parameters: * handle: Module handle returned by dw_module_load() */ -int dw_module_close(HMOD handle) +int API dw_module_close(HMOD handle) { DosFreeModule(handle); return 0; @@ -6671,7 +6671,7 @@ /* * Returns the handle to an unnamed mutex semaphore. */ -HMTX dw_mutex_new(void) +HMTX API dw_mutex_new(void) { HMTX mutex; @@ -6684,7 +6684,7 @@ * Parameters: * mutex: The handle to the mutex returned by dw_mutex_new(). */ -void dw_mutex_close(HMTX mutex) +void API dw_mutex_close(HMTX mutex) { DosCloseMutexSem(mutex); } @@ -6696,7 +6696,7 @@ * Parameters: * mutex: The handle to the mutex returned by dw_mutex_new(). */ -void dw_mutex_lock(HMTX mutex) +void API dw_mutex_lock(HMTX mutex) { if(_dwtid == dw_thread_id()) { @@ -6717,7 +6717,7 @@ * Parameters: * mutex: The handle to the mutex returned by dw_mutex_new(). */ -void dw_mutex_unlock(HMTX mutex) +void API dw_mutex_unlock(HMTX mutex) { DosReleaseMutexSem(mutex); } @@ -6725,7 +6725,7 @@ /* * Returns the handle to an unnamed event semaphore. */ -HEV dw_event_new(void) +HEV API dw_event_new(void) { HEV blah; @@ -6740,7 +6740,7 @@ * Parameters: * eve: The handle to the event returned by dw_event_new(). */ -int dw_event_reset(HEV eve) +int API dw_event_reset(HEV eve) { ULONG count; @@ -6755,7 +6755,7 @@ * Parameters: * eve: The handle to the event returned by dw_event_new(). */ -int dw_event_post(HEV eve) +int API dw_event_post(HEV eve) { if(DosPostEventSem(eve)) return FALSE; @@ -6769,7 +6769,7 @@ * Parameters: * eve: The handle to the event returned by dw_event_new(). */ -int dw_event_wait(HEV eve, unsigned long timeout) +int API dw_event_wait(HEV eve, unsigned long timeout) { int rc = DosWaitEventSem(eve, timeout); if(!rc) @@ -6784,7 +6784,7 @@ * Parameters: * eve: The handle to the event returned by dw_event_new(). */ -int dw_event_close(HEV *eve) +int API dw_event_close(HEV *eve) { if(!eve || ~DosCloseEventSem(*eve)) return FALSE; @@ -6817,7 +6817,7 @@ * data: Parameter(s) passed to the function. * stack: Stack size of new thread (OS/2 and Windows only). */ -DWTID dw_thread_new(void *func, void *data, int stack) +DWTID API dw_thread_new(void *func, void *data, int stack) { void **tmp = malloc(sizeof(void *) * 2); @@ -6830,7 +6830,7 @@ /* * Ends execution of current thread immediately. */ -void dw_thread_end(void) +void API dw_thread_end(void) { _endthread(); } @@ -6838,7 +6838,7 @@ /* * Returns the current thread's ID. */ -DWTID dw_thread_id(void) +DWTID API dw_thread_id(void) { return (DWTID)_threadid; } @@ -6848,7 +6848,7 @@ * Parameters: * exitcode: Exit code reported to the operating system. */ -void dw_exit(int exitcode) +void API dw_exit(int exitcode) { /* In case we are in a signal handler, don't * try to free memory that could possibly be @@ -6868,7 +6868,7 @@ * Returns: * A handle to a splitbar window or NULL on failure. */ -HWND dw_splitbar_new(int type, HWND topleft, HWND bottomright, unsigned long id) +HWND API dw_splitbar_new(int type, HWND topleft, HWND bottomright, unsigned long id) { HWND tmp = WinCreateWindow(HWND_OBJECT, SplitbarClassName, @@ -6905,7 +6905,7 @@ * Parameters: * handle: The handle to the splitbar returned by dw_splitbar_new(). */ -void dw_splitbar_set(HWND handle, float percent) +void API dw_splitbar_set(HWND handle, float percent) { float *mypercent = (float *)dw_window_get_data(handle, "_dw_percent"); int type = (int)dw_window_get_data(handle, "_dw_type"); @@ -6924,7 +6924,7 @@ * Parameters: * handle: The handle to the splitbar returned by dw_splitbar_new(). */ -float dw_splitbar_get(HWND handle) +float API dw_splitbar_get(HWND handle) { float *percent = (float *)dw_window_get_data(handle, "_dw_percent"); @@ -6944,7 +6944,7 @@ * vsize: TRUE if the window (widget) should expand vertically to fill space given. * pad: Number of pixels of padding around the item. */ -void dw_box_pack_start(HWND box, HWND item, int width, int height, int hsize, int vsize, int pad) +void API dw_box_pack_start(HWND box, HWND item, int width, int height, int hsize, int vsize, int pad) { Box *thisbox; @@ -7118,7 +7118,7 @@ * window: Toplevel window or dialog. * defaultitem: Handle to the dialog item to be default. */ -void dw_window_default(HWND window, HWND defaultitem) +void API dw_window_default(HWND window, HWND defaultitem) { Box *thisbox = NULL; HWND box; @@ -7137,7 +7137,7 @@ * window: Window (widget) to look for the ENTER press. * next: Window (widget) to move to next (or click) */ -void dw_window_click_default(HWND window, HWND next) +void API dw_window_click_default(HWND window, HWND next) { WindowData *blah = (WindowData *)WinQueryWindowPtr(window, QWP_USER); @@ -7150,7 +7150,7 @@ * Parameters: * env: Pointer to a DWEnv struct. */ -void dw_environment_query(DWEnv *env) +void API dw_environment_query(DWEnv *env) { ULONG Build; @@ -7197,7 +7197,7 @@ * the file path on success. * */ -char *dw_file_browse(char *title, char *defpath, char *ext, int flags) +char * API dw_file_browse(char *title, char *defpath, char *ext, int flags) { FILEDLG fild; HWND hwndFile; @@ -7281,7 +7281,7 @@ * Returns: * -1 on error. */ -int dw_exec(char *program, int type, char **params) +int API dw_exec(char *program, int type, char **params) { return spawnvp(P_NOWAIT, program, (const char **)params); } @@ -7291,7 +7291,7 @@ * Parameters: * url: Uniform resource locator. */ -int dw_browse(char *url) +int API dw_browse(char *url) { /* Is there a way to find the webbrowser in Unix? */ char *execargs[3], browser[1024], *olddir, *newurl = NULL; @@ -7353,7 +7353,7 @@ * current user directory. Or the root directory (C:\ on * OS/2 and Windows). */ -char *dw_user_dir(void) +char * API dw_user_dir(void) { static char _user_dir[1024] = ""; @@ -7376,7 +7376,7 @@ * function: Function pointer to be called. * data: Pointer to the data to be passed to the function. */ -void dw_window_function(HWND handle, void *function, void *data) +void API dw_window_function(HWND handle, void *function, void *data) { WinSendMsg(handle, WM_USER, (MPARAM)function, (MPARAM)data); } @@ -7474,7 +7474,7 @@ * dataname: A string pointer identifying which signal to be hooked. * data: User data to be passed to the handler function. */ -void dw_window_set_data(HWND window, char *dataname, void *data) +void API dw_window_set_data(HWND window, char *dataname, void *data) { WindowData *blah = (WindowData *)WinQueryWindowPtr(window, QWP_USER); @@ -7523,7 +7523,7 @@ * sigfunc: The pointer to the function to be used as the callback. * data: User data to be passed to the handler function. */ -void dw_signal_connect(HWND window, char *signame, void *sigfunc, void *data) +void API dw_signal_connect(HWND window, char *signame, void *sigfunc, void *data) { ULONG message = 0L; @@ -7554,7 +7554,7 @@ * Parameters: * window: Window handle of callback to be removed. */ -void dw_signal_disconnect_by_name(HWND window, char *signame) +void API dw_signal_disconnect_by_name(HWND window, char *signame) { SignalHandler *prev = NULL, *tmp = Root; ULONG message; @@ -7592,7 +7592,7 @@ * Parameters: * window: Window handle of callback to be removed. */ -void dw_signal_disconnect_by_window(HWND window) +void API dw_signal_disconnect_by_window(HWND window) { SignalHandler *prev = NULL, *tmp = Root; @@ -7627,7 +7627,7 @@ * window: Window handle of callback to be removed. * data: Pointer to the data to be compared against. */ -void dw_signal_disconnect_by_data(HWND window, void *data) +void API dw_signal_disconnect_by_data(HWND window, void *data) { SignalHandler *prev = NULL, *tmp = Root; diff -r c2b5d0019ec3 -r 75bf3051235f platform/dirent.h --- a/platform/dirent.h Sun Dec 01 11:18:14 2002 +0000 +++ b/platform/dirent.h Sun Dec 01 12:59:24 2002 +0000 @@ -1,11 +1,7 @@ -#ifdef __OS2__ +#if defined(__OS2__) || defined (__EMX__) #ifndef __DIRENT_H__ #define __DIRENT_H__ -#ifdef __EMX__ -#include -#else -#if defined(__IBMC__) || defined(__IBMCPP__) || defined(XP_W32_MSVC) #include #ifdef MAXPATHLEN #undef MAXPATHLEN @@ -33,7 +29,6 @@ #endif struct dirent { -#if defined(__OS2__) || defined(__WIN32__) /* use the layout of EMX to avoid trouble */ int d_ino; /* Dummy */ int d_reclen; /* Dummy, same as d_namlen */ int d_namlen; /* length of name */ @@ -42,25 +37,27 @@ unsigned short d_attribute; /* attributes (see above) */ unsigned short d_time; /* modification time */ unsigned short d_date; /* modification date */ -#else - char d_name[MAXNAMLEN + 1]; /* garentee null termination */ - char d_attribute; /* .. extension .. */ - unsigned long d_size; /* .. extension .. */ -#endif }; typedef struct _dirdescr DIR; /* the structs do not have to be defined here */ -extern DIR *opendir(const char *); -extern DIR *openxdir(const char *, unsigned); -extern struct dirent *readdir(DIR *); -extern void seekdir(DIR *, long); -extern long telldir(DIR *); -extern void closedir(DIR *); -#define rewinddir(dirp) seekdir(dirp, 0L) +extern DIR *_opendir(const char *); +#define opendir(a) _opendir(a) +extern DIR *_openxdir(const char *, unsigned); +#define openxdir(a, b) _openxdir(a, b) +extern struct dirent *_readdir(DIR *); +#define readdir(a) _readdir(a) +extern void _seekdir(DIR *, long); +#define seekdir(a, b) _seekdir(a, b) +extern long _telldir(DIR *); +#define telldir(a) _telldir(a) +extern void _closedir(DIR *); +#define closedir(a) _closedir(a) -extern char * abs_path(const char *name, char *buffer, int len); +#define rewinddir(dirp) _seekdir(dirp, 0L) +extern char * _abs_path(const char *name, char *buffer, int len); +#define abs_path(a, b, c) _abs_path(a, b, c) #ifndef S_IFMT #define S_IFMT ( S_IFDIR | S_IFREG ) @@ -78,9 +75,6 @@ } #endif -#endif -#endif - #ifdef __WIN32__ #ifndef __DIRENT_H__ #define __DIRENT_H__ @@ -102,9 +96,6 @@ * */ -#ifdef __EMX__ -#include -#else #if defined(__IBMC__) || defined(__IBMCPP__) || defined(MSVC) #include #ifdef MAXPATHLEN @@ -132,7 +123,6 @@ #endif struct dirent { -#if defined(__OS2__) || defined(__WIN32__) /* use the layout of EMX to avoid trouble */ int d_ino; /* Dummy */ int d_reclen; /* Dummy, same as d_namlen */ int d_namlen; /* length of name */ @@ -141,25 +131,27 @@ unsigned short d_attribute; /* attributes (see above) */ unsigned short d_time; /* modification time */ unsigned short d_date; /* modification date */ -#else - char d_name[MAXNAMLEN + 1]; /* garentee null termination */ - char d_attribute; /* .. extension .. */ - unsigned long d_size; /* .. extension .. */ -#endif }; typedef struct _dirdescr DIR; /* the structs do not have to be defined here */ -extern DIR *opendir(const char *); -extern DIR *openxdir(const char *, unsigned); -extern struct dirent *readdir(DIR *); -extern void seekdir(DIR *, long); -extern long telldir(DIR *); -extern void closedir(DIR *); -#define rewinddir(dirp) seekdir(dirp, 0L) +extern DIR *_opendir(const char *); +#define opendir(a) _opendir(a) +extern DIR *_openxdir(const char *, unsigned); +#define openxdir(a, b) _openxdir(a, b) +extern struct dirent *_readdir(DIR *); +#define readdir(a) _readdir(a) +extern void _seekdir(DIR *, long); +#define seekdir(a, b) _seekdir(a, b) +extern long _telldir(DIR *); +#define telldir(a) _telldir(a) +extern void _closedir(DIR *); +#define closedir(a) _closedir(a) -extern char * abs_path(const char *name, char *buffer, int len); +#define rewinddir(dirp) _seekdir(dirp, 0L) +extern char * _abs_path(const char *name, char *buffer, int len); +#define abs_path(a, b, c) _abs_path(a, b, c) #ifndef S_IFMT #define S_IFMT ( S_IFDIR | S_IFREG ) @@ -178,4 +170,3 @@ #endif #endif -#endif