File: x_screen.h

package info (click to toggle)
mlterm 3.1.2-1.3
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 23,168 kB
  • sloc: ansic: 102,795; sh: 9,676; java: 2,018; perl: 1,601; makefile: 1,595; cpp: 771; sed: 16
file content (226 lines) | stat: -rw-r--r-- 6,172 bytes parent folder | download
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
/*
 *	$Id$
 */

#ifndef  __X_SCREEN_H__
#define  __X_SCREEN_H__


#include  <stdio.h>			/* FILE */
#include  <mkf/mkf_parser.h>
#include  <kiklib/kik_types.h>		/* u_int/int8_t/size_t */
#include  <ml_term.h>

#include  "x_window.h"
#include  "x_selection.h"
#include  "x_shortcut.h"
#include  "x_termcap.h"
#include  "x_mod_meta_mode.h"
#include  "x_bel_mode.h"
#include  "x_sb_mode.h"
#include  "x_im.h"
#include  "x_picture.h"


typedef struct x_screen *  x_screen_ptr_t ;

typedef struct x_system_event_listener
{
	void *  self ;

	void  (*open_screen)( void * , x_screen_ptr_t) ;
	void  (*close_screen)( void * , x_screen_ptr_t) ;
	void  (*open_pty)( void * , x_screen_ptr_t , char *) ;
	void  (*next_pty)( void * , x_screen_ptr_t) ;
	void  (*prev_pty)( void * , x_screen_ptr_t) ;
	void  (*close_pty)( void * , x_screen_ptr_t , char *) ;
	
	void  (*pty_closed)( void * , x_screen_ptr_t) ;

	ml_term_t *  (*get_pty)( void * , char *) ;
	char *  (*pty_list)( void *) ;

	int  (*mlclient)( void * , x_screen_ptr_t , char * , FILE *) ;

	void  (*font_config_updated)(void) ;
	void  (*color_config_updated)(void) ;

	/* for debug */
	void  (*exit)( void * , int) ;

} x_system_event_listener_t ;

typedef struct  x_screen_scroll_event_listener
{
	void *  self ;

	void  (*bs_mode_entered)( void *) ;
	void  (*bs_mode_exited)( void *) ;
	void  (*scrolled_upward)( void * , u_int) ;
	void  (*scrolled_downward)( void * , u_int) ;
	void  (*scrolled_to)( void * , int) ;
	void  (*log_size_changed)( void * , u_int) ;
	void  (*line_height_changed)( void * , u_int) ;
	void  (*change_fg_color)( void * , char *) ;
	char *  (*fg_color)( void *) ;
	void  (*change_bg_color)( void * , char *) ;
	char *  (*bg_color)( void *) ;
	void  (*change_view)( void * , char *) ;
	char *  (*view_name)( void *) ;
	void  (*transparent_state_changed)( void * , int , x_picture_modifier_t *) ;
	x_sb_mode_t  (*sb_mode)( void *) ;
	void  (*change_sb_mode)( void * , x_sb_mode_t) ;
	void  (*term_changed)( void * , u_int , u_int) ;

} x_screen_scroll_event_listener_t ;

