From 4281cb4daab0ac96251a31784fa871b73a337c15 Mon Sep 17 00:00:00 2001 From: Lauri Nurmi Date: Sun, 7 Feb 2016 01:11:25 +0200 Subject: [PATCH] Use enums, not typedef enums, in all public headers. --- include/wx/access.h | 20 ++++++++++---------- include/wx/defs.h | 4 ++-- include/wx/protocol/protocol.h | 4 ++-- include/wx/txtstrm.h | 4 ++-- include/wx/url.h | 4 ++-- interface/wx/access.h | 20 ++++++++++---------- interface/wx/txtstrm.h | 4 ++-- interface/wx/url.h | 4 ++-- 8 files changed, 32 insertions(+), 32 deletions(-) diff --git a/include/wx/access.h b/include/wx/access.h index 70cbaf1389..7eb041730b 100644 --- a/include/wx/access.h +++ b/include/wx/access.h @@ -21,14 +21,14 @@ #include "wx/variant.h" -typedef enum +enum wxAccStatus { wxACC_FAIL, wxACC_FALSE, wxACC_OK, wxACC_NOT_IMPLEMENTED, wxACC_NOT_SUPPORTED -} wxAccStatus; +}; // Child ids are integer identifiers from 1 up. // So zero represents 'this' object. @@ -36,7 +36,7 @@ typedef enum // Navigation constants -typedef enum +enum wxNavDir { wxNAVDIR_DOWN, wxNAVDIR_FIRSTCHILD, @@ -46,11 +46,11 @@ typedef enum wxNAVDIR_PREVIOUS, wxNAVDIR_RIGHT, wxNAVDIR_UP -} wxNavDir; +}; // Role constants -typedef enum { +enum wxAccRole { wxROLE_NONE, wxROLE_SYSTEM_ALERT, wxROLE_SYSTEM_ANIMATION, @@ -113,11 +113,11 @@ typedef enum { wxROLE_SYSTEM_TOOLTIP, wxROLE_SYSTEM_WHITESPACE, wxROLE_SYSTEM_WINDOW -} wxAccRole; +}; // Object types -typedef enum { +enum wxAccObject { wxOBJID_WINDOW = 0x00000000, wxOBJID_SYSMENU = 0xFFFFFFFF, wxOBJID_TITLEBAR = 0xFFFFFFFE, @@ -130,7 +130,7 @@ typedef enum { wxOBJID_CURSOR = 0xFFFFFFF7, wxOBJID_ALERT = 0xFFFFFFF6, wxOBJID_SOUND = 0xFFFFFFF5 -} wxAccObject; +}; // Accessible states @@ -163,7 +163,7 @@ typedef enum { // Selection flag -typedef enum +enum wxAccSelectionFlags { wxACC_SEL_NONE = 0, wxACC_SEL_TAKEFOCUS = 1, @@ -171,7 +171,7 @@ typedef enum wxACC_SEL_EXTENDSELECTION = 4, wxACC_SEL_ADDSELECTION = 8, wxACC_SEL_REMOVESELECTION = 16 -} wxAccSelectionFlags; +}; // Accessibility event identifiers diff --git a/include/wx/defs.h b/include/wx/defs.h index 493af83a4b..5049fa30df 100644 --- a/include/wx/defs.h +++ b/include/wx/defs.h @@ -2742,7 +2742,7 @@ enum wxKeyModifier #define wxDLG_UNIT(parent, pt) parent->ConvertDialogToPixels(pt) /* Paper types */ -typedef enum +enum wxPaperSize { wxPAPER_NONE, /* Use specific dimensions */ wxPAPER_LETTER, /* Letter, 8 1/2 by 11 inches */ @@ -2865,7 +2865,7 @@ typedef enum wxPAPER_PENV_10_ROTATED, /* PRC Envelope #10 Rotated 458 x 324 m */ wxPAPER_A0, /* A0 Sheet 841 x 1189 mm */ wxPAPER_A1 /* A1 Sheet 594 x 841 mm */ -} wxPaperSize; +}; /* Printing orientation */ enum wxPrintOrientation diff --git a/include/wx/protocol/protocol.h b/include/wx/protocol/protocol.h index e500f9dbb2..24f3dd7798 100644 --- a/include/wx/protocol/protocol.h +++ b/include/wx/protocol/protocol.h @@ -29,7 +29,7 @@ class WXDLLIMPEXP_FWD_NET wxProtocolLog; // constants // ---------------------------------------------------------------------------- -typedef enum +enum wxProtocolError { wxPROTO_NOERR = 0, wxPROTO_NETERR, @@ -41,7 +41,7 @@ typedef enum wxPROTO_ABRT, wxPROTO_RCNCT, wxPROTO_STREAMING -} wxProtocolError; +}; // ---------------------------------------------------------------------------- // wxProtocol: abstract base class for all protocols diff --git a/include/wx/txtstrm.h b/include/wx/txtstrm.h index 81b6d751b1..8fc43a176f 100644 --- a/include/wx/txtstrm.h +++ b/include/wx/txtstrm.h @@ -107,13 +107,13 @@ protected: wxDECLARE_NO_COPY_CLASS(wxTextInputStream); }; -typedef enum +enum wxEOL { wxEOL_NATIVE, wxEOL_UNIX, wxEOL_MAC, wxEOL_DOS -} wxEOL; +}; class WXDLLIMPEXP_BASE wxTextOutputStream { diff --git a/include/wx/url.h b/include/wx/url.h index 0ff2fefb0f..457b043b9f 100644 --- a/include/wx/url.h +++ b/include/wx/url.h @@ -22,7 +22,7 @@ #include "wx/protocol/http.h" #endif -typedef enum { +enum wxURLError { wxURL_NOERR = 0, wxURL_SNTXERR, wxURL_NOPROTO, @@ -30,7 +30,7 @@ typedef enum { wxURL_NOPATH, wxURL_CONNERR, wxURL_PROTOERR -} wxURLError; +}; #if wxUSE_URL_NATIVE class WXDLLIMPEXP_FWD_NET wxURL; diff --git a/interface/wx/access.h b/interface/wx/access.h index cd85a95f02..fbbac06dfb 100644 --- a/interface/wx/access.h +++ b/interface/wx/access.h @@ -10,20 +10,20 @@ wxAccessible functions return a wxAccStatus error code, which may be one of this enum's values. */ -typedef enum +enum wxAccStatus { wxACC_FAIL, //!< The function failed. wxACC_FALSE, //!< The function returned false. wxACC_OK, //!< The function completed successfully. wxACC_NOT_IMPLEMENTED, //!< The function is not implemented. wxACC_NOT_SUPPORTED //!< The function is not supported. -} wxAccStatus; +}; /** Directions of navigation are represented by this enum. */ -typedef enum +enum wxNavDir { wxNAVDIR_DOWN, wxNAVDIR_FIRSTCHILD, @@ -33,13 +33,13 @@ typedef enum wxNAVDIR_PREVIOUS, wxNAVDIR_RIGHT, wxNAVDIR_UP -} wxNavDir; +}; /** The role of a user interface element is represented by the values of this enum. */ -typedef enum { +enum wxAccRole { wxROLE_NONE, wxROLE_SYSTEM_ALERT, wxROLE_SYSTEM_ANIMATION, @@ -102,12 +102,12 @@ typedef enum { wxROLE_SYSTEM_TOOLTIP, wxROLE_SYSTEM_WHITESPACE, wxROLE_SYSTEM_WINDOW -} wxAccRole; +}; /** Objects are represented by a wxAccObject enum value. */ -typedef enum { +enum wxAccObject { wxOBJID_WINDOW = 0x00000000, wxOBJID_SYSMENU = 0xFFFFFFFF, wxOBJID_TITLEBAR = 0xFFFFFFFE, @@ -120,13 +120,13 @@ typedef enum { wxOBJID_CURSOR = 0xFFFFFFF7, wxOBJID_ALERT = 0xFFFFFFF6, wxOBJID_SOUND = 0xFFFFFFF5 -} wxAccObject; +}; /** Selection actions are identified by the wxAccSelectionFlags values. */ -typedef enum +enum wxAccSelectionFlags { wxACC_SEL_NONE = 0, wxACC_SEL_TAKEFOCUS = 1, @@ -134,7 +134,7 @@ typedef enum wxACC_SEL_EXTENDSELECTION = 4, wxACC_SEL_ADDSELECTION = 8, wxACC_SEL_REMOVESELECTION = 16 -} wxAccSelectionFlags; +}; //@{ /** diff --git a/interface/wx/txtstrm.h b/interface/wx/txtstrm.h index 11dc8574d4..8f84c89956 100644 --- a/interface/wx/txtstrm.h +++ b/interface/wx/txtstrm.h @@ -251,7 +251,7 @@ public: /** Specifies the end-of-line characters to use with wxTextOutputStream. */ -typedef enum +enum wxEOL { /** Specifies wxTextOutputStream to use the native end-of-line characters. @@ -272,7 +272,7 @@ typedef enum Specifies wxTextOutputStream to use DOS end-of-line characters. */ wxEOL_DOS -} wxEOL; +}; /** diff --git a/interface/wx/url.h b/interface/wx/url.h index a6ba86f934..b59ddb2e53 100644 --- a/interface/wx/url.h +++ b/interface/wx/url.h @@ -8,7 +8,7 @@ /** Error types returned from wxURL::GetError(). */ -typedef enum { +enum wxURLError { wxURL_NOERR = 0, ///< No error. wxURL_SNTXERR, ///< Syntax error in the URL string. wxURL_NOPROTO, ///< Found no protocol which can get this URL. @@ -16,7 +16,7 @@ typedef enum { wxURL_NOPATH, ///< A path is required for this protocol. wxURL_CONNERR, ///< Connection error. wxURL_PROTOERR ///< An error occurred during negotiation. -} wxURLError; +}; /** @class wxURL