~ubuntu-branches/ubuntu/intrepid/xserver-xgl/intrepid

« back to all changes in this revision

Viewing changes to xkb/ddxPrivate.c

  • Committer: Bazaar Package Importer
  • Author(s): Matthew Garrett
  • Date: 2006-02-13 14:21:43 UTC
  • Revision ID: james.westby@ubuntu.com-20060213142143-mad6z9xzem7hzxz9
Tags: upstream-7.0.0
ImportĀ upstreamĀ versionĀ 7.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* $XFree86: xc/programs/Xserver/xkb/ddxPrivate.c,v 1.2 2003/04/03 16:20:22 dawes Exp $ */
 
2
 
 
3
#ifdef HAVE_DIX_CONFIG_H
 
4
#include <dix-config.h>
 
5
#endif
 
6
 
 
7
#ifdef HAVE_XORG_CONFIG_H
 
8
#include <xorg-config.h>
 
9
#endif
 
10
 
 
11
#include <stdio.h>
 
12
#define NEED_EVENTS 1
 
13
#include <X11/X.h>
 
14
#include "windowstr.h"
 
15
#define XKBSRV_NEED_FILE_FUNCS
 
16
#include <X11/extensions/XKBsrv.h>
 
17
 
 
18
#ifdef XF86DDXACTIONS
 
19
#include "xf86.h"
 
20
#endif
 
21
 
 
22
int
 
23
XkbDDXPrivate(DeviceIntPtr dev,KeyCode key,XkbAction *act)
 
24
{
 
25
#ifdef XF86DDXACTIONS
 
26
    XkbAnyAction *xf86act = &(act->any);
 
27
    char msgbuf[XkbAnyActionDataSize+1];
 
28
 
 
29
    if (xf86act->type == XkbSA_XFree86Private) {
 
30
        memcpy(msgbuf, xf86act->data, XkbAnyActionDataSize);
 
31
        msgbuf[XkbAnyActionDataSize]= '\0';
 
32
        if (_XkbStrCaseCmp(msgbuf, "-vmode")==0)
 
33
            xf86ProcessActionEvent(ACTION_PREV_MODE, NULL);
 
34
        else if (_XkbStrCaseCmp(msgbuf, "+vmode")==0)
 
35
            xf86ProcessActionEvent(ACTION_NEXT_MODE, NULL);
 
36
        else if (_XkbStrCaseCmp(msgbuf, "ungrab")==0)
 
37
            xf86ProcessActionEvent(ACTION_DISABLEGRAB, NULL);
 
38
        else if (_XkbStrCaseCmp(msgbuf, "clsgrb")==0)
 
39
            xf86ProcessActionEvent(ACTION_CLOSECLIENT, NULL);
 
40
        else
 
41
            xf86ProcessActionEvent(ACTION_MESSAGE, (void *) msgbuf);
 
42
    }
 
43
#endif
 
44
    return 0;
 
45
}
 
46