00001
00002
00003 #ifndef _LIBZVTMM_ZVT_H
00004 #define _LIBZVTMM_ZVT_H
00005
00006 #include <glibmm.h>
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #include <gtkmm/widget.h>
00030 #include <libzvt/libzvt.h>
00031
00032
00033 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00034 typedef struct _ZvtTerm ZvtTerm;
00035 typedef struct _ZvtTermClass ZvtTermClass;
00036 #endif
00037
00038
00039 namespace Gnome
00040 {
00041
00042 namespace Zvt
00043 { class Term_Class; }
00044
00045 }
00046 namespace Gnome
00047 {
00048
00049 namespace Zvt
00050 {
00051
00057 enum EraseBinding
00058 {
00059 ERASE_CONTROL_H,
00060 ERASE_ESCAPE_SEQUENCE,
00061 ERASE_ASCII_DEL
00062 };
00063
00064 }
00065
00066 }
00067
00068
00069 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00070 namespace Glib
00071 {
00072
00073 template <>
00074 class Value<Gnome::Zvt::EraseBinding> : public Glib::Value_Enum<Gnome::Zvt::EraseBinding>
00075 {
00076 public:
00077 static GType value_type() G_GNUC_CONST;
00078 };
00079
00080 }
00081 #endif
00082
00083
00084 namespace Gnome
00085 {
00086
00087 namespace Zvt
00088 {
00089
00090
00098 class Term
00099 : public Gtk::Widget
00100 {
00101 public:
00102 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00103 typedef Term CppObjectType;
00104 typedef Term_Class CppClassType;
00105 typedef ZvtTerm BaseObjectType;
00106 typedef ZvtTermClass BaseClassType;
00107 #endif
00108
00109 virtual ~Term();
00110
00111 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00112
00113 private:
00114 friend class Term_Class;
00115 static CppClassType term_class_;
00116
00117
00118 Term(const Term&);
00119 Term& operator=(const Term&);
00120
00121 protected:
00122 explicit Term(const Glib::ConstructParams& construct_params);
00123 explicit Term(ZvtTerm* castitem);
00124
00125 #endif
00126
00127 public:
00128 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00129 static GType get_type() G_GNUC_CONST;
00130 static GType get_base_type() G_GNUC_CONST;
00131 #endif
00132
00133 ZvtTerm* gobj() { return reinterpret_cast<ZvtTerm*>(gobject_); }
00134 const ZvtTerm* gobj() const { return reinterpret_cast<ZvtTerm*>(gobject_); }
00135
00136
00137 public:
00138
00139
00140 protected:
00141
00142
00143
00144 virtual void on_child_died();
00145 virtual void on_title_changed(VTTITLE_TYPE type, Glib::ustring newTitle);
00146 virtual void on_got_output(Glib::ustring buffer, gint counter);
00147 virtual void on_copy_clipboard();
00148 virtual void on_paste_clipboard();
00149 virtual void on_scroll(gint p0);
00150 virtual void on_selection_changed();
00151
00152
00153 private:
00154
00155
00156 public:
00157 Term();
00158 Term(guint cols, guint rows);
00159
00161
00162
00163
00164
00165 void reset(int hard);
00166
00167
00168
00169 void feed(gchar* text, int len);
00170
00171
00172
00173 int writechild(gchar *data, int len);
00174
00175
00176
00177 int forkpty(int do_uwtmp_log);
00178
00179
00180
00181 int closepty();
00182
00183
00184
00185 int killchild(int signal);
00186
00187
00188
00189 void bell();
00190
00191
00192
00193 void hide_pointer();
00194
00195
00196
00197 void show_pointer();
00198
00199
00200
00201
00202
00203 int match_add(Glib::ustring& regex, uint32 highlight_mask, void *data);
00204
00205
00206
00207 void match_clear(Glib::ustring& regex);
00208
00209
00210
00211
00212 Glib::ustring match_check(int x, int y, void **user_data_ptr);
00213
00214
00215
00216 void set_scrollback(int lines);
00217
00218
00219
00220
00221
00222
00223 Glib::ustring get_buffer(int *len, int type, int sx, int sy, int ex, int ey);
00224
00225
00226
00227 void set_font_name(Glib::ustring& name);
00228
00229
00230
00231
00232
00233 void set_fonts(GdkFont* font, GdkFont* bold_font);
00234
00235
00236
00237
00238 guint32 get_capabilities();
00239
00240
00241
00242
00243
00244
00245
00246
00247
00248
00249
00250 void set_background(Glib::ustring& pixmap_file, int transparent, int flags);
00251
00252
00253
00254
00255
00256
00257
00258
00259
00260
00261 void set_background_with_shading(Glib::ustring& text, int transparent, int flags, guint16 red, guint16 green, guint16 blue, guint16 alpha);
00262
00263
00264
00265
00266 void set_shadow_type(Gtk::ShadowType type);
00267
00268
00269
00270
00271
00272 void set_size(guint width, guint height);
00273
00274
00275
00276 void set_bell(int state);
00277
00278
00279
00280 gboolean get_bell();
00281
00282
00283
00284 void set_blink(int state);
00285
00286
00287
00288 void set_scroll_on_keystroke(int state);
00289
00290
00291
00292 void set_scroll_on_output(int state);
00293
00294
00295
00296
00297
00298
00299 void set_color_scheme(gushort* red, gushort* green, gushort* blue);
00300
00301
00302
00303 void set_default_color_scheme();
00304
00305
00306
00307 void set_del_key_swap(int state);
00308
00309
00310
00311 void set_del_is_del(int state);
00312
00313
00314
00315 void set_wordclass(guchar* klass);
00316
00317
00318
00319 void set_auto_window_hint(int state);
00320
00321
00322
00323 void set_backspace_binding(EraseBinding binding);
00324
00325
00326
00327 void set_delete_binding(EraseBinding binding);
00328
00329
00330
00331
00332 void copy_clibboard();
00333
00334
00335
00336 void paste_clipboard();
00337
00339
00340
00342
00343
00344
00345
00350 Glib::SignalProxy0<void> signal_child_died();
00351
00352
00357 Glib::SignalProxy2<void,VTTITLE_TYPE,Glib::ustring> signal_title_changed();
00358
00359
00364 Glib::SignalProxy2<void,Glib::ustring,gint> signal_got_output();
00365
00366
00371 Glib::SignalProxy0<void> signal_copy_clipboard();
00372
00373
00378 Glib::SignalProxy0<void> signal_paste_clipboard();
00379
00380
00385 Glib::SignalProxy1<void,gint> signal_scroll();
00386
00387
00392 Glib::SignalProxy0<void> signal_selection_changed();
00393
00394
00396
00397
00399
00400 Gtk::Adjustment* get_adjustment();
00401 const Gtk::Adjustment* get_adjustment() const;
00402
00403
00404 };
00405
00406 }
00407
00408 }
00409
00410
00411 namespace Glib
00412 {
00414 Gnome::Zvt::Term* wrap(ZvtTerm* object, bool take_copy = false);
00415 }
00416 #endif
00417