typedef struct  x_screen
{
	x_window_t  window ;

	x_font_manager_t *  font_man ;
	
	x_color_manager_t *  color_man ;

	ml_term_t *  term ;
	
	x_selection_t  sel ;

	ml_screen_event_listener_t  screen_listener ;
	ml_xterm_event_listener_t  xterm_listener ;
	ml_config_event_listener_t  config_listener ;
	ml_pty_event_listener_t  pty_listener ;

	x_sel_event_listener_t  sel_listener ;
	x_xim_event_listener_t  xim_listener ;
	x_im_event_listener_t  im_listener ;

	x_shortcut_t *  shortcut ;
	x_termcap_entry_t *  termcap ;

	char *  input_method ;
	x_im_t *  im ;
	int  is_preediting ;
	u_int  im_preedit_beg_row ;
	u_int  im_preedit_end_row ;

	char *  mod_meta_key ;
	x_mod_meta_mode_t  mod_meta_mode ;
	u_int  mod_meta_mask ;
	u_int  mod_ignore_mask ;

	x_bel_mode_t  bel_mode ;

	u_int  screen_width_ratio ;
	u_int  screen_height_ratio ;

	x_system_event_listener_t *  system_listener ;
	x_screen_scroll_event_listener_t *  screen_scroll_listener ;

	mkf_parser_t *  xct_parser ;
	mkf_parser_t *  utf_parser ;	/* UTF8 in X, UTF16 in Win32. */
	
	mkf_parser_t *  ml_str_parser ;
	mkf_conv_t *  utf_conv ;	/* UTF8 in X, UTF16 in Win32. */
	mkf_conv_t *  xct_conv ;
	
	int  scroll_cache_rows ;
	int  scroll_cache_boundary_start ;
	int  scroll_cache_boundary_end ;

	char *  pic_file_path ;
	x_picture_modifier_t  pic_mod ;
	x_picture_t *  bg_pic ;

	x_icon_picture_t *  icon ;

#ifdef  ENABLE_SIXEL
	x_picture_manager_t *  pic_man ;
#endif

	/*
	 * These members mustn't be changed by mlterm configuration protocol,
	 * since they can be executed.
	 */
	char *  conf_menu_path_1 ;
	char *  conf_menu_path_2 ;
	char *  conf_menu_path_3 ;

	char  prev_mouse_report_seq[5] ;

	u_int8_t  fade_ratio ;
	u_int8_t  line_space ;
	int8_t  receive_string_via_ucs ;
	int8_t  use_vertical_cursor ;
	int8_t  use_extended_scroll_shortcut ;
	int8_t  borderless ;
	int8_t  font_or_color_config_updated ;	/* 0x1 = font updated, 0x2 = color updated */
	int8_t  cursor_blink_wait ;
	int8_t  hide_underline ;

} x_screen_t ;


/* xterm = traditional, menuN = conf_menu_path_N */
int  x_set_button3_behavior( const char *  mode) ;

int  x_set_im_cursor_color( char *  color) ;

x_screen_t *  x_screen_new( ml_term_t *  term , x_font_manager_t *  font_man ,
	x_color_manager_t *  color_man , x_termcap_entry_t *  termcap ,
	u_int  brightness , u_int contrast , u_int gamma , u_int  alpha ,
	u_int  fade_ratio , x_shortcut_t *  shortcut ,
	u_int  screen_width_ratio , u_int  screen_height_ratio ,
	char *  mod_meta_key , x_mod_meta_mode_t  mod_meta_mode ,
	x_bel_mode_t  bel_mode , int  receive_string_via_ucs , char *  pic_file_path ,
	int  use_transbg , int  use_vertical_cursor , int  big5_buggy ,
	char *  conf_menu_path_1 , char *  conf_menu_path_2 , char *  conf_menu_path_3 ,
	int  use_extended_scroll_shortcut , int  borderless , u_int  line_space ,
	char *  input_method , int  allow_osc52 , int  blink_cursor , int  margin ,
	int  hide_underline) ;

int  x_screen_delete( x_screen_t *  screen) ;

int  x_screen_attach( x_screen_t *  screen , ml_term_t *  term) ;

int  x_screen_attached( x_screen_t *  screen) ;

ml_term_t *  x_screen_detach( x_screen_t *  screen) ;

int  x_set_system_listener( x_screen_t *  screen ,
	x_system_event_listener_t *  system_listener) ;

int  x_set_screen_scroll_listener( x_screen_t *  screen ,
	x_screen_scroll_event_listener_t *  screen_scroll_listener) ;

	
int  x_screen_scroll_upward( x_screen_t *  screen , u_int  size) ;

int  x_screen_scroll_downward( x_screen_t *  screen , u_int  size) ;

int  x_screen_scroll_to( x_screen_t *  screen , int  row) ;


u_int  x_col_width( x_screen_t *  screen) ;

u_int  x_line_height( x_screen_t *  screen) ;

u_int  x_line_ascent( x_screen_t *  screen) ;

u_int  x_line_top_margin( x_screen_t *  screen) ;

u_int  x_line_bottom_margin( x_screen_t *  screen) ;


int  x_screen_exec_cmd( x_screen_t *  screen , char *  cmd) ;

int  x_screen_set_config( x_screen_t *  screen , char *  dev , char *  key , char *  value) ;


int  x_screen_reset_view( x_screen_t *  screen) ;


x_picture_modifier_t *  x_screen_get_picture_modifier( x_screen_t *  screen) ;


#endif