preferences.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  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 <qcolor.h>
  21. #include <qfont.h>
  22. #include <ticables.h>
  23. class QWidget;
  24. class KConfig;
  25. #define SYNS_CUSTOM 1
  26. #define SYNS_BOLD 2
  27. #define SYNS_UNDERLINE 4
  28. #define SYNS_ITALIC 8
  29. #define SYNS_STRIKEOUT 16
  30. typedef unsigned short Syn_Style;
  31. typedef struct
  32. {
  33. QString name;
  34. QString beginning;
  35. QString ending;
  36. QChar ignoreEndingAfter;
  37. bool switchable;
  38. bool lineStartOnly;
  39. QColor color;
  40. Syn_Style style;
  41. } Syn_CustomStyle;
  42. typedef struct
  43. {
  44. QString name;
  45. QStringList list;
  46. QColor color;
  47. Syn_Style style;
  48. bool caseSensitive;
  49. } Syn_WordList;
  50. typedef struct
  51. {
  52. bool enabled;
  53. QColor numberColor;
  54. QColor symbolColor;
  55. QValueList<QColor> parenthesisColors;
  56. Syn_Style numberStyle;
  57. Syn_Style symbolStyle;
  58. Syn_Style parenthesisStyle;
  59. QValueList<Syn_CustomStyle> customStyles;
  60. QValueList<Syn_WordList> wordLists;
  61. } Syn_SettingsForDoc;
  62. int SynToXML(Syn_SettingsForDoc &syn,const QString &destFileName);
  63. enum LinkTargets {LT_NONE, LT_TIEMU, LT_REALCALC};
  64. typedef struct
  65. {
  66. // General
  67. bool stopAtFirstError;
  68. bool jumpToError;
  69. bool successMessage;
  70. bool deleteAsmFiles;
  71. bool deleteObjFiles;
  72. bool splitSourceFiles;
  73. bool allowImplicitDeclaration;
  74. bool autoSave;
  75. bool downloadHeadlines;
  76. bool deleteOverwrittenErrors;
  77. bool useSystemIcons;
  78. // Transfer
  79. LinkTargets linkTarget;
  80. CablePort linkPort;
  81. CableModel linkCable;
  82. // Editor
  83. unsigned short tabWidthC;
  84. unsigned short tabWidthAsm;
  85. bool useBgColor;
  86. QColor bgColor;
  87. QFont editorFont;
  88. bool useCalcCharset;
  89. bool lazyLoading;
  90. bool autoBlocks;
  91. bool removeTrailingSpaces;
  92. // Syntax Highlighting
  93. Syn_SettingsForDoc synC;
  94. Syn_SettingsForDoc synS;
  95. Syn_SettingsForDoc synAsm;
  96. Syn_SettingsForDoc synQll;
  97. // Used internally by the Preferences dialog
  98. bool haveA68k;
  99. bool haveQuill;
  100. Syn_SettingsForDoc tempSynC;
  101. Syn_SettingsForDoc tempSynS;
  102. Syn_SettingsForDoc tempSynAsm;
  103. Syn_SettingsForDoc tempSynQll;
  104. Syn_SettingsForDoc *syn;
  105. } TIGCCPrefs;
  106. void defaultSynHighlight(void);
  107. void loadPreferences(void);
  108. void savePreferences(void);
  109. int showPreferencesDialog(QWidget *parent, bool haveA68k, bool haveQuill);
  110. extern TIGCCPrefs preferences;
  111. #define C_ENABLED_HL_MODE ("TIGCC C")
  112. #define S_ENABLED_HL_MODE ("TIGCC GNU As")
  113. #define ASM_ENABLED_HL_MODE ("TIGCC A68k")
  114. #define QLL_ENABLED_HL_MODE ("TIGCC Quill")
  115. #define C_HL_MODE (preferences.synC.enabled?C_ENABLED_HL_MODE:"None")
  116. #define S_HL_MODE (preferences.synS.enabled?S_ENABLED_HL_MODE:"None")
  117. #define ASM_HL_MODE (preferences.synAsm.enabled?ASM_ENABLED_HL_MODE:"None")
  118. #define QLL_HL_MODE (preferences.synQll.enabled?QLL_ENABLED_HL_MODE:"None")