viewer/evnts.h File Reference

#include "grphics.h"

Go to the source code of this file.

Functions

Variables


Function Documentation

DLLSYM WINDOW await_click ( WINDOW  win,
BOOL8  wait,
float &  x,
float &  y 
)

Wait for click.

Wait (or check) for a click on the given (or all) fd and return it.

Definition at line 83 of file evnts.cpp.

References await_event, DESTROY_EVENT, DOWN_EVENT, NULL, graphicsevent::type, graphicsevent::x, and graphicsevent::y.

00088                            {
00089   GRAPHICS_EVENT event;          /*return event */
00090 
00091   win = await_event (win, wait, DOWN_EVENT, &event);
00092   if (event.type == DESTROY_EVENT)
00093     return NULL;                 //was destroyed
00094   if (win != NULL) {
00095     x = event.x;                 /*get coords */
00096     y = event.y;
00097   }
00098   return win;
00099 }

DLLSYM WINDOW await_key ( WINDOW  win,
BOOL8  wait,
char &  c 
)

Wait for key.

Wait (or check) for a key on the given (or all) fd and return it.

Definition at line 107 of file evnts.cpp.

References await_event, DESTROY_EVENT, graphicsevent::key, KEYPRESS_EVENT, NULL, and graphicsevent::type.

00111                          {
00112   GRAPHICS_EVENT event;          /*return event */
00113 
00114   win = await_event (win, wait, KEYPRESS_EVENT, &event);
00115   if (event.type == DESTROY_EVENT)
00116     return NULL;                 //was destroyed
00117   if (win != NULL)
00118     c = event.key;               /*get keypress */
00119   return win;
00120 }

DLLSYM WINDOW await_selection ( WINDOW  win,
BOOL8  wait,
float &  xmin,
float &  ymin,
float &  xmax,
float &  ymax 
)

Wait for selection.

Wait (or check) for a selection on the given (or all) fd and return it.

Definition at line 55 of file evnts.cpp.

References await_event, DESTROY_EVENT, NULL, SELECT_EVENT, graphicsevent::type, graphicsevent::x, graphicsevent::xmax, graphicsevent::y, and graphicsevent::ymax.

00062                                {
00063   GRAPHICS_EVENT event;          /*return event */
00064 
00065   win = await_event (win, wait, SELECT_EVENT, &event);
00066   if (event.type == DESTROY_EVENT)
00067     return NULL;                 //was destroyed
00068   if (win != NULL) {
00069     xmin = event.x;              /*get coords */
00070     ymin = event.y;
00071     xmax = event.xmax;           /*get coords */
00072     ymax = event.ymax;
00073   }
00074   return win;
00075 }

DLLSYM WINDOW def_await_event ( WINDOW  win,
BOOL8  wait,
INT8  event_type,
GRAPHICS_EVENT out_event 
)

Wait for event.

Wait (or check) for a event on the given (or all) fd and return it.

Definition at line 128 of file evnts.cpp.

References DESTROY_EVENT, graphicsevent::fd, find_event(), WINFD::get_fd(), NULL, and graphicsevent::type.

00133                                {
00134   GRAPHICS_EVENT *event;         /*return event */
00135   INT16 fd;                      //file descriptor
00136 
00137   if (win == NULL)
00138     fd = 0;
00139   else
00140     fd = win->get_fd ();
00141                                  /*look for one */
00142   event = find_event (fd, wait, event_type);
00143   if (event == NULL)
00144     return NULL;                 /*not found */
00145   else {
00146     *out_event = *event;         /*copy event */
00147     if (event->type != DESTROY_EVENT)
00148       delete event;              //free the element
00149     return out_event->fd;
00150   }
00151 }


Variable Documentation

DLLSYM EVENT_HANDLER win_selection_handler

Note:
File: evnts.h (Formerly events.h)
Header of functions and types needed for using events.
Author:
Ray Smith
Date:
Thu May 24 15:14:45 BST 1990
 * (C) Copyright 1990, Hewlett-Packard Ltd.
 ** Licensed under the Apache License, Version 2.0 (the "License");
 ** you may not use this file except in compliance with the License.
 ** You may obtain a copy of the License at
 ** http://www.apache.org/licenses/LICENSE-2.0
 ** Unless required by applicable law or agreed to in writing, software
 ** distributed under the License is distributed on an "AS IS" BASIS,
 ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 ** See the License for the specific language governing permissions and
 ** limitations under the License.

Definition at line 31 of file evnts.cpp.

Referenced by create_edges_window().


Generated on Wed Feb 28 19:49:27 2007 for Tesseract by  doxygen 1.5.1