src/core/linux/SDL_dbus.h
author Alex Baines
Fri, 27 Feb 2015 21:17:29 +0000
changeset 9646 9d4917e2d909
parent 9619 b94b6d0bff0f
child 9998 f67cf37e9cd4
permissions -rw-r--r--
[IBus] Only register interest in messages sent to our input context.
alex@8889
     1
/*
alex@8889
     2
  Simple DirectMedia Layer
slouken@9619
     3
  Copyright (C) 1997-2015 Sam Lantinga <slouken@libsdl.org>
alex@8889
     4
alex@8889
     5
  This software is provided 'as-is', without any express or implied
alex@8889
     6
  warranty.  In no event will the authors be held liable for any damages
alex@8889
     7
  arising from the use of this software.
alex@8889
     8
alex@8889
     9
  Permission is granted to anyone to use this software for any purpose,
alex@8889
    10
  including commercial applications, and to alter it and redistribute it
alex@8889
    11
  freely, subject to the following restrictions:
alex@8889
    12
alex@8889
    13
  1. The origin of this software must not be misrepresented; you must not
alex@8889
    14
     claim that you wrote the original software. If you use this software
alex@8889
    15
     in a product, an acknowledgment in the product documentation would be
alex@8889
    16
     appreciated but is not required.
alex@8889
    17
  2. Altered source versions must be plainly marked as such, and must not be
alex@8889
    18
     misrepresented as being the original software.
alex@8889
    19
  3. This notice may not be removed or altered from any source distribution.
alex@8889
    20
*/
alex@8889
    21
alex@8889
    22
#include "../../SDL_internal.h"
alex@8889
    23
alex@8889
    24
#ifndef _SDL_dbus_h
alex@8889
    25
#define _SDL_dbus_h
alex@8889
    26
alex@8889
    27
#ifdef HAVE_DBUS_DBUS_H
alex@8889
    28
#define SDL_USE_LIBDBUS 1
alex@8889
    29
#include "SDL_stdinc.h"
alex@8889
    30
#include <dbus/dbus.h>
alex@8889
    31
alex@8889
    32
alex@8889
    33
typedef struct SDL_DBusContext {
alex@8889
    34
    DBusConnection *session_conn;
alex@8889
    35
alex@8889
    36
    DBusConnection *(*bus_get_private)(DBusBusType, DBusError *);
alex@8889
    37
    dbus_bool_t (*bus_register)(DBusConnection *, DBusError *);
alex@8889
    38
    void (*bus_add_match)(DBusConnection *, const char *, DBusError *);
alex@8889
    39
    DBusConnection * (*connection_open_private)(const char *, DBusError *);
alex@8889
    40
    void (*connection_set_exit_on_disconnect)(DBusConnection *, dbus_bool_t);
alex@8889
    41
    dbus_bool_t (*connection_get_is_connected)(DBusConnection *); 	
alex@8889
    42
    dbus_bool_t (*connection_add_filter)(DBusConnection *, DBusHandleMessageFunction,
alex@8889
    43
	    void *, DBusFreeFunction);
alex@9646
    44
    dbus_bool_t (*connection_try_register_object_path)(DBusConnection *, const char *,
alex@9646
    45
        const DBusObjectPathVTable *, void *, DBusError *);
alex@8889
    46
    dbus_bool_t (*connection_send)(DBusConnection *, DBusMessage *, dbus_uint32_t *);
alex@8889
    47
    DBusMessage *(*connection_send_with_reply_and_block)(DBusConnection *, DBusMessage *, int, DBusError *);
alex@8889
    48
    void (*connection_close)(DBusConnection *);
alex@8889
    49
    void (*connection_unref)(DBusConnection *);
alex@8889
    50
    void (*connection_flush)(DBusConnection *);
alex@8889
    51
    dbus_bool_t (*connection_read_write)(DBusConnection *, int);
alex@8889
    52
    DBusDispatchStatus (*connection_dispatch)(DBusConnection *);
alex@8889
    53
    dbus_bool_t (*message_is_signal)(DBusMessage *, const char *, const char *); 	
alex@8889
    54
    DBusMessage *(*message_new_method_call)(const char *, const char *, const char *, const char *);
alex@8889
    55
    dbus_bool_t (*message_append_args)(DBusMessage *, int, ...);
alex@8889
    56
    dbus_bool_t (*message_get_args)(DBusMessage *, DBusError *, int, ...);
alex@8889
    57
    dbus_bool_t (*message_iter_init)(DBusMessage *, DBusMessageIter *);
alex@8889
    58
    dbus_bool_t (*message_iter_next)(DBusMessageIter *);
alex@8889
    59
    void (*message_iter_get_basic)(DBusMessageIter *, void *);
alex@8889
    60
    int (*message_iter_get_arg_type)(DBusMessageIter *);
alex@8889
    61
    void (*message_iter_recurse)(DBusMessageIter *, DBusMessageIter *); 	 	
alex@8889
    62
    void (*message_unref)(DBusMessage *);
alex@8889
    63
    void (*error_init)(DBusError *);
alex@8889
    64
    dbus_bool_t (*error_is_set)(const DBusError *);
alex@8889
    65
    void (*error_free)(DBusError *);
alex@8889
    66
    char *(*get_local_machine_id)(void);
alex@8977
    67
    void (*free)(void *);
alex@8977
    68
    void (*shutdown)(void);
alex@8889
    69
alex@8889
    70
} SDL_DBusContext;
alex@8889
    71
alex@8889
    72
extern void SDL_DBus_Init(void);
alex@8889
    73
extern void SDL_DBus_Quit(void);
alex@8889
    74
extern SDL_DBusContext * SDL_DBus_GetContext(void);
alex@8889
    75
extern void SDL_DBus_ScreensaverTickle(void);
alex@8889
    76
extern SDL_bool SDL_DBus_ScreensaverInhibit(SDL_bool inhibit);
alex@8889
    77
alex@8889
    78
#endif /* HAVE_DBUS_DBUS_H */
alex@8889
    79
alex@8889
    80
#endif /* _SDL_dbus_h */
alex@8889
    81
alex@8889
    82
/* vi: set ts=4 sw=4 expandtab: */