source: vendor/emx/current/src/pmgdb/pmtty.h

Last change on this file was 18, checked in by bird, 22 years ago

Initial revision

  • Property cvs2svn:cvs-rev set to 1.1
  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 2.6 KB
Line 
1/* pmtty.h -*- C++ -*-
2 Copyright (c) 1996 Eberhard Mattes
3
4This file is part of pmgdb.
5
6pmgdb is free software; you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by
8the Free Software Foundation; either version 2, or (at your option)
9any later version.
10
11pmgdb is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with pmgdb; see the file COPYING. If not, write to
18the Free Software Foundation, 59 Temple Place - Suite 330,
19Boston, MA 02111-1307, USA. */
20
21
22// A frame window showing scrollable text; with tty-like output and cursor
23
24class pmtty : public pmtxt
25{
26public:
27 typedef pmtxt parent;
28
29 // Constructors and destructors, initialization
30 pmtty (pmapp *app, unsigned id, ULONG frame_flags, const SWP *pswp,
31 const char *fontnamesize = 0);
32 ~pmtty ();
33 void delete_all ();
34
35 // Painting
36 void puts (const char *s, size_t len);
37 void puts (const char *s) { puts (s, strlen (s)); }
38 void backspace (int n = 1);
39 void cursor (bool on);
40
41 // Attributes
42 void set_fg_color (COLOR color) { pmtxt::set_fg_color (sel_attr, color); }
43 void set_fg_color () { pmtxt::set_fg_color (sel_attr); }
44
45 void set_bg_color (COLOR color) { pmtxt::set_bg_color (sel_attr, color); }
46 void set_bg_color () { pmtxt::set_bg_color (sel_attr); }
47
48 const struct pmtxt_attr &get_attr () const {return sel_attr;}
49 void set_attr (const struct pmtxt_attr &a) {sel_attr = a;}
50 void set_attr () {sel_attr = get_default_attr ();}
51
52 void set_line_width (int width);
53 int get_line () const { return y; }
54 int get_column () const { return x; }
55 bool get_xy (POINTL *ptl);
56
57private:
58 int x, y;
59 bool cursor_enabled; // True iff cursor enabled with cursor()
60 bool cursor_painted; // True iff cursor painted
61 int cursor_hidden; // Positive iff cursor temporarily hidden
62 pmtxt_attr sel_attr;
63 int line_width;
64 int cursor_width;
65 HPS hpsCursor;
66 RECTL rclCursor;
67
68 // Override member functions of pmframe
69 MRESULT wm_setfocus (HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
70 MRESULT wm_timer (HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
71 MRESULT wm_presparamchanged (HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
72
73 // Override member functions of pmtxt
74 void painting (bool start);
75 void font_changed ();
76
77 void create_hpsCursor ();
78 void cursor_on ();
79 void cursor_off ();
80 void paint_cursor ();
81 void remove_cursor ();
82 void puts1 (const char *s, size_t len);
83};
Note: See TracBrowser for help on using the repository browser.