/usr/include/crystalspace-2.0/ivaria/conin.h is in libcrystalspace-dev 2.0+dfsg-1build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 | /*
Copyright (C) 2000 by Jorrit Tyberghein
Written by Michael Dale Long
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __CS_IVARIA_CONIN_H__
#define __CS_IVARIA_CONIN_H__
/**\file
* Graphical console input
*/
#include "csutil/scf_interface.h"
struct iEvent;
struct iConsoleOutput;
/**
* Command execution callback.
*/
struct iConsoleExecCallback : public virtual iBase
{
SCF_INTERFACE (iConsoleExecCallback, 0, 0, 1);
/// Execute.
virtual void Execute (const char* cmd) = 0;
};
/**
* This is a plugin that can handle keyboard input and display
* it on an associated console. The plugin has a command history
* and when user presses 'Enter' can call some callback function
* to execute the entered command.
*
* <b>WARNING</b> Do NOT use the event handler
* that may (or may not) be implemented by the console and register
* that to the event queue. This doesn't work properly. Instead register
* your own event handler and call HandleEvent() from that.
*
* Main creators of instances implementing this interface:
* - Standard input console plugin (crystalspace.console.input.standard)
*
* Main ways to get pointers to this interface:
* - csQueryRegistry()
*/
struct iConsoleInput : public virtual iBase
{
SCF_INTERFACE (iConsoleInput, 2, 0, 0);
/**
* Bind to an output console.
* \param console
*/
virtual void Bind (iConsoleOutput* console) = 0;
/**
* Set the command execution callback.
* \param callback will be called whenever the user presses enter
* so the application can then perform the command that was entered.
*/
virtual void SetExecuteCallback (iConsoleExecCallback* callback) = 0;
/// Get the command execution callback.
virtual iConsoleExecCallback* GetExecuteCallback () = 0;
/**
* Return a line from the input buffer.
* \param line is the line number to get or -1 (default) for current line.
*/
virtual const char *GetText (int line = -1) const = 0;
/// Return the current input line number.
virtual int GetCurLine () const = 0;
/// Retrieve the size of the history buffer.
virtual int GetBufferSize () const = 0;
/**
* Set the size of the history buffer.
* \param size is the size in lines of the history buffer.
*/
virtual void SetBufferSize (int size) = 0;
/// Clear the history buffer.
virtual void Clear () = 0;
/// Set the prompt string.
virtual void SetPrompt (const char *prompt) = 0;
/**
* Handle a console-related event. Do NOT use the event handler
* that may (or may not) be implemented by the console and register
* that to the event queue. This doesn't work properly. Instead register
* your own event handler and call HandleEvent() from that.
*/
virtual bool HandleEvent (iEvent&) = 0;
};
#endif // __CS_IVARIA_CONIN_H__
|