2
* Copyright (C) 2010 Canonical Ltd
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.
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.
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/>.
16
* Authored by: Neil Jagdish Patel <neil.patel@canonical.com>
19
#ifndef PANEL_MENU_VIEW_H
20
#define PANEL_MENU_VIEW_H
25
#include "IndicatorObjectProxy.h"
26
#include "Introspectable.h"
27
#include "PanelIndicatorObjectView.h"
28
#include "StaticCairoText.h"
29
#include "WindowButtons.h"
31
#include <libbamf/libbamf.h>
33
class PanelMenuView : public PanelIndicatorObjectView
36
// This contains all the menubar logic for the Panel. Mainly it contains
37
// the following states:
38
// 1. Unmaximized window + no mouse hover
39
// 2. Unmaximized window + mouse hover
40
// 3. Unmaximized window + active menu (Alt+F/arrow key nav)
41
// 4. Maximized window + no mouse hover
42
// 5. Maximized window + mouse hover
43
// 6. Maximized window + active menu
45
// It also deals with undecorating maximized windows (and redecorating them
53
virtual long ProcessEvent (nux::IEvent &ievent, long TraverseInfo, long ProcessEventInfo);
54
virtual void Draw (nux::GraphicsEngine& GfxContext, bool force_draw);
55
virtual void DrawContent (nux::GraphicsEngine &GfxContext, bool force_draw);
56
virtual long PostLayoutManagement (long LayoutResult);
58
void SetProxy (IndicatorObjectProxy *proxy);
60
void OnEntryAdded (IndicatorObjectEntryProxy *proxy);
61
void OnEntryMoved (IndicatorObjectEntryProxy *proxy);
62
void OnEntryRemoved (IndicatorObjectEntryProxy *proxy);
63
void OnActiveChanged (PanelIndicatorObjectEntryView *view, bool is_active);
64
void OnActiveWindowChanged (BamfView *old_view, BamfView *new_view);
66
void OnWindowUnmapped (guint xid);
67
void OnWindowMaximized (guint32 xid);
68
void OnWindowRestored (guint32 xid);
71
void AllMenusClosed ();
73
void OnCloseClicked ();
74
void OnMinimizeClicked ();
75
void OnRestoreClicked ();
76
void OnWindowButtonsRedraw ();
79
const gchar * GetName ();
80
const gchar * GetChildsName ();
81
void AddProperties (GVariantBuilder *builder);
84
gchar * GetActiveViewName ();
87
BamfMatcher* _matcher;
89
nux::AbstractPaintLayer *_title_layer;
90
nux::HLayout *_menu_layout;
91
nux::CairoGraphics _util_cg;
92
nux::IntrusiveSP<nux::IOpenGLBaseTexture> _gradient_texture;
93
nux::BaseTexture *_title_tex;
97
PanelIndicatorObjectEntryView *_last_active_view;
99
WindowButtons *_window_buttons;
101
std::map<guint32, bool> _decor_map;