From: Mikko Rasa Date: Sun, 27 Nov 2022 10:08:07 +0000 (+0200) Subject: Include the matching header first in .cpp files X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=30cab36b531f6efddca07c3fe9a6b1b81ca42bde;p=libs%2Fgui.git Include the matching header first in .cpp files This helps ensure that the headers are complete. I haven't tested building for non-Linux platforms at this time. --- diff --git a/source/graphics/android/display.cpp b/source/graphics/android/display.cpp index bd2cf27..d62c877 100644 --- a/source/graphics/android/display.cpp +++ b/source/graphics/android/display.cpp @@ -1,7 +1,7 @@ -#include -#include #include "display.h" #include "display_private.h" +#include +#include using namespace std; diff --git a/source/graphics/android/window.cpp b/source/graphics/android/window.cpp index be1441a..301af2a 100644 --- a/source/graphics/android/window.cpp +++ b/source/graphics/android/window.cpp @@ -1,7 +1,7 @@ -#include "display.h" -#include "display_private.h" #include "window.h" #include "window_private.h" +#include "display.h" +#include "display_private.h" using namespace std; diff --git a/source/graphics/bmploader.cpp b/source/graphics/bmploader.cpp index a339463..582edc6 100644 --- a/source/graphics/bmploader.cpp +++ b/source/graphics/bmploader.cpp @@ -1,5 +1,5 @@ -#include #include "bmploader.h" +#include using namespace std; diff --git a/source/graphics/cgl/glcontext.cpp b/source/graphics/cgl/glcontext.cpp index 02c4d44..d05364e 100644 --- a/source/graphics/cgl/glcontext.cpp +++ b/source/graphics/cgl/glcontext.cpp @@ -1,8 +1,8 @@ +#include "glcontext.h" #include #include #include "cocoaglcontext.h" #include "cocoapixelformat.h" -#include "glcontext.h" #include "window_private.h" using namespace std; diff --git a/source/graphics/cocoa/display.cpp b/source/graphics/cocoa/display.cpp index 31aa9a2..367691e 100644 --- a/source/graphics/cocoa/display.cpp +++ b/source/graphics/cocoa/display.cpp @@ -1,7 +1,7 @@ -#include -#include "cocoadisplay.h" #include "display.h" #include "display_private.h" +#include +#include "cocoadisplay.h" using namespace std; diff --git a/source/graphics/cocoa/errordialog.cpp b/source/graphics/cocoa/errordialog.cpp index e923586..5eab7a4 100644 --- a/source/graphics/cocoa/errordialog.cpp +++ b/source/graphics/cocoa/errordialog.cpp @@ -1,8 +1,8 @@ +#include "errordialog.h" #include #include #include #include "cocoaerrordialog.h" -#include "errordialog.h" using namespace std; diff --git a/source/graphics/cocoa/window.cpp b/source/graphics/cocoa/window.cpp index 796e969..f372aac 100644 --- a/source/graphics/cocoa/window.cpp +++ b/source/graphics/cocoa/window.cpp @@ -1,9 +1,9 @@ +#include "window.h" +#include "window_private.h" #include "cocoadisplay.h" #include "cocoawindow.h" #include "display.h" #include "display_private.h" -#include "window.h" -#include "window_private.h" namespace Msp { namespace Graphics { diff --git a/source/graphics/devil/devilloader.cpp b/source/graphics/devil/devilloader.cpp index d4c7bff..34e37ce 100644 --- a/source/graphics/devil/devilloader.cpp +++ b/source/graphics/devil/devilloader.cpp @@ -1,7 +1,7 @@ +#include "devilloader.h" #include #include #include -#include "devilloader.h" using namespace std; diff --git a/source/graphics/display.cpp b/source/graphics/display.cpp index f40e02e..92e341a 100644 --- a/source/graphics/display.cpp +++ b/source/graphics/display.cpp @@ -1,6 +1,6 @@ +#include "display.h" #include #include -#include "display.h" #include "display_private.h" #include "window.h" diff --git a/source/graphics/egl_android/glcontext.cpp b/source/graphics/egl_android/glcontext.cpp index 7853b21..26a4063 100644 --- a/source/graphics/egl_android/glcontext.cpp +++ b/source/graphics/egl_android/glcontext.cpp @@ -1,9 +1,9 @@ +#include "glcontext.h" #include #include #include #include #include "display.h" -#include "glcontext.h" #include "window_private.h" using namespace std; diff --git a/source/graphics/glcontext.cpp b/source/graphics/glcontext.cpp index ec073cb..16c1a55 100644 --- a/source/graphics/glcontext.cpp +++ b/source/graphics/glcontext.cpp @@ -1,6 +1,6 @@ +#include "glcontext.h" #include #include -#include "glcontext.h" #include "window.h" using namespace std; diff --git a/source/graphics/glx/glcontext.cpp b/source/graphics/glx/glcontext.cpp index 34daa08..6859e3e 100644 --- a/source/graphics/glx/glcontext.cpp +++ b/source/graphics/glx/glcontext.cpp @@ -1,10 +1,10 @@ +#include "glcontext.h" #include #include #include #include #include #include -#include "glcontext.h" #include "display_private.h" #include "window_private.h" diff --git a/source/graphics/image.cpp b/source/graphics/image.cpp index 2835d05..2903d49 100644 --- a/source/graphics/image.cpp +++ b/source/graphics/image.cpp @@ -1,8 +1,8 @@ +#include "image.h" #include #include #include #include -#include "image.h" #include "imageloader.h" using namespace std; diff --git a/source/graphics/imageloader.cpp b/source/graphics/imageloader.cpp index 9b8a42d..0746f6f 100644 --- a/source/graphics/imageloader.cpp +++ b/source/graphics/imageloader.cpp @@ -1,9 +1,9 @@ +#include "imageloader.h" #include #include #include #include #include "bmploader.h" -#include "imageloader.h" #ifdef WITH_LIBPNG #include "png/pngloader.h" #endif diff --git a/source/graphics/jpeg/jpegloader.cpp b/source/graphics/jpeg/jpegloader.cpp index 45689cf..a38cca5 100644 --- a/source/graphics/jpeg/jpegloader.cpp +++ b/source/graphics/jpeg/jpegloader.cpp @@ -1,7 +1,7 @@ +#include "jpegloader.h" #include #include #include -#include "jpegloader.h" using namespace std; diff --git a/source/graphics/png/pngloader.cpp b/source/graphics/png/pngloader.cpp index 1dfa773..aae7015 100644 --- a/source/graphics/png/pngloader.cpp +++ b/source/graphics/png/pngloader.cpp @@ -1,5 +1,5 @@ -#include #include "pngloader.h" +#include using namespace std; diff --git a/source/graphics/quartz/quartzloader.cpp b/source/graphics/quartz/quartzloader.cpp index 3799bcd..9a74862 100644 --- a/source/graphics/quartz/quartzloader.cpp +++ b/source/graphics/quartz/quartzloader.cpp @@ -1,8 +1,6 @@ +#include "quartzloader.h" #include #include -// Avoid messing up sigc++ headers -#undef nil -#include "quartzloader.h" using namespace std; diff --git a/source/graphics/videomode.cpp b/source/graphics/videomode.cpp index b3ca948..dfd002e 100644 --- a/source/graphics/videomode.cpp +++ b/source/graphics/videomode.cpp @@ -1,5 +1,5 @@ -#include #include "videomode.h" +#include namespace Msp { namespace Graphics { diff --git a/source/graphics/vkxlib/vulkancontext.cpp b/source/graphics/vkxlib/vulkancontext.cpp index f253499..0d332b3 100644 --- a/source/graphics/vkxlib/vulkancontext.cpp +++ b/source/graphics/vkxlib/vulkancontext.cpp @@ -1,3 +1,5 @@ +#include "vulkancontext.h" +#include "vulkancontext_platform.h" #include #include #define VK_USE_PLATFORM_XLIB_KHR @@ -6,8 +8,6 @@ #include #include #include "display_private.h" -#include "vulkancontext.h" -#include "vulkancontext_platform.h" #include "window_private.h" using namespace std; diff --git a/source/graphics/vulkancontext.cpp b/source/graphics/vulkancontext.cpp index bbf03e3..b279c94 100644 --- a/source/graphics/vulkancontext.cpp +++ b/source/graphics/vulkancontext.cpp @@ -1,5 +1,5 @@ -#include #include "vulkancontext.h" +#include #include "window.h" namespace Msp { diff --git a/source/graphics/wgl/glcontext.cpp b/source/graphics/wgl/glcontext.cpp index b0f685b..5f9ae42 100644 --- a/source/graphics/wgl/glcontext.cpp +++ b/source/graphics/wgl/glcontext.cpp @@ -1,10 +1,10 @@ +#include "glcontext.h" #include #include #include #include #include #include -#include "glcontext.h" #include "window_private.h" using namespace std; diff --git a/source/graphics/window.cpp b/source/graphics/window.cpp index 6cadf3e..dde9249 100644 --- a/source/graphics/window.cpp +++ b/source/graphics/window.cpp @@ -1,7 +1,7 @@ -#include -#include "display.h" #include "window.h" #include "window_private.h" +#include +#include "display.h" using namespace std; diff --git a/source/graphics/windows/display.cpp b/source/graphics/windows/display.cpp index b5f97ad..d71f81b 100644 --- a/source/graphics/windows/display.cpp +++ b/source/graphics/windows/display.cpp @@ -1,6 +1,6 @@ -#include #include "display.h" #include "display_private.h" +#include using namespace std; diff --git a/source/graphics/windows/errordialog.cpp b/source/graphics/windows/errordialog.cpp index 7ff4d25..aa05eba 100644 --- a/source/graphics/windows/errordialog.cpp +++ b/source/graphics/windows/errordialog.cpp @@ -1,7 +1,7 @@ +#include "errordialog.h" #include #include #include -#include "errordialog.h" using namespace std; diff --git a/source/graphics/windows/window.cpp b/source/graphics/windows/window.cpp index 38e7f73..a92281d 100644 --- a/source/graphics/windows/window.cpp +++ b/source/graphics/windows/window.cpp @@ -1,9 +1,9 @@ #define _WIN32_WINNT 0x0601 +#include "window.h" +#include "window_private.h" #include #include #include -#include "window.h" -#include "window_private.h" using namespace std; diff --git a/source/graphics/x11/display.cpp b/source/graphics/x11/display.cpp index 949509f..8209deb 100644 --- a/source/graphics/x11/display.cpp +++ b/source/graphics/x11/display.cpp @@ -1,3 +1,5 @@ +#include "display.h" +#include "display_private.h" #include #include #ifdef WITH_XRANDR @@ -6,8 +8,6 @@ #include #include #include -#include "display.h" -#include "display_private.h" using namespace std; diff --git a/source/graphics/x11/window.cpp b/source/graphics/x11/window.cpp index 825c049..fb77c32 100644 --- a/source/graphics/x11/window.cpp +++ b/source/graphics/x11/window.cpp @@ -1,10 +1,10 @@ +#include "window.h" +#include "window_private.h" #include #include #include #include #include "display_private.h" -#include "window.h" -#include "window_private.h" using namespace std; diff --git a/source/input/android/keyboard.cpp b/source/input/android/keyboard.cpp index 631b048..01a5ae1 100644 --- a/source/input/android/keyboard.cpp +++ b/source/input/android/keyboard.cpp @@ -1,6 +1,6 @@ +#include "keyboard.h" #include #include -#include "keyboard.h" #include "keys_private.h" using namespace std; diff --git a/source/input/android/keys.cpp b/source/input/android/keys.cpp index 0ed9051..289fc86 100644 --- a/source/input/android/keys.cpp +++ b/source/input/android/keys.cpp @@ -1,5 +1,5 @@ -#include #include "keys.h" +#include namespace Msp { namespace Input { diff --git a/source/input/android/mouse.cpp b/source/input/android/mouse.cpp index 6769d78..5c6b72a 100644 --- a/source/input/android/mouse.cpp +++ b/source/input/android/mouse.cpp @@ -1,6 +1,6 @@ +#include "mouse.h" #include #include "keys.h" -#include "mouse.h" namespace Msp { namespace Input { diff --git a/source/input/android/touchscreen.cpp b/source/input/android/touchscreen.cpp index 4e443b5..ac20538 100644 --- a/source/input/android/touchscreen.cpp +++ b/source/input/android/touchscreen.cpp @@ -1,5 +1,5 @@ -#include #include "touchscreen.h" +#include namespace Msp { namespace Input { diff --git a/source/input/bindings.cpp b/source/input/bindings.cpp index d6317d8..1c58816 100644 --- a/source/input/bindings.cpp +++ b/source/input/bindings.cpp @@ -1,6 +1,6 @@ +#include "bindings.h" #include #include -#include "bindings.h" #include "controlscheme.h" using namespace std; diff --git a/source/input/cocoa/keyboard.cpp b/source/input/cocoa/keyboard.cpp index db097aa..e4f297c 100644 --- a/source/input/cocoa/keyboard.cpp +++ b/source/input/cocoa/keyboard.cpp @@ -1,5 +1,5 @@ -#include #include "keyboard.h" +#include #include "keys_private.h" using namespace std; diff --git a/source/input/cocoa/mouse.cpp b/source/input/cocoa/mouse.cpp index abda35c..f9df533 100644 --- a/source/input/cocoa/mouse.cpp +++ b/source/input/cocoa/mouse.cpp @@ -1,6 +1,6 @@ +#include "mouse.h" #include #include "keys.h" -#include "mouse.h" namespace Msp { namespace Input { diff --git a/source/input/control.cpp b/source/input/control.cpp index 3e2398d..f82b9c3 100644 --- a/source/input/control.cpp +++ b/source/input/control.cpp @@ -1,7 +1,7 @@ +#include "control.h" #include #include #include "binarycontrol.h" -#include "control.h" #include "device.h" using namespace std; diff --git a/source/input/controlscheme.cpp b/source/input/controlscheme.cpp index 4e5e8de..515d1de 100644 --- a/source/input/controlscheme.cpp +++ b/source/input/controlscheme.cpp @@ -1,6 +1,6 @@ +#include "controlscheme.h" #include #include "control.h" -#include "controlscheme.h" using namespace std; diff --git a/source/input/device.cpp b/source/input/device.cpp index d5b3b86..87102f6 100644 --- a/source/input/device.cpp +++ b/source/input/device.cpp @@ -1,5 +1,5 @@ -#include #include "device.h" +#include using namespace std; diff --git a/source/input/generic/gamecontroller.cpp b/source/input/generic/gamecontroller.cpp index 8f14e02..1d97e42 100644 --- a/source/input/generic/gamecontroller.cpp +++ b/source/input/generic/gamecontroller.cpp @@ -1,5 +1,5 @@ -#include #include "gamecontroller.h" +#include using namespace std; diff --git a/source/input/gesturedetector.cpp b/source/input/gesturedetector.cpp index d53c07f..f6678e8 100644 --- a/source/input/gesturedetector.cpp +++ b/source/input/gesturedetector.cpp @@ -1,7 +1,7 @@ +#include "gesturedetector.h" #define _USE_MATH_DEFINES #include #include -#include "gesturedetector.h" #include "touchscreen.h" using namespace std; diff --git a/source/input/hub.cpp b/source/input/hub.cpp index 79b42aa..5325122 100644 --- a/source/input/hub.cpp +++ b/source/input/hub.cpp @@ -1,9 +1,9 @@ +#include "hub.h" #include #include #include #include #include -#include "hub.h" using namespace std; diff --git a/source/input/keyboard.cpp b/source/input/keyboard.cpp index 30a6145..a79f004 100644 --- a/source/input/keyboard.cpp +++ b/source/input/keyboard.cpp @@ -1,5 +1,5 @@ -#include #include "keyboard.h" +#include #include "keys.h" namespace Msp { diff --git a/source/input/keys.cpp b/source/input/keys.cpp index f1324a0..9b3349a 100644 --- a/source/input/keys.cpp +++ b/source/input/keys.cpp @@ -1,7 +1,7 @@ +#include "keys.h" #include #include #include -#include "keys.h" using namespace std; diff --git a/source/input/linux/gamecontroller.cpp b/source/input/linux/gamecontroller.cpp index 58e4ef1..c6b17c8 100644 --- a/source/input/linux/gamecontroller.cpp +++ b/source/input/linux/gamecontroller.cpp @@ -1,3 +1,5 @@ +#include "gamecontroller.h" +#include "gamecontroller_platform.h" #include #include #include @@ -5,8 +7,6 @@ #include #include #include -#include "gamecontroller.h" -#include "gamecontroller_platform.h" using namespace std; diff --git a/source/input/mouse.cpp b/source/input/mouse.cpp index 937a89e..e379576 100644 --- a/source/input/mouse.cpp +++ b/source/input/mouse.cpp @@ -1,6 +1,6 @@ +#include "mouse.h" #include #include "keys.h" -#include "mouse.h" namespace Msp { namespace Input { diff --git a/source/input/smoothcontrol.cpp b/source/input/smoothcontrol.cpp index 3218753..c9d0a3c 100644 --- a/source/input/smoothcontrol.cpp +++ b/source/input/smoothcontrol.cpp @@ -1,5 +1,5 @@ -#include #include "smoothcontrol.h" +#include using namespace std; diff --git a/source/input/windows/gamecontroller.cpp b/source/input/windows/gamecontroller.cpp index 1d06bfe..9c6853a 100644 --- a/source/input/windows/gamecontroller.cpp +++ b/source/input/windows/gamecontroller.cpp @@ -1,7 +1,7 @@ -#include -#include #include "gamecontroller.h" #include "gamecontroller_platform.h" +#include +#include using namespace std; diff --git a/source/input/windows/keyboard.cpp b/source/input/windows/keyboard.cpp index 690ba3a..47f2256 100644 --- a/source/input/windows/keyboard.cpp +++ b/source/input/windows/keyboard.cpp @@ -1,6 +1,6 @@ +#include "keyboard.h" #include #include -#include "keyboard.h" #include "keys.h" #include "keys_private.h" diff --git a/source/input/windows/keys.cpp b/source/input/windows/keys.cpp index e4cd0dc..9f81dc3 100644 --- a/source/input/windows/keys.cpp +++ b/source/input/windows/keys.cpp @@ -1,5 +1,5 @@ -#include #include "keys.h" +#include namespace Msp { namespace Input { diff --git a/source/input/windows/mouse.cpp b/source/input/windows/mouse.cpp index c9cb8a1..e5b3582 100644 --- a/source/input/windows/mouse.cpp +++ b/source/input/windows/mouse.cpp @@ -1,7 +1,7 @@ +#include "mouse.h" #include #include #include "keys.h" -#include "mouse.h" namespace Msp { namespace Input { diff --git a/source/input/windows/touchscreen.cpp b/source/input/windows/touchscreen.cpp index ce8e5a2..5820bda 100644 --- a/source/input/windows/touchscreen.cpp +++ b/source/input/windows/touchscreen.cpp @@ -1,7 +1,7 @@ #define _WIN32_WINNT 0x0601 +#include "touchscreen.h" #include #include -#include "touchscreen.h" using namespace std; diff --git a/source/input/x11/keyboard.cpp b/source/input/x11/keyboard.cpp index 68247e4..ed959da 100644 --- a/source/input/x11/keyboard.cpp +++ b/source/input/x11/keyboard.cpp @@ -1,7 +1,7 @@ +#include "keyboard.h" #include #include #include -#include "keyboard.h" #include "keys.h" #include "keys_private.h" diff --git a/source/input/x11/keys.cpp b/source/input/x11/keys.cpp index 1f0e509..ff7be19 100644 --- a/source/input/x11/keys.cpp +++ b/source/input/x11/keys.cpp @@ -1,6 +1,6 @@ +#include "keys.h" #include #include -#include "keys.h" namespace Msp { namespace Input { diff --git a/source/input/x11/mouse.cpp b/source/input/x11/mouse.cpp index b8a7717..84d1ea9 100644 --- a/source/input/x11/mouse.cpp +++ b/source/input/x11/mouse.cpp @@ -1,6 +1,6 @@ +#include "mouse.h" #include #include "keys.h" -#include "mouse.h" namespace Msp { namespace Input {