/usr/include/IVGlyph/textview.h is in ivtools-dev 1.2.11a1-11.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 | //
// Simple Text Editor Implementation
//
// Copyright (C) 1993 Ellemtel Telecommunication Systems Labratories
//
// Permission is granted to any individual or institution to use, copy,
// modify, and distribute this software, provided that this complete
// copyright and permission notice is maintained, intact, in all copies
// and supporting documentation.
//
// Ellemtel Telecommunication Systems Labratories make no representation
// of the suitability of this software for any purpose. It is provided
// "as is" without any expressed or implied warranty.
//
// Jan Andersson, Torpa Konsult AB
// janne@torpa.se - 1993-08-29
//
#ifndef textview_h
#define textview_h
#include <InterViews/action.h>
#include <InterViews/input.h>
#include <InterViews/observe.h>
#include <InterViews/selection.h>
class EivTextBuffer;
class Event;
class OpenFileChooser;
class Font;
class Menu;
class PopupWindow;
class Style;
class TE_Editor;
class TE_View;
class Window;
// key mapping information
typedef void (TE_View::*TE_ViewKeyFunc)();
struct TE_ViewKeyInfo {
char key;
TE_ViewKeyFunc func;
};
static const int keymap_size = 256;
struct TE_ViewKeySymInfo {
unsigned long keysym;
TE_ViewKeyFunc func;
};
struct CommandInfo;
class TE_View :public InputHandler, public Observable {
public:
TE_View(Style*, EivTextBuffer*, int rows, int cols, boolean active);
~TE_View();
void load_popup();
void save_popup();
int load(const char* path);
int save_as(const char* path);
int save_current();
void save();
void quit();
// InputHandler
virtual void press(const Event&);
virtual void drag(const Event&);
virtual void release(const Event&);
virtual void keystroke(const Event&);
virtual void double_click(const Event&);
// various edit functions
void up();
void down();
void left();
void right();
void page_up();
void page_down();
void forward_char(const int cont = 1);
void backward_char(const int cont = 1);
void forward_word(const int cont = 1);
void backward_word(const int cont = 1);
void forward_line(const int cont = 1);
void backward_line(const int cont = 1);
void forward_page(const int cont = 1);
void backward_page(const int cont = 1);
void copy();
void cut();
void paste_buffer();
void cut_eol();
void beginning_of_word();
void end_of_word();
void beginning_of_line();
void end_of_line();
void beginning_of_text();
void end_of_text();
void delete_backward();
void delete_forward();
void find_forward(const char* pattern);
void find_backward(const char* pattern);
void find_selection_forward();
void find_selection_backward();
void newline();
// selections
void copy_selection(SelectionManager*);
void own_selection(SelectionManager*);
void convert_selection(SelectionManager*);
void free_selection(SelectionManager*);
// text
void insert_string(const char*, int count);
void insert_char(char c);
// various information about displayed lines
int start_row() { return start_row_; }
int end_row() { return end_row_; }
int first_visible_line();
int displayed_lines();
void line_update();
// number of lines in buffer
int lines();
// scroll to index
void do_scroll(GlyphIndex);
// access text editor
TE_Editor* text_editor() { return text_editor_; }
const char* text();
void text(const char*, boolean update =true);
void disable_caret();
void enable_caret();
protected:
void scroll_to_line(int line);
void make_visible(const boolean scroll_page = true);
int event_to_index(const Event&);
// popup menu stuff
Menu* menu_;
PopupWindow* menu_window_;
Menu* make_menu(Menu*, CommandInfo*);
void popup_menu(const Event&);
// variables to track "tripple-click"
unsigned long click_time_;
unsigned long threshold_;
// modes during a drag operation
enum { DragSelect, DragMenu, DragNone } drag_mode_;
EivTextBuffer* te_buffer_;
TE_Editor* text_editor_;
OpenFileChooser* chooser_;
Window* current_window_;
Style* style_;
char* selection_buffer_;
TE_ViewKeyFunc key_[keymap_size];
int rows_; // rows in view
GlyphIndex start_row_; // 1'st row in view
GlyphIndex end_row_; // last row in view
GlyphIndex lines_; // displayed lines
boolean active_;
};
declareSelectionCallback(TE_View);
declareActionCallback(TE_View);
// popup menu
struct CommandInfo {
const char* str;
ActionMemberFunction(TE_View) func;
CommandInfo* submenu;
};
#endif
|