41
39
class BamfLauncherIcon : public SimpleLauncherIcon
41
NUX_DECLARE_OBJECT_TYPE(BamfLauncherIcon, SimpleLauncherIcon);
44
BamfLauncherIcon(Launcher* IconManager, BamfApplication* app);
43
BamfLauncherIcon(BamfApplication* app);
45
44
virtual ~BamfLauncherIcon();
47
const char* DesktopFile();
46
void ActivateLauncherIcon(ActionArg arg);
48
std::string DesktopFile();
50
bool IsSticky() const;
51
bool IsVisible() const;
52
bool IsActive() const;
53
bool IsRunning() const;
54
bool IsUrgent() const;
57
void Stick(bool save = true);
53
void ActivateLauncherIcon(ActionArg arg);
55
virtual bool ShowInSwitcher();
60
virtual bool ShowInSwitcher(bool current);
56
61
virtual unsigned long long SwitcherPriority();
58
std::vector<Window> RelatedXids ();
60
std::string NameForWindow (Window window);
63
std::vector<Window> Windows();
64
std::vector<Window> WindowsForMonitor(int monitor);
65
std::string NameForWindow(Window window);
63
std::list<DbusmenuMenuitem*> GetMenus();
65
void UpdateIconGeometries(nux::Point3 center);
66
void OnCenterStabilized(nux::Point3 center);
68
void OnLauncherHiddenChanged();
68
void UpdateIconGeometries(std::vector<nux::Point3> center);
69
void OnCenterStabilized(std::vector<nux::Point3> center);
70
70
void AddProperties(GVariantBuilder* builder);
72
const gchar* GetRemoteUri();
74
nux::DndAction OnQueryAcceptDrop(unity::DndData& dnd_data);
75
71
void OnAcceptDrop(unity::DndData& dnd_data);
79
75
void OpenInstanceLauncherIcon(ActionArg arg);
78
nux::DndAction OnQueryAcceptDrop(unity::DndData& dnd_data);
80
std::list<DbusmenuMenuitem*> GetMenus();
81
81
std::set<std::string> ValidateUrisForLaunch(unity::DndData& dnd_data);
83
const char* BamfName();
83
const gchar* GetRemoteUri();
84
std::string BamfName() const;
85
bool HandlesSpread () { return true; }
86
bool HandlesSpread() { return true; }
87
std::string GetName() const;
88
BamfApplication* m_App;
90
std::map<std::string, DbusmenuClient*> _menu_clients;
91
std::map<std::string, DbusmenuMenuitem*> _menu_items;
92
std::map<std::string, DbusmenuMenuitem*> _menu_items_extra;
93
std::map<std::string, gulong> _menu_callbacks;
94
DbusmenuMenuitem* _menu_desktop_shortcuts;
97
guint _dnd_hover_timer;
99
gchar* _cached_desktop_file;
102
GFileMonitor* _desktop_file_monitor;
103
gulong _on_desktop_file_changed_handler_id;
105
std::set<std::string> _supported_types;
106
bool _supported_types_filled;
107
guint _fill_supported_types_id;
108
guint32 _window_moved_id;
109
guint32 _window_moved_xid;
111
90
void EnsureWindowState();
91
void EnsureMenuItemsReady();
113
92
void UpdateDesktopFile();
114
93
void UpdateMenus();
115
94
void UpdateDesktopQuickList();
95
void FillSupportedTypes();
117
97
void OpenInstanceWithUris(std::set<std::string> uris);
118
98
void Focus(ActionArg arg);
119
99
bool Spread(bool current_desktop, int state, bool force);
121
void EnsureMenuItemsReady();
123
101
void OnWindowMinimized(guint32 xid);
124
102
void OnWindowMoved(guint32 xid);
125
bool OwnsWindow(Window w);
104
bool OwnsWindow(Window w) const;
127
106
const std::set<std::string>& GetSupportedTypes();
129
static void OnClosed(BamfView* view, gpointer data);
130
static void OnUserVisibleChanged(BamfView* view, gboolean visible, gpointer data);
131
static void OnActiveChanged(BamfView* view, gboolean active, gpointer data);
132
static void OnRunningChanged(BamfView* view, gboolean running, gpointer data);
133
static void OnUrgentChanged(BamfView* view, gboolean urgent, gpointer data);
134
static void OnChildAdded(BamfView* view, BamfView* child, gpointer data);
135
static void OnChildRemoved(BamfView* view, BamfView* child, gpointer data);
137
static void OnQuit(DbusmenuMenuitem* item, int time, BamfLauncherIcon* self);
138
static void OnLaunch(DbusmenuMenuitem* item, int time, BamfLauncherIcon* self);
139
static void OnTogglePin(DbusmenuMenuitem* item, int time, BamfLauncherIcon* self);
141
static void OnDesktopFileChanged(GFileMonitor* monitor,
144
GFileMonitorEvent event_type,
147
static gboolean OnDndHoveredTimeout(gpointer data);
148
static gboolean FillSupportedTypes(gpointer data);
109
glib::Object<BamfApplication> _bamf_app;
111
guint _dnd_hover_timer;
113
bool _supported_types_filled;
114
guint _fill_supported_types_id;
115
guint _window_moved_id;
117
std::string _remote_uri;
118
std::string _desktop_file;
119
std::set<std::string> _supported_types;
120
std::map<std::string, glib::Object<DbusmenuClient>> _menu_clients;
121
std::map<std::string, glib::Object<DbusmenuMenuitem>> _menu_items;
122
std::map<std::string, glib::Object<DbusmenuMenuitem>> _menu_items_extra;
123
glib::Object<IndicatorDesktopShortcuts> _desktop_shortcuts;
124
glib::Object<DbusmenuMenuitem> _menu_desktop_shortcuts;
125
glib::Object<GFileMonitor> _desktop_file_monitor;
126
glib::SignalManager _gsignals;