Skip to content

Commit

Permalink
style: recreate & unify style for all header guards
Browse files Browse the repository at this point in the history
Use a single style convention for all header guards.
  • Loading branch information
ardera committed Aug 3, 2023
1 parent fdb554c commit 1c5c42d
Show file tree
Hide file tree
Showing 37 changed files with 272 additions and 115 deletions.
6 changes: 3 additions & 3 deletions src/compositor_ng.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
* Copyright (c) 2022, Hannes Winkler <[email protected]>
*/

#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 <flutter_embedder.h>

Expand Down Expand Up @@ -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
16 changes: 13 additions & 3 deletions src/cursor.h
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>
*/

#ifndef _FLUTTERPI_SRC_CURSOR_H
#define _FLUTTERPI_SRC_CURSOR_H

#include <stdint.h>

Expand Down Expand Up @@ -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
6 changes: 3 additions & 3 deletions src/dmabuf_surface.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
* Copyright (c) 2022, Hannes Winkler <[email protected]>
*/

#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"

Expand Down Expand Up @@ -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
13 changes: 6 additions & 7 deletions src/dummy_render_surface.h
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>
* Copyright (c) 2023, Hannes Winkler <[email protected]>
*/

#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"

Expand All @@ -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
6 changes: 3 additions & 3 deletions src/egl.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
* Copyright (c) 2022, Hannes Winkler <[email protected]>
*/

#ifndef _FLUTTERPI_INCLUDE_EGL_H
#define _FLUTTERPI_INCLUDE_EGL_H
#ifndef _FLUTTERPI_SRC_EGL_H
#define _FLUTTERPI_SRC_EGL_H

#include <stdbool.h>
#include <string.h>
Expand Down Expand Up @@ -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
6 changes: 3 additions & 3 deletions src/egl_gbm_render_surface.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
* Copyright (c) 2022, Hannes Winkler <[email protected]>
*/

#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"
Expand Down Expand Up @@ -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
15 changes: 12 additions & 3 deletions src/event_loop.h
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>
*/

#ifndef _FLUTTERPI_SRC_EVENT_LOOP_H
#define _FLUTTERPI_SRC_EVENT_LOOP_H

#include "util/refcounting.h"

Expand Down Expand Up @@ -49,4 +58,4 @@ struct evloop *evthread_get_evloop(struct evthread *thread);

void evthread_join(struct evthread *thread);

#endif // _EVENT_LOOP_H
#endif // _FLUTTERPI_SRC_EVENT_LOOP_H
6 changes: 3 additions & 3 deletions src/filesystem_layout.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
* Copyright (c) 2022, Hannes Winkler <[email protected]>
*/

#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"

Expand All @@ -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
13 changes: 10 additions & 3 deletions src/flutter-pi.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
#ifndef _FLUTTERPI_H
#define _FLUTTERPI_H
// SPDX-License-Identifier: MIT
/*
* Flutter-Pi main header
*
* Copyright (c) 2023, Hannes Winkler <[email protected]>
*/

#ifndef _FLUTTERPI_SRC_FLUTTERPI_H
#define _FLUTTERPI_SRC_FLUTTERPI_H

#define LOG_FLUTTERPI_ERROR(...) fprintf(stderr, "[flutter-pi] " __VA_ARGS__)

Expand Down Expand Up @@ -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
6 changes: 3 additions & 3 deletions src/frame_scheduler.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
* Copyright (c) 2022, Hannes Winkler <[email protected]>
*/

#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"
Expand Down Expand Up @@ -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
6 changes: 3 additions & 3 deletions src/gl_renderer.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
* Copyright (c) 2022, Hannes Winkler <[email protected]>
*/

#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"
Expand Down Expand Up @@ -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
6 changes: 3 additions & 3 deletions src/gles.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
* Copyright (c) 2022, Hannes Winkler <[email protected]>
*/

#ifndef _FLUTTERPI_INCLUDE_GLES_H
#define _FLUTTERPI_INCLUDE_GLES_H
#ifndef _FLUTTERPI_SRC_GLES_H
#define _FLUTTERPI_SRC_GLES_H

#include "config.h"

Expand All @@ -17,4 +17,4 @@
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>

#endif // _FLUTTERPI_INCLUDE_GLES_H
#endif // _FLUTTERPI_SRC_GLES_H
15 changes: 12 additions & 3 deletions src/keyboard.h
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>
*/

#ifndef _FLUTTERPI_SRC_KEYBOARD_H
#define _FLUTTERPI_SRC_KEYBOARD_H

#include <stdbool.h>

Expand Down Expand Up @@ -94,4 +103,4 @@ static inline struct keyboard_modifier_state keyboard_state_get_meta_state(struc
};
}

#endif
#endif // _FLUTTERPI_SRC_KEYBOARD_H
15 changes: 12 additions & 3 deletions src/locales.h
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>
*/

#ifndef _FLUTTERPI_SRC_LOCALES_H
#define _FLUTTERPI_SRC_LOCALES_H

#include <flutter_embedder.h>

Expand Down Expand Up @@ -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
6 changes: 3 additions & 3 deletions src/modesetting.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
* Copyright (c) 2022, Hannes Winkler <[email protected]>
*/

#ifndef _FLUTTERPI_INCLUDE_MODESETTING_H
#define _FLUTTERPI_INCLUDE_MODESETTING_H
#ifndef _FLUTTERPI_SRC_MODESETTING_H
#define _FLUTTERPI_SRC_MODESETTING_H

#include <stdbool.h>

Expand Down Expand Up @@ -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
18 changes: 15 additions & 3 deletions src/notifier_listener.h
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>
*/

#ifndef _FLUTTERPI_SRC_NOTIFIER_LISTENER_H
#define _FLUTTERPI_SRC_NOTIFIER_LISTENER_H

#include "util/collection.h"
#include "util/list.h"
Expand Down Expand Up @@ -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
19 changes: 16 additions & 3 deletions src/pixel_format.h
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>
*/

#ifndef _FLUTTERPI_SRC_PIXEL_FORMAT_H
#define _FLUTTERPI_SRC_PIXEL_FORMAT_H

#include <stdbool.h>

Expand Down Expand Up @@ -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
20 changes: 17 additions & 3 deletions src/platformchannel.h
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>
*/

#ifndef _FLUTTERPI_SRC_PLATFORMCHANNEL_H
#define _FLUTTERPI_SRC_PLATFORMCHANNEL_H

#include <errno.h>
#include <stdint.h>
Expand Down Expand Up @@ -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
15 changes: 12 additions & 3 deletions src/pluginregistry.h
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>
*/

#ifndef _FLUTTERPI_SRC_PLUGINREGISTRY_H
#define _FLUTTERPI_SRC_PLUGINREGISTRY_H

#include <string.h>

Expand Down Expand Up @@ -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
Loading

0 comments on commit 1c5c42d

Please sign in to comment.