Main Page   Data Structures   File List   Data Fields   Globals   Related Pages  

core.h File Reference

VTCore class definition. More...

#include <stdio.h>
#include <wchar.h>
#include "io.h"
#include "screen.h"

Go to the source code of this file.

Data Structures

struct  _VTCore

Typedefs

typedef _VTCore VTCore
 typedefed struct of struct _VTCore


Enumerations

enum  {
  VTM_SHIFT = 0x0004, VTM_META = 0x0008, VTM_CONTROL = 0x0010, VTK_LEFT = 0xFF51,
  VTK_UP = 0xFF52, VTK_RIGHT = 0xFF53, VTK_DOWN = 0xFF54, VTK_CR = 0xFF0D,
  VTK_KP_0 = 0xFF00, VTK_KP_1 = 0xFF01, VTK_KP_2 = 0xFF02, VTK_KP_3 = 0xFF03,
  VTK_KP_4 = 0xFF04, VTK_KP_5 = 0xFF05, VTK_KP_6 = 0xFF06, VTK_KP_7 = 0xFF07,
  VTK_KP_8 = 0xFF08, VTK_KP_9 = 0xFF09, VTK_KP_DASH = 0xFF0A, VTK_KP_COMMA = 0xFF0B,
  VTK_KP_PERIOD = 0xFF0C, VTK_KP_ENTER = 0xFF0D, VTK_KP_PF1 = 0xFF0E, VTK_KP_PF2 = 0xFF0F,
  VTK_KP_PF3 = 0xFF10, VTK_KP_PF4 = 0xFF11, VTK_F1 = 0x1000, VTK_F2 = 0x1001,
  VTK_F3 = 0x1002, VTK_F4 = 0x1003, VTK_F5 = 0x1004, VTK_F6 = 0x1005,
  VTK_F7 = 0x1006, VTK_F8 = 0x1007, VTK_F9 = 0x1008, VTK_F10 = 0x1009,
  VTK_F11 = 0x1010, VTK_F12 = 0x1011, VTK_F13 = 0x1012, VTK_F14 = 0x1013,
  VTK_F15 = 0x1014, VTK_F16 = 0x1015, VTK_F17 = 0x1016, VTK_F18 = 0x1017
}

Functions

VTCoreVTCore_new (TerminalIO *io, int num_cols, int num_rows, int num_history)
 Constructor of VTCore object.

void VTCore_destroy (VTCore *core)
 Destructor of VTCore object.

int VTCore_write (struct _VTCore *core, char *mb, int length)
 method to write input data to Host.

int VTCore_send_key (VTCore *core, int type)
 method to send specified key

void VTCore_redraw (VTCore *core, int scol, int srow, int ecol, int erow)
 method to request redraw to screen model.

void VTCore_set_screen_view (VTCore *core, VTScreenView *view)
 method to set ScreenView to ScreenModel

void VTCore_set_screen_size (VTCore *core, int width, int height)
 method to set Screen size

void VTCore_start_selection (VTCore *core, int scol, int srow, int type)
 Start selection.

void VTCore_extend_selection (VTCore *core, int scol, int srow)
 Extend selection.

void VTCore_copy_buffer (VTCore *core, int scol, int srow, int ecol, int erow, char *dest, int dest_size)
 Copy multibyte characters from buffer.

void VTCore_copy_selected_buffer (VTCore *core, char *dest, int dest_size)
 Copy multibyte characters from buffer.

void VTCore_clear_selection (VTCore *core)
 Clear selection.

void VTCore_scroll (VTCore *core, double top)
 Scroll buffer.

void VTCore_set_exit_callback (VTCore *core, void(*proc)(VTScreenView *view))
 set callback function when host thread finish.

void VTCore_set_reverse_video (VTCore *core, int on)
 set reverse video

void VTCore_scroll_up (VTCore *core, int num_line)
 Scroll buffer.

void VTCore_scroll_down (VTCore *core, int num_line)
 Scroll buffer.

int VTCore_send_mouse_position (VTCore *core, int button, int modifiers, int pressed, int col, int row)
 Send mouse cursor position This should be called when.

void VTCore_dispatch (VTCore *core)
 Dispatch host event; This method doesn't return until host sends bytes.


Detailed Description

VTCore class definition.


Enumeration Type Documentation

anonymous enum
 

