X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fwayland.hpp;h=af3614275ad54eb6ca69d9f974e52741043f69d9;hb=626b0fc7a92da537f4914afcd3ff390f855785c4;hp=b66bca72a3c5bd39344a0bce94d512dc2ad148ca;hpb=cb5568e11bbe2d499d4d43dc30a779a5869b12ea;p=staging%2Fwindowmanager.git diff --git a/src/wayland.hpp b/src/wayland.hpp index b66bca7..af36142 100644 --- a/src/wayland.hpp +++ b/src/wayland.hpp @@ -2,12 +2,12 @@ #define WM_WAYLAND_HPP #include "ivi-controller-client-protocol.h" - +#include "controller_hooks.hpp" #include "util.hpp" #include -#include #include +#include #include // _ _ @@ -75,6 +75,12 @@ struct display { int dispatch(); void flush(); int get_fd() const; + int get_error(); + + // Lets just proxy this for the registry + inline void add_global_handler(char const *iface, registry::binder bind) { + this->r.add_global_handler(iface, bind); + } }; // _ _ @@ -99,7 +105,7 @@ struct output : wayland_proxy { void done(); void scale(int32_t factor); }; -} +} // namespace wl // _ __ __ _ _ __ ___ ___ ___ _ __ __ _ ___ ___ // | '_ \ / _` | '_ ` _ \ / _ \/ __| '_ \ / _` |/ __/ _ \ @@ -135,6 +141,16 @@ struct controller_child { virtual ~controller_child() {} }; +struct surface_properties { + uint32_t id; // let's just save an ID here too + struct rect dst_rect; + struct rect src_rect; + struct size size; + int32_t orientation; + int32_t visibility; + float opacity; +}; + // __ // ___ _ _ _ __ / _| __ _ ___ ___ // / __| | | | '__| |_ / _` |/ __/ _ \ @@ -143,13 +159,6 @@ struct controller_child { // struct surface : public wayland_proxy, controller_child { - struct rect dst_rect; - struct rect src_rect; - struct size size; - int32_t orientation; - int32_t visibility; - float opacity; - surface(surface const &) = delete; surface &operator=(surface const &) = delete; surface(uint32_t i, struct controller *c); @@ -176,13 +185,6 @@ struct surface : public wayland_proxy, // |___/ struct layer : public wayland_proxy, controller_child { - struct rect dst_rect; - struct rect src_rect; - struct size size; - int32_t orientation; - int32_t visibility; - float opacity; - layer(layer const &) = delete; layer &operator=(layer const &) = delete; layer(uint32_t i, struct controller *c); @@ -227,6 +229,16 @@ struct screen : public wayland_proxy, // \___\___/|_| |_|\__|_| \___/|_|_|\___|_| // struct controller : public wayland_proxy { + typedef std::unordered_map proxy_to_id_map_type; + typedef std::unordered_map> + surface_map_type; + typedef std::unordered_map> + layer_map_type; + typedef std::unordered_map> + screen_map_type; + + typedef std::unordered_map props_map; + // HACK: // The order of these member is mandatory, as when objects are destroyed // they will call their parent (that's us right here!) and remove their @@ -234,13 +246,16 @@ struct controller : public wayland_proxy { // when the surfaces/layers/screens maps are destroyed. This sucks, but // I cannot see a better solution w/o globals or some other horrible // call-our-parent construct. - std::unordered_map surface_proxy_to_id; - std::unordered_map layer_proxy_to_id; - std::unordered_map screen_proxy_to_id; + proxy_to_id_map_type surface_proxy_to_id; + proxy_to_id_map_type layer_proxy_to_id; + proxy_to_id_map_type screen_proxy_to_id; + + props_map sprops; + props_map lprops; - std::unordered_map> surfaces; - std::unordered_map> layers; - std::unordered_map> screens; + surface_map_type surfaces; + layer_map_type layers; + screen_map_type screens; typedef std::pair> name_task_pair; @@ -248,7 +263,7 @@ struct controller : public wayland_proxy { size output_size; - void debug_dump_current_status(); + wm::controller_hooks *chooks; void add_proxy_to_id_mapping(struct ivi_controller_surface *p, uint32_t id); void remove_proxy_to_id_mapping(struct ivi_controller_surface *p); @@ -289,8 +304,8 @@ struct controller : public wayland_proxy { void surface_orientation(struct surface *s, int32_t orientation); void surface_pixelformat(struct surface *s, int32_t pixelformat); void surface_layer(struct surface *s, struct ivi_controller_layer *layer); - void surface_stats(struct surface *s, uint32_t redraw_count, uint32_t frame_count, - uint32_t update_count, uint32_t pid, + void surface_stats(struct surface *s, uint32_t redraw_count, + uint32_t frame_count, uint32_t update_count, uint32_t pid, const char *process_name); void surface_destroyed(struct surface *s); void surface_content(struct surface *s, int32_t content_state); @@ -298,8 +313,8 @@ struct controller : public wayland_proxy { // layer void layer_visibility(struct layer *l, int32_t visibility); void layer_opacity(struct layer *l, float opacity); - void layer_source_rectangle(struct layer *l, int32_t x, int32_t y, int32_t width, - int32_t height); + void layer_source_rectangle(struct layer *l, int32_t x, int32_t y, + int32_t width, int32_t height); void layer_destination_rectangle(struct layer *l, int32_t x, int32_t y, int32_t width, int32_t height); void layer_configuration(struct layer *l, int32_t width, int32_t height); @@ -307,6 +322,6 @@ struct controller : public wayland_proxy { void layer_screen(struct layer *l, struct wl_output *screen); void layer_destroyed(struct layer *l); }; -} +} // namespace genivi #endif // !WM_WAYLAND_HPP