# HG changeset patch # User Santeri Piippo # Date 1393983949 -7200 # Node ID 425b169a82aa81f59b6a869599425dd237951680 # Parent d4dda62c660059445e6e4b2d9dedd55473658d0a - changed header guards into #pragma once diff -r d4dda62c6600 -r 425b169a82aa src/AddObjectDialog.h --- a/src/AddObjectDialog.h Wed Mar 05 03:39:31 2014 +0200 +++ b/src/AddObjectDialog.h Wed Mar 05 03:45:49 2014 +0200 @@ -16,9 +16,7 @@ * along with this program. If not, see . */ -#ifndef LDFORGE_ADDOBJECTDIALOG_H -#define LDFORGE_ADDOBJECTDIALOG_H - +#pragma once #include #include "LDObject.h" @@ -69,5 +67,3 @@ void slot_colorButtonClicked(); void slot_subfileTypeChanged(); }; - -#endif // LDFORGE_ADDOBJECTDIALOG_H diff -r d4dda62c6600 -r 425b169a82aa src/ColorSelector.h --- a/src/ColorSelector.h Wed Mar 05 03:39:31 2014 +0200 +++ b/src/ColorSelector.h Wed Mar 05 03:45:49 2014 +0200 @@ -16,9 +16,7 @@ * along with this program. If not, see . */ -#ifndef LDFORGE_COLORSELECTOR_H -#define LDFORGE_COLORSELECTOR_H - +#pragma once #include #include "Main.h" @@ -50,5 +48,3 @@ void drawScene(); void drawColorInfo(); }; - -#endif // LDFORGE_COLORSELECTOR_H diff -r d4dda62c6600 -r 425b169a82aa src/Colors.h --- a/src/Colors.h Wed Mar 05 03:39:31 2014 +0200 +++ b/src/Colors.h Wed Mar 05 03:45:49 2014 +0200 @@ -16,9 +16,7 @@ * along with this program. If not, see . */ -#ifndef LDFORGE_COLORS_H -#define LDFORGE_COLORS_H - +#pragma once #include #include "Main.h" @@ -42,5 +40,3 @@ // Main and edge color identifiers static const int maincolor = 16; static const int edgecolor = 24; - -#endif // LDFORGE_COLORS_H diff -r d4dda62c6600 -r 425b169a82aa src/Configuration.h --- a/src/Configuration.h Wed Mar 05 03:39:31 2014 +0200 +++ b/src/Configuration.h Wed Mar 05 03:45:49 2014 +0200 @@ -16,16 +16,13 @@ * along with this program. If not, see . */ -#ifndef LDFORGE_CONFIG_H -#define LDFORGE_CONFIG_H - +#pragma once +#include +#include +#include #include "PropertyMacro.h" #include "Types.h" -// ============================================================================= -#include -#include -#include class QSettings; #define MAX_INI_LINE 512 @@ -148,45 +145,50 @@ ValueType m_default; // ============================================================================= +// class IntConfig : public Config { IMPLEMENT_CONFIG (Int) }; // ============================================================================= +// class StringConfig : public Config { IMPLEMENT_CONFIG (String) }; // ============================================================================= +// class FloatConfig : public Config { IMPLEMENT_CONFIG (Float) }; // ============================================================================= +// class BoolConfig : public Config { IMPLEMENT_CONFIG (Bool) }; // ============================================================================= +// class KeySequenceConfig : public Config { IMPLEMENT_CONFIG (KeySequence) }; // ============================================================================= +// class ListConfig : public Config { IMPLEMENT_CONFIG (List) }; // ============================================================================= +// class VertexConfig : public Config { IMPLEMENT_CONFIG (Vertex) }; - -#endif // LDFORGE_CONFIG_H diff -r d4dda62c6600 -r 425b169a82aa src/ConfigurationDialog.h --- a/src/ConfigurationDialog.h Wed Mar 05 03:39:31 2014 +0200 +++ b/src/ConfigurationDialog.h Wed Mar 05 03:45:49 2014 +0200 @@ -16,9 +16,7 @@ * along with this program. If not, see . */ -#ifndef LDFORGE_CONFIGDIALOG_H -#define LDFORGE_CONFIGDIALOG_H - +#pragma once #include "MainWindow.h" #include @@ -119,5 +117,3 @@ private slots: virtual void keyPressEvent (QKeyEvent* ev) override; }; - -#endif // LDFORGE_CONFIGDIALOG_H diff -r d4dda62c6600 -r 425b169a82aa src/CrashCatcher.h --- a/src/CrashCatcher.h Wed Mar 05 03:39:31 2014 +0200 +++ b/src/CrashCatcher.h Wed Mar 05 03:45:49 2014 +0200 @@ -16,14 +16,9 @@ * along with this program. If not, see . */ -#ifndef LDFORGE_CRASHCATCHER_H -#define LDFORGE_CRASHCATCHER_H - +#pragma once #ifdef __unix__ - void initCrashCatcher(); - #else // ifdef __unix__ -#define initCrashCatcher() +# define initCrashCatcher() #endif // ifdef __unix__ -#endif // ifndef LDFORGE_CRASHCATCHER_H \ No newline at end of file diff -r d4dda62c6600 -r 425b169a82aa src/Dialogs.h --- a/src/Dialogs.h Wed Mar 05 03:39:31 2014 +0200 +++ b/src/Dialogs.h Wed Mar 05 03:45:49 2014 +0200 @@ -16,9 +16,7 @@ * along with this program. If not, see . */ -#ifndef LDFORGE_DIALOGS_H -#define LDFORGE_DIALOGS_H - +#pragma once #include #include "Main.h" #include "Types.h" @@ -141,5 +139,3 @@ }; void bombBox (const QString& message); - -#endif // LDFORGE_DIALOGS_H diff -r d4dda62c6600 -r 425b169a82aa src/Document.h --- a/src/Document.h Wed Mar 05 03:39:31 2014 +0200 +++ b/src/Document.h Wed Mar 05 03:45:49 2014 +0200 @@ -16,9 +16,7 @@ * along with this program. If not, see . */ -#ifndef LDFORGE_DOCUMENT_H -#define LDFORGE_DOCUMENT_H - +#pragma once #include #include "Main.h" #include "LDObject.h" @@ -41,18 +39,16 @@ } // ============================================================================= -// LDDocument // -// The LDDocument class stores a document opened in LDForge either as a editable -// file for the user or for subfile caching. Its methods handle file input and -// output. +// This class stores a document either as a editable file for the user or for +// subfile caching. Its methods handle file input and output. // // A file is implicit when they are opened automatically for caching purposes // and are hidden from the user. User-opened files are explicit (not implicit). // // The default name is a placeholder, initially suggested name for a file. The // primitive generator uses this to give initial names to primitives. -// ============================================================================= +// class LDDocument : public QObject { properties: @@ -208,14 +204,13 @@ extern QList g_loadedFiles; // Vector of all currently opened files. // ============================================================================= -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -// ============================================================================= -// FileLoader +// +// LDFileLoader // // Loads the given file and parses it to LDObjects using parseLine. It's a // separate class so as to be able to do the work progressively through the // event loop, allowing the program to maintain responsivity during loading. -// ============================================================================= +// class LDFileLoader : public QObject { Q_OBJECT @@ -241,5 +236,3 @@ void progressUpdate (int progress); void workDone(); }; - -#endif // LDFORGE_DOCUMENT_H diff -r d4dda62c6600 -r 425b169a82aa src/Documentation.h --- a/src/Documentation.h Wed Mar 05 03:39:31 2014 +0200 +++ b/src/Documentation.h Wed Mar 05 03:45:49 2014 +0200 @@ -16,11 +16,6 @@ * along with this program. If not, see . */ -#ifndef LDFORGE_DOCS_H -#define LDFORGE_DOCS_H - +#pragma once extern const char* g_docs_overlays; - void showDocumentation (const char* text); - -#endif // LDFORGE_DOCS_H \ No newline at end of file diff -r d4dda62c6600 -r 425b169a82aa src/EditHistory.h --- a/src/EditHistory.h Wed Mar 05 03:39:31 2014 +0200 +++ b/src/EditHistory.h Wed Mar 05 03:45:49 2014 +0200 @@ -16,9 +16,7 @@ * along with this program. If not, see . */ -#ifndef LDFORGE_HISTORY_H -#define LDFORGE_HISTORY_H - +#pragma once #include "Main.h" #include "LDObject.h" @@ -180,5 +178,3 @@ private: int a, b; }; - -#endif // LDFORGE_HISTORY_H diff -r d4dda62c6600 -r 425b169a82aa src/GLRenderer.h --- a/src/GLRenderer.h Wed Mar 05 03:39:31 2014 +0200 +++ b/src/GLRenderer.h Wed Mar 05 03:45:49 2014 +0200 @@ -16,9 +16,7 @@ * along with this program. If not, see . */ -#ifndef LDFORGE_GLDRAW_H -#define LDFORGE_GLDRAW_H - +#pragma once #include #include "Main.h" #include "LDObject.h" @@ -305,5 +303,3 @@ extern const GL::EFixedCamera g_Cameras[7]; extern const char* g_CameraNames[7]; - -#endif // LDFORGE_GLDRAW_H diff -r d4dda62c6600 -r 425b169a82aa src/LDConfig.h --- a/src/LDConfig.h Wed Mar 05 03:39:31 2014 +0200 +++ b/src/LDConfig.h Wed Mar 05 03:45:49 2014 +0200 @@ -16,9 +16,7 @@ * along with this program. If not, see . */ -#ifndef LDFORGE_LDCONFIG_H -#define LDFORGE_LDCONFIG_H - +#pragma once #include "Types.h" #include @@ -54,5 +52,3 @@ }; void parseLDConfig(); - -#endif // LDFORGE_LDCONFIG_H diff -r d4dda62c6600 -r 425b169a82aa src/LDObject.h --- a/src/LDObject.h Wed Mar 05 03:39:31 2014 +0200 +++ b/src/LDObject.h Wed Mar 05 03:45:49 2014 +0200 @@ -16,9 +16,7 @@ * along with this program. If not, see . */ -#ifndef LDFORGE_LDTYPES_H -#define LDFORGE_LDTYPES_H - +#pragma once #include "Main.h" #include "Types.h" #include "misc/DocumentPointer.h" @@ -566,5 +564,3 @@ static const int hires = 48; QString getLicenseText (int id); - -#endif // LDFORGE_LDTYPES_H diff -r d4dda62c6600 -r 425b169a82aa src/Main.h --- a/src/Main.h Wed Mar 05 03:39:31 2014 +0200 +++ b/src/Main.h Wed Mar 05 03:45:49 2014 +0200 @@ -20,9 +20,7 @@ // This file is included one way or another in every source file of LDForge. // Stuff defined and included here is universally included. -#ifndef LDFORGE_MAIN_H -#define LDFORGE_MAIN_H - +#pragma once #include #include #include @@ -103,5 +101,3 @@ static const char* __func__ = ""; // Current function name typedef void FILE; // :| #endif // IN_IDE_PARSER - -#endif // LDFORGE_MAIN_H diff -r d4dda62c6600 -r 425b169a82aa src/MainWindow.h --- a/src/MainWindow.h Wed Mar 05 03:39:31 2014 +0200 +++ b/src/MainWindow.h Wed Mar 05 03:45:49 2014 +0200 @@ -16,9 +16,7 @@ * along with this program. If not, see . */ -#ifndef LDFORGE_GUI_H -#define LDFORGE_GUI_H - +#pragma once #include #include #include @@ -254,11 +252,15 @@ }; // ============================================================================= +// // Pointer to the instance of MainWindow. +// extern MainWindow* g_win; // ============================================================================= -// Other GUI-related stuff not directly part of MainWindow: +// +// Other GUI-related stuff not directly part of MainWindow +// QPixmap getIcon (QString iconName); // Get an icon from the resource dir QList quickColorsFromConfig(); // Make a list of quick colors based on config bool confirm (QString title, QString msg); // Generic confirm prompt @@ -269,10 +271,10 @@ QImage imageFromScreencap (uchar* data, int w, int h); // ============================================================================= -// ============================================================================= +// // Takes in pairs of radio buttons and respective values and returns the value of // the first found radio button that was checked. -// ============================================================================= +// template T radioSwitch (const T& defval, QList> haystack) { @@ -284,10 +286,10 @@ } // ============================================================================= -// ============================================================================= +// // Takes in pairs of radio buttons and respective values and checks the first // found radio button to have the given value. -// ============================================================================= +// template void radioDefault (const T& expr, QList> haystack) { @@ -300,5 +302,3 @@ } } } - -#endif // LDFORGE_GUI_H diff -r d4dda62c6600 -r 425b169a82aa src/MessageLog.h --- a/src/MessageLog.h Wed Mar 05 03:39:31 2014 +0200 +++ b/src/MessageLog.h Wed Mar 05 03:45:49 2014 +0200 @@ -16,9 +16,7 @@ * along with this program. If not, see . */ -#ifndef LDFORGE_MESSAGELOG_H -#define LDFORGE_MESSAGELOG_H - +#pragma once #include #include #include "Main.h" @@ -66,5 +64,3 @@ private slots: void tick(); }; - -#endif // LDFORGE_MESSAGELOG_H diff -r d4dda62c6600 -r 425b169a82aa src/Misc.h --- a/src/Misc.h Wed Mar 05 03:39:31 2014 +0200 +++ b/src/Misc.h Wed Mar 05 03:45:49 2014 +0200 @@ -16,9 +16,7 @@ * along with this program. If not, see . */ -#ifndef LDFORGE_MISC_H -#define LDFORGE_MISC_H - +#pragma once #include #include "Configuration.h" #include "Main.h" @@ -138,5 +136,3 @@ std::sort (a.begin(), a.end()); a.erase (std::unique (a.begin(), a.end()), a.end()); } - -#endif // LDFORGE_MISC_H diff -r d4dda62c6600 -r 425b169a82aa src/PartDownloader.h --- a/src/PartDownloader.h Wed Mar 05 03:39:31 2014 +0200 +++ b/src/PartDownloader.h Wed Mar 05 03:45:49 2014 +0200 @@ -16,9 +16,7 @@ * along with this program. If not, see . */ -#ifndef LDFORGE_DOWNLOAD_H -#define LDFORGE_DOWNLOAD_H - +#pragma once #include #include "Main.h" #include "Types.h" @@ -33,7 +31,7 @@ class QAbstractButton; // ============================================================================= -// ============================================================================= +// class PartDownloader : public QDialog { typedefs: @@ -87,7 +85,7 @@ }; // ============================================================================= -// ============================================================================= +// class PartDownloadRequest : public QObject { typedefs: @@ -130,5 +128,3 @@ void downloadProgress (qint64 recv, qint64 total); void abort(); }; - -#endif // LDFORGE_DOWNLOAD_H diff -r d4dda62c6600 -r 425b169a82aa src/Primitives.h --- a/src/Primitives.h Wed Mar 05 03:39:31 2014 +0200 +++ b/src/Primitives.h Wed Mar 05 03:45:49 2014 +0200 @@ -16,9 +16,7 @@ * along with this program. If not, see . */ -#ifndef LDFORGE_PRIMITIVES_H -#define LDFORGE_PRIMITIVES_H - +#pragma once #include "Main.h" #include "Types.h" #include @@ -130,5 +128,3 @@ LDDocument* getPrimitive (PrimitiveType type, int segs, int divs, int num); QString radialFileName (PrimitiveType type, int segs, int divs, int num); - -#endif // LDFORGE_PRIMITIVES_H diff -r d4dda62c6600 -r 425b169a82aa src/PropertyMacro.h --- a/src/PropertyMacro.h Wed Mar 05 03:39:31 2014 +0200 +++ b/src/PropertyMacro.h Wed Mar 05 03:45:49 2014 +0200 @@ -16,8 +16,7 @@ * along with this program. If not, see . */ -#ifndef LDFORGE_PROPERTY_H -#define LDFORGE_PROPERTY_H +#pragma once // ============================================================================= // @@ -199,5 +198,3 @@ { \ return PROPERTY_GET_ACCESSOR (NAME)().size(); \ } - -#endif // LDFORGE_PROPERTY_H \ No newline at end of file diff -r d4dda62c6600 -r 425b169a82aa src/Types.h --- a/src/Types.h Wed Mar 05 03:39:31 2014 +0200 +++ b/src/Types.h Wed Mar 05 03:45:49 2014 +0200 @@ -16,9 +16,7 @@ * along with this program. If not, see . */ -#ifndef LDFORGE_TYPES_H -#define LDFORGE_TYPES_H - +#pragma once #include #include #include @@ -311,5 +309,3 @@ extern const Matrix g_identity; // Identity matrix static const double pi = 3.14159265358979323846; - -#endif // LDFORGE_TYPES_H diff -r d4dda62c6600 -r 425b169a82aa src/Version.h --- a/src/Version.h Wed Mar 05 03:39:31 2014 +0200 +++ b/src/Version.h Wed Mar 05 03:45:49 2014 +0200 @@ -34,4 +34,4 @@ #ifdef RELEASE # undef DEBUG -#endif // RELEASE \ No newline at end of file +#endif // RELEASE diff -r d4dda62c6600 -r 425b169a82aa src/Widgets.h --- a/src/Widgets.h Wed Mar 05 03:39:31 2014 +0200 +++ b/src/Widgets.h Wed Mar 05 03:45:49 2014 +0200 @@ -16,9 +16,7 @@ * along with this program. If not, see . */ -#ifndef WIDGETS_H -#define WIDGETS_H - +#pragma once #include #include #include @@ -92,5 +90,3 @@ void slot_buttonPressed (int btn); void slot_buttonReleased (int btn); }; - -#endif // WIDGETS_H diff -r d4dda62c6600 -r 425b169a82aa src/misc/DocumentPointer.h --- a/src/misc/DocumentPointer.h Wed Mar 05 03:39:31 2014 +0200 +++ b/src/misc/DocumentPointer.h Wed Mar 05 03:45:49 2014 +0200 @@ -16,8 +16,7 @@ * along with this program. If not, see . */ -#ifndef LDFORGE_DOCUMENT_POINTER_H -#define LDFORGE_DOCUMENT_POINTER_H +#pragma once #include "../Main.h" @@ -55,4 +54,3 @@ void removeReference(); }; -#endif // LDFORGE_DOCUMENT_POINTER_H \ No newline at end of file diff -r d4dda62c6600 -r 425b169a82aa src/misc/InvokationDeferer.h --- a/src/misc/InvokationDeferer.h Wed Mar 05 03:39:31 2014 +0200 +++ b/src/misc/InvokationDeferer.h Wed Mar 05 03:45:49 2014 +0200 @@ -16,8 +16,7 @@ * along with this program. If not, see . */ -#ifndef LDFORGE_MISC_INVOKATION_DEFERER_H -#define LDFORGE_MISC_INVOKATION_DEFERER_H +#pragma once #include @@ -43,4 +42,3 @@ void invokeLater (InvokationDeferer::FunctionType func); -#endif // LDFORGE_MISC_INVOKATION_DEFERER_H \ No newline at end of file diff -r d4dda62c6600 -r 425b169a82aa src/misc/RingFinder.h --- a/src/misc/RingFinder.h Wed Mar 05 03:39:31 2014 +0200 +++ b/src/misc/RingFinder.h Wed Mar 05 03:45:49 2014 +0200 @@ -16,8 +16,7 @@ * along with this program. If not, see . */ -#ifndef LDFORGE_MISC_RINGFINDER_H -#define LDFORGE_MISC_RINGFINDER_H +#pragma once #include "../Main.h" @@ -85,4 +84,3 @@ extern RingFinder g_RingFinder; -#endif // LDFORGE_MISC_RINGFINDER_H \ No newline at end of file