~ubuntu-branches/ubuntu/natty/thunderbird/natty

« back to all changes in this revision

Viewing changes to debian/globalmenu/components/src/uGlobalMenuObject.h

  • Committer: Bazaar Package Importer
  • Author(s): Chris Coulson
  • Date: 2011-04-07 00:08:36 UTC
  • Revision ID: james.westby@ubuntu.com-20110407000836-csot2a9asqu8204y
Tags: 3.1.9+nobinonly-0ubuntu2
* Update globalmenu-extension code to 0.7
  - Fixes LP: #749440 - Interaction with CuteButtons extension makes
    Thunderbird abort with icons in menus. Work around this by ignoring
    icons greater than 100x100 to avoid DoS'ing unity and dbus-daemon with
    lots of icon data
  - Fixes LP: #734837 - Some menu items are not displayed. Some menuitems
    inherit a label from their command content node rather than having a
    label attribute on the menuitem content node. Make sure we use the 
    right label in this case
  - Make the Alt key show the menubar in the panel
  - Drop the hacks we had to workaround the lack of menu closed signals from
    Unity. We no longer synthesize our own menu closed events, but use the
    proper event from dbusmenu.
  - In addition to this, we split the work done during menu opening in to
    2 phases - the first phase triggered off "about-to-show" and the second
    phase triggered off "opened". In the future, we should be able to delay 
    the menu opening with the about-to-show handler, which is where we
    do all the work to update the menu

* Fix LP: #719919 - no option for Thunderbird as default mail client
  - update debian/thunderbird.desktop
* Disable the default mail client check. This seemed to always be the
  intent, but the wrong preference was being set. We correctly set
  mail.shell.checkDefaultClient to false now. This check doesn't work in
  Natty and isn't going to work unless I get time to backport gio support
  to 3.1
  - update debian/thunderbird.js

Show diffs side-by-side

added added

removed removed

Lines of Context:
46
46
#include <imgIRequest.h>
47
47
#include <imgIContainerObserver.h>
48
48
#include <nsThreadUtils.h>
 
49
#include <imgILoader.h>
49
50
 
50
51
#include <libdbusmenu-glib/server.h>
51
52
 
72
73
  NS_DECL_IMGICONTAINEROBSERVER
73
74
  NS_DECL_NSIRUNNABLE
74
75
 
75
 
  void LoadIcon ();
 
76
  void LoadIcon();
76
77
 
77
 
  uGlobalMenuIconLoader (uGlobalMenuObject *aMenuItem):
78
 
                         mMenuItem(aMenuItem) { };
79
 
  ~uGlobalMenuIconLoader () { };
 
78
  uGlobalMenuIconLoader(uGlobalMenuObject *aMenuItem):
 
79
                        mMenuItem(aMenuItem) { };
 
80
  ~uGlobalMenuIconLoader() { };
80
81
 
81
82
protected:
82
 
  void Destroy ();
 
83
  void Destroy();
83
84
 
84
85
private:
85
 
  void ClearIcon ();
86
 
  PRBool ShouldShowIcon ();
 
86
  void ClearIcon();
 
87
  PRBool ShouldShowIcon();
87
88
 
88
89
  PRBool mIconLoaded;
89
90
  uGlobalMenuObject *mMenuItem;
91
92
  nsCOMPtr<imgIRequest> mIconRequest;
92
93
  nsIntRect mImageRect;
93
94
  static PRInt32 sImagesInMenus;
 
95
  static nsCOMPtr<imgILoader> sLoader;
94
96
};
95
97
 
96
98
class uGlobalMenuObject
100
102
  uGlobalMenuObject (uMenuObjectType aType): mDbusMenuItem(nsnull),
101
103
                                             mListener(nsnull),
102
104
                                             mParent(nsnull),
103
 
                                             mType(aType) { };
104
 
  DbusmenuMenuitem* GetDbusMenuItem () { return mDbusMenuItem; }
 
105
                                             mType(aType),
 
106
                                             mLabelContent(nsnull),
 
107
                                             mLabelSyncGuard(PR_FALSE),
 
108
                                             mSensitivitySyncGuard(PR_FALSE)
 
109
                                             { };
 
110
  DbusmenuMenuitem* GetDbusMenuItem() { return mDbusMenuItem; }
105
111
  uGlobalMenuObject* GetParent() { return mParent; }
106
112
  uMenuObjectType GetType() { return mType; }
107
 
  void GetContent (nsIContent **_retval);
 
113
  void GetContent(nsIContent **_retval);
108
114
  void UpdateVisibility();
109
 
  virtual ~uGlobalMenuObject () { };
 
115
  virtual ~uGlobalMenuObject() { };
110
116
 
111
117
protected:
112
 
  void SyncLabelFromContent ();
113
 
  void SyncVisibilityFromContent ();
114
 
  void SyncSensitivityFromContent ();
115
 
  void SyncSensitivityFromContent (nsIContent *aContent);
116
 
  void SyncIconFromContent ();
 
118
  void SyncLabelFromContent();
 
119
  void SyncLabelFromContent(nsIContent *aCommandContent);
 
120
  void SyncVisibilityFromContent();
 
121
  void SyncSensitivityFromContent();
 
122
  void SyncSensitivityFromContent(nsIContent *aCommandContent);
 
123
  void SyncIconFromContent();
117
124
  void UpdateInfoFromContentClass();
118
 
  void DestroyIconLoader ();
 
125
  void DestroyIconLoader();
119
126
  PRBool WithFavicon() { return mWithFavicon; }
120
127
 
121
128
  nsCOMPtr<nsIContent> mContent;
125
132
  uMenuObjectType mType;
126
133
  PRBool mContentVisible;
127
134
  uGlobalMenuBar *mMenuBar;
 
135
 
 
136
private:
 
137
  nsRefPtr<uGlobalMenuIconLoader> mIconLoader;
128
138
  PRBool mWithFavicon;
129
139
  PRBool mShowOnlyForKb;
130
 
 
131
 
private:
132
 
  nsRefPtr<uGlobalMenuIconLoader> mIconLoader;
 
140
  nsIContent *mLabelContent;
 
141
  PRBool mLabelSyncGuard;
 
142
  PRBool mSensitivitySyncGuard;
133
143
};
134
144
 
135
145
#endif