Skip to content

Commit 566c504

Browse files
committed
style: recreate & unify style for all header guards
Use a single style convention for all header guards.
1 parent ed186fa commit 566c504

37 files changed

+272
-115
lines changed

src/compositor_ng.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
* Copyright (c) 2022, Hannes Winkler <[email protected]>
88
*/
99

10-
#ifndef _FLUTTERPI_INCLUDE_COMPOSITOR_NG_H
11-
#define _FLUTTERPI_INCLUDE_COMPOSITOR_NG_H
10+
#ifndef _FLUTTERPI_SRC_COMPOSITOR_NG_H
11+
#define _FLUTTERPI_SRC_COMPOSITOR_NG_H
1212

1313
#include <flutter_embedder.h>
1414

@@ -203,4 +203,4 @@ DECLARE_REF_OPS(fl_layer_composition)
203203
size_t fl_layer_composition_get_n_layers(struct fl_layer_composition *composition);
204204
struct fl_layer *fl_layer_composition_peek_layer(struct fl_layer_composition *composition, int layer);
205205

206-
#endif // _FLUTTERPI_INCLUDE_COMPOSITOR_NG_H
206+
#endif // _FLUTTERPI_SRC_COMPOSITOR_NG_H

src/cursor.h

+13-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
1-
#ifndef _CURSOR_H
2-
#define _CURSOR_H
1+
// SPDX-License-Identifier: MIT
2+
/*
3+
* Cursor Images
4+
*
5+
* Contains all the mouse cursor images in compressed form,
6+
* and some utilities for using them.
7+
*
8+
* Copyright (c) 2023, Hannes Winkler <[email protected]>
9+
*/
10+
11+
#ifndef _FLUTTERPI_SRC_CURSOR_H
12+
#define _FLUTTERPI_SRC_CURSOR_H
313

414
#include <stdint.h>
515

@@ -58,4 +68,4 @@ struct vec2i pointer_icon_get_hotspot(const struct pointer_icon *icon);
5868

5969
void *pointer_icon_dup_pixels(const struct pointer_icon *icon);
6070

61-
#endif
71+
#endif // _FLUTTERPI_SRC_CURSOR_H

src/dmabuf_surface.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
* Copyright (c) 2022, Hannes Winkler <[email protected]>
88
*/
99

10-
#ifndef _FLUTTERPI_INCLUDE_DMABUF_SURFACE_H
11-
#define _FLUTTERPI_INCLUDE_DMABUF_SURFACE_H
10+
#ifndef _FLUTTERPI_SRC_DMABUF_SURFACE_H
11+
#define _FLUTTERPI_SRC_DMABUF_SURFACE_H
1212

1313
#include "pixel_format.h"
1414

