4
** Copyright (c) 1993-2001 by Hans-Ulrich Kiel & Joerg Czeranski
5
** All rights reserved.
7
** Redistribution and use in source and binary forms, with or without
8
** modification, are permitted provided that the following conditions are
11
** 1. Redistributions of source code must retain the above copyright
12
** notice, this list of conditions and the following disclaimer.
13
** 2. Redistributions in binary form must reproduce the above copyright
14
** notice, this list of conditions and the following disclaimer in the
15
** documentation and/or other materials provided with the distribution.
16
** 3. The name of the authors may not be used to endorse or promote
17
** products derived from this software without specific prior written
19
** 4. The name ``iMaze'' may not be used for products derived from this
20
** software unless a prefix or a suffix is added to the name.
22
** THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
23
** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
24
** WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
25
** DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT,
26
** INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
27
** (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
28
** SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29
** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
30
** STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
31
** IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32
** POSSIBILITY OF SUCH DAMAGE.
38
** Wertet Events von der Tastatur aus und setzt definierte Signale
42
#include <xview/xview.h>
43
#include <xview/canvas.h>
44
#include <xview/panel.h>
49
#include "ereignisse.h"
52
#include "xv_einaus.h"
55
static char sccsid[] = "@(#)xv_tasten.c 3.6 12/3/01";
58
struct arg_option xv_eingabe_opts[] =
60
{ Arg_Include, NULL, X_eingabe_opts },
67
** verarbeitet die Tastatur-Events und ordnet sie den internen Signalen zu
70
** window: Fenster fuer den der Event bestimmt ist
71
** event: Beschreibung des Events
74
** aktiv wird veraendert
76
static void event_routine(Xv_Window window, Event *event)
78
X_event_routine(XV_DISPLAY_FROM_WINDOW(event_window(event)),
85
** sucht in einem Fenster nach Unterfenstern vom Typ CANVAS und
86
** initialisiert darin die Event-Abfrage
89
** frame: Fenster, in dem gesucht werden soll
91
static void frame_init(Frame frame)
96
for (i = 1; (subwindow = xv_get(frame,
97
FRAME_NTH_SUBWINDOW, i)) != 0; i++)
98
if ((Xv_pkg *)xv_get(subwindow, XV_TYPE) == CANVAS)
100
/* KBD_DONE: Fenster verliert Fokus
101
WIN_ASCII_EVENT: Tasten werden gedrueckt
102
WIN_UP_EVENT: Taste losgelassen (wird evtl.
103
nicht unterstuetzt) */
104
xv_set(canvas_paint_window(subwindow),
106
KBD_DONE, WIN_ASCII_EVENTS,
108
WIN_EVENT_PROC, event_routine,
114
/* bis hier lokaler Teil */
115
/***********************************************/
116
/* ab hier globaler Teil */
121
** sucht nach Unterfenstern vom Typ CANVAS und initialisiert darin
125
** hauptframe: Fenster, von dem alle anderen Fenster abstammen
126
** panel: Panel, in dem Buttons ergaenzt werden duerfen
129
** 0 fuer Erfolg, 1 fuer Fehler
131
int xv_eingabe_init(Frame hauptframe, Panel panel)
134
Frame subframe; /* ein Fenster */
136
/* im Hauptfenster suchen */
137
frame_init(hauptframe);
139
/* in allen weiteren Fenstern suchen */
140
for (i = 1; (subframe = xv_get(hauptframe,
141
FRAME_NTH_SUBFRAME, i)) != 0; i++)
142
frame_init(subframe);
144
return X_eingabe_init();
150
** Dummy-Routine fuer das Schliessen von Eingabekanaelen etc.
152
void xv_eingabe_ende(void)