summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorYuta Doi <yuta-d@witz-inc.co.jp>2017-11-10 17:41:05 +0900
committerJan-Simon Moeller <jsmoeller@linuxfoundation.org>2017-11-10 14:34:08 +0000
commitc392fff74872af6d4f165ff3f854d19f390ec0ee (patch)
treecefb2683252e645196c96b3f3e0de5470e16bae7 /src
parent0b1d9ca2550bdb877d065a74e4debcc95c4e7b98 (diff)
Remove and replace the comments
Remove the unnecessary comments and replace ascii-art comments with doxygen format. Change-Id: Id1abf56db58070a83f403a1f8280bc9888e7de09 Signed-off-by: Yuta Doi <yuta-d@witz-inc.co.jp>
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt2
-rw-r--r--src/afb_binding_api.cpp11
-rw-r--r--src/app.cpp4
-rw-r--r--src/layers.cpp2
-rw-r--r--src/layers.hpp4
-rwxr-xr-xsrc/main.cpp9
-rw-r--r--src/util.hpp9
-rw-r--r--src/wayland.cpp85
-rw-r--r--src/wayland.hpp93
9 files changed, 71 insertions, 148 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index fc7e8ad..25849de 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -72,7 +72,7 @@ target_compile_definitions(${TARGETS_WM}
# We do not want source location of messages
AFB_BINDING_PRAGMA_NO_VERBOSE_DETAILS
WINMAN_VERSION_STRING="${PACKAGE_VERSION}"
- _GNU_SOURCE) # XXX should I define this here?!
+ _GNU_SOURCE)
if(NOT ${CMAKE_BUILD_TYPE} STREQUAL "Release")
target_compile_definitions(${TARGETS_WM}
diff --git a/src/afb_binding_api.cpp b/src/afb_binding_api.cpp
index beada73..3c75524 100644
--- a/src/afb_binding_api.cpp
+++ b/src/afb_binding_api.cpp
@@ -26,12 +26,9 @@ using json = nlohmann::json;
#include <json-c/json.h>
namespace wm {
-// _ _ _ _ _ _ _
-// | |__ (_)_ __ __| (_)_ __ __ _ __ _ _ __ (_) (_)_ __ ___ _ __ | |
-// | '_ \| | '_ \ / _` | | '_ \ / _` | / _` | '_ \| | | | '_ ` _ \| '_ \| |
-// | |_) | | | | | (_| | | | | | (_| | | (_| | |_) | | | | | | | | | |_) | |
-// |_.__/|_|_| |_|\__,_|_|_| |_|\__, |___\__,_| .__/|_| |_|_| |_| |_| .__/|_|
-// |___/_____| |_| |_|
+/**
+ * binding_api impl
+ */
binding_api::result_type binding_api::requestsurface(
char const *drawing_name) {
auto r = this->app->api_request_surface(drawing_name);
@@ -100,7 +97,7 @@ binding_api::result_type binding_api::debug_status() {
binding_api::result_type binding_api::debug_terminate() {
HMI_DEBUG("wm", "%s", __func__);
if (getenv("WINMAN_DEBUG_TERMINATE") != nullptr) {
- raise(SIGKILL); // XXX afb-daemon kills it's pgroup using TERM, which
+ raise(SIGKILL); // afb-daemon kills it's pgroup using TERM, which
// doesn't play well with perf
}
return Ok(json_object_new_object());
diff --git a/src/app.cpp b/src/app.cpp
index af552b5..307217e 100644
--- a/src/app.cpp
+++ b/src/app.cpp
@@ -504,8 +504,7 @@ char const *App::api_deactivate_surface(char const *drawing_name) {
return "No surface active";
}
- // XXX: check against main_surface, main_surface_name is the configuration
- // item.
+ // Check against main_surface, main_surface_name is the configuration item.
if (*surface_id == this->layers.main_surface) {
HMI_DEBUG("wm", "Refusing to deactivate main_surface %d", *surface_id);
return nullptr;
@@ -580,7 +579,6 @@ char const *App::api_enddraw(char const *drawing_name) {
if (n && *n == drawing_name) {
std::swap(this->pending_end_draw[i], this->pending_end_draw[iend - 1]);
this->pending_end_draw.resize(iend - 1);
- // XXX: Please tell the compositor to thaw the surface...
this->activate(this->pending_end_draw[i]);
this->layout_commit();
this->emit_flushdraw(drawing_name);
diff --git a/src/layers.cpp b/src/layers.cpp
index 30828dd..04f944d 100644
--- a/src/layers.cpp
+++ b/src/layers.cpp
@@ -77,7 +77,7 @@ struct result<struct layer_map> to_layer_map(nlohmann::json const &j) {
j.value("layer_id", -1), layer(j));
});
- // XXX: add sanity checks here?
+ // TODO: add sanity checks here?
// * check for double IDs
// * check for double names/roles
diff --git a/src/layers.hpp b/src/layers.hpp
index 268936b..1942229 100644
--- a/src/layers.hpp
+++ b/src/layers.hpp
@@ -73,10 +73,6 @@ struct layer_map {
using role_to_layer_map = std::vector<std::pair<std::string, int>>;
using addsurf_layer_map = std::map<int, int>;
- // XXX: we also will need a layer_id to layer map, perhaps
- // make this the primary map, and the surface_id->layer a
- // secondary map.
-
storage_type mapping; // map surface_id to layer
layers_type layers; // the actual layer IDs we have
int main_surface;
diff --git a/src/main.cpp b/src/main.cpp
index 3a41a50..c615d3a 100755
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -86,12 +86,9 @@ error:
return -1;
}
-// _ _ _ _ _ _ _ ____
-// | |__ (_)_ __ __| (_)_ __ __ _ (_)_ __ (_) |_ / /\ \
-// | '_ \| | '_ \ / _` | | '_ \ / _` | | | '_ \| | __| | | |
-// | |_) | | | | | (_| | | | | | (_| | | | | | | | |_| | | |
-// |_.__/|_|_| |_|\__,_|_|_| |_|\__, |___|_|_| |_|_|\__| | | |
-// |___/_____| \_\/_/
+/**
+ * binding_init_()
+ */
int binding_init_() {
HMI_NOTICE("wm", "WinMan ver. %s", WINMAN_VERSION_STRING);
diff --git a/src/util.hpp b/src/util.hpp
index 5ebee23..f4e6e5f 100644
--- a/src/util.hpp
+++ b/src/util.hpp
@@ -85,12 +85,9 @@ struct ScopeTrace {
};
#endif
-// _ _ _ __ _
-// ___| |_ _ __ _ _ ___| |_ _ _ _ __ (_) __ _ _ _ ___ / _| __| |
-// / __| __| '__| | | |/ __| __| | | | | '_ \| |/ _` | | | |/ _ \ | |_ / _` |
-// \__ \ |_| | | |_| | (__| |_ | |_| | | | | | (_| | |_| | __/ | _| (_| |
-// |___/\__|_| \__,_|\___|\__| \__,_|_| |_|_|\__, |\__,_|\___|___|_| \__,_|
-// |_| |_____|
+/**
+ * @struct unique_fd
+ */
struct unique_fd {
int fd{-1};
unique_fd() = default;
diff --git a/src/wayland.cpp b/src/wayland.cpp
index 4a723e5..4d6fc3d 100644
--- a/src/wayland.cpp
+++ b/src/wayland.cpp
@@ -20,20 +20,14 @@
#include "wayland.hpp"
#include "hmi-debug.h"
-// _
-// _ __ __ _ _ __ ___ ___ ___ _ __ __ _ ___ ___ __ _| |
-// | '_ \ / _` | '_ ` _ \ / _ \/ __| '_ \ / _` |/ __/ _ \ \ \ /\ / / |
-// | | | | (_| | | | | | | __/\__ \ |_) | (_| | (_| __/ \ V V /| |
-// |_| |_|\__,_|_| |_| |_|\___||___/ .__/ \__,_|\___\___| \_/\_/ |_|
-// |_|
+/**
+ * namespace wl
+ */
namespace wl {
-// _ _ _
-// __| (_)___ _ __ | | __ _ _ _
-// / _` | / __| '_ \| |/ _` | | | |
-// | (_| | \__ \ |_) | | (_| | |_| |
-// \__,_|_|___/ .__/|_|\__,_|\__, |
-// |_| |___/
+/**
+ * display
+ */
display::display()
: d(std::unique_ptr<struct wl_display, void (*)(struct wl_display *)>(
wl_display_connect(nullptr), &wl_display_disconnect)),
@@ -49,7 +43,6 @@ int display::dispatch_pending() { return wl_display_dispatch_pending(this->d.get
int display::read_events() {
ST();
- // XXX: uhm, how?!
while (wl_display_prepare_read(this->d.get()) == -1) {
STN(pending_events_dispatch);
if (wl_display_dispatch_pending(this->d.get()) == -1) {
@@ -74,12 +67,9 @@ int display::get_fd() const { return wl_display_get_fd(this->d.get()); }
int display::get_error() { return wl_display_get_error(this->d.get()); }
-// _ _
-// _ __ ___ __ _(_)___| |_ _ __ _ _
-// | '__/ _ \/ _` | / __| __| '__| | | |
-// | | | __/ (_| | \__ \ |_| | | |_| |
-// |_| \___|\__, |_|___/\__|_| \__, |
-// |___/ |___/
+/**
+ * registry
+ */
namespace {
void registry_global(void *data, struct wl_registry * /*r*/, uint32_t name,
char const *iface, uint32_t v) {
@@ -117,12 +107,9 @@ void registry::global(uint32_t name, char const *iface, uint32_t v) {
void registry::global_remove(uint32_t /*name*/) {}
-// _ _
-// ___ _ _| |_ _ __ _ _| |_
-// / _ \| | | | __| '_ \| | | | __|
-// | (_) | |_| | |_| |_) | |_| | |_
-// \___/ \__,_|\__| .__/ \__,_|\__|
-// |_|
+/**
+ * output
+ */
namespace {
void output_geometry(void *data, struct wl_output * /*wl_output*/, int32_t x,
int32_t y, int32_t physical_width, int32_t physical_height,
@@ -188,21 +175,14 @@ void output::scale(int32_t factor) {
}
} // namespace wl
-// _ __ __ _ _ __ ___ ___ ___ _ __ __ _ ___ ___
-// | '_ \ / _` | '_ ` _ \ / _ \/ __| '_ \ / _` |/ __/ _ \
-// | | | | (_| | | | | | | __/\__ \ |_) | (_| | (_| __/
-// |_| |_|\__,_|_| |_| |_|\___||___/ .__/ \__,_|\___\___|
-// |_|
-
-// namespace compositor
+/**
+ * namespace compositor
+ */
namespace compositor {
-// _ _ _
-// ___ ___ _ __ | |_ _ __ ___ | | | ___ _ __
-// / __/ _ \| '_ \| __| '__/ _ \| | |/ _ \ '__|
-// | (_| (_) | | | | |_| | | (_) | | | __/ |
-// \___\___/|_| |_|\__|_| \___/|_|_|\___|_|
-//
+/**
+ * controller
+ */
namespace {
void controller_screen(void *data, struct ivi_controller * /*ivi_controller*/,
uint32_t id_screen,
@@ -278,12 +258,9 @@ void controller::controller_error(int32_t object_id, int32_t object_type,
this->proxy.get(), object_id, object_type, error_code, error_text);
}
-// _
-// | | __ _ _ _ ___ _ __
-// | |/ _` | | | |/ _ \ '__|
-// | | (_| | |_| | __/ |
-// |_|\__,_|\__, |\___|_|
-// |___/
+/**
+ * layer
+ */
namespace {
void layer_visibility(void *data,
struct ivi_controller_layer * /*ivi_controller_layer*/,
@@ -462,12 +439,9 @@ void controller::layer_destroyed(struct layer *l) {
this->layers.erase(l->id);
}
-// __
-// ___ _ _ _ __ / _| __ _ ___ ___
-// / __| | | | '__| |_ / _` |/ __/ _ \
-// \__ \ |_| | | | _| (_| | (_| __/
-// |___/\__,_|_| |_| \__,_|\___\___|
-//
+/**
+ * surface
+ */
namespace {
void surface_visibility(
@@ -684,7 +658,6 @@ void controller::surface_stats(struct surface *s, uint32_t redraw_count,
void controller::surface_destroyed(struct surface *s) {
HMI_DEBUG("wm", "compositor::surface %s @ %d", __func__, s->id);
this->chooks->surface_removed(s->id);
- // XXX: do I need to actually remove the surface late, i.e. using add_task()?
this->sprops.erase(s->id);
this->surfaces.erase(s->id);
}
@@ -693,7 +666,6 @@ void controller::surface_content(struct surface *s, int32_t content_state) {
HMI_DEBUG("wm", "compositor::surface %s @ %d s %i", __func__, s->id,
content_state);
if (content_state == IVI_CONTROLLER_SURFACE_CONTENT_STATE_CONTENT_REMOVED) {
- // XXX is this the right thing to do?
this->chooks->surface_removed(s->id);
this->sprops.erase(s->id);
this->surfaces.erase(s->id);
@@ -734,12 +706,9 @@ void controller::remove_proxy_to_id_mapping(struct wl_output *p) {
this->screen_proxy_to_id.erase(uintptr_t(p));
}
-//
-// ___ ___ _ __ ___ ___ _ __
-// / __|/ __| '__/ _ \/ _ \ '_ \
-// \__ \ (__| | | __/ __/ | | |
-// |___/\___|_| \___|\___|_| |_|
-//
+/**
+ * screen
+ */
screen::screen(uint32_t i, struct controller *c,
struct ivi_controller_screen *p)
: wayland_proxy(p), controller_child(c, i) {
diff --git a/src/wayland.hpp b/src/wayland.hpp
index b72edc6..59d7ade 100644
--- a/src/wayland.hpp
+++ b/src/wayland.hpp
@@ -26,12 +26,9 @@
#include <unordered_map>
#include <vector>
-// _ _
-// __ ____ _ _ _| | __ _ _ __ __| | _ __ _ __ _____ ___ _
-// \ \ /\ / / _` | | | | |/ _` | '_ \ / _` | | '_ \| '__/ _ \ \/ / | | |
-// \ V V / (_| | |_| | | (_| | | | | (_| | | |_) | | | (_) > <| |_| |
-// \_/\_/ \__,_|\__, |_|\__,_|_| |_|\__,_|____| .__/|_| \___/_/\_\\__, |
-// |___/ |_____|_| |___/
+/**
+ * @struct wayland_proxy
+ */
template <typename ProxyT>
struct wayland_proxy {
std::unique_ptr<ProxyT, std::function<void(ProxyT *)>> proxy;
@@ -45,19 +42,14 @@ struct wayland_proxy {
static_cast<ProxyT *>(p), p_del)) {}
};
-// _
-// _ __ __ _ _ __ ___ ___ ___ _ __ __ _ ___ ___ __ _| |
-// | '_ \ / _` | '_ ` _ \ / _ \/ __| '_ \ / _` |/ __/ _ \ \ \ /\ / / |
-// | | | | (_| | | | | | | __/\__ \ |_) | (_| | (_| __/ \ V V /| |
-// |_| |_|\__,_|_| |_| |_|\___||___/ .__/ \__,_|\___\___| \_/\_/ |_|
-// |_|
+/**
+ * namespace wl
+ */
namespace wl {
-// _ _
-// _ __ ___ __ _(_)___| |_ _ __ _ _
-// | '__/ _ \/ _` | / __| __| '__| | | |
-// | | | __/ (_| | \__ \ |_| | | |_| |
-// |_| \___|\__, |_|___/\__|_| \__, |
-// |___/ |___/
+
+/**
+ * @struct registry
+ */
struct registry : public wayland_proxy<struct wl_registry> {
typedef std::function<void(struct wl_registry *, uint32_t, uint32_t)> binder;
std::unordered_map<std::string, binder> bindings;
@@ -73,12 +65,9 @@ struct registry : public wayland_proxy<struct wl_registry> {
void global_remove(uint32_t name);
};
-// _ _ _
-// __| (_)___ _ __ | | __ _ _ _
-// / _` | / __| '_ \| |/ _` | | | |
-// | (_| | \__ \ |_) | | (_| | |_| |
-// \__,_|_|___/ .__/|_|\__,_|\__, |
-// |_| |___/
+/**
+ * @struct display
+ */
struct display {
std::unique_ptr<struct wl_display, void (*)(struct wl_display *)> d;
struct registry r;
@@ -101,12 +90,9 @@ struct display {
}
};
-// _ _
-// ___ _ _| |_ _ __ _ _| |_
-// / _ \| | | | __| '_ \| | | | __|
-// | (_) | |_| | |_| |_) | |_| | |_
-// \___/ \__,_|\__| .__/ \__,_|\__|
-// |_|
+/**
+ * @struct output
+ */
struct output : wayland_proxy<struct wl_output> {
int width{};
int height{};
@@ -126,14 +112,9 @@ struct output : wayland_proxy<struct wl_output> {
};
} // namespace wl
-// _ __ __ _ _ __ ___ ___ ___ _ __ __ _ ___ ___
-// | '_ \ / _` | '_ ` _ \ / _ \/ __| '_ \ / _` |/ __/ _ \
-// | | | | (_| | | | | | | __/\__ \ |_) | (_| | (_| __/
-// |_| |_|\__,_|_| |_| |_|\___||___/ .__/ \__,_|\___\___|
-// |_|
-// _ _
-
-// namespace compositor
+/**
+ * namespace compositor
+ */
namespace compositor {
struct size {
@@ -173,12 +154,9 @@ struct surface_properties {
float opacity;
};
-// __
-// ___ _ _ _ __ / _| __ _ ___ ___
-// / __| | | | '__| |_ / _` |/ __/ _ \
-// \__ \ |_| | | | _| (_| | (_| __/
-// |___/\__,_|_| |_| \__,_|\___\___|
-//
+/**
+ * @struct surface
+ */
struct surface : public wayland_proxy<struct ivi_controller_surface>,
controller_child {
surface(surface const &) = delete;
@@ -199,12 +177,9 @@ struct surface : public wayland_proxy<struct ivi_controller_surface>,
void destroy(int32_t destroy_scene_object);
};
-// _
-// | | __ _ _ _ ___ _ __
-// | |/ _` | | | |/ _ \ '__|
-// | | (_| | |_| | __/ |
-// |_|\__,_|\__, |\___|_|
-// |___/
+/**
+ * @struct layer
+ */
struct layer : public wayland_proxy<struct ivi_controller_layer>,
controller_child {
layer(layer const &) = delete;
@@ -228,12 +203,9 @@ struct layer : public wayland_proxy<struct ivi_controller_layer>,
void set_render_order(std::vector<uint32_t> const &ro);
};
-//
-// ___ ___ _ __ ___ ___ _ __
-// / __|/ __| '__/ _ \/ _ \ '_ \
-// \__ \ (__| | | __/ __/ | | |
-// |___/\___|_| \___|\___|_| |_|
-//
+/**
+ * @struct screen
+ */
struct screen : public wayland_proxy<struct ivi_controller_screen>,
controller_child {
screen(screen const &) = delete;
@@ -244,12 +216,9 @@ struct screen : public wayland_proxy<struct ivi_controller_screen>,
void set_render_order(std::vector<uint32_t> const &ro);
};
-// _ _ _
-// ___ ___ _ __ | |_ _ __ ___ | | | ___ _ __
-// / __/ _ \| '_ \| __| '__/ _ \| | |/ _ \ '__|
-// | (_| (_) | | | | |_| | | (_) | | | __/ |
-// \___\___/|_| |_|\__|_| \___/|_|_|\___|_|
-//
+/**
+ * @struct controller
+ */
struct controller : public wayland_proxy<struct ivi_controller> {
// This controller is still missing ivi-input