2010-07-10 08:58:15 -05:00
|
|
|
/*
|
|
|
|
* The contents of this file are subject to the Mozilla Public
|
|
|
|
* License Version 1.1 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.mozilla.org/MPL/
|
|
|
|
*
|
|
|
|
* Software distributed under the License is distributed on an "AS
|
|
|
|
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
|
|
|
* implied. See the License for the specific language governing
|
|
|
|
* rights and limitations under the License.
|
|
|
|
*
|
|
|
|
* The Original Code is Vision.
|
|
|
|
*
|
2010-05-07 04:47:10 -05:00
|
|
|
* The Initial Developer of the Original Code is The Vision Team.
|
|
|
|
* Portions created by The Vision Team are
|
|
|
|
* Copyright (C) 1999, 2000, 2001 The Vision Team. All Rights
|
|
|
|
* Reserved.
|
2010-07-10 08:58:15 -05:00
|
|
|
*
|
2010-05-07 04:47:10 -05:00
|
|
|
* Contributor(s): Rene Gollent
|
|
|
|
* Todd Lair
|
|
|
|
*/
|
2010-07-10 08:58:15 -05:00
|
|
|
|
2010-05-07 04:47:10 -05:00
|
|
|
#ifndef THEME_H_
|
|
|
|
#define THEME_H_
|
|
|
|
|
|
|
|
#include <OS.h>
|
|
|
|
#include <GraphicsDefs.h>
|
|
|
|
#include <List.h>
|
|
|
|
|
2021-06-30 11:12:57 -05:00
|
|
|
#include <librunview/TextRender.h>
|
2010-05-07 04:47:10 -05:00
|
|
|
|
|
|
|
class BView;
|
|
|
|
class NormalTextRender;
|
|
|
|
|
|
|
|
#define MARGIN_WIDTH 10.0 //default value, double of fTextMargin
|
|
|
|
#define MARGIN_INDENT 10.0 //default value, double of fSoftLineIndent
|
|
|
|
|
|
|
|
class Theme
|
|
|
|
{
|
2010-07-10 08:58:15 -05:00
|
|
|
char* name;
|
|
|
|
rgb_color* fores;
|
|
|
|
rgb_color* backs;
|
|
|
|
TextRender** text_renders; //FIX!!
|
|
|
|
|
2012-10-18 15:59:15 -05:00
|
|
|
int fore_count;
|
|
|
|
int back_count;
|
|
|
|
int render_count;
|
2010-05-07 04:47:10 -05:00
|
|
|
|
|
|
|
BList list;
|
|
|
|
sem_id sid;
|
2010-07-10 08:58:15 -05:00
|
|
|
|
2010-05-07 04:47:10 -05:00
|
|
|
float fSoftLineIndent;
|
|
|
|
float fTextMargin;
|
|
|
|
NormalTextRender* normal_textrender;
|
|
|
|
|
2010-07-10 08:58:15 -05:00
|
|
|
public:
|
2010-05-07 04:47:10 -05:00
|
|
|
|
2012-10-18 15:59:15 -05:00
|
|
|
static int TimestampFore;
|
|
|
|
static int TimestampBack;
|
|
|
|
static int TimestampFont;
|
|
|
|
static int TimespaceFore;
|
|
|
|
static int TimespaceBack;
|
|
|
|
static int TimespaceFont;
|
|
|
|
static int NormalFore;
|
|
|
|
static int NormalBack;
|
|
|
|
static int NormalFont;
|
|
|
|
static int SelectionBack;
|
|
|
|
|
|
|
|
Theme(const char*, int, int, int);
|
2010-05-07 04:47:10 -05:00
|
|
|
virtual ~Theme (void);
|
|
|
|
|
2010-07-10 08:58:15 -05:00
|
|
|
const char* Name (void) const {
|
|
|
|
return name;
|
|
|
|
}
|
2010-05-07 04:47:10 -05:00
|
|
|
|
|
|
|
void ReadLock (void);
|
|
|
|
void ReadUnlock (void);
|
|
|
|
void WriteLock (void);
|
|
|
|
void WriteUnlock (void);
|
|
|
|
|
2012-10-18 15:59:15 -05:00
|
|
|
int CountForegrounds (void) const;
|
|
|
|
int CountBackgrounds (void) const;
|
2010-07-10 08:58:15 -05:00
|
|
|
// int16 CountFonts (void) const;
|
2012-10-18 15:59:15 -05:00
|
|
|
int CountTextRenders (void) const;
|
2010-07-10 08:58:15 -05:00
|
|
|
|
2012-10-18 15:59:15 -05:00
|
|
|
const rgb_color ForegroundAt (int) const;
|
|
|
|
const rgb_color BackgroundAt (int) const;
|
2010-07-10 08:58:15 -05:00
|
|
|
|
2010-05-07 04:47:10 -05:00
|
|
|
//const BFont &FontAt (int16) const;
|
|
|
|
|
2012-10-18 15:59:15 -05:00
|
|
|
TextRender* TextRenderAt(int);
|
2010-05-07 04:47:10 -05:00
|
|
|
|
2012-10-18 15:59:15 -05:00
|
|
|
bool SetForeground (int, const rgb_color);
|
|
|
|
bool SetForeground (int w, uchar r, uchar g, uchar b, uchar a = 255) {
|
2010-07-10 08:58:15 -05:00
|
|
|
rgb_color color = {r, g, b, a};
|
|
|
|
return SetForeground (w, color);
|
|
|
|
}
|
2012-10-18 15:59:15 -05:00
|
|
|
bool SetBackground (int, const rgb_color);
|
|
|
|
bool SetBackground (int w, uchar r, uchar g, uchar b, uchar a = 255) {
|
2010-07-10 08:58:15 -05:00
|
|
|
rgb_color color = {r, g, b, a};
|
|
|
|
return SetBackground (w, color);
|
|
|
|
}
|
|
|
|
|
2010-05-07 04:47:10 -05:00
|
|
|
//bool SetFont (int16, const BFont &);
|
2012-10-18 15:59:15 -05:00
|
|
|
bool SetTextRender(int, TextRender*);
|
2010-07-10 08:58:15 -05:00
|
|
|
|
2010-05-07 04:47:10 -05:00
|
|
|
void SetSoftLineIndent(float indent);
|
|
|
|
void SetTextMargin(float margin);
|
2010-07-10 08:58:15 -05:00
|
|
|
|
|
|
|
float TextMargin() const {
|
|
|
|
return fTextMargin;
|
|
|
|
}
|
|
|
|
float SoftLineIndent() const {
|
|
|
|
return fSoftLineIndent;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void AddView (BView*);
|
|
|
|
void RemoveView (BView*);
|
2010-05-07 04:47:10 -05:00
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|