diff --git a/src/compositor_ng.h b/src/compositor_ng.h index ee786930..d7360964 100644 --- a/src/compositor_ng.h +++ b/src/compositor_ng.h @@ -7,8 +7,8 @@ * Copyright (c) 2022, Hannes Winkler */ -#ifndef _FLUTTERPI_INCLUDE_COMPOSITOR_NG_H -#define _FLUTTERPI_INCLUDE_COMPOSITOR_NG_H +#ifndef _FLUTTERPI_SRC_COMPOSITOR_NG_H +#define _FLUTTERPI_SRC_COMPOSITOR_NG_H #include @@ -203,4 +203,4 @@ DECLARE_REF_OPS(fl_layer_composition) size_t fl_layer_composition_get_n_layers(struct fl_layer_composition *composition); struct fl_layer *fl_layer_composition_peek_layer(struct fl_layer_composition *composition, int layer); -#endif // _FLUTTERPI_INCLUDE_COMPOSITOR_NG_H +#endif // _FLUTTERPI_SRC_COMPOSITOR_NG_H diff --git a/src/cursor.h b/src/cursor.h index af313adf..270404e7 100644 --- a/src/cursor.h +++ b/src/cursor.h @@ -1,5 +1,15 @@ -#ifndef _CURSOR_H -#define _CURSOR_H +// SPDX-License-Identifier: MIT +/* + * Cursor Images + * + * Contains all the mouse cursor images in compressed form, + * and some utilities for using them. + * + * Copyright (c) 2023, Hannes Winkler + */ + +#ifndef _FLUTTERPI_SRC_CURSOR_H +#define _FLUTTERPI_SRC_CURSOR_H #include @@ -58,4 +68,4 @@ struct vec2i pointer_icon_get_hotspot(const struct pointer_icon *icon); void *pointer_icon_dup_pixels(const struct pointer_icon *icon); -#endif +#endif // _FLUTTERPI_SRC_CURSOR_H diff --git a/src/dmabuf_surface.h b/src/dmabuf_surface.h index db030b6a..0050e3ac 100644 --- a/src/dmabuf_surface.h +++ b/src/dmabuf_surface.h @@ -7,8 +7,8 @@ * Copyright (c) 2022, Hannes Winkler */ -#ifndef _FLUTTERPI_INCLUDE_DMABUF_SURFACE_H -#define _FLUTTERPI_INCLUDE_DMABUF_SURFACE_H +#ifndef _FLUTTERPI_SRC_DMABUF_SURFACE_H +#define _FLUTTERPI_SRC_DMABUF_SURFACE_H #include "pixel_format.h" @@ -44,4 +44,4 @@ int dmabuf_surface_push_dmabuf(struct dmabuf_surface *s, const struct dmabuf *bu ATTR_PURE int64_t dmabuf_surface_get_texture_id(struct dmabuf_surface *s); -#endif // _FLUTTERPI_INCLUDE_DMABUF_SURFACE_H +#endif // _FLUTTERPI_SRC_DMABUF_SURFACE_H diff --git a/src/dummy_render_surface.h b/src/dummy_render_surface.h index e8a4c8c1..dacabb0e 100644 --- a/src/dummy_render_surface.h +++ b/src/dummy_render_surface.h @@ -1,15 +1,14 @@ // SPDX-License-Identifier: MIT /* - * Vulkan GBM render surface + * Dummy render surface * - * - used as a render target for flutter vulkan rendering - * - can be scanned out using KMS + * Just a render surface that does nothing when presenting. * - * Copyright (c) 2022, Hannes Winkler + * Copyright (c) 2023, Hannes Winkler */ -#ifndef _FLUTTERPI_INCLUDE_DUMMY_RENDER_SURFACE_H -#define _FLUTTERPI_INCLUDE_DUMMY_RENDER_SURFACE_H +#ifndef _FLUTTERPI_SRC_DUMMY_RENDER_SURFACE_H +#define _FLUTTERPI_SRC_DUMMY_RENDER_SURFACE_H #include "util/geometry.h" @@ -26,4 +25,4 @@ ATTR_PURE struct dummy_render_surface *__checked_cast_dummy_render_surface(void struct dummy_render_surface *dummy_render_surface_new(struct tracer *tracer, struct vec2i size); -#endif // _FLUTTERPI_INCLUDE_DUMMY_RENDER_SURFACE_H +#endif // _FLUTTERPI_SRC_DUMMY_RENDER_SURFACE_H diff --git a/src/egl.h b/src/egl.h index 2cb80f52..9a9a936c 100644 --- a/src/egl.h +++ b/src/egl.h @@ -5,8 +5,8 @@ * Copyright (c) 2022, Hannes Winkler */ -#ifndef _FLUTTERPI_INCLUDE_EGL_H -#define _FLUTTERPI_INCLUDE_EGL_H +#ifndef _FLUTTERPI_SRC_EGL_H +#define _FLUTTERPI_SRC_EGL_H #include #include @@ -478,4 +478,4 @@ static inline const char *egl_strerror(EGLenum result) { #define LOG_EGL_ERROR(result, fmt, ...) LOG_ERROR(fmt ": %s\n", __VA_ARGS__ egl_strerror(result)) #endif -#endif // _FLUTTERPI_INCLUDE_EGL_H +#endif // _FLUTTERPI_SRC_EGL_H diff --git a/src/egl_gbm_render_surface.h b/src/egl_gbm_render_surface.h index 110a4c2e..ad7f0284 100644 --- a/src/egl_gbm_render_surface.h +++ b/src/egl_gbm_render_surface.h @@ -7,8 +7,8 @@ * Copyright (c) 2022, Hannes Winkler */ -#ifndef _FLUTTERPI_INCLUDE_EGL_GBM_RENDER_SURFACE_H -#define _FLUTTERPI_INCLUDE_EGL_GBM_RENDER_SURFACE_H +#ifndef _FLUTTERPI_SRC_EGL_GBM_RENDER_SURFACE_H +#define _FLUTTERPI_SRC_EGL_GBM_RENDER_SURFACE_H #include "compositor_ng.h" #include "pixel_format.h" @@ -49,4 +49,4 @@ ATTR_PURE EGLSurface egl_gbm_render_surface_get_egl_surface(struct egl_gbm_rende ATTR_PURE EGLConfig egl_gbm_render_surface_get_egl_config(struct egl_gbm_render_surface *s); -#endif // _FLUTTERPI_INCLUDE_EGL_GBM_RENDER_SURFACE_H +#endif // _FLUTTERPI_SRC_EGL_GBM_RENDER_SURFACE_H diff --git a/src/event_loop.h b/src/event_loop.h index db423f2f..62edabe7 100644 --- a/src/event_loop.h +++ b/src/event_loop.h @@ -1,5 +1,14 @@ -#ifndef _EVENT_LOOP_H -#define _EVENT_LOOP_H +// SPDX-License-Identifier: MIT +/* + * Event Loop + * + * - multithreaded event loop + * + * Copyright (c) 2023, Hannes Winkler + */ + +#ifndef _FLUTTERPI_SRC_EVENT_LOOP_H +#define _FLUTTERPI_SRC_EVENT_LOOP_H #include "util/refcounting.h" @@ -49,4 +58,4 @@ struct evloop *evthread_get_evloop(struct evthread *thread); void evthread_join(struct evthread *thread); -#endif // _EVENT_LOOP_H \ No newline at end of file +#endif // _FLUTTERPI_SRC_EVENT_LOOP_H diff --git a/src/filesystem_layout.h b/src/filesystem_layout.h index 8adaa518..8a3b4efa 100644 --- a/src/filesystem_layout.h +++ b/src/filesystem_layout.h @@ -7,8 +7,8 @@ * Copyright (c) 2022, Hannes Winkler */ -#ifndef _FLUTTERPI_INCLUDE_FILESYSTEM_LAYOUT_H -#define _FLUTTERPI_INCLUDE_FILESYSTEM_LAYOUT_H +#ifndef _FLUTTERPI_SRC_FILESYSTEM_LAYOUT_H +#define _FLUTTERPI_SRC_FILESYSTEM_LAYOUT_H #include "flutter-pi.h" @@ -30,4 +30,4 @@ void flutter_paths_free(struct flutter_paths *paths); struct flutter_paths *fs_layout_flutterpi_resolve(const char *app_bundle_path, enum flutter_runtime_mode runtime_mode); struct flutter_paths *fs_layout_metaflutter_resolve(const char *app_bundle_path, enum flutter_runtime_mode runtime_mode); -#endif // _FLUTTERPI_INCLUDE_FILESYSTEM_LAYOUT_H +#endif // _FLUTTERPI_SRC_FILESYSTEM_LAYOUT_H diff --git a/src/flutter-pi.h b/src/flutter-pi.h index 21a37d40..e1203a63 100644 --- a/src/flutter-pi.h +++ b/src/flutter-pi.h @@ -1,5 +1,12 @@ -#ifndef _FLUTTERPI_H -#define _FLUTTERPI_H +// SPDX-License-Identifier: MIT +/* + * Flutter-Pi main header + * + * Copyright (c) 2023, Hannes Winkler + */ + +#ifndef _FLUTTERPI_SRC_FLUTTERPI_H +#define _FLUTTERPI_SRC_FLUTTERPI_H #define LOG_FLUTTERPI_ERROR(...) fprintf(stderr, "[flutter-pi] " __VA_ARGS__) @@ -157,4 +164,4 @@ void flutterpi_trace_event_begin(struct flutterpi *flutterpi, const char *name); void flutterpi_trace_event_end(struct flutterpi *flutterpi, const char *name); -#endif +#endif // _FLUTTERPI_SRC_FLUTTERPI_H diff --git a/src/frame_scheduler.h b/src/frame_scheduler.h index 1f038502..229d9e59 100644 --- a/src/frame_scheduler.h +++ b/src/frame_scheduler.h @@ -7,8 +7,8 @@ * Copyright (c) 2022, Hannes Winkler */ -#ifndef _FLUTTERPI_INCLUDE_FRAME_SCHEDULER_H -#define _FLUTTERPI_INCLUDE_FRAME_SCHEDULER_H +#ifndef _FLUTTERPI_SRC_FRAME_SCHEDULER_H +#define _FLUTTERPI_SRC_FRAME_SCHEDULER_H #include "util/collection.h" #include "util/refcounting.h" @@ -80,4 +80,4 @@ void frame_scheduler_on_fb_released(struct frame_scheduler *scheduler, bool has_ */ void frame_scheduler_present_frame(struct frame_scheduler *scheduler, void_callback_t present_cb, void *userdata, void_callback_t cancel_cb); -#endif // _FLUTTERPI_INCLUDE_FRAME_SCHEDULER_H +#endif // _FLUTTERPI_SRC_FRAME_SCHEDULER_H diff --git a/src/gl_renderer.h b/src/gl_renderer.h index 831ad55a..d6c8160a 100644 --- a/src/gl_renderer.h +++ b/src/gl_renderer.h @@ -11,8 +11,8 @@ * Copyright (c) 2022, Hannes Winkler */ -#ifndef _FLUTTERPI_INCLUDE_EGL_GL_RENDERER_H -#define _FLUTTERPI_INCLUDE_EGL_GL_RENDERER_H +#ifndef _FLUTTERPI_SRC_GL_RENDERER_H +#define _FLUTTERPI_SRC_GL_RENDERER_H #include "pixel_format.h" #include "util/collection.h" @@ -85,4 +85,4 @@ EGLSurface gl_renderer_create_gbm_window_surface( const EGLint *int_attrib_list ); -#endif // _FLUTTERPI_INCLUDE_EGL_GL_RENDERER_H +#endif // _FLUTTERPI_SRC_GL_RENDERER_H diff --git a/src/gles.h b/src/gles.h index 5095f919..00c4edfd 100644 --- a/src/gles.h +++ b/src/gles.h @@ -5,8 +5,8 @@ * Copyright (c) 2022, Hannes Winkler */ -#ifndef _FLUTTERPI_INCLUDE_GLES_H -#define _FLUTTERPI_INCLUDE_GLES_H +#ifndef _FLUTTERPI_SRC_GLES_H +#define _FLUTTERPI_SRC_GLES_H #include "config.h" @@ -17,4 +17,4 @@ #include #include -#endif // _FLUTTERPI_INCLUDE_GLES_H +#endif // _FLUTTERPI_SRC_GLES_H diff --git a/src/keyboard.h b/src/keyboard.h index e41b77e0..a72ac25b 100644 --- a/src/keyboard.h +++ b/src/keyboard.h @@ -1,5 +1,14 @@ -#ifndef KEYBOARD_H -#define KEYBOARD_H +// SPDX-License-Identifier: MIT +/* + * Keyboard / Text Input support + * + * Converts key events to text events using the system keyboard config. + * + * Copyright (c) 2023, Hannes Winkler + */ + +#ifndef _FLUTTERPI_SRC_KEYBOARD_H +#define _FLUTTERPI_SRC_KEYBOARD_H #include @@ -94,4 +103,4 @@ static inline struct keyboard_modifier_state keyboard_state_get_meta_state(struc }; } -#endif +#endif // _FLUTTERPI_SRC_KEYBOARD_H diff --git a/src/locales.h b/src/locales.h index c94da195..04da3788 100644 --- a/src/locales.h +++ b/src/locales.h @@ -1,5 +1,14 @@ -#ifndef _LOCALES_H -#define _LOCALES_H +// SPDX-License-Identifier: MIT +/* + * Locales + * + * Provides the configured system locales in a flutter-friendly form. + * + * Copyright (c) 2023, Hannes Winkler + */ + +#ifndef _FLUTTERPI_SRC_LOCALES_H +#define _FLUTTERPI_SRC_LOCALES_H #include @@ -36,4 +45,4 @@ locales_on_compute_platform_resolved_locale(struct locales *locales, const Flutt void locales_print(const struct locales *locales); -#endif +#endif // _FLUTTERPI_SRC_LOCALES_H diff --git a/src/modesetting.h b/src/modesetting.h index bbd4461a..91de16d1 100644 --- a/src/modesetting.h +++ b/src/modesetting.h @@ -9,8 +9,8 @@ * Copyright (c) 2022, Hannes Winkler */ -#ifndef _FLUTTERPI_INCLUDE_MODESETTING_H -#define _FLUTTERPI_INCLUDE_MODESETTING_H +#ifndef _FLUTTERPI_SRC_MODESETTING_H +#define _FLUTTERPI_SRC_MODESETTING_H #include @@ -916,4 +916,4 @@ drmModeModeInfo *__next_mode(const struct drm_connector *connector, const drmMod #define for_each_unreserved_plane_in_atomic_req(atomic_req, plane) for_each_pointer_in_pset(&(atomic_req)->available_planes, plane) -#endif // _FLUTTERPI_INCLUDE_MODESETTING_H +#endif // _FLUTTERPI_SRC_MODESETTING_H diff --git a/src/notifier_listener.h b/src/notifier_listener.h index b5c739b4..3861182e 100644 --- a/src/notifier_listener.h +++ b/src/notifier_listener.h @@ -1,5 +1,17 @@ -#ifndef _FLUTTERPI_INCLUDE_NOTIFIER_LISTENER_H -#define _FLUTTERPI_INCLUDE_NOTIFIER_LISTENER_H +// SPDX-License-Identifier: MIT +/* + * Notifier/Listener + * + * Basically a nicer wrapper around callbacks. + * + * Notifiers are event sources that can be listened to. A listener + * is a callbacks that's registered for listening to a notifier. + * + * Copyright (c) 2023, Hannes Winkler + */ + +#ifndef _FLUTTERPI_SRC_NOTIFIER_LISTENER_H +#define _FLUTTERPI_SRC_NOTIFIER_LISTENER_H #include "util/collection.h" #include "util/list.h" @@ -130,4 +142,4 @@ int notifier_unlisten(struct notifier *notifier, struct listener *listener); */ void notifier_notify(struct notifier *notifier, void *arg); -#endif // _FLUTTERPI_INCLUDE_NOTIFIER_LISTENER_H +#endif // _FLUTTERPI_SRC_NOTIFIER_LISTENER_H diff --git a/src/pixel_format.h b/src/pixel_format.h index f5971826..b4befd79 100644 --- a/src/pixel_format.h +++ b/src/pixel_format.h @@ -1,5 +1,18 @@ -#ifndef _FLUTTERPI_INCLUDE_PIXEL_FORMAT_H -#define _FLUTTERPI_INCLUDE_PIXEL_FORMAT_H +// SPDX-License-Identifier: MIT +/* + * Pixel Formats + * + * A list of pixel formats that flutter-pi supports, with details + * about their composition. + * + * Provides a translations between DRM, EGL/GL, fbdev, vulkan and + * flutter software pixel foramts. + * + * Copyright (c) 2023, Hannes Winkler + */ + +#ifndef _FLUTTERPI_SRC_PIXEL_FORMAT_H +#define _FLUTTERPI_SRC_PIXEL_FORMAT_H #include @@ -387,4 +400,4 @@ COMPILE_ASSERT(PIXFMT_RGB565 == 0); #define ASSERT_PIXFMT_VALID(format) ASSERT_MSG(format >= PIXFMT_RGB565 && format <= PIXFMT_MAX, "Invalid pixel format") #define ASSUME_PIXFMT_VALID(format) ASSUME((format) >= PIXFMT_RGB565 && (format) <= PIXFMT_MAX) -#endif // _FLUTTERPI_INCLUDE_PIXEL_FORMAT_H +#endif // _FLUTTERPI_SRC_PIXEL_FORMAT_H diff --git a/src/platformchannel.h b/src/platformchannel.h index a49ff604..68cfef6e 100644 --- a/src/platformchannel.h +++ b/src/platformchannel.h @@ -1,5 +1,19 @@ -#ifndef _METHODCHANNEL_H -#define _METHODCHANNEL_H +// SPDX-License-Identifier: MIT +/* + * Platform Channels + * + * Encoding/Decoding of flutter platform messages, with different + * + * Supported codecs: + * - standard message & method codec, + * - json message & method codec + * - pigeon (not really a codec) + * + * Copyright (c) 2023, Hannes Winkler + */ + +#ifndef _FLUTTERPI_SRC_PLATFORMCHANNEL_H +#define _FLUTTERPI_SRC_PLATFORMCHANNEL_H #include #include @@ -1624,4 +1638,4 @@ ATTR_PURE const struct raw_std_value *raw_std_method_call_get_arg(const struct r #define for_each_element_in_raw_std_list(value, list) \ for_each_element_in_raw_std_list_indexed(UNIQUE_NAME(__raw_std_list_element_index), value, list) -#endif +#endif // _FLUTTERPI_SRC_PLATFORMCHANNEL_H diff --git a/src/pluginregistry.h b/src/pluginregistry.h index 32ecd5aa..4efe6bf8 100644 --- a/src/pluginregistry.h +++ b/src/pluginregistry.h @@ -1,5 +1,14 @@ -#ifndef FLUTTER_PI_REGISTRY_H_ -#define FLUTTER_PI_REGISTRY_H_ +// SPDX-License-Identifier: MIT +/* + * Plugin Registry + * + * Initializes & deinitializes plugins, manages registration of plugins. + * + * Copyright (c) 2023, Hannes Winkler + */ + +#ifndef _FLUTTERPI_SRC_PLUGINREGISTRY_H +#define _FLUTTERPI_SRC_PLUGINREGISTRY_H #include @@ -165,4 +174,4 @@ void static_plugin_registry_remove_plugin(const char *plugin_name); \ __attribute__((destructor)) static void __unreg_plugin_##_identifier_name() { static_plugin_registry_remove_plugin(_name); } -#endif +#endif // _FLUTTERPI_SRC_PLUGINREGISTRY_H diff --git a/src/render_surface.h b/src/render_surface.h index 3d9cda9e..994742e1 100644 --- a/src/render_surface.h +++ b/src/render_surface.h @@ -13,8 +13,8 @@ * Copyright (c) 2022, Hannes Winkler */ -#ifndef _FLUTTERPI_INCLUDE_RENDER_SURFACE_H -#define _FLUTTERPI_INCLUDE_RENDER_SURFACE_H +#ifndef _FLUTTERPI_SRC_RENDER_SURFACE_H +#define _FLUTTERPI_SRC_RENDER_SURFACE_H #include @@ -35,4 +35,4 @@ int render_surface_fill(struct render_surface *store, FlutterBackingStore *fl_st int render_surface_queue_present(struct render_surface *store, const FlutterBackingStore *fl_store); -#endif // _FLUTTERPI_INCLUDE_BACKING_STORE_H +#endif // _FLUTTERPI_SRC_BACKING_STORE_H diff --git a/src/render_surface_private.h b/src/render_surface_private.h index a742e246..d93e1aed 100644 --- a/src/render_surface_private.h +++ b/src/render_surface_private.h @@ -8,8 +8,8 @@ * Copyright (c) 2022, Hannes Winkler */ -#ifndef _FLUTTERPI_INCLUDE_RENDER_SURFACE_PRIVATE_H -#define _FLUTTERPI_INCLUDE_RENDER_SURFACE_PRIVATE_H +#ifndef _FLUTTERPI_SRC_RENDER_SURFACE_PRIVATE_H +#define _FLUTTERPI_SRC_RENDER_SURFACE_PRIVATE_H #include @@ -33,4 +33,4 @@ int render_surface_init(struct render_surface *surface, struct tracer *tracer, s void render_surface_deinit(struct surface *s); -#endif // _FLUTTERPI_INCLUDE_BACKING_STORE_PRIVATE_H +#endif // _FLUTTERPI_SRC_RENDER_SURFACE_PRIVATE_H diff --git a/src/surface.h b/src/surface.h index 24d930a3..8d6b2987 100644 --- a/src/surface.h +++ b/src/surface.h @@ -7,8 +7,8 @@ * Copyright (c) 2022, Hannes Winkler */ -#ifndef _FLUTTERPI_INCLUDE_SURFACE_H -#define _FLUTTERPI_INCLUDE_SURFACE_H +#ifndef _FLUTTERPI_SRC_SURFACE_H +#define _FLUTTERPI_SRC_SURFACE_H #include "util/collection.h" #include "util/lock_ops.h" @@ -44,4 +44,4 @@ int surface_present_kms(struct surface *s, const struct fl_layer_props *props, s int surface_present_fbdev(struct surface *s, const struct fl_layer_props *props, struct fbdev_commit_builder *builder); -#endif // _FLUTTERPI_INCLUDE_SURFACE_H +#endif // _FLUTTERPI_SRC_SURFACE_H diff --git a/src/surface_private.h b/src/surface_private.h index 2d0931c8..72488a3b 100644 --- a/src/surface_private.h +++ b/src/surface_private.h @@ -7,8 +7,8 @@ * Copyright (c) 2022, Hannes Winkler */ -#ifndef _FLUTTERPI_INCLUDE_SURFACE_PRIVATE_H -#define _FLUTTERPI_INCLUDE_SURFACE_PRIVATE_H +#ifndef _FLUTTERPI_SRC_SURFACE_PRIVATE_H +#define _FLUTTERPI_SRC_SURFACE_PRIVATE_H #include @@ -41,4 +41,4 @@ int surface_init(struct surface *s, struct tracer *tracer); void surface_deinit(struct surface *s); -#endif // _FLUTTERPI_INCLUDE_SURFACE_PRIVATE_H +#endif // _FLUTTERPI_SRC_SURFACE_PRIVATE_H diff --git a/src/texture_registry.h b/src/texture_registry.h index 55b2803f..cc30122a 100644 --- a/src/texture_registry.h +++ b/src/texture_registry.h @@ -1,5 +1,14 @@ -#ifndef _TEXTURE_REGISTRY_H -#define _TEXTURE_REGISTRY_H +// SPDX-License-Identifier: MIT +/* + * Texture Registry + * + * Manages flutter external texture registration, texture frame callbacks. + * + * Copyright (c) 2023, Hannes Winkler + */ + +#ifndef _FLUTTERPI_SRC_TEXTURE_REGISTRY_H +#define _FLUTTERPI_SRC_TEXTURE_REGISTRY_H #include @@ -69,4 +78,4 @@ int texture_push_unresolved_frame(struct texture *texture, const struct unresolv void texture_destroy(struct texture *texture); -#endif +#endif // _FLUTTERPI_SRC_TEXTURE_REGISTRY_H diff --git a/src/tracer.h b/src/tracer.h index a15b8385..896ee686 100644 --- a/src/tracer.h +++ b/src/tracer.h @@ -5,8 +5,8 @@ * Copyright (c) 2022, Hannes Winkler */ -#ifndef _FLUTTERPI_INCLUDE_TRACER_H -#define _FLUTTERPI_INCLUDE_TRACER_H +#ifndef _FLUTTERPI_SRC_TRACER_H +#define _FLUTTERPI_SRC_TRACER_H #include @@ -77,4 +77,4 @@ void tracer_set_cbs( return tracer_instant(obj_var_name->tracer_member_name, name); \ } -#endif // _FLUTTERPI_INCLUDE_TRACER_H +#endif // _FLUTTERPI_SRC_TRACER_H diff --git a/src/user_input.h b/src/user_input.h index 1d9456f4..ae5b382c 100644 --- a/src/user_input.h +++ b/src/user_input.h @@ -1,5 +1,15 @@ -#ifndef USER_INPUT_H_ -#define USER_INPUT_H_ +// SPDX-License-Identifier: MIT +/* + * User Input + * + * Collects user input from libinput, transforms it (partially into + * more flutter compatible forms), and calls configured handler callbacks. + * + * Copyright (c) 2023, Hannes Winkler + */ + +#ifndef _FLUTTERPI_SRC_USER_INPUT_H +#define _FLUTTERPI_SRC_USER_INPUT_H #include #include @@ -336,4 +346,4 @@ void user_input_suspend(struct user_input *input); int user_input_resume(struct user_input *input); -#endif +#endif // _FLUTTERPI_SRC_USER_INPUT_H diff --git a/src/util/asserts.h b/src/util/asserts.h index f474f5aa..b2926833 100644 --- a/src/util/asserts.h +++ b/src/util/asserts.h @@ -1,5 +1,12 @@ -#ifndef _UTIL_ASSERTS_H -#define _UTIL_ASSERTS_H +// SPDX-License-Identifier: MIT +/* + * Common assert macros + * + * Copyright (c) 2023, Hannes Winkler + */ + +#ifndef _FLUTTERPI_SRC_UTIL_ASSERTS_H +#define _FLUTTERPI_SRC_UTIL_ASSERTS_H #include @@ -36,4 +43,4 @@ #define COMPILE_ASSERT_MSG(expression, msg) _Static_assert(expression, msg) #define COMPILE_ASSERT(expression) COMPILE_ASSERT_MSG(expression, "Expression evaluates to false") -#endif // _UTIL_ASSERTS_H +#endif // _FLUTTERPI_SRC_UTIL_ASSERTS_H diff --git a/src/util/collection.h b/src/util/collection.h index 2a891731..bbc48d23 100644 --- a/src/util/collection.h +++ b/src/util/collection.h @@ -1,5 +1,12 @@ -#ifndef _COLLECTION_H -#define _COLLECTION_H +// SPDX-License-Identifier: MIT +/* + * Collection - common useful functions & macros + * + * Copyright (c) 2023, Hannes Winkler + */ + +#ifndef _FLUTTERPI_SRC_UTIL_COLLECTION_H +#define _FLUTTERPI_SRC_UTIL_COLLECTION_H #if !defined(_XOPEN_SOURCE) || _XOPEN_SOURCE < 500L #define _XOPEN_SOURCE 500L @@ -112,4 +119,4 @@ ATTR_PURE static inline bool streq(const char *a, const char *b) { const pthread_mutexattr_t *get_default_mutex_attrs(); -#endif +#endif // _FLUTTERPI_SRC_UTIL_COLLECTION_H diff --git a/src/util/geometry.h b/src/util/geometry.h index 9a2d0ace..11481244 100644 --- a/src/util/geometry.h +++ b/src/util/geometry.h @@ -1,6 +1,12 @@ +// SPDX-License-Identifier: MIT +/* + * Geometry - structs and functions for working with vectors & rectangles + * + * Copyright (c) 2023, Hannes Winkler + */ -#ifndef GEOMETRY_H -#define GEOMETRY_H +#ifndef _FLUTTERPI_SRC_UTIL_GEOMETRY_H +#define _FLUTTERPI_SRC_UTIL_GEOMETRY_H #include #include @@ -315,4 +321,4 @@ ATTR_CONST static inline struct vec2f vec2f_swap_xy(const struct vec2f point) { return VEC2F(point.y, point.x); } -#endif +#endif // _FLUTTERPI_SRC_UTIL_GEOMETRY_H diff --git a/src/util/lock_ops.h b/src/util/lock_ops.h index 2aab0738..dc0a31a0 100644 --- a/src/util/lock_ops.h +++ b/src/util/lock_ops.h @@ -1,5 +1,13 @@ -#ifndef _UTIL_LOCKOPS_H -#define _UTIL_LOCKOPS_H +// SPDX-License-Identifier: MIT +/* + * Lock Ops - Macros for defining locking operations for a struct with + * sane defaults. + * + * Copyright (c) 2023, Hannes Winkler + */ + +#ifndef _FLUTTERPI_SRC_UTIL_LOCK_OPS_H +#define _FLUTTERPI_SRC_UTIL_LOCK_OPS_H #include @@ -51,4 +59,4 @@ (void) ok; \ } -#endif // _UTIL_LOCKOPS_H +#endif // _FLUTTERPI_SRC_UTIL_LOCK_OPS_H diff --git a/src/util/logging.h b/src/util/logging.h index 935c6d87..81473c0d 100644 --- a/src/util/logging.h +++ b/src/util/logging.h @@ -1,8 +1,13 @@ +// SPDX-License-Identifier: MIT +/* + * Logging - Provides debug & error logging macros. + * + * Copyright (c) 2023, Hannes Winkler + */ + #ifndef _FLUTTERPI_SRC_UTIL_LOGGING_H #define _FLUTTERPI_SRC_UTIL_LOGGING_H -//#define FILE_DESCR(_logging_name) static const char *__attribute__((unused)) __file_logging_name = _logging_name; - #define LOG_ERROR(fmtstring, ...) fprintf(stderr, "%s: " fmtstring, __FILE__, ##__VA_ARGS__) #define LOG_ERROR_UNPREFIXED(fmtstring, ...) fprintf(stderr, fmtstring, ##__VA_ARGS__) @@ -18,4 +23,4 @@ } while (0) #endif -#endif +#endif // _FLUTTERPI_SRC_UTIL_LOGGING_H diff --git a/src/util/refcounting.h b/src/util/refcounting.h index 8ae90e09..6f35f300 100644 --- a/src/util/refcounting.h +++ b/src/util/refcounting.h @@ -1,5 +1,12 @@ -#ifndef REFCOUNTING_H -#define REFCOUNTING_H +// SPDX-License-Identifier: MIT +/* + * Refcounting - Defines functions and macros for reference keeping. + * + * Copyright (c) 2023, Hannes Winkler + */ + +#ifndef _FLUTTERPI_SRC_UTIL_REFCOUNTING_H +#define _FLUTTERPI_SRC_UTIL_REFCOUNTING_H #include #include @@ -104,4 +111,4 @@ static inline int refcount_get_for_debug(refcount_t *refcount) { } \ UNUSED static void obj_name##_unref_void(void *obj) { obj_name##_unref((struct obj_name *) obj); } -#endif +#endif // _FLUTTERPI_SRC_UTIL_REFCOUNTING_H diff --git a/src/util/uuid.h b/src/util/uuid.h index 48f61380..160d16d4 100644 --- a/src/util/uuid.h +++ b/src/util/uuid.h @@ -1,5 +1,12 @@ -#ifndef UUID_H -#define UUID_H +// SPDX-License-Identifier: MIT +/* + * UUID - Defines an uuid struct and macros & functions for working with it. + * + * Copyright (c) 2023, Hannes Winkler + */ + +#ifndef _FLUTTERPI_SRC_UTIL_UUID_H +#define _FLUTTERPI_SRC_UTIL_UUID_H #include #include @@ -26,4 +33,4 @@ static inline void uuid_copy(uuid_t *dst, const uuid_t src) { memcpy(dst, &src, sizeof(uuid_t)); } -#endif +#endif // _FLUTTERPI_SRC_UTIL_UUID_H diff --git a/src/vk_gbm_render_surface.h b/src/vk_gbm_render_surface.h index 17bc1648..03d67250 100644 --- a/src/vk_gbm_render_surface.h +++ b/src/vk_gbm_render_surface.h @@ -8,8 +8,8 @@ * Copyright (c) 2022, Hannes Winkler */ -#ifndef _FLUTTERPI_INCLUDE_VK_GBM_RENDER_SURFACE_H -#define _FLUTTERPI_INCLUDE_VK_GBM_RENDER_SURFACE_H +#ifndef _FLUTTERPI_SRC_VK_GBM_RENDER_SURFACE_H +#define _FLUTTERPI_SRC_VK_GBM_RENDER_SURFACE_H #include "compositor_ng.h" #include "pixel_format.h" @@ -35,4 +35,4 @@ struct vk_gbm_render_surface *vk_gbm_render_surface_new( enum pixfmt pixel_format ); -#endif // _FLUTTERPI_INCLUDE_VK_GBM_RENDER_SURFACE_H +#endif // _FLUTTERPI_SRC_VK_GBM_RENDER_SURFACE_H diff --git a/src/vk_renderer.h b/src/vk_renderer.h index 48879915..6e25b145 100644 --- a/src/vk_renderer.h +++ b/src/vk_renderer.h @@ -14,8 +14,8 @@ * Copyright (c) 2022, Hannes Winkler */ -#ifndef _FLUTTERPI_INCLUDE_VK_RENDERER_H -#define _FLUTTERPI_INCLUDE_VK_RENDERER_H +#ifndef _FLUTTERPI_SRC_VK_RENDERER_H +#define _FLUTTERPI_SRC_VK_RENDERER_H #include "util/collection.h" #include "util/refcounting.h" @@ -129,4 +129,4 @@ ATTR_PURE const char **vk_renderer_get_enabled_device_extensions(struct vk_rende */ ATTR_PURE int vk_renderer_find_mem_type(struct vk_renderer *renderer, VkMemoryPropertyFlags flags, uint32_t req_bits); -#endif // _FLUTTERPI_INCLUDE_VK_RENDERER_H +#endif // _FLUTTERPI_SRC_VK_RENDERER_H diff --git a/src/vulkan.h b/src/vulkan.h index 3f2248f2..3821805a 100644 --- a/src/vulkan.h +++ b/src/vulkan.h @@ -5,8 +5,8 @@ * Copyright (c) 2022, Hannes Winkler */ -#ifndef _FLUTTERPI_INCLUDE_VULKAN_H -#define _FLUTTERPI_INCLUDE_VULKAN_H +#ifndef _FLUTTERPI_SRC_VULKAN_H +#define _FLUTTERPI_SRC_VULKAN_H #include "config.h" @@ -87,4 +87,4 @@ static inline const char *vk_strerror(VkResult result) { #define LOG_VK_ERROR(result, fmt, ...) LOG_ERROR(fmt ": %s\n", __VA_ARGS__ vk_strerror(result)) -#endif // _FLUTTERPI_INCLUDE_VULKAN_H +#endif // _FLUTTERPI_SRC_VULKAN_H diff --git a/src/window.h b/src/window.h index 42af224b..ed7616f4 100644 --- a/src/window.h +++ b/src/window.h @@ -7,8 +7,8 @@ * Copyright (c) 2022, Hannes Winkler */ -#ifndef _FLUTTERPI_INCLUDE_WINDOW_H -#define _FLUTTERPI_INCLUDE_WINDOW_H +#ifndef _FLUTTERPI_SRC_WINDOW_H +#define _FLUTTERPI_SRC_WINDOW_H #include "compositor_ng.h" #include "modesetting.h" @@ -128,4 +128,4 @@ int window_set_cursor( // clang-format on ); -#endif // _FLUTTERPI_INCLUDE_WINDOW_H +#endif // _FLUTTERPI_SRC_WINDOW_H