~canonical-dx-team/unity/unity.fix-ql-losing-focus

672.1.1 by Mirco Müller
new style-handling class for the panel implemented as a singleton
1
/*
2
 * Copyright (C) 2010 Canonical Ltd
3
 *
4
 * This program is free software: you can redistribute it and/or modify
5
 * it under the terms of the GNU General Public License version 3 as
6
 * published by the Free Software Foundation.
7
 *
8
 * This program is distributed in the hope that it will be useful,
9
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11
 * GNU General Public License for more details.
12
 *
13
 * You should have received a copy of the GNU General Public License
14
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
15
 *
16
 * Authored by: Mirco Müller <mirco.mueller@canonical.com>
853.4.21 by Neil Jagdish Patel
[merge] trunk
17
 *              Neil Jagdish Patel <neil.patel@canonical.com>
672.1.1 by Mirco Müller
new style-handling class for the panel implemented as a singleton
18
 */
19
20
#ifndef PANEL_STYLE_H
21
#define PANEL_STYLE_H
22
853.4.10 by Neil Jagdish Patel
Update the style branch, add ability to draw the panel background from the theme
23
#include <Nux/Nux.h>
24
25
#include <gtk/gtk.h>
672.1.1 by Mirco Müller
new style-handling class for the panel implemented as a singleton
26
672.1.5 by Mirco Müller
fix some of the color-shades, use those in PanelView, base PanelStyle on nux::Object and do ref-counting
27
class PanelStyle : public nux::Object
28
{
672.1.1 by Mirco Müller
new style-handling class for the panel implemented as a singleton
29
  public:
853.4.17 by Neil Jagdish Patel
correctly repaint everything
30
    typedef enum
31
    {
853.4.18 by Neil Jagdish Patel
Implement panel button theming support for Ambiance and Radiance
32
      WINDOW_BUTTON_CLOSE = 0,
33
      WINDOW_BUTTON_MINIMIZE,
34
      WINDOW_BUTTON_UNMAXIMIZE
853.4.17 by Neil Jagdish Patel
correctly repaint everything
35
853.4.18 by Neil Jagdish Patel
Implement panel button theming support for Ambiance and Radiance
36
    } WindowButtonType;
853.4.17 by Neil Jagdish Patel
correctly repaint everything
37
38
    typedef enum
39
    {
853.4.18 by Neil Jagdish Patel
Implement panel button theming support for Ambiance and Radiance
40
      WINDOW_STATE_NORMAL,
41
      WINDOW_STATE_PRELIGHT,
42
      WINDOW_STATE_PRESSED
853.4.17 by Neil Jagdish Patel
correctly repaint everything
43
    
853.4.18 by Neil Jagdish Patel
Implement panel button theming support for Ambiance and Radiance
44
    } WindowState;
853.4.17 by Neil Jagdish Patel
correctly repaint everything
45
    
46
    static PanelStyle * GetDefault ();
47
672.1.1 by Mirco Müller
new style-handling class for the panel implemented as a singleton
48
    PanelStyle ();
49
    ~PanelStyle ();
50
672.1.4 by Mirco Müller
applied some requested style-changes to the code
51
    nux::Color& GetTextColor ();
52
    nux::Color& GetBackgroundTop ();
53
    nux::Color& GetBackgroundBottom ();
54
    nux::Color& GetTextShadow ();
871.4.24 by Neil Jagdish Patel
Fix Panel font rendering to be clearer, fix entry to be larger and render correctly
55
    nux::Color& GetLineColor ();
672.1.1 by Mirco Müller
new style-handling class for the panel implemented as a singleton
56
853.4.10 by Neil Jagdish Patel
Update the style branch, add ability to draw the panel background from the theme
57
    GdkPixbuf * GetBackground (int width, int height);
58
853.4.18 by Neil Jagdish Patel
Implement panel button theming support for Ambiance and Radiance
59
    nux::BaseTexture * GetWindowButton (WindowButtonType type, WindowState state);
853.4.17 by Neil Jagdish Patel
correctly repaint everything
60
853.4.20 by Neil Jagdish Patel
Fix the home button logo to match theme
61
    GdkPixbuf * GetHomeButton ();
62
853.4.14 by Neil Jagdish Patel
More styling fixes
63
    sigc::signal<void> changed;
853.4.10 by Neil Jagdish Patel
Update the style branch, add ability to draw the panel background from the theme
64
65
  private:
66
    void        Refresh ();
67
    static void OnStyleChanged (GObject*    gobject,
68
                                GParamSpec* pspec,
69
                                gpointer    data);
853.4.19 by Neil Jagdish Patel
Add support for non Ambiance/Radiance window buttons
70
    nux::BaseTexture * GetWindowButtonForTheme (WindowButtonType type, WindowState state);
853.4.10 by Neil Jagdish Patel
Update the style branch, add ability to draw the panel background from the theme
71
  private:
72
    GtkWidget         *_offscreen;
853.4.18 by Neil Jagdish Patel
Implement panel button theming support for Ambiance and Radiance
73
    char              *_theme_name;
672.1.4 by Mirco Müller
applied some requested style-changes to the code
74
    nux::Color         _text;
75
    nux::Color         _bg_top;
76
    nux::Color         _bg_bottom;
77
    nux::Color         _text_shadow;
871.4.24 by Neil Jagdish Patel
Fix Panel font rendering to be clearer, fix entry to be larger and render correctly
78
    nux::Color         _line;
672.1.1 by Mirco Müller
new style-handling class for the panel implemented as a singleton
79
};
80
81
#endif // PANEL_STYLE_H