/*****************************************************************************
FILE:               kmouse_main.c
LANGUAGE:           c
SYSTEM:             POSIX
USER-INTERFACE:     NONE
DESCRIPTION
    
    This  loadable  kernel  module  provides  an entry  point  to  the
    process_mouse_event kernel function.
    
AUTHORS
    <PJB> Pascal Bourguignon <pjb@informatimago.com>
MODIFICATIONS
    2003-11-24 <PJB> Created.
BUGS
LEGAL
    GPL
    
    Copyright Pascal Bourguignon 2003 - 2003
    
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
    as published by the Free Software Foundation; either version
    2 of the License, or (at your option) any later version.
    
    This program is distributed in the hope that it will be
    useful, but WITHOUT ANY WARRANTY; without even the implied
    warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
    PURPOSE.  See the GNU General Public License for more details.
    
    You should have received a copy of the GNU General Public
    License along with this program; if not, write to the Free
    Software Foundation, Inc., 59 Temple Place, Suite 330,
    Boston, MA 02111-1307 USA
*****************************************************************************/
    
/* kmouse_main.c:  major functions of kmouse */

#include <syslog.h>
#include <kernserv/kern_server_types.h>

    kern_server_t instance;

    void kmouse_init(void)
        /* Called when kmouse is loaded. */
    {
        /* printf("kmouse loaded\n"); */
    }


    void kmouse_signoff(void)
        /* Called when kmouse is unloaded. */
    {
        /* printf("kmouse unloaded\n\n"); */
    }


    kern_return_t kmouse_send_event (port_t server,int state)
        /* Called by kmouse_server, which was created by MiG. */
    {
        process_mouse_event(&state);
        return(KERN_SUCCESS);
    }


    kern_return_t kmouse_get_state (port_t server,
                                    int* buttons,
                                    int* flags,
                                    int* clock,
                                    int* location)
    {
        struct { int filler[2]; 
            int buttons; int eventFlags; int vertRetraceClock; 
            int cursorSema; int cursorLoc; } *evg=(void*)0x40c36dc;
        *buttons=evg->buttons;
        *flags=evg->eventFlags;
        *clock=evg->vertRetraceClock;
        *location=evg->cursorLoc;
        return(KERN_SUCCESS);
    }


/*** kmouse_main.c                    --                     --          ***/