Enumeration values:
VTM_SHIFT  Shift modifier.
VTM_META  Meta modifier.
VTM_CONTROL  Control modifier.
VTK_LEFT  cursor key left
VTK_UP  cursor key up
VTK_RIGHT  cursor key right
VTK_DOWN  cursor key down
VTK_CR  Enter/Return Key.
VTK_KP_0  KeyPad 0 Key.
VTK_KP_1  KeyPad 1 Key.
VTK_KP_2  KeyPad 2 Key.
VTK_KP_3  KeyPad 3 Key.
VTK_KP_4  KeyPad 4 Key.
VTK_KP_5  KeyPad 5 Key.
VTK_KP_6  KeyPad 6 Key.
VTK_KP_7  KeyPad 7 Key.
VTK_KP_8  KeyPad 8 Key.
VTK_KP_9  KeyPad 9 Key.
VTK_KP_DASH  KeyPad Dash/Minus/Hyphen Key.
VTK_KP_COMMA  KeyPad Comma Key.
VTK_KP_PERIOD  KeyPad Period Key.
VTK_KP_ENTER  KeyPad Enter/Return Key.
VTK_KP_PF1  KeyPad PF1 Key.
VTK_KP_PF2  KeyPad PF2 Key.
VTK_KP_PF3  KeyPad PF3 Key.
VTK_KP_PF4  KeyPad PF4 Key.
VTK_F1  F1 Key.
VTK_F2  F2 Key.
VTK_F3  F3 Key.
VTK_F4  F4 Key.
VTK_F5  F5 Key.
VTK_F6  F6 Key.
VTK_F7  F7 Key.
VTK_F8  F8 Key.
VTK_F9  F9 Key.
VTK_F10  F10 Key.
VTK_F11  F11 Key.
VTK_F12  F12 Key.
VTK_F13  F13 Key.
VTK_F14  F14 Key.
VTK_F15  F15 Key.
VTK_F16  F16 Key.
VTK_F17  F17 Key.
VTK_F18  F18 Key.


Function Documentation

void VTCore_clear_selection VTCore   core
 

Clear selection.

Parameters:
core reference to VTCore object

void VTCore_copy_buffer VTCore   core,
int    scol,
int    srow,
int    ecol,
int    erow,
char *    dest,
int    dest_size
 

Copy multibyte characters from buffer.


Caller must allocate dest before calling this method

Parameters:
core reference to VTCore object
scol start column
srow start row
ecol end column inclusive
erow end row inclusive
dest destination
dest_size size of destination

void VTCore_copy_selected_buffer VTCore   core,
char *    dest,
int    dest_size
 

Copy multibyte characters from buffer.


Caller must allocate dest before calling this method and specfy selection by VTCore_start_selection /VTCore_extend_selection method.

Parameters:
core reference to VTCore object
dest destination
dest_size size of destination

void VTCore_destroy VTCore   core
 

Destructor of VTCore object.

Parameters:
core reference to VTCore object

void VTCore_dispatch VTCore   core
 

Dispatch host event; This method doesn't return until host sends bytes.

Caller must detect host event before calling this method.

Parameters:
core reference to VTCore object

void VTCore_extend_selection VTCore   core,
int    col,
int    row
 

Extend selection.

Parameters:
core reference to VTCore object
col end column
row end row

VTCore* VTCore_new TerminalIO   io,
int    num_cols,
int    num_rows,
int    num_history
 

Constructor of VTCore object.

Parameters:
io reference to TerminalIO object which VTCore connect to
num_cols number of columns
num_rows number of rows
num_history number of saved rows, should be num_rows <

void VTCore_redraw VTCore   core,
int    scol,
int    srow,
int    ecol,
int    erow
 

method to request redraw to screen model.

Parameters:
core reference to VTCore object
scol top left column
srow top left row
ecol bottom right column exclusively
erow bottom right row exclusively

void VTCore_scroll VTCore   core,
double    top
 

Scroll buffer.

Parameters:
core reference to VTCore object
top 0.0 is a beginning of buffer
NOTE: top must be 0.0 - 1.0

void VTCore_scroll_down VTCore   core,
int    num_line
 

Scroll buffer.

Parameters:
core reference to VTCore object
num_line number of line to scroll down

void VTCore_scroll_up VTCore   core,
int    num_line
 

Scroll buffer.

Parameters:
core reference to VTCore object
num_line number of line to scroll up

int VTCore_send_key VTCore   core,
int    type
 

method to send specified key

Parameters:
core reference to VTCore object
type key type

int VTCore_send_mouse_position VTCore   core,
int    button,
int    modifiers,
int    pressed,
int    col,
int    row
 

Send mouse cursor position This should be called when.

Parameters:
core reference to VTScreen object.
button button number 0 =<
modifiers modifiers of key(VTM_SHIFT, VTM_META or VTM_CONTROL)
pressed 1 if this button is pressed, 0 if released
col mouse column
row mouse row
Returns:
if send to the host return 1, else 0. Caller should NOT do anything after this returns 1;

void VTCore_set_exit_callback VTCore   core,
void(*    proc)(VTScreenView *view)
 

set callback function when host thread finish.

Parameters:
core reference to VTCore object
proc reference to function to be called. Function Prototype is void proc(VTScreenView *view), but may be changed ;-)

void VTCore_set_reverse_video VTCore   core,
int    on
 

set reverse video

Parameters:
core reference to VTCore object
on 0 will unset reverse video, 1 is opposite

void VTCore_set_screen_size VTCore   core,
int    width,
int    height
 

method to set Screen size

Parameters:
core reference to VTCore object
width new number of cols
height new number of rows

void VTCore_set_screen_view VTCore   core,
VTScreenView   view
 

method to set ScreenView to ScreenModel

Parameters:
core reference to VTCore object
view reference to ScreenView object

void VTCore_start_selection VTCore   core,
int    col,
int    row,
int    type
 

Start selection.

Parameters:
core reference to VTCore object
col start column
row start row
type selection type

int VTCore_write struct _VTCore *    core,
char *    mb,
int    length
 

method to write input data to Host.

Parameters:
core reference to VTCore object
mb reference to multibyte character
length of character to write


Generated on Sun Dec 29 16:55:32 2002 by doxygen1.3-rc2