*** empty log message ***
git-svn-id: svn://10.65.10.50/trunk@19 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
3f5ce20380
commit
a0136bf864
@ -20,15 +20,13 @@ class _HotSpot:public TObject
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
void TTextfile ::
|
void TTextfile::set_hotspots (char fg, char bg)
|
||||||
set_hotspots (char fg, char bg)
|
|
||||||
{
|
{
|
||||||
_HotSpot *hp = new _HotSpot (fg, bg);
|
_HotSpot *hp = new _HotSpot (fg, bg);
|
||||||
_hotspots.add (hp);
|
_hotspots.add (hp);
|
||||||
}
|
}
|
||||||
|
|
||||||
style TTextfile ::
|
style TTextfile::_trans_style (char ch)
|
||||||
_trans_style (char ch)
|
|
||||||
{
|
{
|
||||||
switch (ch)
|
switch (ch)
|
||||||
{
|
{
|
||||||
@ -56,8 +54,7 @@ _trans_style (char ch)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TTextfile ::
|
void TTextfile::_read_page (long n)
|
||||||
_read_page (long n)
|
|
||||||
{
|
{
|
||||||
switch (_direction)
|
switch (_direction)
|
||||||
{
|
{
|
||||||
@ -125,8 +122,7 @@ _read_page (long n)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TTextfile ::
|
void TTextfile::read_line (long n, long pos, bool pg)
|
||||||
read_line (long n, long pos, bool pg)
|
|
||||||
{
|
{
|
||||||
CHECK (_isopen, "Attempt operation on closed file");
|
CHECK (_isopen, "Attempt operation on closed file");
|
||||||
CHECKD (n >= 0 && n < _lines, "Line not present", n);
|
CHECKD (n >= 0 && n < _lines, "Line not present", n);
|
||||||
@ -201,8 +197,7 @@ read_line (long n, long pos, bool pg)
|
|||||||
_item = 0;
|
_item = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *TTextfile ::
|
const char *TTextfile::line (long j, long pos)
|
||||||
line (long j, long pos)
|
|
||||||
{
|
{
|
||||||
if (_cur_line != j)
|
if (_cur_line != j)
|
||||||
read_line (j);
|
read_line (j);
|
||||||
@ -213,8 +208,7 @@ line (long j, long pos)
|
|||||||
return strlen (mytmpstr) > (word) pos ? &(mytmpstr[pos]) : "";
|
return strlen (mytmpstr) > (word) pos ? &(mytmpstr[pos]) : "";
|
||||||
}
|
}
|
||||||
|
|
||||||
long TTextfile ::
|
long TTextfile::get_attribute (int pos)
|
||||||
get_attribute (int pos)
|
|
||||||
{
|
{
|
||||||
long stl = 0;
|
long stl = 0;
|
||||||
if (pos == -1)
|
if (pos == -1)
|
||||||
@ -238,37 +232,32 @@ get_attribute (int pos)
|
|||||||
return stl;
|
return stl;
|
||||||
}
|
}
|
||||||
|
|
||||||
int TTextfile ::
|
int TTextfile::get_style (int pos)
|
||||||
get_style (int pos)
|
|
||||||
{
|
{
|
||||||
long x = get_attribute (pos);
|
long x = get_attribute (pos);
|
||||||
return (int) (x & 0x0000ffff);
|
return (int) (x & 0x0000ffff);
|
||||||
}
|
}
|
||||||
|
|
||||||
char TTextfile ::
|
char TTextfile::get_background (int pos)
|
||||||
get_background (int pos)
|
|
||||||
{
|
{
|
||||||
long x = get_attribute (pos);
|
long x = get_attribute (pos);
|
||||||
return (char) (x >> 24);
|
return (char) (x >> 24);
|
||||||
}
|
}
|
||||||
|
|
||||||
char TTextfile ::
|
char TTextfile::get_foreground (int pos)
|
||||||
get_foreground (int pos)
|
|
||||||
{
|
{
|
||||||
long x = get_attribute (pos);
|
long x = get_attribute (pos);
|
||||||
return (char) ((x >> 16) & 0x000000ff);
|
return (char) ((x >> 16) & 0x000000ff);
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *TTextfile ::
|
const char *TTextfile::piece ()
|
||||||
piece ()
|
|
||||||
{
|
{
|
||||||
if (_item >= _line.items ())
|
if (_item >= _line.items ())
|
||||||
return NULL;
|
return NULL;
|
||||||
return strcpy (mytmpstr, (const char *) _line.get (_item++));
|
return strcpy (mytmpstr, (const char *) _line.get (_item++));
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *TTextfile ::
|
const char *TTextfile::word_at (long x, long y)
|
||||||
word_at (long x, long y)
|
|
||||||
{
|
{
|
||||||
CHECK (_isopen, "Attempt operation on closed file");
|
CHECK (_isopen, "Attempt operation on closed file");
|
||||||
TString s (line (y));
|
TString s (line (y));
|
||||||
@ -295,8 +284,7 @@ word_at (long x, long y)
|
|||||||
return mytmpstr;
|
return mytmpstr;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TTextfile ::
|
bool TTextfile::append (const char *l)
|
||||||
append (const char *l)
|
|
||||||
{
|
{
|
||||||
CHECK (_isopen, "Attempt operation on closed file");
|
CHECK (_isopen, "Attempt operation on closed file");
|
||||||
|
|
||||||
@ -354,8 +342,7 @@ append (const char *l)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TTextfile ::
|
void TTextfile::close ()
|
||||||
close ()
|
|
||||||
{
|
{
|
||||||
CHECK (_isopen, "Attempt operation on closed file");
|
CHECK (_isopen, "Attempt operation on closed file");
|
||||||
fclose (_instr);
|
fclose (_instr);
|
||||||
@ -364,8 +351,7 @@ close ()
|
|||||||
_isopen = FALSE;
|
_isopen = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TTextfile ::
|
void TTextfile::print ()
|
||||||
print ()
|
|
||||||
{
|
{
|
||||||
CHECK (_isopen, "Attempt operation on closed file");
|
CHECK (_isopen, "Attempt operation on closed file");
|
||||||
warning_box ("Funzione non ancora implementata");
|
warning_box ("Funzione non ancora implementata");
|
||||||
@ -374,8 +360,7 @@ print ()
|
|||||||
// print
|
// print
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TTextfile ::
|
bool TTextfile::write (const char *path, TPoint * from, TPoint * to)
|
||||||
write (const char *path, TPoint * from, TPoint * to)
|
|
||||||
{
|
{
|
||||||
bool ok = FALSE;
|
bool ok = FALSE;
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
@ -409,8 +394,7 @@ write (const char *path, TPoint * from, TPoint * to)
|
|||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TTextfile ::
|
void TTextfile::destroy ()
|
||||||
destroy ()
|
|
||||||
{
|
{
|
||||||
CHECK (_istemp, "destroy() chiamata su testo permanente!");
|
CHECK (_istemp, "destroy() chiamata su testo permanente!");
|
||||||
if (_page.items () > 0)
|
if (_page.items () > 0)
|
||||||
@ -442,8 +426,7 @@ TTextfile ::TTextfile (const char *file, int pagesize, direction preferred):
|
|||||||
_page_size (pagesize), _page (pagesize), _filename (file), _lines (0l),
|
_page_size (pagesize), _page (pagesize), _filename (file), _lines (0l),
|
||||||
_index (NULL), _page_start (0l), _page_end (-1l), _direction (preferred),
|
_index (NULL), _page_start (0l), _page_end (-1l), _direction (preferred),
|
||||||
_dirty (FALSE), _istemp (FALSE), _item (0), _line (256), _cur_line (-1),
|
_dirty (FALSE), _istemp (FALSE), _item (0), _line (256), _cur_line (-1),
|
||||||
_hotspots (4),
|
_hotspots (4), _accept (TRUE)
|
||||||
_accept (TRUE)
|
|
||||||
{
|
{
|
||||||
// open file & build index
|
// open file & build index
|
||||||
if (file == NULL)
|
if (file == NULL)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user