1 /* TN5250 - An implementation of the 5250 telnet protocol.
2  * Copyright (C) 2000-2008 Jay 'Eraserhead' Felice
3  *
4  * This file is part of TN5250.
5  *
6  * TN5250 is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU Lesser General Public License as published by
8  * the Free Software Foundation; either version 2.1, or (at your option)
9  * any later version.
10  *
11  * TN5250 is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public License
17  * along with this software; see the file COPYING.  If not, write to
18  * the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
19  * Boston, MA 02111-1307 USA
20  *
21  */
22 #include "tn5250-private.h"
23 
24 void
tn5250_terminal_init(Tn5250Terminal * This)25 tn5250_terminal_init (Tn5250Terminal * This)
26 {
27   (*((This)->init)) ((This));
28 }
29 
30 void
tn5250_terminal_term(Tn5250Terminal * This)31 tn5250_terminal_term (Tn5250Terminal * This)
32 {
33   (*((This)->term)) ((This));
34 }
35 
36 void
tn5250_terminal_destroy(Tn5250Terminal * This)37 tn5250_terminal_destroy (Tn5250Terminal * This)
38 {
39   (*((This)->destroy)) ((This));
40 }
41 
42 int
tn5250_terminal_width(Tn5250Terminal * This)43 tn5250_terminal_width (Tn5250Terminal * This)
44 {
45   return (*((This)->width)) ((This));
46 }
47 
48 int
tn5250_terminal_height(Tn5250Terminal * This)49 tn5250_terminal_height (Tn5250Terminal * This)
50 {
51   return (*((This)->height)) ((This));
52 }
53 
54 int
tn5250_terminal_flags(Tn5250Terminal * This)55 tn5250_terminal_flags (Tn5250Terminal * This)
56 {
57   return (*((This)->flags)) ((This));
58 }
59 
60 void
tn5250_terminal_update(Tn5250Terminal * This,Tn5250Display * d)61 tn5250_terminal_update (Tn5250Terminal * This, Tn5250Display * d)
62 {
63   (*((This)->update)) ((This), (d));
64 }
65 
66 void
tn5250_terminal_update_indicators(Tn5250Terminal * This,Tn5250Display * d)67 tn5250_terminal_update_indicators (Tn5250Terminal * This, Tn5250Display * d)
68 {
69   (*((This)->update_indicators)) ((This), (d));
70 }
71 
72 int
tn5250_terminal_waitevent(Tn5250Terminal * This)73 tn5250_terminal_waitevent (Tn5250Terminal * This)
74 {
75   return (*((This)->waitevent)) ((This));
76 }
77 
78 int
tn5250_terminal_getkey(Tn5250Terminal * This)79 tn5250_terminal_getkey (Tn5250Terminal * This)
80 {
81   return (*((This)->getkey)) ((This));
82 }
83 
84 void
tn5250_terminal_putkey(Tn5250Terminal * This,Tn5250Display * d,unsigned char k,int y,int x)85 tn5250_terminal_putkey (Tn5250Terminal * This, Tn5250Display * d,
86 			unsigned char k, int y, int x)
87 {
88   if ((This)->putkey != NULL)
89     {
90       (*((This)->putkey)) ((This), (d), (k), (y), (x));
91     }
92 }
93 
94 void
tn5250_terminal_beep(Tn5250Terminal * This)95 tn5250_terminal_beep (Tn5250Terminal * This)
96 {
97   (*((This)->beep)) ((This));
98 }
99 
100 int
tn5250_terminal_enhanced(Tn5250Terminal * This)101 tn5250_terminal_enhanced (Tn5250Terminal * This)
102 {
103   return (This)->enhanced == NULL ? 0 : (*((This)->enhanced)) ((This));
104 }
105 
106 int
tn5250_terminal_config(Tn5250Terminal * This,Tn5250Config * conf)107 tn5250_terminal_config (Tn5250Terminal * This, Tn5250Config * conf)
108 {
109   return ((This)->config == NULL ? 0 : (*((This)->config)) ((This), (conf)));
110 }
111 
112 void
tn5250_terminal_create_window(Tn5250Terminal * This,Tn5250Display * d,struct _Tn5250Window * w)113 tn5250_terminal_create_window (Tn5250Terminal * This, Tn5250Display * d,
114 			       struct _Tn5250Window * w)
115 {
116   (*((This)->create_window)) ((This), (d), (w));
117 }
118 
119 void
tn5250_terminal_destroy_window(Tn5250Terminal * This,Tn5250Display * d,struct _Tn5250Window * w)120 tn5250_terminal_destroy_window (Tn5250Terminal * This, Tn5250Display * d,
121 				struct _Tn5250Window * w)
122 {
123   (*((This)->destroy_window)) ((This), (d), (w));
124 }
125 
126 void
tn5250_terminal_create_scrollbar(Tn5250Terminal * This,Tn5250Display * d,struct _Tn5250Scrollbar * s)127 tn5250_terminal_create_scrollbar (Tn5250Terminal * This, Tn5250Display * d,
128 				  struct _Tn5250Scrollbar *s)
129 {
130   (*((This)->create_scrollbar)) ((This), (d), (s));
131 }
132 
133 void
tn5250_terminal_destroy_scrollbar(Tn5250Terminal * This,Tn5250Display * d)134 tn5250_terminal_destroy_scrollbar (Tn5250Terminal * This, Tn5250Display * d)
135 {
136   (*((This)->destroy_scrollbar)) ((This), (d));
137 }
138 
139 void
tn5250_terminal_create_menubar(Tn5250Terminal * This,Tn5250Display * d,struct _Tn5250Menubar * m)140 tn5250_terminal_create_menubar (Tn5250Terminal * This, Tn5250Display * d,
141 				struct _Tn5250Menubar *m)
142 {
143   (*((This)->create_menubar)) ((This), (d), (m));
144 }
145 
146 void
tn5250_terminal_destroy_menubar(Tn5250Terminal * This,Tn5250Display * d,struct _Tn5250Menubar * m)147 tn5250_terminal_destroy_menubar (Tn5250Terminal * This, Tn5250Display * d,
148 				 struct _Tn5250Menubar *m)
149 {
150   (*((This)->destroy_menubar)) ((This), (d), (m));
151 }
152 
153 void
tn5250_terminal_create_menuitem(Tn5250Terminal * This,Tn5250Display * d,struct _Tn5250Menuitem * i)154 tn5250_terminal_create_menuitem (Tn5250Terminal * This, Tn5250Display * d,
155 				 struct _Tn5250Menuitem *i)
156 {
157   (*((This)->create_menuitem)) ((This), (d), (i));
158 }
159 
160 void
tn5250_terminal_destroy_menuitem(Tn5250Terminal * This,Tn5250Display * d,struct _Tn5250Menuitem * i)161 tn5250_terminal_destroy_menuitem (Tn5250Terminal * This, Tn5250Display * d,
162 				  struct _Tn5250Menuitem *i)
163 {
164   (*((This)->destroy_menuitem)) ((This), (d), (i));
165 }
166