2
* Copyright © 2008-2009 dragchan <zgchan317@gmail.com>
3
* This file is part of FbTerm.
5
* This program is free software; you can redistribute it and/or
6
* modify it under the terms of the GNU General Public License
7
* as published by the Free Software Foundation; either version 2
8
* of the License, or (at your option) any later version.
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25
* messages from IM to Fbterm:
27
* Connect: IM send it to FbTerm after ending initization
28
* PutText: IM put translated input method text in this message, then send back to FbTerm
29
* SetWins: IM tell FbTerm that rectangles contained in the message will be used to draw IM's UI,
30
* and FbTerm should NOT paint on these areas
33
* messages from FbTerm to IM:
35
* FbTermInfo: FbTerm send font name/size etc to IM, help IM to keep same UI with FbTerm
36
* Disconnect: FbTerm request IM to exit
37
* Active: FbTerm tell IM that user switch input method state on
38
* Deactive: FbTerm tell IM that user siwtch input method state off
39
* SendKey: when input method state is on, FbTerm send all keybord keys to IM
40
* CursorPosition: FbTerm tell IM that cursor poisition has been changed
41
* AckWins: when receive message SetWins, FbTerm send this message to IM,
42
* on the other side, after sending SetWins, IM will keep waiting until receive AckWins from FbTerm
43
* TermMode: FbTerm send term mode to IM, help IM to translate keycode to terminal input
48
Connect = 0, Disconnect,
52
CursorPosition, FbTermInfo, TermMode,
53
ShowUI, HideUI, AckHideUI
58
unsigned short fontSize, fontHeight, fontWidth;
70
unsigned short type; // message's type, see enum MessageType
71
unsigned short len; // message's length, including head and body
74
char keys[0]; // for SendKey
75
char texts[0]; // for PutText
76
ImWin wins[0]; // for SetWins
77
Info info; // for FbTermInfo
78
char raw; // for Connect, 1: when IM actived, FbTerm sets keyboard mode to K_MEDIUMRAW
79
// 0: keep K_UNICODE mode
85
} term; // for TermMode;
89
} cursor; // for CursorPosition