(g2-UU+5B73): Add `=decomposition@hanyo-denshi'.
[chise/xemacs-chise.git.1] / src / gpmevent.c
index 0a219b9..d42c9ae 100644 (file)
@@ -1,4 +1,4 @@
-/* GPM functions
+/* GPM (General purpose mouse) functions
    Copyright (C) 1997 William M. Perry <wmperry@gnu.org>
    Copyright (C) 1999 Free Software Foundation, Inc.
 
@@ -52,7 +52,7 @@ extern int gpm_tried;
 extern void *gpm_stack;
 
 static int (*orig_event_pending_p) (int);
-static void (*orig_next_event_cb) (struct Lisp_Event *);
+static void (*orig_next_event_cb) (Lisp_Event *);
 
 static Lisp_Object gpm_event_queue;
 static Lisp_Object gpm_event_queue_tail;
@@ -95,7 +95,7 @@ clear_gpm_state (int fd)
 }
 
 static int
-get_process_infd (struct Lisp_Process *p)
+get_process_infd (Lisp_Process *p)
 {
   Lisp_Object instr, outstr;
   get_process_streams (p, &instr, &outstr);
@@ -112,8 +112,8 @@ This function is the process handler for the GPM connection.
        Gpm_Event ev;
        int modifiers = 0;
        int button = 1;
-       Lisp_Object fake_event;
-       struct Lisp_Event *event = NULL;
+       Lisp_Object fake_event = Qnil;
+       Lisp_Event *event = NULL;
        struct gcpro gcpro1;
        static int num_events;
 
@@ -140,10 +140,10 @@ This function is the process handler for the GPM connection.
        /* Whow, wouldn't named defines be NICE!?!?! */
        modifiers = 0;
 
-       if (ev.modifiers & 1)   modifiers |= MOD_SHIFT;
-       if (ev.modifiers & 2)   modifiers |= MOD_META;
-       if (ev.modifiers & 4)   modifiers |= MOD_CONTROL;
-       if (ev.modifiers & 8)   modifiers |= MOD_META;
+       if (ev.modifiers & 1)   modifiers |= XEMACS_MOD_SHIFT;
+       if (ev.modifiers & 2)   modifiers |= XEMACS_MOD_META;
+       if (ev.modifiers & 4)   modifiers |= XEMACS_MOD_CONTROL;
+       if (ev.modifiers & 8)   modifiers |= XEMACS_MOD_META;
 
        if (ev.buttons & GPM_B_LEFT)
        {
@@ -217,9 +217,9 @@ tty_get_foreign_selection (Lisp_Object selection_symbol, Lisp_Object target_type
        struct device *d = decode_device (Qnil);
        int fd = DEVICE_INFD (d);
        char c = 3;
-       Lisp_Object output_stream;
-       Lisp_Object terminal_stream;
-       Lisp_Object output_string;
+       Lisp_Object output_stream = Qnil;
+       Lisp_Object terminal_stream = Qnil ;
+       Lisp_Object output_string = Qnil;
        struct gcpro gcpro1,gcpro2,gcpro3;
 
        GCPRO3(output_stream,terminal_stream,output_string);
@@ -272,8 +272,8 @@ tty_get_foreign_selection (Lisp_Object selection_symbol, Lisp_Object target_type
        while (1)
        {
                Bufbyte tempbuf[1024]; /* some random amount */
-               ssize_t i;
-               ssize_t size_in_bytes =
+               Lstream_data_count i;
+               Lstream_data_count size_in_bytes =
                  Lstream_read (XLSTREAM (terminal_stream),
                                tempbuf, sizeof (tempbuf));
 
@@ -309,7 +309,7 @@ tty_get_foreign_selection (Lisp_Object selection_symbol, Lisp_Object target_type
 }
 
 static Lisp_Object
-tty_selection_exists_p (Lisp_Object selection)
+tty_selection_exists_p (Lisp_Object selection, Lisp_Object selection_type)
 {
        return (Qt);
 }
@@ -317,7 +317,8 @@ tty_selection_exists_p (Lisp_Object selection)
 
 #if 0
 static Lisp_Object
-tty_own_selection (Lisp_Object selection_name, Lisp_Object selection_value)
+tty_own_selection (Lisp_Object selection_name, Lisp_Object selection_value,
+                  Lisp_Object how_to_add, Lisp_Object selection_type)
 {
        /* There is no way to do this cleanly - the GPM selection
        ** 'protocol' (actually the TIOCLINUX ioctl) requires a start and
@@ -369,7 +370,7 @@ tty_get_mouse_position (struct device *d, Lisp_Object *frame, int *x, int *y)
 static void
 tty_set_mouse_position (struct window *w, int x, int y)
 {
-       /* 
+       /*
           #### I couldn't find any GPM functions that set the mouse position.
           #### Mr. Perry had left this function empty; that must be why.
           #### karlheg
@@ -390,14 +391,14 @@ static int gpm_event_pending_p (int user_p)
        return (orig_event_pending_p (user_p));
 }
 
-static void gpm_next_event_cb (struct Lisp_Event *event)
+static void gpm_next_event_cb (Lisp_Event *event)
 {
        /* #### It would be nice to preserve some sort of ordering of the
        ** #### different types of events, but that would be quite a bit
        ** #### of work, and would more than likely break the abstraction
        ** #### between the other event loops and this one.
        */
-          
+
        if (!NILP (gpm_event_queue))
        {
                Lisp_Object queued_event = dequeue_event (&gpm_event_queue, &gpm_event_queue_tail);
@@ -569,7 +570,7 @@ Toggle accepting of GPM mouse events.
        conn.maxMod = ((1<<KG_SHIFT)|(1<<KG_ALT)|(1<<KG_CTRL));
 
        /* Reset some silly static variables so that multiple Gpm_Open()
-       ** calls have even a sligh chance of working
+       ** calls have even a slight chance of working
        */
        gpm_tried = 0;
        gpm_flag = 0;
@@ -579,7 +580,7 @@ Toggle accepting of GPM mouse events.
        ** descriptor, or it can get the wrong terminal sizes, etc.
        */
        gpm_consolefd = fd;
-       
+
        /* We have to pass the virtual console manually, otherwise if you
        ** use 'gnuclient -nw' to connect to an XEmacs that is running in
        ** X, Gpm_Open() tries to use ttyname(0 | 1 | 2) to find out which
@@ -634,8 +635,8 @@ void vars_of_gpmevent (void)
        gpm_event_queue_tail = Qnil;
        staticpro (&gpm_event_queue);
        staticpro (&gpm_event_queue_tail);
-       pdump_wire (&gpm_event_queue);
-       pdump_wire (&gpm_event_queue_tail);
+       dump_add_root_object (&gpm_event_queue);
+       dump_add_root_object (&gpm_event_queue_tail);
 }
 
 void syms_of_gpmevent (void)