]> Shamusworld >> Repos - architektonas/blobdiff - src/base/enums.h
Removed unnecessary RS_ prefix from classes and whatnot.
[architektonas] / src / base / enums.h
similarity index 75%
rename from src/base/rs.h
rename to src/base/enums.h
index d0bfc411e7eba9cd451cc5d2aa79860b588bbcc8..667f311d93df04a3d4b91afd8de93fbbe5eb2927 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef __RS_H__
-#define __RS_H__
+#ifndef __ENUMS_H__
+#define __ENUMS_H__
 
 #include <QtGui>
 #include <QPrinter>
@@ -21,6 +21,7 @@
  * @author James Hammons
  * @author Andrew Mustun
  */
+//change from RS2 to EN (for ENum)
 class RS2
 {
 public:
@@ -62,7 +63,7 @@ public:
     };
 
     /**
-     * Variable types used by RS_VariableDict and RS_Variable.
+     * Variable types used by VariableDict and Variable.
      */
     enum VariableType {
         VariableString,
@@ -594,88 +595,6 @@ public:
         LineByBlock = -2      /**< Line type defined by block not entity */
     };
 
-    /**
-     * Wrapper for Qt
-     */
-    static Qt::PenStyle rsToQtLineType(RS2::LineType t) {
-        switch (t) {
-        case NoPen:
-            return Qt::NoPen;
-            break;
-        case SolidLine:
-            return Qt::SolidLine;
-            break;
-        case DotLine:
-        case DotLine2:
-        case DotLineX2:
-            return Qt::DotLine;
-            break;
-        case DashLine:
-        case DashLine2:
-        case DashLineX2:
-            return Qt::DashLine;
-            break;
-        case DashDotLine:
-        case DashDotLine2:
-        case DashDotLineX2:
-            return Qt::DashDotLine;
-            break;
-        case DivideLine:
-        case DivideLine2:
-        case DivideLineX2:
-            return Qt::DashDotDotLine;
-            break;
-        case CenterLine:
-        case CenterLine2:
-        case CenterLineX2:
-            return Qt::DashDotLine;
-            break;
-        case BorderLine:
-        case BorderLine2:
-        case BorderLineX2:
-            return Qt::DashDotLine;
-            break;
-        case LineByLayer:
-        case LineByBlock:
-        default:
-            return Qt::SolidLine;
-            break;
-        }
-        return Qt::SolidLine;
-    }
-
-    /**
-     * Wrapper for Qt.
-     */
-    static RS2::LineType qtToRsPenStyle(Qt::PenStyle s)
-    {
-        switch (s)
-               {
-        case Qt::NoPen:
-            return NoPen;
-        case Qt::SolidLine:
-            return SolidLine;
-            break;
-        case Qt::DashLine:
-            return DashLine;
-            break;
-        case Qt::DotLine:
-            return DotLine;
-            break;
-        case Qt::DashDotLine:
-            return DashDotLine;
-            break;
-        case Qt::DashDotDotLine:
-            return DivideLine;
-            break;
-        default:
-            return SolidLine;
-            break;
-        }
-
-               return SolidLine;
-    }
-
     /**
      * \brief Struct that stores a line type pattern (e.g. dash dot dot).
      */
@@ -719,121 +638,6 @@ public:
         WidthDefault = -3  /**< Line width defaults to the predefined line width. */
     };
 
-    /**
-     * Wrapper for Qt
-     */
-    static LineWidth intToLineWidth(int w)
-    {
-               if (w == -3)
-               {
-                       return WidthDefault;
-               }
-               else if (w == -2)
-               {
-                       return WidthByBlock;
-               }
-               else if (w == -1)
-               {
-                       return WidthByLayer;
-               }
-               else if (w < 3)
-               {
-                       return Width00;
-               }
-               else if (w < 8)
-               {
-                       return Width01;
-               }
-               else if (w < 12)
-               {
-                       return Width02;
-               }
-               else if (w < 14)
-               {
-                       return Width03;
-               }
-               else if (w < 17)
-               {
-                       return Width04;
-               }
-               else if (w < 19)
-               {
-                       return Width05;
-               }
-               else if (w < 23)
-               {
-                       return Width06;
-               }
-               else if (w < 28)
-               {
-                       return Width07;
-               }
-               else if (w < 33)
-               {
-                       return Width08;
-               }
-               else if (w < 38)
-               {
-                       return Width09;
-               }
-               else if (w < 46)
-               {
-                       return Width10;
-               }
-               else if (w < 52)
-               {
-                       return Width11;
-               }
-               else if (w < 57)
-               {
-                       return Width12;
-               }
-               else if (w < 66)
-               {
-                       return Width13;
-               }
-               else if (w < 76)
-               {
-                       return Width14;
-               }
-               else if (w < 86)
-               {
-                       return Width15;
-               }
-               else if (w < 96)
-               {
-                       return Width16;
-               }
-               else if (w < 104)
-               {
-                       return Width17;
-               }
-               else if (w < 114)
-               {
-                       return Width18;
-               }
-               else if (w < 131)
-               {
-                       return Width19;
-               }
-               else if (w < 150)
-               {
-                       return Width20;
-               }
-               else if (w < 180)
-               {
-                       return Width21;
-               }
-               else if (w < 206)
-               {
-                       return Width22;
-               }
-               else
-               {
-                       return Width23;
-               }
-    }
-
     /**
      * Enum of cursor types.
      */
