preferences.h 3.6 KB

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