~ubuntu-branches/ubuntu/natty/unity/natty

« back to all changes in this revision

Viewing changes to src/PanelTray.h

  • Committer: Bazaar Package Importer
  • Author(s): Didier Roche
  • Date: 2011-02-17 20:37:42 UTC
  • mto: This revision was merged to the branch mainline in revision 62.
  • Revision ID: james.westby@ubuntu.com-20110217203742-ezkynl9fs8fv8ohj
Tags: upstream-3.4.4
ImportĀ upstreamĀ versionĀ 3.4.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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: Neil Jagdish Patel <neil.patel@canonical.com>
 
17
 */
 
18
 
 
19
#ifndef PANEL_TRAY_H
 
20
#define PANEL_TRAY_H
 
21
 
 
22
#include <Nux/View.h>
 
23
#include <gtk/gtk.h>
 
24
 
 
25
#include <gdk/gdkx.h>
 
26
 
 
27
#include "IndicatorObjectProxy.h"
 
28
#include "Introspectable.h"
 
29
#include "PanelIndicatorObjectView.h"
 
30
 
 
31
#include <unity-misc/na-tray.h>
 
32
#include <unity-misc/na-tray-child.h>
 
33
#include <unity-misc/na-tray-manager.h>
 
34
 
 
35
class PanelTray : public PanelIndicatorObjectView
 
36
{
 
37
public:
 
38
 
 
39
  PanelTray ();
 
40
  ~PanelTray ();
 
41
 
 
42
  void Draw (nux::GraphicsEngine& gfx_content, bool force_draw);
 
43
  
 
44
  Window GetTrayWindow ();
 
45
 
 
46
  void Sync ();
 
47
 
 
48
  void OnEntryAdded (IndicatorObjectEntryProxy *proxy);
 
49
  void OnEntryMoved (IndicatorObjectEntryProxy *proxy);
 
50
  void OnEntryRemoved (IndicatorObjectEntryProxy *proxy);
 
51
 
 
52
public:
 
53
  int        _n_children;
 
54
  char     **_whitelist;
 
55
protected:
 
56
  const gchar * GetName ();
 
57
  const gchar * GetChildsName ();
 
58
  void          AddProperties (GVariantBuilder *builder);
 
59
 
 
60
private:
 
61
  static gboolean FilterTrayCallback (NaTray *tray, NaTrayChild *child, PanelTray *self);
 
62
  static void     OnTrayIconRemoved  (NaTrayManager *manager, NaTrayChild *child, PanelTray *self);
 
63
  static gboolean IdleSync (PanelTray *tray);
 
64
  static gboolean OnTrayExpose (GtkWidget *widget, GdkEventExpose *ev, PanelTray *tray);
 
65
 
 
66
private:
 
67
  GSettings *_settings;
 
68
  GtkWidget *_window;
 
69
  NaTray    *_tray;
 
70
  int        _last_x;
 
71
  int        _last_y;
 
72
};
 
73
#endif