diff options
author | David Robillard <d@drobilla.net> | 2025-02-10 15:30:59 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2025-02-10 15:30:59 -0500 |
commit | b024eaf5eb5c2416184ab4dbd9b4f19c96ae872e (patch) | |
tree | a882f0ba538afe11503a3ce54483e8c1d5e4a859 /src/Canvas.cpp | |
parent | 0f9bf0bf5cbefd10cc97c32565dee962967cdbb1 (diff) | |
download | ganv-b024eaf5eb5c2416184ab4dbd9b4f19c96ae872e.tar.gz ganv-b024eaf5eb5c2416184ab4dbd9b4f19c96ae872e.tar.bz2 ganv-b024eaf5eb5c2416184ab4dbd9b4f19c96ae872e.zip |
Put local utility functions in anonymous namespaces
Diffstat (limited to 'src/Canvas.cpp')
-rw-r--r-- | src/Canvas.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/Canvas.cpp b/src/Canvas.cpp index 7a77497..b7b7bfc 100644 --- a/src/Canvas.cpp +++ b/src/Canvas.cpp @@ -812,6 +812,8 @@ GanvCanvasImpl::layout_dot(const std::string& filename) } #endif +namespace { + inline uint64_t get_monotonic_time() { @@ -824,8 +826,12 @@ get_monotonic_time() #endif } +} // namespace + #ifdef GANV_FDGL +namespace { + inline Region get_region(GanvNode* node) { @@ -855,6 +861,8 @@ apply_force(GanvNode* a, GanvNode* b, const Vector& f) b->impl->force = vec_sub(b->impl->force, f); } +} // namespace + gboolean GanvCanvasImpl::layout_iteration() { @@ -4062,7 +4070,9 @@ ganv_canvas_request_update(GanvCanvas* canvas) } } -static inline gboolean +namespace { + +inline gboolean rect_overlaps(const IRect* a, const IRect* b) { if ((a->x > b->x + b->width) || @@ -4074,7 +4084,7 @@ rect_overlaps(const IRect* a, const IRect* b) return TRUE; } -static inline gboolean +inline gboolean rect_is_visible(GanvCanvas* canvas, const IRect* r) { const IRect rect = { @@ -4087,6 +4097,8 @@ rect_is_visible(GanvCanvas* canvas, const IRect* r) return rect_overlaps(&rect, r); } +} // namespace + void ganv_canvas_request_redraw_c(GanvCanvas* canvas, int x1, int y1, int x2, int y2) |