summaryrefslogtreecommitdiff
path: root/Source/DiVine/include/divine.h
blob: b4c2051257816036b522e98762871f1398ceb406 (plain)
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
/*
   (c) Copyright 2000-2002  convergence integrated media GmbH.
   (c) Copyright 2002       convergence GmbH.

   All rights reserved.

   Written by Denis Oliver Kropp <dok@directfb.org>,
              Andreas Hundt <andi@fischlustig.de> and
              Sven Neumann <sven@convergence.de>.

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.

   This library 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
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public
   License along with this library; if not, write to the
   Free Software Foundation, Inc., 59 Temple Place - Suite 330,
   Boston, MA 02111-1307, USA.
*/

#ifndef __DIVINE_H__
#define __DIVINE_H__

#include <directfb.h>

/*
 * Main interface of DiVine, created by DiVineCreate().
 */
DECLARE_INTERFACE( IDiVine )

/*
 * Parses the command-line and initializes some variables. You
 * absolutely need to call this before doing anything else.
 * Removes all options used by DiVine from argv.
 */
DFBResult DiVineInit( int *argc, char *(*argv[]) );

/*
 * Creates the super interface.
 */
DFBResult DiVineCreate(
                        IDiVine **interface  /* pointer to the created interface */
                      );

/***********
 * IDiVine *
 ***********/

/*
 * <i>No summary yet...</i>
 */
DEFINE_INTERFACE(   IDiVine,

   /** Events **/

     /*
      * Sends an input event.
      */
     DFBResult (*SendEvent) (
          IDiVine                 *thiz,
          const DFBInputEvent     *event
     );

     /*
      * Sends an input key symbol.
      */
     DFBResult (*SendSymbol) (
          IDiVine                 *thiz,
          DFBInputDeviceKeySymbol  symbol
     );
);


/*
 * The DiVine struct represents the connection to the input driver.
 */
typedef struct _DiVine DiVine;

/*
 * Opens a connection to the input driver by opening the pipe
 * specified by 'path'.
 *
 * Returns the DiVine connection object.
 */
DiVine *divine_open (const char *path);


/*
 * Sends an input event.
 */
void divine_send_event (DiVine *divine, const DFBInputEvent *event);

/*
 * Sends a press and a release event for the specified symbol.
 */
void divine_send_symbol (DiVine *divine, DFBInputDeviceKeySymbol symbol);

/*
 * Sends a press and a release event for the specified identifier.
 */
void divine_send_identifier (DiVine *divine, DFBInputDeviceKeyIdentifier identifier);

/*
 * Sends a press and a release event for the specified ANSI string.
 * Use this to feed terminal input into a DirectFB application.
 */
void divine_send_vt102 (DiVine *divine, int size, const char *ansistr);

/*
 *
 */
void divine_send_motion_absolute( DiVine *divine, int x, int y );

/*
 *
 */
void divine_send_button_press( DiVine *divine, DFBInputDeviceButtonIdentifier button );

/*
 *
 */
void divine_send_button_release( DiVine *divine, DFBInputDeviceButtonIdentifier button );


/*
 * Closes the pipe and destroys the connection object.
 */
void divine_close (DiVine *divine);

#endif