@@ -44,4 +44,4 @@ int dmabuf_surface_push_dmabuf(struct dmabuf_surface *s, const struct dmabuf *bu
4444

4545
ATTR_PURE int64_t dmabuf_surface_get_texture_id(struct dmabuf_surface *s);
4646

47-
#endif // _FLUTTERPI_INCLUDE_DMABUF_SURFACE_H
47+
#endif // _FLUTTERPI_SRC_DMABUF_SURFACE_H

src/dummy_render_surface.h

+6-7
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
// SPDX-License-Identifier: MIT
22
/*
3-
* Vulkan GBM render surface
3+
* Dummy render surface
44
*
5-
* - used as a render target for flutter vulkan rendering
6-
* - can be scanned out using KMS
5+
* Just a render surface that does nothing when presenting.
76
*
8-
* Copyright (c) 2022, Hannes Winkler <[email protected]>
7+
* Copyright (c) 2023, Hannes Winkler <[email protected]>
98
*/
109

11-
#ifndef _FLUTTERPI_INCLUDE_DUMMY_RENDER_SURFACE_H
12-
#define _FLUTTERPI_INCLUDE_DUMMY_RENDER_SURFACE_H
10+
#ifndef _FLUTTERPI_SRC_DUMMY_RENDER_SURFACE_H
11+
#define _FLUTTERPI_SRC_DUMMY_RENDER_SURFACE_H
1312

1413
#include "util/geometry.h"
1514

@@ -26,4 +25,4 @@ ATTR_PURE struct dummy_render_surface *__checked_cast_dummy_render_surface(void
2625

2726
struct dummy_render_surface *dummy_render_surface_new(struct tracer *tracer, struct vec2i size);
2827

29-
#endif // _FLUTTERPI_INCLUDE_DUMMY_RENDER_SURFACE_H
28+
#endif // _FLUTTERPI_SRC_DUMMY_RENDER_SURFACE_H

src/egl.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
* Copyright (c) 2022, Hannes Winkler <[email protected]>
66
*/
77

8-
#ifndef _FLUTTERPI_INCLUDE_EGL_H
9-
#define _FLUTTERPI_INCLUDE_EGL_H
8+
#ifndef _FLUTTERPI_SRC_EGL_H
9+
#define _FLUTTERPI_SRC_EGL_H
1010

1111
#include <stdbool.h>
1212
#include <string.h>
@@ -478,4 +478,4 @@ static inline const char *egl_strerror(EGLenum result) {
478478
#define LOG_EGL_ERROR(result, fmt, ...) LOG_ERROR(fmt ": %s\n", __VA_ARGS__ egl_strerror(result))
479479
#endif
480480

481-
#endif // _FLUTTERPI_INCLUDE_EGL_H
481+
#endif // _FLUTTERPI_SRC_EGL_H

src/egl_gbm_render_surface.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
* Copyright (c) 2022, Hannes Winkler <[email protected]>
88
*/
99

10-
#ifndef _FLUTTERPI_INCLUDE_EGL_GBM_RENDER_SURFACE_H
11-
#define _FLUTTERPI_INCLUDE_EGL_GBM_RENDER_SURFACE_H
10+
#ifndef _FLUTTERPI_SRC_EGL_GBM_RENDER_SURFACE_H
11+
#define _FLUTTERPI_SRC_EGL_GBM_RENDER_SURFACE_H
1212

1313
#include "compositor_ng.h"
1414
#include "pixel_format.h"
@@ -49,4 +49,4 @@ ATTR_PURE EGLSurface egl_gbm_render_surface_get_egl_surface(struct egl_gbm_rende
4949

5050
ATTR_PURE EGLConfig egl_gbm_render_surface_get_egl_config(struct egl_gbm_render_surface *s);
5151

52-
#endif // _FLUTTERPI_INCLUDE_EGL_GBM_RENDER_SURFACE_H
52+
#endif // _FLUTTERPI_SRC_EGL_GBM_RENDER_SURFACE_H

src/event_loop.h

+12-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
1-
#ifndef _EVENT_LOOP_H
2-
#define _EVENT_LOOP_H
1+
// SPDX-License-Identifier: MIT
2+
/*
3+
* Event Loop
4+
*
5+
* - multithreaded event loop
6+
*
7+
* Copyright (c) 2023, Hannes Winkler <[email protected]>
8+
*/
9+
10+
#ifndef _FLUTTERPI_SRC_EVENT_LOOP_H
11+
#define _FLUTTERPI_SRC_EVENT_LOOP_H
312

413
#include "util/refcounting.h"
514

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

5059
void evthread_join(struct evthread *thread);
5160

52-
#endif // _EVENT_LOOP_H
61+
#endif // _FLUTTERPI_SRC_EVENT_LOOP_H

src/filesystem_layout.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
* Copyright (c) 2022, Hannes Winkler <[email protected]>
88
*/
99

10-
#ifndef _FLUTTERPI_INCLUDE_FILESYSTEM_LAYOUT_H
11-
#define _FLUTTERPI_INCLUDE_FILESYSTEM_LAYOUT_H
10+
#ifndef _FLUTTERPI_SRC_FILESYSTEM_LAYOUT_H
11+
#define _FLUTTERPI_SRC_FILESYSTEM_LAYOUT_H
1212

1313
#include "flutter-pi.h"
1414

@@ -30,4 +30,4 @@ void flutter_paths_free(struct flutter_paths *paths);
3030
struct flutter_paths *fs_layout_flutterpi_resolve(const char *app_bundle_path, enum flutter_runtime_mode runtime_mode);
3131
struct flutter_paths *fs_layout_metaflutter_resolve(const char *app_bundle_path, enum flutter_runtime_mode runtime_mode);
3232

33-
#endif // _FLUTTERPI_INCLUDE_FILESYSTEM_LAYOUT_H
33+
#endif // _FLUTTERPI_SRC_FILESYSTEM_LAYOUT_H

src/flutter-pi.h

+10-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
1-
#ifndef _FLUTTERPI_H
2-
#define _FLUTTERPI_H
1+
// SPDX-License-Identifier: MIT
2+
/*
3+
* Flutter-Pi main header
4+
*
5+
* Copyright (c) 2023, Hannes Winkler <[email protected]>
6+
*/
7+
8+
#ifndef _FLUTTERPI_SRC_FLUTTERPI_H
9+
#define _FLUTTERPI_SRC_FLUTTERPI_H
310

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

@@ -157,4 +164,4 @@ void flutterpi_trace_event_begin(struct flutterpi *flutterpi, const char *name);
157164

158165
void flutterpi_trace_event_end(struct flutterpi *flutterpi, const char *name);
159166

160-
#endif
167+
#endif // _FLUTTERPI_SRC_FLUTTERPI_H

src/frame_scheduler.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
* Copyright (c) 2022, Hannes Winkler <[email protected]>
88
*/
99

10-
#ifndef _FLUTTERPI_INCLUDE_FRAME_SCHEDULER_H
11-
#define _FLUTTERPI_INCLUDE_FRAME_SCHEDULER_H
10+
#ifndef _FLUTTERPI_SRC_FRAME_SCHEDULER_H
11+
#define _FLUTTERPI_SRC_FRAME_SCHEDULER_H
1212

1313
#include "util/collection.h"
1414
#include "util/refcounting.h"
@@ -80,4 +80,4 @@ void frame_scheduler_on_fb_released(struct frame_scheduler *scheduler, bool has_
8080
*/
8181
void frame_scheduler_present_frame(struct frame_scheduler *scheduler, void_callback_t present_cb, void *userdata, void_callback_t cancel_cb);
8282

83-
#endif // _FLUTTERPI_INCLUDE_FRAME_SCHEDULER_H
83+
#endif // _FLUTTERPI_SRC_FRAME_SCHEDULER_H

src/gl_renderer.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
* Copyright (c) 2022, Hannes Winkler <[email protected]>
1212
*/
1313

14-
#ifndef _FLUTTERPI_INCLUDE_EGL_GL_RENDERER_H
15-
#define _FLUTTERPI_INCLUDE_EGL_GL_RENDERER_H
14+
#ifndef _FLUTTERPI_SRC_GL_RENDERER_H
15+
#define _FLUTTERPI_SRC_GL_RENDERER_H
1616

1717
#include "pixel_format.h"
1818
#include "util/collection.h"
@@ -85,4 +85,4 @@ EGLSurface gl_renderer_create_gbm_window_surface(
8585
const EGLint *int_attrib_list
8686
);
8787

88-
#endif // _FLUTTERPI_INCLUDE_EGL_GL_RENDERER_H
88+
#endif // _FLUTTERPI_SRC_GL_RENDERER_H

src/gles.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
* Copyright (c) 2022, Hannes Winkler <[email protected]>
66
*/
77

8-
#ifndef _FLUTTERPI_INCLUDE_GLES_H
9-
#define _FLUTTERPI_INCLUDE_GLES_H
8+
#ifndef _FLUTTERPI_SRC_GLES_H
9+
#define _FLUTTERPI_SRC_GLES_H
1010

1111
#include "config.h"
1212

@@ -17,4 +17,4 @@
1717
#include <GLES2/gl2.h>
1818
#include <GLES2/gl2ext.h>
1919

20-
#endif // _FLUTTERPI_INCLUDE_GLES_H
20+
#endif // _FLUTTERPI_SRC_GLES_H

src/keyboard.h

+12-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
1-
#ifndef KEYBOARD_H
2-
#define KEYBOARD_H
1+
// SPDX-License-Identifier: MIT
2+
/*
3+
* Keyboard / Text Input support
4+
*
5+
* Converts key events to text events using the system keyboard config.
6+
*
7+
* Copyright (c) 2023, Hannes Winkler <[email protected]>
8+
*/
9+
10+
#ifndef _FLUTTERPI_SRC_KEYBOARD_H
11+
#define _FLUTTERPI_SRC_KEYBOARD_H
312

413
#include <stdbool.h>
514

@@ -94,4 +103,4 @@ static inline struct keyboard_modifier_state keyboard_state_get_meta_state(struc
94103
};
95104
}
96105

97-
#endif
106+
#endif // _FLUTTERPI_SRC_KEYBOARD_H

src/locales.h

+12-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
1-
#ifndef _LOCALES_H
2-
#define _LOCALES_H
1+
// SPDX-License-Identifier: MIT
2+
/*
3+
* Locales
4+
*
5+
* Provides the configured system locales in a flutter-friendly form.
6+
*
7+
* Copyright (c) 2023, Hannes Winkler <[email protected]>
8+
*/
9+
10+
#ifndef _FLUTTERPI_SRC_LOCALES_H
11+
#define _FLUTTERPI_SRC_LOCALES_H
312

413
#include <flutter_embedder.h>
514

@@ -36,4 +45,4 @@ locales_on_compute_platform_resolved_locale(struct locales *locales, const Flutt
3645

3746
void locales_print(const struct locales *locales);
3847

39-
#endif
48+
#endif // _FLUTTERPI_SRC_LOCALES_H

src/modesetting.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
* Copyright (c) 2022, Hannes Winkler <[email protected]>
1010
*/
1111

12-
#ifndef _FLUTTERPI_INCLUDE_MODESETTING_H
13-
#define _FLUTTERPI_INCLUDE_MODESETTING_H
12+
#ifndef _FLUTTERPI_SRC_MODESETTING_H
13+
#define _FLUTTERPI_SRC_MODESETTING_H
1414

1515
#include <stdbool.h>
1616

@@ -916,4 +916,4 @@ drmModeModeInfo *__next_mode(const struct drm_connector *connector, const drmMod
916916

917917
#define for_each_unreserved_plane_in_atomic_req(atomic_req, plane) for_each_pointer_in_pset(&(atomic_req)->available_planes, plane)
918918

919-
#endif // _FLUTTERPI_INCLUDE_MODESETTING_H
919+
#endif // _FLUTTERPI_SRC_MODESETTING_H

src/notifier_listener.h

+15-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
1-
#ifndef _FLUTTERPI_INCLUDE_NOTIFIER_LISTENER_H
2-
#define _FLUTTERPI_INCLUDE_NOTIFIER_LISTENER_H
1+
// SPDX-License-Identifier: MIT
2+
/*
3+
* Notifier/Listener
4+
*
5+
* Basically a nicer wrapper around callbacks.
6+
*
7+
* Notifiers are event sources that can be listened to. A listener
8+
* is a callbacks that's registered for listening to a notifier.
9+
*
10+
* Copyright (c) 2023, Hannes Winkler <[email protected]>
11+
*/
12+
13+
#ifndef _FLUTTERPI_SRC_NOTIFIER_LISTENER_H
14+
#define _FLUTTERPI_SRC_NOTIFIER_LISTENER_H
315

416
#include "util/collection.h"
517
#include "util/list.h"
@@ -130,4 +142,4 @@ int notifier_unlisten(struct notifier *notifier, struct listener *listener);
130142
*/
131143
void notifier_notify(struct notifier *notifier, void *arg);
132144

133-
#endif // _FLUTTERPI_INCLUDE_NOTIFIER_LISTENER_H
145+
#endif // _FLUTTERPI_SRC_NOTIFIER_LISTENER_H

src/pixel_format.h

+16-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
1-
#ifndef _FLUTTERPI_INCLUDE_PIXEL_FORMAT_H
2-
#define _FLUTTERPI_INCLUDE_PIXEL_FORMAT_H
1+
// SPDX-License-Identifier: MIT
2+
/*
3+
* Pixel Formats
4+
*
5+
* A list of pixel formats that flutter-pi supports, with details
6+
* about their composition.
7+
*
8+
* Provides a translations between DRM, EGL/GL, fbdev, vulkan and
9+
* flutter software pixel foramts.
10+
*
11+
* Copyright (c) 2023, Hannes Winkler <[email protected]>
12+
*/
13+
14+
#ifndef _FLUTTERPI_SRC_PIXEL_FORMAT_H
15+
#define _FLUTTERPI_SRC_PIXEL_FORMAT_H
316

417
#include <stdbool.h>
518

@@ -387,4 +400,4 @@ COMPILE_ASSERT(PIXFMT_RGB565 == 0);
387400
#define ASSERT_PIXFMT_VALID(format) ASSERT_MSG(format >= PIXFMT_RGB565 && format <= PIXFMT_MAX, "Invalid pixel format")
388401
#define ASSUME_PIXFMT_VALID(format) ASSUME((format) >= PIXFMT_RGB565 && (format) <= PIXFMT_MAX)
389402

390-
#endif // _FLUTTERPI_INCLUDE_PIXEL_FORMAT_H
403+
#endif // _FLUTTERPI_SRC_PIXEL_FORMAT_H

src/platformchannel.h

+17-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
1-
#ifndef _METHODCHANNEL_H
2-
#define _METHODCHANNEL_H
1+
// SPDX-License-Identifier: MIT
2+
/*
3+
* Platform Channels
4+
*
5+
* Encoding/Decoding of flutter platform messages, with different
6+
*
7+
* Supported codecs:
8+
* - standard message & method codec,
9+
* - json message & method codec
10+
* - pigeon (not really a codec)
11+
*
12+
* Copyright (c) 2023, Hannes Winkler <[email protected]>
13+
*/
14+
15+
#ifndef _FLUTTERPI_SRC_PLATFORMCHANNEL_H
16+
#define _FLUTTERPI_SRC_PLATFORMCHANNEL_H
317

418
#include <errno.h>
519
#include <stdint.h>
@@ -1624,4 +1638,4 @@ ATTR_PURE const struct raw_std_value *raw_std_method_call_get_arg(const struct r
16241638
#define for_each_element_in_raw_std_list(value, list) \
16251639
for_each_element_in_raw_std_list_indexed(UNIQUE_NAME(__raw_std_list_element_index), value, list)
16261640

1627-
#endif
1641+
#endif // _FLUTTERPI_SRC_PLATFORMCHANNEL_H

src/pluginregistry.h

+12-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
1-
#ifndef FLUTTER_PI_REGISTRY_H_
2-
#define FLUTTER_PI_REGISTRY_H_
1+
// SPDX-License-Identifier: MIT
2+
/*
3+
* Plugin Registry
4+
*
5+
* Initializes & deinitializes plugins, manages registration of plugins.
6+
*
7+
* Copyright (c) 2023, Hannes Winkler <[email protected]>
8+
*/
9+
10+
#ifndef _FLUTTERPI_SRC_PLUGINREGISTRY_H
11+
#define _FLUTTERPI_SRC_PLUGINREGISTRY_H
312

413
#include <string.h>
514

@@ -165,4 +174,4 @@ void static_plugin_registry_remove_plugin(const char *plugin_name);
165174
\
166175
__attribute__((destructor)) static void __unreg_plugin_##_identifier_name() { static_plugin_registry_remove_plugin(_name); }
167176

168-
#endif
177+
#endif // _FLUTTERPI_SRC_PLUGINREGISTRY_H

0 commit comments

Comments
 (0)