~ubuntu-branches/ubuntu/trusty/libgii/trusty

« back to all changes in this revision

Viewing changes to include/ggi/gii.h

  • Committer: Bazaar Package Importer
  • Author(s): Martin Albert
  • Date: 2001-08-27 23:17:32 UTC
  • Revision ID: james.westby@ubuntu.com-20010827231732-5kiieyxb3mvj25ur
Tags: upstream-0.8.1
ImportĀ upstreamĀ versionĀ 0.8.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* $Id: gii.h,v 1.3 2001/06/30 09:56:14 soyt Exp $
 
2
******************************************************************************
 
3
 
 
4
   LibGII API header file
 
5
 
 
6
   Copyright (C) 1998      Andreas Beck         [becka@ggi-project.org]
 
7
   Copyright (C) 1999-2000 Marcus Sundberg      [marcus@ggi-project.org]
 
8
 
 
9
   Permission is hereby granted, free of charge, to any person obtaining a
 
10
   copy of this software and associated documentation files (the "Software"),
 
11
   to deal in the Software without restriction, including without limitation
 
12
   the rights to use, copy, modify, merge, publish, distribute, sublicense,
 
13
   and/or sell copies of the Software, and to permit persons to whom the
 
14
   Software is furnished to do so, subject to the following conditions:
 
15
 
 
16
   The above copyright notice and this permission notice shall be included in
 
17
   all copies or substantial portions of the Software.
 
18
 
 
19
   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 
20
   IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 
21
   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
 
22
   THE AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
 
23
   IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 
24
   CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
25
 
 
26
******************************************************************************
 
27
*/
 
28
              
 
29
#ifndef _GGI_GII_H
 
30
#define _GGI_GII_H
 
31
 
 
32
#include <ggi/events.h>
 
33
 
 
34
#ifndef _INTERNAL_LIBGII
 
35
/* Opaque pointer types.
 
36
   This little magic gains us some type checking. */
 
37
struct gii_h_dummy1 { char dummy1; };
 
38
typedef struct gii_h_dummy1 *gii_input_t;
 
39
#endif
 
40
 
 
41
 
 
42
/*
 
43
******************************************************************************
 
44
 libGII function definitions
 
45
******************************************************************************
 
46
*/
 
47
__BEGIN_DECLS
 
48
 
 
49
/* Get the master config dir
 
50
 */
 
51
const char *giiGetConfDir(void);
 
52
 
 
53
/* Enter and leave the library.
 
54
 */
 
55
int  giiInit(void);
 
56
int  giiExit(void);
 
57
void giiPanic(const char *format, ...);
 
58
 
 
59
/* Turn on thread safe operation
 
60
 */
 
61
int giiMTInit(void);
 
62
 
 
63
/* Open a new Input - use input `NULL' for autoselect.
 
64
 */
 
65
gii_input_t     giiOpen(const char *input,...);
 
66
int             giiClose(gii_input_t inp);
 
67
 
 
68
/* Input management
 
69
 */
 
70
gii_input_t giiJoinInputs(gii_input_t inp, gii_input_t inp2);
 
71
int giiSplitInputs(gii_input_t inp, gii_input_t *newhand,
 
72
                   uint32 origin, uint32 flags);
 
73
 
 
74
/* Event Handling
 
75
 */
 
76
gii_event_mask  giiEventPoll(gii_input_t inp, gii_event_mask mask,
 
77
                             struct timeval *t);
 
78
int             giiEventRead(gii_input_t inp, gii_event *ev,
 
79
                             gii_event_mask mask);
 
80
int             giiEventsQueued(gii_input_t inp, gii_event_mask mask);
 
81
int             giiEventSend(gii_input_t inp, gii_event *ev);
 
82
int             giiSetEventMask(gii_input_t inp, gii_event_mask evm);
 
83
gii_event_mask  giiGetEventMask(gii_input_t inp);
 
84
 
 
85
#define giiAddEventMask(inp,mask)  \
 
86
                giiSetEventMask((inp), giiGetEventMask((inp)) | (mask))
 
87
#define giiRemoveEventMask(inp,mask)  \
 
88
                giiSetEventMask((inp), giiGetEventMask((inp)) & ~(mask))
 
89
 
 
90
/* Deviceinfo stuff
 
91
 */
 
92
int          giiQueryDeviceInfo        (gii_input_t inp, uint32 origin, gii_cmddata_getdevinfo *info);
 
93
int          giiQueryDeviceInfoByNumber(gii_input_t inp, uint32 number, uint32 *origin, gii_cmddata_getdevinfo *info);
 
94
int          giiQueryValInfo   (gii_input_t inp, uint32 origin, uint32 valnumber, gii_cmddata_getvalinfo *info);
 
95
 
 
96
__END_DECLS
 
97
 
 
98
#endif /* _GGI_GII_H */