1 #ifndef WF_DOCK_HPP
2 #define WF_DOCK_HPP
3 
4 #include <map>
5 #include <gtkmm/hvbox.h>
6 #include <wayland-client.h>
7 
8 #include "toplevel-icon.hpp"
9 #include "wf-shell-app.hpp"
10 
11 class WfDock
12 {
13     public:
14     WfDock(WayfireOutput *output);
15     ~WfDock();
16 
17     void add_child(Gtk::Widget& widget);
18     void rem_child(Gtk::Widget& widget);
19 
20     wl_surface *get_wl_surface();
21     class impl;
22     private:
23     std::unique_ptr<impl> pimpl;
24 };
25 
26 class WfDockApp : public WayfireShellApp
27 {
28   public:
29     WfDock* dock_for_wl_output(wl_output *output);
30     void handle_toplevel_manager(zwlr_foreign_toplevel_manager_v1 *manager);
31     void handle_new_toplevel(zwlr_foreign_toplevel_handle_v1* handle);
32     void handle_toplevel_closed(zwlr_foreign_toplevel_handle_v1 *handle);
33 
34     static WfDockApp& get();
35 
36     /* Starts the program. get() is valid afterward the first (and the only)
37      * call to run() */
38     static void create(int argc, char **argv);
39     virtual ~WfDockApp();
40 
41     void on_activate() override;
42     void handle_new_output(WayfireOutput *output) override;
43     void handle_output_removed(WayfireOutput *output) override;
44 
45   private:
46     WfDockApp(int argc, char **argv);
47 
48     class impl;
49     std::unique_ptr<impl> priv;
50 };
51 
52 #endif /* end of include guard: WF_DOCK_HPP */
53