21 #ifndef Fl_Help_View_H 22 #define Fl_Help_View_H 30 #include "Fl_Scrollbar.H" 39 typedef const char *(Fl_Help_Func)(
Fl_Widget *,
const char *);
86 const size_t MAX_FL_HELP_FS_ELTS = 100;
96 elts_[nfonts_].set(f, s, c);
104 if (nfonts_ < MAX_FL_HELP_FS_ELTS-1) nfonts_ ++;
105 elts_[nfonts_].set(f, s, c);
110 if (nfonts_ > 0) nfonts_ --;
115 size_t count()
const {
return nfonts_;}
196 enum { RIGHT = -1, CENTER, LEFT };
231 static int selection_first;
232 static int selection_last;
233 static int selection_push_first;
234 static int selection_push_last;
235 static int selection_drag_first;
236 static int selection_drag_last;
238 static int draw_mode;
241 static int current_pos;
244 static Fl_Color hv_selection_text_color;
247 void initfont(
Fl_Font &f,
Fl_Fontsize &s,
Fl_Color &c) { f = textfont_; s = textsize_; c = textcolor_; fstack_.init(f, s, c); }
252 Fl_Help_Block *add_block(
const char *s,
int xx,
int yy,
int ww,
int hh,
uchar border = 0);
253 void add_link(
const char *n,
int xx,
int yy,
int ww,
int hh);
254 void add_target(
const char *n,
int yy);
256 int do_align(
Fl_Help_Block *block,
int line,
int xx,
int a,
int &l);
261 void format_table(
int *table_width,
int *columns,
const char *table);
263 int get_align(
const char *p,
int a);
264 const char *get_attr(
const char *p,
const char *n,
char *buf,
int bufsize);
267 int get_length(
const char *l);
272 void hv_draw(
const char *t,
int x,
int y,
int entity_extra_length = 0);
273 char begin_selection();
274 char extend_selection();
275 void end_selection(
int c=0);
276 void clear_global_selection();
282 Fl_Help_View(
int xx,
int yy,
int ww,
int hh,
const char *l = 0);
285 const char *
directory()
const {
if (directory_[0])
return (directory_);
286 else return ((
const char *)0); }
288 const char *
filename()
const {
if (filename_[0])
return (filename_);
289 else return ((
const char *)0); }
290 int find(
const char *s,
int p = 0);
313 void link(Fl_Help_Func *fn) { link_ = fn; }
314 int load(
const char *f);
315 void resize(
int,
int,
int,
int);
317 int size()
const {
return (size_); }
332 const char *
title() {
return (title_); }
333 void topline(
const char *n);
340 void value(
const char *val);
342 const char *
value()
const {
return (value_); }
343 void clear_selection();
355 return(scrollbar_size_);
377 scrollbar_size_ = newSize;
381 #endif // !Fl_Help_View_H
int size() const
Gets the size of the help view.
Definition: Fl_Help_View.H:317
Fl_Fontsize textsize() const
Gets the default text size.
Definition: Fl_Help_View.H:330
Fl_Font textfont() const
Returns the current default text font.
Definition: Fl_Help_View.H:326
void scrollbar_size(int newSize)
Sets the pixel size of the scrollbars' troughs to newSize, in pixels.
Definition: Fl_Help_View.H:376
size_t count() const
Gets the current count of font style elements in the stack.
Definition: Fl_Help_View.H:115
int scrollbar_size() const
Gets the current size of the scrollbars' troughs, in pixels.
Definition: Fl_Help_View.H:354
File names and URI utility functions.
void textsize(Fl_Fontsize s)
Sets the default text size.
Definition: Fl_Help_View.H:328
void textfont(Fl_Font f)
Sets the default text font.
Definition: Fl_Help_View.H:324
void fl_color(Fl_Color c)
Sets the color for all subsequent drawing operations.
Definition: fl_draw.H:49
int topline() const
Returns the current top line in pixels.
Definition: Fl_Help_View.H:336
void link(Fl_Help_Func *fn)
This method assigns a callback function to use when a link is followed or a file is loaded (via Fl_He...
Definition: Fl_Help_View.H:313
FL_EXPORT void fl_font(Fl_Font face, Fl_Fontsize fsize)
Sets the current font, which is then used in various drawing routines.
Definition: fl_draw.cxx:431
Fl_Help_Font_Stack()
font stack construction, initialize attributes.
Definition: Fl_Help_View.H:90
Fl_Color textcolor() const
Returns the current default text color.
Definition: Fl_Help_View.H:322
The Fl_Help_View widget displays HTML text.
Definition: Fl_Help_View.H:194
const char * title()
Returns the current document title, or NULL if there is no title.
Definition: Fl_Help_View.H:332
void textcolor(Fl_Color c)
Sets the default text color.
Definition: Fl_Help_View.H:320
Definition: Fl_Help_View.H:88
Definition of a link for the html viewer.
Definition: Fl_Help_View.H:61
Fl_Font f
Font.
Definition: Fl_Help_View.H:76
const char * value() const
Returns the current buffer contents.
Definition: Fl_Help_View.H:342
const char * directory() const
Returns the current directory for the text in the buffer.
Definition: Fl_Help_View.H:285
The Fl_Group class is the FLTK container widget.
Definition: Fl_Group.H:42
size_t nfonts_
current number of fonts in stack
Definition: Fl_Help_View.H:118
Fl_Color c
Font Color.
Definition: Fl_Help_View.H:78
Fl_Help_View font stack element definition.
Definition: Fl_Help_View.H:75
Fl_Help_Target structure.
Definition: Fl_Help_View.H:124
int y
Y offset of target.
Definition: Fl_Help_View.H:126
int y
Y offset of link text.
Definition: Fl_Help_View.H:64
#define FL_PATH_MAX
all path buffers should use this length
Definition: filename.H:31
int Fl_Fontsize
Size of a font in pixels.
Definition: Enumerations.H:1014
void push(Fl_Font f, Fl_Fontsize s, Fl_Color c)
Pushes the font style triplet on the stack, also calls fl_font() & fl_color() adequately.
Definition: Fl_Help_View.H:103
void pop(Fl_Font &f, Fl_Fontsize &s, Fl_Color &c)
Pops from the stack the font style triplet and calls fl_font() & fl_color() adequately.
Definition: Fl_Help_View.H:109
Fl_Fontsize s
Font Size.
Definition: Fl_Help_View.H:77
utility header to pull drawing functions together
unsigned int Fl_Color
An FLTK color value; see also Colors.
Definition: Enumerations.H:1042
int Fl_Font
A font number is an index into the internal font table.
Definition: Enumerations.H:985
This class supports caching, loading, and drawing of image files.
Definition: Fl_Shared_Image.H:49
Definition: Fl_Help_View.H:45
const char * filename() const
Returns the current filename for the text in the buffer.
Definition: Fl_Help_View.H:288
int leftline() const
Gets the left position in pixels.
Definition: Fl_Help_View.H:339
unsigned char uchar
unsigned char
Definition: fl_types.h:28
void top(Fl_Font &f, Fl_Fontsize &s, Fl_Color &c)
Gets the top (current) element on the stack.
Definition: Fl_Help_View.H:101