Removed several warnings in librunview.
This commit is contained in:
parent
92f2ee4547
commit
37f1324431
|
@ -16,7 +16,7 @@ public:
|
||||||
}
|
}
|
||||||
virtual ~NormalTextRender() {};
|
virtual ~NormalTextRender() {};
|
||||||
|
|
||||||
virtual void Render(BView* target, const char* txt, int16 num, BPoint pos) {
|
virtual void Render(BView* target, const char* txt, int num, BPoint pos) {
|
||||||
|
|
||||||
target->SetFont(&font);
|
target->SetFont(&font);
|
||||||
target->DrawString(txt, num, pos);
|
target->DrawString(txt, num, pos);
|
||||||
|
|
|
@ -74,7 +74,7 @@ static unsigned char URLCursorData[] = {16, 1, 2, 2,
|
||||||
};
|
};
|
||||||
|
|
||||||
struct SoftBreak {
|
struct SoftBreak {
|
||||||
int16 fOffset;
|
int fOffset;
|
||||||
float fHeight;
|
float fHeight;
|
||||||
float fAscent;
|
float fAscent;
|
||||||
};
|
};
|
||||||
|
@ -94,7 +94,7 @@ struct URL {
|
||||||
typedef BObjectList<URL> urllist;
|
typedef BObjectList<URL> urllist;
|
||||||
|
|
||||||
struct SoftBreakEnd {
|
struct SoftBreakEnd {
|
||||||
int16 fOffset;
|
int fOffset;
|
||||||
|
|
||||||
SoftBreakEnd (int16 offset)
|
SoftBreakEnd (int16 offset)
|
||||||
: fOffset (offset)
|
: fOffset (offset)
|
||||||
|
@ -102,7 +102,7 @@ struct SoftBreakEnd {
|
||||||
};
|
};
|
||||||
|
|
||||||
struct FontColor {
|
struct FontColor {
|
||||||
int16 fOffset;
|
int fOffset;
|
||||||
// G++ is stupid. We only need 2 bits
|
// G++ is stupid. We only need 2 bits
|
||||||
// for fWhich, but the compiler has a bug
|
// for fWhich, but the compiler has a bug
|
||||||
// and warns us against fWhich == 2
|
// and warns us against fWhich == 2
|
||||||
|
@ -121,42 +121,42 @@ struct Line {
|
||||||
float fTop;
|
float fTop;
|
||||||
float fBottom;
|
float fBottom;
|
||||||
|
|
||||||
int16 fLength;
|
int fLength;
|
||||||
int16 fSpace_count;
|
int fSpace_count;
|
||||||
int16 fEdge_count;
|
int fEdge_count;
|
||||||
int16 fFc_count;
|
int fFc_count;
|
||||||
int16 fSoftie_size;
|
int fSoftie_size;
|
||||||
int16 fSoftie_used;
|
int fSoftie_used;
|
||||||
|
|
||||||
Line (
|
Line (
|
||||||
const char* buffer,
|
const char* buffer,
|
||||||
int16 fLength,
|
int fLength,
|
||||||
float top,
|
float top,
|
||||||
float width,
|
float width,
|
||||||
Theme* fTheme,
|
Theme* fTheme,
|
||||||
const char* fStamp_format,
|
const char* fStamp_format,
|
||||||
int16 fore,
|
int fore,
|
||||||
int16 back,
|
int back,
|
||||||
int16 font);
|
int font);
|
||||||
|
|
||||||
~Line (void);
|
~Line (void);
|
||||||
|
|
||||||
void Append (
|
void Append (
|
||||||
const char* buffer,
|
const char* buffer,
|
||||||
int16 len,
|
int len,
|
||||||
float width,
|
float width,
|
||||||
Theme* fTheme,
|
Theme* fTheme,
|
||||||
int16 fore,
|
int fore,
|
||||||
int16 back,
|
int back,
|
||||||
int16 font);
|
int font);
|
||||||
|
|
||||||
void FigureSpaces (void);
|
void FigureSpaces (void);
|
||||||
|
|
||||||
void FigureFontColors (
|
void FigureFontColors (
|
||||||
int16 pos,
|
int pos,
|
||||||
int16 fore,
|
int fore,
|
||||||
int16 back,
|
int back,
|
||||||
int16 font);
|
int font);
|
||||||
|
|
||||||
void FigureEdges (
|
void FigureEdges (
|
||||||
Theme* fTheme,
|
Theme* fTheme,
|
||||||
|
@ -172,7 +172,7 @@ struct Line {
|
||||||
int16 CountChars (int16 pos, int16 len);
|
int16 CountChars (int16 pos, int16 len);
|
||||||
size_t SetStamp (const char*, bool);
|
size_t SetStamp (const char*, bool);
|
||||||
|
|
||||||
void SelectWord (int16*, int16*);
|
void SelectWord (int*, int*);
|
||||||
};
|
};
|
||||||
|
|
||||||
inline int32
|
inline int32
|
||||||
|
@ -343,7 +343,7 @@ RunView::Draw (BRect frame)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
float indent (fTheme->TextMargin());
|
float indent (fTheme->TextMargin());
|
||||||
int16 place (0);
|
int place (0);
|
||||||
|
|
||||||
int16 fore (0);
|
int16 fore (0);
|
||||||
int16 back (0);
|
int16 back (0);
|
||||||
|
@ -351,7 +351,7 @@ RunView::Draw (BRect frame)
|
||||||
|
|
||||||
height = line->fTop;
|
height = line->fTop;
|
||||||
|
|
||||||
for (int16 sit = 0; sit < line->fSoftie_used; /*++sit*/sit++) {
|
for (int sit = 0; sit < line->fSoftie_used; /*++sit*/sit++) {
|
||||||
int last_len (UTF8_CHAR_LEN (line->fText[line->fSofties[sit].fOffset]));
|
int last_len (UTF8_CHAR_LEN (line->fText[line->fSofties[sit].fOffset]));
|
||||||
float left (indent);
|
float left (indent);
|
||||||
float start (0.0);
|
float start (0.0);
|
||||||
|
@ -364,7 +364,7 @@ RunView::Draw (BRect frame)
|
||||||
FillRect (r, B_SOLID_LOW);
|
FillRect (r, B_SOLID_LOW);
|
||||||
|
|
||||||
if (sit) {
|
if (sit) {
|
||||||
int16 j (place);
|
int j (place);
|
||||||
|
|
||||||
while (--j >= 0)
|
while (--j >= 0)
|
||||||
if ((start = line->fEdges[j]) != 0)
|
if ((start = line->fEdges[j]) != 0)
|
||||||
|
@ -476,7 +476,7 @@ RunView::Draw (BRect frame)
|
||||||
left,
|
left,
|
||||||
height,
|
height,
|
||||||
line->fEdges[k] + indent - start,
|
line->fEdges[k] + indent - start,
|
||||||
height + line->fSofties[sit].fHeight - 1.0);
|
height + line->fSofties[sit].fHeight - 1);
|
||||||
|
|
||||||
SetDrawingMode (B_OP_COPY);
|
SetDrawingMode (B_OP_COPY);
|
||||||
if (drawSelection)
|
if (drawSelection)
|
||||||
|
@ -513,10 +513,10 @@ RunView::Draw (BRect frame)
|
||||||
SetLowColor (view_color);
|
SetLowColor (view_color);
|
||||||
FillRect (
|
FillRect (
|
||||||
BRect (
|
BRect (
|
||||||
left + 1.0,
|
left + 1,
|
||||||
height,
|
height,
|
||||||
bounds.right,
|
bounds.right,
|
||||||
height + line->fSofties[sit].fHeight - 1.0),
|
height + line->fSofties[sit].fHeight - 1),
|
||||||
B_SOLID_LOW);
|
B_SOLID_LOW);
|
||||||
|
|
||||||
height += line->fSofties[sit].fHeight;
|
height += line->fSofties[sit].fHeight;
|
||||||
|
@ -849,8 +849,8 @@ RunView::MouseMoved (BPoint point, uint32 transit, const BMessage* msg)
|
||||||
if (!end_found)
|
if (!end_found)
|
||||||
for (int16 sit = 1; sit < line->fSoftie_used; ++sit) {
|
for (int16 sit = 1; sit < line->fSoftie_used; ++sit) {
|
||||||
if (!start_found && fSp_start.fOffset < line->fSofties[sit].fOffset) {
|
if (!start_found && fSp_start.fOffset < line->fSofties[sit].fOffset) {
|
||||||
left = line->fEdges[fSp_start.fOffset] -
|
left = (float)(line->fEdges[fSp_start.fOffset] -
|
||||||
line->fEdges[line->fSofties[sit-1].fOffset];
|
line->fEdges[line->fSofties[sit-1].fOffset]);
|
||||||
|
|
||||||
top += (sit) * line->fSofties[sit].fHeight;
|
top += (sit) * line->fSofties[sit].fHeight;
|
||||||
top_softie = sit;
|
top_softie = sit;
|
||||||
|
@ -1265,9 +1265,9 @@ RunView::RecalcScrollBar (bool constrain)
|
||||||
void
|
void
|
||||||
RunView::Append (
|
RunView::Append (
|
||||||
const char* buffer,
|
const char* buffer,
|
||||||
int16 fore,
|
int fore,
|
||||||
int16 back,
|
int back,
|
||||||
int16 font)
|
int font)
|
||||||
{
|
{
|
||||||
Append (buffer, strlen (buffer), fore, back, font);
|
Append (buffer, strlen (buffer), fore, back, font);
|
||||||
}
|
}
|
||||||
|
@ -1276,9 +1276,9 @@ void
|
||||||
RunView::Append (
|
RunView::Append (
|
||||||
const char* buffer,
|
const char* buffer,
|
||||||
int32 len,
|
int32 len,
|
||||||
int16 fore,
|
int fore,
|
||||||
int16 back,
|
int back,
|
||||||
int16 font)
|
int font)
|
||||||
{
|
{
|
||||||
if (buffer == NULL)
|
if (buffer == NULL)
|
||||||
return;
|
return;
|
||||||
|
@ -1739,14 +1739,14 @@ RunView::SetClippingName (const char* name)
|
||||||
|
|
||||||
Line::Line (
|
Line::Line (
|
||||||
const char* buffer,
|
const char* buffer,
|
||||||
int16 len,
|
int len,
|
||||||
float top,
|
float top,
|
||||||
float width,
|
float width,
|
||||||
Theme* theme,
|
Theme* theme,
|
||||||
const char* stamp_format,
|
const char* stamp_format,
|
||||||
int16 fore,
|
int fore,
|
||||||
int16 back,
|
int back,
|
||||||
int16 font)
|
int font)
|
||||||
: fText (NULL),
|
: fText (NULL),
|
||||||
fStamp (time(NULL)),
|
fStamp (time(NULL)),
|
||||||
fUrls (NULL),
|
fUrls (NULL),
|
||||||
|
@ -1787,12 +1787,12 @@ Line::~Line (void)
|
||||||
void
|
void
|
||||||
Line::Append (
|
Line::Append (
|
||||||
const char* buffer,
|
const char* buffer,
|
||||||
int16 len,
|
int len,
|
||||||
float width,
|
float width,
|
||||||
Theme* theme,
|
Theme* theme,
|
||||||
int16 fore,
|
int fore,
|
||||||
int16 back,
|
int back,
|
||||||
int16 font)
|
int font)
|
||||||
{
|
{
|
||||||
int16 save (fLength);
|
int16 save (fLength);
|
||||||
char* new_fText;
|
char* new_fText;
|
||||||
|
@ -1859,10 +1859,10 @@ Line::FigureSpaces (void)
|
||||||
|
|
||||||
void
|
void
|
||||||
Line::FigureFontColors (
|
Line::FigureFontColors (
|
||||||
int16 pos,
|
int pos,
|
||||||
int16 fore,
|
int fore,
|
||||||
int16 back,
|
int back,
|
||||||
int16 font)
|
int font)
|
||||||
{
|
{
|
||||||
if (fFc_count) {
|
if (fFc_count) {
|
||||||
int16 last_fore = -1;
|
int16 last_fore = -1;
|
||||||
|
@ -2335,7 +2335,7 @@ Line::SetStamp (const char* format, bool was_on)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Line::SelectWord (int16* start, int16* end)
|
Line::SelectWord (int* start, int* end)
|
||||||
{
|
{
|
||||||
int16 start_tmp (*start), end_tmp (*end);
|
int16 start_tmp (*start), end_tmp (*end);
|
||||||
|
|
||||||
|
|
|
@ -52,12 +52,12 @@ class SelectPos
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
int16 fLine;
|
int fLine;
|
||||||
int16 fOffset;
|
int fOffset;
|
||||||
|
|
||||||
SelectPos (
|
SelectPos (
|
||||||
int16 selLine = 0,
|
int selLine = 0,
|
||||||
int16 selOffset = 0)
|
int selOffset = 0)
|
||||||
: fLine (selLine),
|
: fLine (selLine),
|
||||||
fOffset (selOffset)
|
fOffset (selOffset)
|
||||||
{ }
|
{ }
|
||||||
|
@ -157,8 +157,8 @@ public:
|
||||||
virtual void MouseUp (BPoint);
|
virtual void MouseUp (BPoint);
|
||||||
|
|
||||||
|
|
||||||
void Append (const char*, int32, int16, int16, int16);
|
void Append (const char*, int32, int, int, int);
|
||||||
void Append (const char*, int16, int16, int16);
|
void Append (const char*, int, int, int);
|
||||||
|
|
||||||
void Clear (void);
|
void Clear (void);
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ public:
|
||||||
|
|
||||||
virtual ~SmileTextRender() {};
|
virtual ~SmileTextRender() {};
|
||||||
|
|
||||||
virtual void Render(BView* target, const char* txt, int16 num, BPoint pos) {
|
virtual void Render(BView* target, const char* txt, int num, BPoint pos) {
|
||||||
|
|
||||||
BBitmap* pointer = NULL;
|
BBitmap* pointer = NULL;
|
||||||
BString f(txt, num);
|
BString f(txt, num);
|
||||||
|
|
|
@ -9,7 +9,7 @@ public:
|
||||||
TextRender() {};
|
TextRender() {};
|
||||||
virtual ~TextRender() {};
|
virtual ~TextRender() {};
|
||||||
|
|
||||||
virtual void Render(BView* target, const char*, int16 num, BPoint pos) = 0;
|
virtual void Render(BView* target, const char*, int num, BPoint pos) = 0;
|
||||||
virtual void GetHeight(font_height* height) = 0;
|
virtual void GetHeight(font_height* height) = 0;
|
||||||
virtual void GetEscapements(const char charArray[], int32 numChars, float escapementArray[]) = 0;
|
virtual void GetEscapements(const char charArray[], int32 numChars, float escapementArray[]) = 0;
|
||||||
virtual float Size() = 0;
|
virtual float Size() = 0;
|
||||||
|
|
Ŝarĝante…
Reference in New Issue