Index: configure.in =================================================================== RCS file: /usr/CVSroot/XEmacs/xemacs-20/configure.in,v retrieving revision 1.91 diff -u -r1.91 configure.in --- configure.in 1998/04/23 02:07:43 1.91 +++ configure.in 1998/04/24 16:54:14 @@ -2381,12 +2381,14 @@ test "$with_menubars" != "no" && XE_ADD_OBJS(menubar-msw.o) test "$with_toolbars" != "no" && XE_ADD_OBJS(toolbar-msw.o) fi - + dnl check for our special version of select AC_TRY_RUN([#include int main() { return (open("/dev/windows", O_RDONLY, 0) > 0)? 0 : 1; }], [AC_DEFINE(HAVE_MSG_SELECT)]) const_is_losing=no with_file_coding=yes + use_minimal_tagbits=yes + use_indexed_lrecord_implementation=yes XE_ADD_OBJS(console-msw.o device-msw.o event-msw.o frame-msw.o objects-msw.o select-msw.o redisplay-msw.o glyphs-msw.o) fi fi Index: src/config.h.in =================================================================== RCS file: /usr/CVSroot/XEmacs/xemacs-20/src/config.h.in,v retrieving revision 1.47 diff -u -r1.47 config.h.in --- src/config.h.in 1998/04/23 02:08:00 1.47 +++ src/config.h.in 1998/04/24 16:54:21 @@ -117,6 +117,9 @@ /* Compile in support for MS windows? */ #undef HAVE_MS_WINDOWS +/* special cygwin process handling? */ +#undef HAVE_MSG_SELECT + /* Compile in support for the X window system? */ #undef HAVE_X_WINDOWS @@ -146,7 +149,7 @@ #endif /* Define HAVE_UNIXOID_EVENT_LOOP if we use select() to wait for events. */ -#if defined (HAVE_X_WINDOWS) || defined (HAVE_TTY) +#if defined (HAVE_X_WINDOWS) || defined (HAVE_TTY) || defined(HAVE_MSG_SELECT) #define HAVE_UNIXOID_EVENT_LOOP #endif Index: src/console-msw.h =================================================================== RCS file: /usr/CVSroot/XEmacs/xemacs-20/src/console-msw.h,v retrieving revision 1.17 diff -u -r1.17 console-msw.h --- src/console-msw.h 1998/04/23 02:08:01 1.17 +++ src/console-msw.h 1998/04/24 16:54:21 @@ -126,7 +126,7 @@ POINTS last_click_point; #ifdef HAVE_TOOLBARS /* Toolbar hashtable. See toolbar-msw.c */ - Lisp_Object toolbar_hashtable[4]; + Lisp_Object toolbar_hashtable; unsigned int toolbar_checksum[4]; #endif @@ -158,8 +158,8 @@ #define FRAME_MSWINDOWS_DC(f) (FRAME_MSWINDOWS_DATA (f)->hdc) #define FRAME_MSWINDOWS_CDC(f) (FRAME_MSWINDOWS_DATA (f)->cdc) #define FRAME_MSWINDOWS_MENU_HASHTABLE(f) (FRAME_MSWINDOWS_DATA (f)->menu_hashtable) -#define FRAME_MSWINDOWS_TOOLBAR_HASHTABLE(f, pos) \ - (FRAME_MSWINDOWS_DATA (f)->toolbar_hashtable[pos]) +#define FRAME_MSWINDOWS_TOOLBAR_HASHTABLE(f) \ + (FRAME_MSWINDOWS_DATA (f)->toolbar_hashtable) #define FRAME_MSWINDOWS_TOOLBAR_CHECKSUM(f,pos) \ (FRAME_MSWINDOWS_DATA (f)->toolbar_checksum[pos]) #define FRAME_MSWINDOWS_MENU_CHECKSUM(f) (FRAME_MSWINDOWS_DATA (f)->menu_checksum) Index: src/device-msw.c =================================================================== RCS file: /usr/CVSroot/XEmacs/xemacs-20/src/device-msw.c,v retrieving revision 1.12 diff -u -r1.12 device-msw.c --- src/device-msw.c 1998/04/23 02:08:01 1.12 +++ src/device-msw.c 1998/04/24 16:54:21 @@ -130,7 +134,7 @@ { /* Initialise DDE management library and our related globals */ mswindows_dde_mlid = 0; - DdeInitialize (&mswindows_dde_mlid, mswindows_dde_callback, + DdeInitialize (&mswindows_dde_mlid, (PFNCALLBACK)mswindows_dde_callback, APPCMD_FILTERINITS|CBF_FAIL_SELFCONNECTIONS|CBF_FAIL_ADVISES| CBF_FAIL_POKES|CBF_FAIL_REQUESTS|CBF_SKIP_ALLNOTIFICATIONS, 0); Index: src/emacs.c =================================================================== RCS file: /usr/CVSroot/XEmacs/xemacs-20/src/emacs.c,v retrieving revision 1.67 diff -u -r1.67 emacs.c --- src/emacs.c 1998/04/22 06:33:27 1.67 +++ src/emacs.c 1998/04/24 16:54:25 @@ -1167,7 +1167,7 @@ #ifdef FILE_CODING lstream_type_create_mule_coding (); #endif -#ifdef HAVE_MS_WINDOWS +#if defined (HAVE_MS_WINDOWS) && !defined(HAVE_MSG_SELECT) lstream_type_create_mswindows_selectable (); #endif Index: src/event-msw.c =================================================================== RCS file: /usr/CVSroot/XEmacs/xemacs-20/src/event-msw.c,v retrieving revision 1.24 diff -u -r1.24 event-msw.c --- src/event-msw.c 1998/04/23 02:08:02 1.24 +++ src/event-msw.c 1998/04/24 16:54:45 @@ -52,6 +52,7 @@ #include "sysproc.h" #include "syswait.h" #include "systime.h" +#include "sysdep.h" #include "events-mod.h" #ifdef HAVE_MSG_SELECT @@ -78,6 +79,10 @@ #define DndFiles 3 #define DndText 4 +extern Lisp_Object +mswindows_get_toolbar_button_text (struct frame* f, int command_id); +extern Lisp_Object +mswindows_handle_toolbar_wm_command (struct frame* f, HWND ctrl, WORD id); static Lisp_Object mswindows_find_frame (HWND hwnd); static Lisp_Object mswindows_find_console (HWND hwnd); @@ -175,7 +180,7 @@ #define MAX_SLURP_STREAMS 32 struct ntpipe_slurp_stream_shared_data -shared_data_block[MAX_SLURP_STREAMS]={0}; +shared_data_block[MAX_SLURP_STREAMS]={{0}}; struct ntpipe_slurp_stream { @@ -405,6 +410,7 @@ return bytes_read + 1; } } + return 0; } static int @@ -1094,7 +1100,6 @@ { if (FD_ISSET (i, &temp_mask) && FD_ISSET (i, &process_only_mask)) { - Lisp_Object process; struct Lisp_Process *p = get_process_from_usid (FD_TO_USID(i)); @@ -1596,14 +1601,8 @@ if (!NILP(btext)) { - /* is this safe? */ - tttext->lpszText=XSTRING_DATA(btext); - /* this doesn't seem to work */ - /* strncpy (tttext->szText, XSTRING_DATA (btext), 80);*/ - } - else - { - tttext->szText[0]=0; + strncpy (tttext->szText, XSTRING_DATA (btext), 80); + tttext->lpszText=tttext->szText; } #if 0 tttext->uFlags |= TTF_DI_SETITEM; @@ -2500,10 +2499,8 @@ void lstream_type_create_mswindows_selectable (void) { -#ifndef HAVE_MSG_SELECT init_slurp_stream (); init_shove_stream (); -#endif } void Index: src/frame-msw.c =================================================================== RCS file: /usr/CVSroot/XEmacs/xemacs-20/src/frame-msw.c,v retrieving revision 1.19 diff -u -r1.19 frame-msw.c --- src/frame-msw.c 1998/04/23 02:08:03 1.19 +++ src/frame-msw.c 1998/04/24 16:54:48 @@ -78,7 +78,6 @@ static void mswindows_init_frame_1 (struct frame *f, Lisp_Object props) { - Lisp_Object device = FRAME_DEVICE (f); Lisp_Object initially_unmapped; Lisp_Object name, height, width, popup, top, left; Lisp_Object frame_obj = Qnil; @@ -133,13 +132,7 @@ FRAME_MSWINDOWS_DATA(f)->sizing = 0; FRAME_MSWINDOWS_MENU_HASHTABLE(f) = Qnil; #ifdef HAVE_TOOLBARS - FRAME_MSWINDOWS_TOOLBAR_HASHTABLE(f,0) = Fmake_hashtable (make_int (50), - Qequal); - FRAME_MSWINDOWS_TOOLBAR_HASHTABLE(f,1) = Fmake_hashtable (make_int (50), - Qequal); - FRAME_MSWINDOWS_TOOLBAR_HASHTABLE(f,2) = Fmake_hashtable (make_int (50), - Qequal); - FRAME_MSWINDOWS_TOOLBAR_HASHTABLE(f,3) = Fmake_hashtable (make_int (50), + FRAME_MSWINDOWS_TOOLBAR_HASHTABLE(f) = Fmake_hashtable (make_int (50), Qequal); #endif @@ -190,7 +183,7 @@ hwnd = CreateWindowEx (exstyle, XEMACS_CLASS, STRINGP(f->name) ? XSTRING_DATA(f->name) : - (STRINGP(name) ? XSTRING_DATA(name) : XEMACS_CLASS), + (STRINGP(name) ? XSTRING_DATA(name) : XEMACS_CLASS), style, rect_default.left, rect_default.top, rect_default.width, rect_default.height, @@ -246,10 +239,7 @@ { ((markobj) (FRAME_MSWINDOWS_MENU_HASHTABLE (f))); #ifdef HAVE_TOOLBARS - ((markobj) (FRAME_MSWINDOWS_TOOLBAR_HASHTABLE (f,0))); - ((markobj) (FRAME_MSWINDOWS_TOOLBAR_HASHTABLE (f,1))); - ((markobj) (FRAME_MSWINDOWS_TOOLBAR_HASHTABLE (f,2))); - ((markobj) (FRAME_MSWINDOWS_TOOLBAR_HASHTABLE (f,3))); + ((markobj) (FRAME_MSWINDOWS_TOOLBAR_HASHTABLE (f))); #endif } Index: src/glyphs-msw.h =================================================================== RCS file: /usr/CVSroot/XEmacs/xemacs-20/src/glyphs-msw.h,v retrieving revision 1.3 diff -u -r1.3 glyphs-msw.h --- src/glyphs-msw.h 1998/04/03 07:10:22 1.3 +++ src/glyphs-msw.h 1998/04/24 16:54:48 @@ -59,5 +59,12 @@ #define XIMAGE_INSTANCE_MSWINDOWS_ICON(i) \ IMAGE_INSTANCE_MSWINDOWS_ICON (XIMAGE_INSTANCE (i)) +int +mswindows_resize_dibitmap_instance (struct Lisp_Image_Instance* ii, + struct frame* f, + int newx, int newy); +void +mswindows_create_icon_from_image(Lisp_Object image, struct frame* f, int size); + #endif /* HAVE_MS_WINDOWS */ #endif /* _XEMACS_GLYPHS_MSW_H_ */ Index: src/ntplay.c =================================================================== RCS file: /usr/CVSroot/XEmacs/xemacs-20/src/ntplay.c,v retrieving revision 1.1 diff -u -r1.1 ntplay.c --- src/ntplay.c 1998/03/12 11:59:21 1.1 +++ src/ntplay.c 1998/04/24 16:54:48 @@ -21,6 +21,7 @@ #include #undef CONST #include +#include #ifdef __CYGWIN32__ extern BOOL WINAPI PlaySound(LPCSTR,HMODULE,DWORD); Index: src/process-unix.c =================================================================== RCS file: /usr/CVSroot/XEmacs/xemacs-20/src/process-unix.c,v retrieving revision 1.5 diff -u -r1.5 process-unix.c --- src/process-unix.c 1998/04/07 05:39:46 1.5 +++ src/process-unix.c 1998/04/24 16:54:51 @@ -204,9 +204,8 @@ static int allocate_pty (void) { +#ifndef PTY_OPEN struct stat stb; - int c, i; - int fd; /* Some systems name their pseudoterminals so that there are gaps in the usual sequence - for example, on HP9000/S700 systems, there @@ -214,10 +213,14 @@ three failures in a row before deciding that we've reached the end of the ptys. */ int failed_count = 0; +#endif + int i; + int fd; #ifdef PTY_ITERATION PTY_ITERATION #else + int c; for (c = FIRST_PTY_LETTER; c <= 'z'; c++) for (i = 0; i < 16; i++) #endif Index: src/select-msw.c =================================================================== RCS file: /usr/CVSroot/XEmacs/xemacs-20/src/select-msw.c,v retrieving revision 1.4 diff -u -r1.4 select-msw.c --- src/select-msw.c 1998/03/31 20:12:12 1.4 +++ src/select-msw.c 1998/04/24 16:54:52 @@ -121,7 +121,7 @@ do { /* copy next line or remaining bytes excluding '\0' */ - next = _memccpy (dst, src, '\r', rawsize); + next = memccpy (dst, src, '\r', rawsize); if (next) { /* copied one line ending with '\r' */ Index: src/sheap.c =================================================================== RCS file: /usr/CVSroot/XEmacs/xemacs-20/src/sheap.c,v retrieving revision 1.8 diff -u -r1.8 sheap.c --- src/sheap.c 1998/04/04 23:13:57 1.8 +++ src/sheap.c 1998/04/24 16:54:52 @@ -22,6 +22,7 @@ #include #include "lisp.h" #include +#include #include #define STATIC_HEAP_BASE 0x600000 Index: src/toolbar-msw.c =================================================================== RCS file: /usr/CVSroot/XEmacs/xemacs-20/src/toolbar-msw.c,v retrieving revision 1.3 diff -u -r1.3 toolbar-msw.c --- src/toolbar-msw.c 1998/04/23 02:08:08 1.3 +++ src/toolbar-msw.c 1998/04/24 16:54:53 @@ -31,6 +31,7 @@ #include "toolbar.h" #include "window.h" #include "gui.h" +#include "elhash.h" #include "console-msw.h" #include "glyphs-msw.h" #include "objects-msw.h" @@ -38,8 +39,7 @@ /* Why did Kirill choose this range ? */ #define TOOLBAR_ITEM_ID_MIN 0x4000 #define TOOLBAR_ITEM_ID_MAX 0x7FFF -#define TOOLBAR_ITEM_ID_BITS(x,pos) ((((x) & 0x0FFF) + (0x1000 * pos)) \ - | 0x4000) +#define TOOLBAR_ITEM_ID_BITS(x) (((x) & 0x3FFF) | 0x4000) #define TOOLBAR_ID_BIAS 16 #define TOOLBAR_HANDLE(f,p) \ GetDlgItem(FRAME_MSWINDOWS_HANDLE(f), TOOLBAR_ID_BIAS + p) @@ -75,11 +75,11 @@ enum toolbar_pos pos) { /* hmm what do we generate an id based on */ - int id = TOOLBAR_ITEM_ID_BITS (internal_hash (button->callback, 0),pos); + int id = TOOLBAR_ITEM_ID_BITS (internal_hash (button->callback, 0)); while (!NILP (Fgethash (make_int (id), - FRAME_MSWINDOWS_TOOLBAR_HASHTABLE (f,pos), Qnil))) + FRAME_MSWINDOWS_TOOLBAR_HASHTABLE (f), Qnil))) { - id = TOOLBAR_ITEM_ID_BITS (id + 1,pos); + id = TOOLBAR_ITEM_ID_BITS (id + 1); } return id; } @@ -93,12 +93,16 @@ HWND toolbarwnd = TOOLBAR_HANDLE(f, pos); if (toolbarwnd) { - Fclrhash(FRAME_MSWINDOWS_TOOLBAR_HASHTABLE(f,pos)); + TBBUTTON info; - /* delete the buttons */ + /* delete the buttons and remove the command from the hashtable*/ i = SendMessage (toolbarwnd, TB_BUTTONCOUNT, 0, 0); for (i--; i >= 0; i--) { + SendMessage (toolbarwnd, TB_GETBUTTON, (WPARAM)i, + (LPARAM)&info); + Fremhash(make_int(info.idCommand), + FRAME_MSWINDOWS_TOOLBAR_HASHTABLE(f)); SendMessage (toolbarwnd, TB_DELETEBUTTON, (WPARAM)i, 0); } @@ -165,7 +169,9 @@ while (!NILP (button)) { struct toolbar_button *tb = XTOOLBAR_BUTTON (button); - checksum = HASH2 (checksum, TOOLBAR_ITEM_ID_BITS (internal_hash (tb->callback, 0), pos)); + checksum = HASH3 (checksum, + internal_hash (get_toolbar_button_glyph(w, tb), 0), + internal_hash (tb->callback, 0)); button = tb->next; nbuttons++; } @@ -268,7 +274,7 @@ } Fputhash (make_int (tbbutton->idCommand), - tb->callback, FRAME_MSWINDOWS_TOOLBAR_HASHTABLE (f,pos)); + button, FRAME_MSWINDOWS_TOOLBAR_HASHTABLE (f)); tbbutton++; button = tb->next; @@ -307,11 +313,11 @@ error ("couldn't set button structure size"); } - /* set the size of buttons + /* set the size of buttons */ SendMessage (toolbarwnd, TB_SETBUTTONSIZE, 0, (LPARAM)MAKELONG (width, height)); - /* set the size of bitmaps + /* set the size of bitmaps */ SendMessage (toolbarwnd, TB_SETBITMAPSIZE, 0, (LPARAM)MAKELONG (bmwidth, bmheight)); @@ -479,33 +485,13 @@ Lisp_Object mswindows_get_toolbar_button_text ( struct frame* f, int command_id ) { - Lisp_Object button, command; - enum toolbar_pos pos = - !NILP (Fgethash (make_int (command_id), - FRAME_MSWINDOWS_TOOLBAR_HASHTABLE (f,0), Qnil)) ? 0 : - !NILP (Fgethash (make_int (command_id), - FRAME_MSWINDOWS_TOOLBAR_HASHTABLE (f,1), Qnil)) ? 1 : - !NILP (Fgethash (make_int (command_id), - FRAME_MSWINDOWS_TOOLBAR_HASHTABLE (f,2), Qnil)) ? 2 : - !NILP (Fgethash (make_int (command_id), - FRAME_MSWINDOWS_TOOLBAR_HASHTABLE (f,3), Qnil)) ? 3 : -1; + Lisp_Object button = Fgethash (make_int (command_id), + FRAME_MSWINDOWS_TOOLBAR_HASHTABLE (f), Qnil); - if (pos <0) - return Qnil; - - button = FRAME_TOOLBAR_DATA (f, pos)->toolbar_buttons; - command = Fgethash (make_int (command_id), - FRAME_MSWINDOWS_TOOLBAR_HASHTABLE (f,pos), Qnil); - - while (!NILP (button)) + if (!NILP (button)) { struct toolbar_button *tb = XTOOLBAR_BUTTON (button); - - if (EQ(command,tb->callback)) - { - return tb->help_string; - } - button = tb->next; + return tb->help_string; } return Qnil; } @@ -520,19 +506,20 @@ mswindows_handle_toolbar_wm_command (struct frame* f, HWND ctrl, WORD id) { /* Try to map the command id through the proper hash table */ - Lisp_Object command, funcsym, frame; + Lisp_Object button, command, funcsym, frame; struct gcpro gcpro1; - int pos; - pos = mswindows_find_toolbar_pos(f, ctrl); - if (pos < 0) - return Qnil; + button = Fgethash (make_int (id), + FRAME_MSWINDOWS_TOOLBAR_HASHTABLE (f), Qnil); - command = Fgethash (make_int (id), - FRAME_MSWINDOWS_TOOLBAR_HASHTABLE (f, pos), Qunbound); - if (UNBOUNDP (command)) + if (NILP (button)) return Qnil; + command = XTOOLBAR_BUTTON(button)->callback; + + if (UNBOUNDP(command)) + return Qnil; + /* Need to gcpro because the hashtable may get destroyed by menu_cleanup(), and will not gcpro the command any more */ Index: src/s/cygwin32.h =================================================================== RCS file: /usr/CVSroot/XEmacs/xemacs-20/src/s/cygwin32.h,v retrieving revision 1.10 diff -u -r1.10 cygwin32.h --- src/s/cygwin32.h 1998/04/23 02:08:08 1.10 +++ src/s/cygwin32.h 1998/04/24 16:54:56 @@ -82,12 +82,26 @@ extern int cygwin32_posix_to_win32_path_list_buf_size(const char*); struct timeval; struct timezone; +struct itimerval; +struct stat; extern int gettimeofday(struct timeval *tp, struct timezone *tzp); extern int gethostname (char* name, int namelen); extern char* mktemp(char *); extern double logb(double); extern void sync(); extern int ioctl(int, int, ...); + /* sys/stat.h */ +extern int lstat(const char *path, struct stat *buf); + /* unistd.h */ +extern int readlink(const char *path, void *buf, unsigned int bufsiz); +extern int symlink(const char *name1, const char *name2); + /* sys/time.h */ +extern int setitimer(int which, const struct itimerval *value, + struct itimerval *ovalue); +extern int utimes(char *file, struct timeval *tvp); + +extern int srandom( unsigned seed); +extern long random(); #endif #ifdef HAVE_MS_WINDOWS @@ -99,7 +113,7 @@ #define ORDINARY_LINK #endif -#define C_SWITCH_SYSTEM -Wno-sign-compare -Wno-implicit -fno-caller-saves +#define C_SWITCH_SYSTEM -Wno-sign-compare -fno-caller-saves #define LIBS_SYSTEM -lwinmm #define ICC_BAR_CLASSES 4 @@ -172,6 +186,10 @@ /* Text does precede data space, but this is never a safe assumption. */ #define VIRT_ADDR_VARIES + +/* set this if you have a new version of cygwin +#define DATA_SEG_BITS 0x10000000 +*/ /* If you are compiling with a non-C calling convention but need to declare vararg routines differently, put it here */