Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Is there a command to install Xevie (for X11 programming) from repository?

(so that Xevie.h will be available for programming)

I need it to compile this sample in Qt Creator:

/* xeviedemo.c */
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <X11/Xlib.h>
#include <X11/Xproto.h>
#include <X11/X.h>
#include <X11/extensions/Xevie.h>
#include <X11/Xutil.h>


static void
print_key_event (XEvent *ev)
{
    XKeyEvent *key_ev;
    char buffer[20];
    int bufsize = 19;
    KeySym key;
    XComposeStatus compose;
    int char_count;

    key_ev = (XKeyEvent *)ev;

    printf ("        State: %x KeyCode: %x\n", key_ev->state & ShiftMask, key_ev->keycode);
    char_count = XLookupString(key_ev, buffer, bufsize, &key, &compose);
    buffer[char_count] = '\0';
    printf ("        Char Count: %d KeySym: %x char: |%c|\n", char_count, key, buffer[0]);
}

int
main(int argc, char **argv)
{
    Display *dpy;
    int major, minor;
    XEvent  event;
    XClientMessageEvent *xcme;
    int count = 0;
    long delay = 0;
    int ret;

    if (argc > 2)
    {
        printf ("Usage: xeviedemo delay (in milliseconds)\n");
        exit(1);
    }
    else if (argc == 2)
    {
        delay = strtol(argv[1], 0, 0);
    }
    printf("Delay is %d milliseconds\n", delay);
    delay *= 1000;

    dpy = XOpenDisplay(NULL);
    XevieQueryVersion(dpy, &major, &minor);
    printf("major = %d, minor = %d\n", major, minor);
    if(XevieStart(dpy))
        printf("XevieStart(dpy) finished \n");
    else
    {
        printf("XevieStart(dpy) failed, only one client is allowed to do event interception\n");
        exit(1);
    }

    XevieSelectInput(dpy, KeyPressMask | KeyReleaseMask |
                     ButtonPressMask | ButtonReleaseMask | PointerMotionMask);

    while(1)
    {
        XNextEvent(dpy, &event);
        xcme = (XClientMessageEvent *)&event;
        /* for readOnly users, send events back to Xserver immediately */
        printf("(%4d)", count++);
        switch(event.type)
        {
        case KeyPress:
            usleep(delay);
            printf(" KeyPress\n");
            print_key_event (&event);
            break;
        case KeyRelease:
            printf(" KeyRelease\n");
            break;
        case ButtonPress:
            usleep(delay);
            printf(" ButtonPress\n");
            break;
        case ButtonRelease:
            printf(" ButtonRelease\n");
            break;
        case MotionNotify:
            printf(" MotionNotify\n");
            break;
        case ClientMessage:
            printf("ClientMessage: <%s>\n", &xcme->data.b[1]);
            break;
        default:
            printf(" unknown event %x\n", event.type);
            break;
        }
        XevieSendEvent(dpy, &event, XEVIE_UNMODIFIED);
        if(count > 10000)
        {
            break;
        }
    }
    XevieEnd(dpy);
    printf("XevieEnd(dpy) finished \n");
    exit(0);
}
share|improve this question
    
Are you looking for this? –  terdon May 11 at 2:22
    
No. because it is already installed but xevie.h is not added to my system. –  Minimus Heximus May 11 at 2:24
    
I have a C program which includes #include <X11/extensions/Xevie.h>. To compile it I need to install xevie extension for X11. How can I do that? –  Minimus Heximus May 11 at 2:30

2 Answers 2

I don't think that any package provides Xevie.h. There is a different library called xevie.h which is provided by libxcb-xevie0-dev but that's not what you need.

However, I did find this page which has what looks like the source packages. I tried downloading libXevie-1.0.3.tbz and I can confirm that it contains a file called Xevie.h that includes the functions from your comment. In fact, the file is so small I am reproducing the entire thing here:

/************************************************************

Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice (including the next
paragraph) shall be included in all copies or substantial portions of the
Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.

************************************************************/

#ifndef _XEVIE_H_
#define _XEVIE_H_

#include <X11/Xfuncproto.h>

#define XEVIE_UNMODIFIED    0
#define XEVIE_MODIFIED   1

#ifndef _XEVIE_SERVER_

_XFUNCPROTOBEGIN

Bool XevieQueryVersion(
    Display*            /* dpy */,
    int*            /* major_version */,
    int*            /* minor_version */
);

extern Status XevieStart(
    Display*            /* dpy */
);

Status XevieEnd(
    Display*            /* dpy */
);

Status XevieSendEvent(
    Display*                    /* dpy */,
    XEvent*         /* event */,
    int             /* data type */
);

Status XevieSelectInput(
    Display*                    /* dpy */,
    long
);


_XFUNCPROTOEND

#endif /* _XEVIE_SERVER_ */

#endif /* _XEVIE_H_ */

When looking for a specific file, you can search for it at http://packages.ubuntu.com or use apt-file:

$ apt-file search xevie.h
libxcb-xevie0-dev: /usr/include/xcb/xevie.h

As you can see, using apt-file search filename returns the package (if any) that provides the file. If apt-file is not installed, you will need to install it and generate its package list before running it:

sudo apt-get install apt-file
sudo apt-file update
share|improve this answer
    
thanks. But it includes xcb xevie.h, while I'm looking for Xevie.h extension for X11. For example this function does not exist in xcb xevie.h. –  Minimus Heximus May 11 at 6:39
    
I think the package name is libXevie-devel and is not located in repository. But I don't know where I can download it. –  Minimus Heximus May 11 at 6:53
    
@MinimusHeximus found it! See updated answer. –  terdon May 11 at 12:48
    
The problem is not just the header file. There may be .lib files and other files needed to compile the program I added in my question. –  Minimus Heximus May 11 at 18:40
    
@MinimusHeximus did you download the .zip? It also contains libXevie.la, libXevie.a and libXevie.so.1. It is almost certainly exactly what you're after. –  terdon May 11 at 19:08

Xevie support was removed from Xorg in X11R7.5 in 2009 since it had been broken for a while and no one needed it or was interested in fixing it. Even if you find the library and header files to build clients, they'll fail to work with any recent Xorg server.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.