local_spice.h 2.07 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
/*
    Copyright (C) 2016  Jeremy White <jwhite@codeweavers.com>
    All rights reserved.

    This file is part of x11spice

    x11spice 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 3 of the License, or
    (at your option) any later version.

    x11spice 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 x11spice.  If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef LOCAL_SPICE_H_
#define LOCAL_SPICE_H_

#include <spice.h>

#include "options.h"
27
#include "display.h"
28

29
struct session_struct;
30

31 32 33
/*----------------------------------------------------------------------------
**  Structure definitions
**--------------------------------------------------------------------------*/
34
typedef struct {
35 36 37
    SpiceServer *server;
    SpiceCoreInterface *core;
    QXLInstance display_sin;
Jeremy White's avatar
Jeremy White committed
38

39 40 41
    int width;
    int height;

Jeremy White's avatar
Jeremy White committed
42 43 44
    SpiceKbdInstance keyboard_sin;
    uint8_t escape;

45 46 47
    SpiceTabletInstance tablet_sin;
    uint32_t buttons_state;

48
    int compression_level;
49

50
    struct session_struct *session;
51 52
} spice_t;

Jeremy White's avatar
Jeremy White committed
53 54
typedef enum { RELEASE_SHMI, RELEASE_MEMORY } release_type_t;

55
typedef struct {
Jeremy White's avatar
Jeremy White committed
56 57 58 59 60
    release_type_t type;
    void *data;
    spice_t *s;
} spice_release_t;

61 62 63
/*----------------------------------------------------------------------------
**  Prototypes
**--------------------------------------------------------------------------*/
64
int spice_start(spice_t *s, options_t *options, shm_image_t *fullscreen);
65
void spice_end(spice_t *s);
66 67
int spice_create_primary(spice_t *s, int w, int h, int bytes_per_line, void *shmaddr);
void spice_destroy_primary(spice_t *s);
68

Jeremy White's avatar
Jeremy White committed
69 70 71 72
spice_release_t *spice_create_release(spice_t *s, release_type_t type, void *data);
void spice_free_release(spice_release_t *r);


73
#endif