preferences.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. /*
  2. ktigcc - TIGCC IDE for KDE
  3. Copyright (C) 2004-2006 Kevin Kofler
  4. Copyright (C) 2006 Joey Adams
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 2, or (at your option)
  8. any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; if not, write to the Free Software Foundation,
  15. Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  16. */
  17. #include <qstring.h>
  18. #include <qstringlist.h>
  19. #include <qvaluelist.h>
  20. #include <qpair.h>
  21. #include <qcolor.h>
  22. #include <qfont.h>
  23. #include <ticables.h>
  24. class QWidget;
  25. class KConfig;
  26. #define SYNS_CUSTOM 1
  27. #define SYNS_BOLD 2
  28. #define SYNS_UNDERLINE 4
  29. #define SYNS_ITALIC 8
  30. #define SYNS_STRIKEOUT 16
  31. typedef unsigned short Syn_Style;
  32. typedef struct
  33. {
  34. QString name;
  35. QString beginning;
  36. QString ending;
  37. QChar ignoreEndingAfter;
  38. bool switchable;
  39. bool lineStartOnly;
  40. QColor color;
  41. Syn_Style style;
  42. } Syn_CustomStyle;
  43. typedef struct
  44. {
  45. QString name;
  46. QStringList list;
  47. QColor color;
  48. Syn_Style style;
  49. bool caseSensitive;
  50. } Syn_WordList;
  51. typedef struct
  52. {
  53. bool enabled;
  54. QColor numberColor;
  55. QColor symbolColor;
  56. QValueList<QColor> parenthesisColors;
  57. Syn_Style numberStyle;
  58. Syn_Style symbolStyle;
  59. Syn_Style parenthesisStyle;
  60. QValueList<Syn_CustomStyle> customStyles;
  61. QValueList<Syn_WordList> wordLists;
  62. } Syn_SettingsForDoc;
  63. int SynToXML(Syn_SettingsForDoc &syn,const QString &destFileName);
  64. enum LinkTargets {LT_NONE, LT_TIEMU, LT_REALCALC};
  65. typedef struct
  66. {
  67. // General
  68. bool stopAtFirstError;
  69. bool jumpToError;
  70. bool successMessage;
  71. bool deleteAsmFiles;
  72. bool deleteObjFiles;
  73. bool splitSourceFiles;
  74. bool allowImplicitDeclaration;
  75. bool autoSave;
  76. bool downloadHeadlines;
  77. bool deleteOverwrittenErrors;
  78. bool useSystemIcons;
  79. // Transfer
  80. LinkTargets linkTarget;
  81. CablePort linkPort;
  82. CableModel linkCable;
  83. // Editor
  84. unsigned short tabWidthC;
  85. unsigned short tabWidthAsm;
  86. bool useBgColor;
  87. QColor bgColor;
  88. QFont editorFont;
  89. bool useCalcCharset;
  90. bool lazyLoading;
  91. bool autoBlocks;
  92. bool removeTrailingSpaces;
  93. // Syntax Highlighting
  94. Syn_SettingsForDoc synC;
  95. Syn_SettingsForDoc synS;
  96. Syn_SettingsForDoc synAsm;
  97. Syn_SettingsForDoc synQll;
  98. // Coding
  99. QValueList<QPair<QString,QString> > templates;
  100. // Used internally by the Preferences dialog
  101. bool haveA68k;
  102. bool haveQuill;
  103. Syn_SettingsForDoc tempSynC;
  104. Syn_SettingsForDoc tempSynS;
  105. Syn_SettingsForDoc tempSynAsm;
  106. Syn_SettingsForDoc tempSynQll;
  107. Syn_SettingsForDoc *syn;
  108. } TIGCCPrefs;
  109. void resetSyntaxPreference(Syn_SettingsForDoc *syn);
  110. void loadPreferences(void);
  111. void savePreferences(void);
  112. int showPreferencesDialog(QWidget *parent, bool haveA68k, bool haveQuill);
  113. extern TIGCCPrefs preferences;
  114. #define C_ENABLED_HL_MODE ("TIGCC C")
  115. #define S_ENABLED_HL_MODE ("TIGCC GNU As")
  116. #define ASM_ENABLED_HL_MODE ("TIGCC A68k")
  117. #define QLL_ENABLED_HL_MODE ("TIGCC Quill")
  118. #define C_HL_MODE (preferences.synC.enabled?C_ENABLED_HL_MODE:"None")
  119. #define S_HL_MODE (preferences.synS.enabled?S_ENABLED_HL_MODE:"None")
  120. #define ASM_HL_MODE (preferences.synAsm.enabled?ASM_ENABLED_HL_MODE:"None")
  121. #define QLL_HL_MODE (preferences.synQll.enabled?QLL_ENABLED_HL_MODE:"None")