mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-09-03 10:51:12 +02:00
Merge remote-tracking branch 'check/next-cc'
needs buildfixing in framebuffer class... Conflicts: data/locale/deutsch.locale data/locale/english.locale src/driver/fontrenderer.cpp src/driver/volume.cpp src/gui/audiomute.cpp src/gui/audioplayer.cpp src/gui/osd_setup.cpp src/gui/widget/stringinput.cpp src/neutrino.cpp
This commit is contained in:
@@ -2,23 +2,23 @@
|
||||
Neutrino-GUI - DBoxII-Project
|
||||
|
||||
Copyright (C) 2001 Steffen Hehn 'McClean'
|
||||
Homepage: http://dbox.cyberphoria.org/
|
||||
|
||||
License: GPL
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
You should have received a copy of the GNU General Public
|
||||
License along with this program; if not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include "framebuffer_ng.h"
|
||||
@@ -33,6 +33,7 @@
|
||||
#include <linux/vt.h>
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
#include <OpenThreads/Mutex>
|
||||
#include <OpenThreads/ScopedLock>
|
||||
@@ -112,30 +113,40 @@ class CFrameBuffer
|
||||
bool active;
|
||||
static void switch_signal (int);
|
||||
fb_fix_screeninfo fix;
|
||||
#ifdef USE_NEVIS_GXA
|
||||
#ifdef USE_NEVIS_GXA
|
||||
int devmem_fd; /* to access the GXA register we use /dev/mem */
|
||||
unsigned int smem_start; /* as aquired from the fbdev, the framebuffers physical start address */
|
||||
volatile uint8_t *gxa_base; /* base address for the GXA's register access */
|
||||
|
||||
#endif /* USE_NEVIS_GXA */
|
||||
#endif /* USE_NEVIS_GXA */
|
||||
bool locked;
|
||||
std::map<std::string, rawIcon> icon_cache;
|
||||
int cache_size;
|
||||
|
||||
int *q_circle;
|
||||
bool corner_tl, corner_tr, corner_bl, corner_br;
|
||||
|
||||
void * int_convertRGB2FB(unsigned char *rgbbuff, unsigned long x, unsigned long y, int transp, bool alpha);
|
||||
int m_transparent_default, m_transparent;
|
||||
// Unlocked versions (no mutex)
|
||||
void paintHLineRelInternal(int x, int dx, int y, const fb_pixel_t col);
|
||||
void paintVLineRelInternal(int x, int y, int dy, const fb_pixel_t col);
|
||||
|
||||
void paintShortHLineRelInternal(const int& x, const int& dx, const int& y, const fb_pixel_t& col);
|
||||
int limitRadius(const int& dx, const int& dy, int& radius);
|
||||
void setCornerFlags(const int& type);
|
||||
void initQCircle();
|
||||
inline int calcCornersOffset(const int& dy, const int& line, const int& radius, const int& type) { int ofs = 0; calcCorners(&ofs, NULL, NULL, dy, line, radius, type); return ofs; }
|
||||
bool calcCorners(int *ofs, int *ofl, int *ofr, const int& dy, const int& line, const int& radius, const int& type);
|
||||
|
||||
public:
|
||||
fb_pixel_t realcolor[256];
|
||||
|
||||
~CFrameBuffer();
|
||||
|
||||
static CFrameBuffer* getInstance();
|
||||
#ifdef USE_NEVIS_GXA
|
||||
#ifdef USE_NEVIS_GXA
|
||||
void setupGXA(void);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
void init(const char * const fbDevice = "/dev/fb/0");
|
||||
int setMode(unsigned int xRes, unsigned int yRes, unsigned int bpp);
|
||||
@@ -148,8 +159,9 @@ class CFrameBuffer
|
||||
unsigned int getStride() const; // size of a single line in the framebuffer (in bytes)
|
||||
unsigned int getScreenWidth(bool real = false);
|
||||
unsigned int getScreenHeight(bool real = false);
|
||||
unsigned int getScreenWidthRel();
|
||||
unsigned int getScreenHeightRel();
|
||||
unsigned int getScreenPercentRel(bool force_small);
|
||||
unsigned int getScreenWidthRel(bool force_small = false);
|
||||
unsigned int getScreenHeightRel(bool force_small = false);
|
||||
unsigned int getScreenX();
|
||||
unsigned int getScreenY();
|
||||
|
||||
@@ -177,7 +189,7 @@ class CFrameBuffer
|
||||
inline void paintBox(int xa, int ya, int xb, int yb, const fb_pixel_t col) { paintBoxRel(xa, ya, xb - xa, yb - ya, col); }
|
||||
inline void paintBox(int xa, int ya, int xb, int yb, const fb_pixel_t col, int radius, int type) { paintBoxRel(xa, ya, xb - xa, yb - ya, col, radius, type); }
|
||||
|
||||
void paintBoxFrame(const int x, const int y, const int dx, const int dy, const int px, const fb_pixel_t col, const int rad = 0);
|
||||
void paintBoxFrame(const int x, const int y, const int dx, const int dy, const int px, const fb_pixel_t col, int radius = 0, int type = CORNER_ALL);
|
||||
void paintLine(int xa, int ya, int xb, int yb, const fb_pixel_t col);
|
||||
|
||||
inline void paintVLine(int x, int ya, int yb, const fb_pixel_t col) { paintVLineRel(x, ya, yb - ya, col); }
|
||||
@@ -225,7 +237,7 @@ class CFrameBuffer
|
||||
bool Locked(void) { return locked; };
|
||||
#ifdef USE_NEVIS_GXA
|
||||
void add_gxa_sync_marker(void);
|
||||
void waitForIdle(void);
|
||||
void waitForIdle(const char* func=NULL);
|
||||
#else
|
||||
inline void waitForIdle(void) {};
|
||||
#endif
|
||||
@@ -244,6 +256,51 @@ class CFrameBuffer
|
||||
};
|
||||
void SetTransparent(int t){ m_transparent = t; }
|
||||
void SetTransparentDefault(){ m_transparent = m_transparent_default; }
|
||||
|
||||
// ## AudioMute / Clock ######################################
|
||||
private:
|
||||
enum {
|
||||
FB_PAINTAREA_MATCH_NO,
|
||||
FB_PAINTAREA_MATCH_OK
|
||||
};
|
||||
|
||||
typedef struct fb_area_t
|
||||
{
|
||||
int x;
|
||||
int y;
|
||||
int dx;
|
||||
int dy;
|
||||
int element;
|
||||
} fb_area_struct_t;
|
||||
|
||||
bool fbAreaActiv;
|
||||
typedef std::vector<fb_area_t> v_fbarea_t;
|
||||
typedef v_fbarea_t::iterator fbarea_iterator_t;
|
||||
v_fbarea_t v_fbarea;
|
||||
bool fb_no_check;
|
||||
bool do_paint_mute_icon;
|
||||
|
||||
bool _checkFbArea(int _x, int _y, int _dx, int _dy, bool prev);
|
||||
int checkFbAreaElement(int _x, int _y, int _dx, int _dy, fb_area_t *area);
|
||||
|
||||
public:
|
||||
enum {
|
||||
FB_PAINTAREA_INFOCLOCK,
|
||||
FB_PAINTAREA_MUTEICON1,
|
||||
FB_PAINTAREA_MUTEICON2,
|
||||
|
||||
FB_PAINTAREA_MAX
|
||||
};
|
||||
|
||||
#if defined(FB_HW_ACCELERATION)
|
||||
inline bool checkFbArea(int, int, int, int, bool) { return true; }
|
||||
#else
|
||||
inline bool checkFbArea(int _x, int _y, int _dx, int _dy, bool prev) { return (fbAreaActiv && !fb_no_check) ? _checkFbArea(_x, _y, _dx, _dy, prev) : true; }
|
||||
#endif
|
||||
|
||||
void setFbArea(int element, int _x=0, int _y=0, int _dx=0, int _dy=0);
|
||||
void fbNoCheck(bool noCheck) { fb_no_check = noCheck; }
|
||||
void doPaintMuteIcon(bool mode) { do_paint_mute_icon = mode; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user