From 139792c8603a4ec6faa23576ff03d39a50d4ab91 Mon Sep 17 00:00:00 2001 From: fluxgen Date: Fri, 28 Nov 2003 22:53:10 +0000 Subject: GContext --- src/FbTk/Menu.cc | 16 ++++++++-------- src/FbTk/MenuTheme.hh | 17 +++++++++++------ 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/src/FbTk/Menu.cc b/src/FbTk/Menu.cc index 8b4ddd2..96e8fa8 100644 --- a/src/FbTk/Menu.cc +++ b/src/FbTk/Menu.cc @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Menu.cc,v 1.41 2003/11/19 12:57:27 rathnor Exp $ +// $Id: Menu.cc,v 1.42 2003/11/28 22:52:20 fluxgen Exp $ //use GNU extensions #ifndef _GNU_SOURCE @@ -785,9 +785,9 @@ void Menu::drawItem(unsigned int index, bool highlight, bool clear, bool render_ } GC gc = - ((highlight || item->isSelected()) ? m_theme.hiliteTextGC() : - m_theme.frameTextGC()); - GC tgc = + ((highlight || item->isSelected()) ? m_theme.hiliteTextGC().gc() : + m_theme.frameTextGC().gc()); + const GContext &tgc = (highlight ? m_theme.hiliteTextGC() : (item->isEnabled() ? m_theme.frameTextGC() : m_theme.disableTextGC() ) ); @@ -842,11 +842,11 @@ void Menu::drawItem(unsigned int index, bool highlight, bool clear, bool render_ if (dohilite && highlight && (menu.hilite_pixmap != ParentRelative)) { if (menu.hilite_pixmap) { m_frame_pm.copyArea(menu.hilite_pixmap, - m_theme.hiliteGC(), hoff_x, hoff_y, + m_theme.hiliteGC().gc(), hoff_x, hoff_y, hilite_x, hilite_y, hilite_w, hilite_h); } else { - m_frame_pm.fillRectangle(m_theme.hiliteGC(), + m_frame_pm.fillRectangle(m_theme.hiliteGC().gc(), hilite_x, hilite_y, hilite_w, hilite_h); } @@ -876,12 +876,12 @@ void Menu::drawItem(unsigned int index, bool highlight, bool clear, bool render_ } else { if (menu.sel_pixmap) { m_frame_pm.copyArea(highlight ? menu.frame_pixmap : menu.sel_pixmap, - m_theme.hiliteGC(), + m_theme.hiliteGC().gc(), 0, 0, sel_x, sel_y, half_w, half_w); } else { - m_frame_pm.fillRectangle(m_theme.hiliteGC(), + m_frame_pm.fillRectangle(m_theme.hiliteGC().gc(), sel_x, sel_y, half_w, half_w); } } diff --git a/src/FbTk/MenuTheme.hh b/src/FbTk/MenuTheme.hh index e81a2f2..4e9deb3 100644 --- a/src/FbTk/MenuTheme.hh +++ b/src/FbTk/MenuTheme.hh @@ -19,7 +19,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: MenuTheme.hh,v 1.9 2003/09/12 23:32:02 fluxgen Exp $ +// $Id: MenuTheme.hh,v 1.10 2003/11/28 22:53:10 fluxgen Exp $ #ifndef FBTK_MENUTHEME_HH #define FBTK_MENUTHEME_HH @@ -83,11 +83,16 @@ public: @name graphic contexts */ ///@{ - GC titleTextGC() const { return t_text_gc.gc(); } - GC frameTextGC() const { return f_text_gc.gc(); } - GC hiliteTextGC() const { return h_text_gc.gc(); } - GC disableTextGC() const { return d_text_gc.gc(); } - GC hiliteGC() const { return hilite_gc.gc(); } + const GContext &titleTextGC() const { return t_text_gc; } + const GContext &frameTextGC() const { return f_text_gc; } + const GContext &hiliteTextGC() const { return h_text_gc; } + const GContext &disableTextGC() const { return d_text_gc; } + const GContext &hiliteGC() const { return hilite_gc; } + GContext &titleTextGC() { return t_text_gc; } + GContext &frameTextGC() { return f_text_gc; } + GContext &hiliteTextGC() { return h_text_gc; } + GContext &disableTextGC() { return d_text_gc; } + GContext &hiliteGC() { return hilite_gc; } ///@} BulletType bullet() const { return *m_bullet; } FbTk::Justify bulletPos() const { return *bullet_pos; } -- cgit v0.11.2