From 539c1ddd4029f4ea62368c45955d0c1f6bca4006 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 15 Feb 2019 22:37:50 +0100 Subject: Clean up includes --- pugl/pugl.h | 7 +++---- pugl/pugl_internal.h | 6 +++--- pugl/pugl_internal_types.h | 6 +++--- pugl/pugl_osx.m | 8 ++++---- pugl/pugl_win.cpp | 4 ++-- pugl/pugl_x11.c | 19 +++++++++---------- pugl/pugl_x11.h | 5 +++-- pugl/pugl_x11_cairo.c | 13 ++++++------- pugl/pugl_x11_gl.c | 8 ++++---- pugl_cairo_test.c | 8 ++++---- pugl_test.c | 6 +++--- 11 files changed, 44 insertions(+), 46 deletions(-) diff --git a/pugl/pugl.h b/pugl/pugl.h index 1cfe3c9..05366be 100644 --- a/pugl/pugl.h +++ b/pugl/pugl.h @@ -21,6 +21,7 @@ #ifndef PUGL_H_INCLUDED #define PUGL_H_INCLUDED +#include #include #ifdef PUGL_SHARED @@ -42,8 +43,6 @@ #ifdef __cplusplus extern "C" { -#else -# include #endif /** @@ -82,8 +81,8 @@ typedef enum { Drawing context type. */ typedef enum { - PUGL_GL = 0x1, /**< OpenGL (3D) */ - PUGL_CAIRO = 0x2 /**< Cairo (2D) */ + PUGL_GL = 1 << 0, /**< OpenGL (3D) */ + PUGL_CAIRO = 1 << 1 /**< Cairo (2D) */ } PuglContextType; /** diff --git a/pugl/pugl_internal.h b/pugl/pugl_internal.h index c3a342c..ce79d2a 100644 --- a/pugl/pugl_internal.h +++ b/pugl/pugl_internal.h @@ -28,12 +28,12 @@ PUGL_HAVE_GL: Include OpenGL support code. */ +#include "pugl/pugl.h" +#include "pugl/pugl_internal_types.h" + #include #include -#include "pugl/pugl_internal_types.h" -#include "pugl/pugl.h" - PuglInternals* puglInitInternals(void); PuglView* diff --git a/pugl/pugl_internal_types.h b/pugl/pugl_internal_types.h index dce5429..63b81cd 100644 --- a/pugl/pugl_internal_types.h +++ b/pugl/pugl_internal_types.h @@ -21,10 +21,10 @@ #ifndef PUGL_INTERNAL_TYPES_H #define PUGL_INTERNAL_TYPES_H -#include "pugl/pugl.h" - -#include #include +#include + +#include "pugl/pugl.h" /** Platform-specific internals. */ typedef struct PuglInternalsImpl PuglInternals; diff --git a/pugl/pugl_osx.m b/pugl/pugl_osx.m index 71d98a1..712f5fc 100644 --- a/pugl/pugl_osx.m +++ b/pugl/pugl_osx.m @@ -19,14 +19,14 @@ @file pugl_osx.m OSX/Cocoa Pugl Implementation. */ -#include - -#import - #include "pugl/cairo_gl.h" #include "pugl/gl.h" #include "pugl/pugl_internal.h" +#import + +#include + @class PuglOpenGLView; struct PuglInternalsImpl { diff --git a/pugl/pugl_win.cpp b/pugl/pugl_win.cpp index 83d4474..fd14593 100644 --- a/pugl/pugl_win.cpp +++ b/pugl/pugl_win.cpp @@ -18,6 +18,8 @@ @file pugl_win.cpp Windows/WGL Pugl Implementation. */ +#include "pugl/pugl_internal.h" + #include #include #include @@ -27,8 +29,6 @@ #include #include -#include "pugl/pugl_internal.h" - #ifndef WM_MOUSEWHEEL # define WM_MOUSEWHEEL 0x020A #endif diff --git a/pugl/pugl_x11.c b/pugl/pugl_x11.c index 7a334e3..3a8cead 100644 --- a/pugl/pugl_x11.c +++ b/pugl/pugl_x11.c @@ -20,26 +20,25 @@ @file pugl_x11.c X11 Pugl Implementation. */ -#include -#include -#include - -#include -#include -#include -#include #include "pugl/pugl_internal.h" #include "pugl/pugl_x11.h" - #ifdef PUGL_HAVE_GL #include "pugl/pugl_x11_gl.h" #endif - #ifdef PUGL_HAVE_CAIRO #include "pugl/pugl_x11_cairo.h" #endif +#include +#include +#include +#include + +#include +#include +#include + #ifndef MIN # define MIN(a, b) (((a) < (b)) ? (a) : (b)) #endif diff --git a/pugl/pugl_x11.h b/pugl/pugl_x11.h index a8c8c02..9c53c49 100644 --- a/pugl/pugl_x11.h +++ b/pugl/pugl_x11.h @@ -14,11 +14,12 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include - #include "pugl/pugl.h" #include "pugl/pugl_internal_types.h" +#include +#include + struct PuglInternalsImpl { Display* display; int screen; diff --git a/pugl/pugl_x11_cairo.c b/pugl/pugl_x11_cairo.c index 3614c4b..db2e262 100644 --- a/pugl/pugl_x11_cairo.c +++ b/pugl/pugl_x11_cairo.c @@ -14,17 +14,16 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include -#include +#include "pugl/pugl_internal_types.h" +#include "pugl/pugl_x11.h" +#include "pugl/pugl_x11_cairo.h" +#include #include #include -#include - -#include "pugl/pugl_internal_types.h" -#include "pugl/pugl_x11.h" -#include "pugl/pugl_x11_cairo.h" +#include +#include typedef struct { cairo_surface_t* surface; diff --git a/pugl/pugl_x11_gl.c b/pugl/pugl_x11_gl.c index 809f4a3..d6242f2 100644 --- a/pugl/pugl_x11_gl.c +++ b/pugl/pugl_x11_gl.c @@ -14,14 +14,14 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include +#include "pugl/pugl_internal_types.h" +#include "pugl/pugl_x11.h" +#include "pugl/pugl_x11_gl.h" #include #include -#include "pugl/pugl_x11.h" -#include "pugl/pugl_x11_gl.h" -#include "pugl/pugl_internal_types.h" +#include typedef struct { GLXContext ctx; diff --git a/pugl_cairo_test.c b/pugl_cairo_test.c index 78abcfa..9480560 100644 --- a/pugl_cairo_test.c +++ b/pugl_cairo_test.c @@ -18,13 +18,13 @@ @file pugl_cairo_test.c A simple Pugl test that creates a top-level window. */ -#include -#include -#include +#include "pugl/pugl.h" #include -#include "pugl/pugl.h" +#include +#include +#include static int quit = 0; static bool entered = false; diff --git a/pugl_test.c b/pugl_test.c index fc3d921..0b5c916 100644 --- a/pugl_test.c +++ b/pugl_test.c @@ -18,14 +18,14 @@ @file pugl_test.c A simple Pugl test that creates a top-level window. */ +#include "pugl/gl.h" +#include "pugl/pugl.h" + #include #include #include #include -#include "pugl/gl.h" -#include "pugl/pugl.h" - static int quit = 0; static float xAngle = 0.0f; static float yAngle = 0.0f; -- cgit v1.2.1