@@ -861,69 +665,6 @@ public:
         MovingHandCursor      /**< Moving hand - a little flat hand. */
     };
 
-    /**
-     * Wrapper for Qt.
-     */
-    static Qt::CursorShape rsToQtCursorType(RS2::CursorType t)
-    {
-        switch (t)
-               {
-        case ArrowCursor:
-            return Qt::ArrowCursor;
-            break;
-        case UpArrowCursor:
-            return Qt::UpArrowCursor;
-            break;
-        case CrossCursor:
-            return Qt::CrossCursor;
-            break;
-        case WaitCursor:
-            return Qt::WaitCursor;
-            break;
-        case IbeamCursor:
-            return Qt::IBeamCursor;
-            break;
-        case SizeVerCursor:
-            return Qt::SizeVerCursor;
-            break;
-        case SizeHorCursor:
-            return Qt::SizeHorCursor;
-            break;
-        case SizeBDiagCursor:
-            return Qt::SizeBDiagCursor;
-            break;
-        case SizeFDiagCursor:
-            return Qt::SizeFDiagCursor;
-            break;
-        case SizeAllCursor:
-            return Qt::SizeAllCursor;
-            break;
-        case BlankCursor:
-            return Qt::BlankCursor;
-            break;
-        case SplitVCursor:
-            return Qt::SplitVCursor;
-            break;
-        case SplitHCursor:
-            return Qt::SplitHCursor;
-            break;
-        case PointingHandCursor:
-            return Qt::PointingHandCursor;
-            break;
-        case ForbiddenCursor:
-            return Qt::ForbiddenCursor;
-            break;
-        case WhatsThisCursor:
-            return Qt::WhatsThisCursor;
-            break;
-        default:
-            return Qt::ArrowCursor;
-            break;
-        }
-
-               return Qt::ArrowCursor;
-    }
-
     /**
      * Paper formats.
      */
@@ -962,116 +703,14 @@ public:
                NPageSize
        };
 
-    /**
-     * Wrapper for Qt.
-     */
-    static QPrinter::PageSize rsToQtPaperFormat(RS2::PaperFormat f)
-    {
-               QPrinter::PageSize ret;
-
-               switch (f)
-               {
-        case Custom:
-                       ret = QPrinter::Custom;
-                       break;
-               case Letter:
-                       ret = QPrinter::Letter;
-                       break;
-               case Legal:
-                       ret = QPrinter::Legal;
-                       break;
-               case Executive:
-                       ret = QPrinter::Executive;
-                       break;
-        case A0:
-                       ret = QPrinter::A0;
-                       break;
-               case A1:
-                       ret = QPrinter::A1;
-                       break;
-               case A2:
-                       ret = QPrinter::A2;
-                       break;
-               case A3:
-                       ret = QPrinter::A3;
-                       break;
-               default:
-               case A4:
-                       ret = QPrinter::A4;
-                       break;
-               case A5:
-                       ret = QPrinter::A5;
-                       break;
-               case A6:
-                       ret = QPrinter::A6;
-                       break;
-               case A7:
-                       ret = QPrinter::A7;
-                       break;
-               case A8:
-                       ret = QPrinter::A8;
-                       break;
-               case A9:
-                       ret = QPrinter::A9;
-                       break;
-               case B0:
-                       ret = QPrinter::B0;
-                       break;
-               case B1:
-                       ret = QPrinter::B1;
-                       break;
-               case B2:
-                       ret = QPrinter::B2;
-                       break;
-               case B3:
-                       ret = QPrinter::B3;
-                       break;
-               case B4:
-                       ret = QPrinter::B4;
-                       break;
-               case B5:
-                       ret = QPrinter::B5;
-                       break;
-               case B6:
-                       ret = QPrinter::B6;
-                       break;
-               case B7:
-                       ret = QPrinter::B7;
-                       break;
-               case B8:
-                       ret = QPrinter::B8;
-                       break;
-               case B9:
-                       ret = QPrinter::B9;
-                       break;
-               case B10:
-                       ret = QPrinter::B10;
-                       break;
-               case C5E:
-                       ret = QPrinter::C5E;
-                       break;
-               case Comm10E:
-                       ret = QPrinter::Comm10E;
-                       break;
-        case DLE:
-                       ret = QPrinter::DLE;
-                       break;
-               case Folio:
-                       ret = QPrinter::Folio;
-                       break;
-               //case Ledger:
-               //      ret = QPrinter::Ledger;
-               //      break;
-               case Tabloid:
-                       ret = QPrinter::Tabloid;
-                       break;
-               case NPageSize:
-                       ret = QPrinter::NPageSize;
-                       break;
-               }
-
-               return ret;
-       }
+               /**
+                * Wrappers for Qt (ICK)
+                */
+               static Qt::PenStyle rsToQtLineType(RS2::LineType t);
+               static RS2::LineType qtToRsPenStyle(Qt::PenStyle s);
+               static RS2::LineWidth intToLineWidth(int w);
+               static Qt::CursorShape rsToQtCursorType(RS2::CursorType t);
+               static QPrinter::PageSize rsToQtPaperFormat(RS2::PaperFormat f);
 };
 
-#endif // __RS_H__
+#endif // __ENUMS_H__