qscilexeridl.cpp 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. // This module implements the QsciLexerIDL class.
  2. //
  3. // Copyright (c) 2017 Riverbank Computing Limited <info@riverbankcomputing.com>
  4. //
  5. // This file is part of QScintilla.
  6. //
  7. // This file may be used under the terms of the GNU General Public License
  8. // version 3.0 as published by the Free Software Foundation and appearing in
  9. // the file LICENSE included in the packaging of this file. Please review the
  10. // following information to ensure the GNU General Public License version 3.0
  11. // requirements will be met: http://www.gnu.org/copyleft/gpl.html.
  12. //
  13. // If you do not wish to use this file under the terms of the GPL version 3.0
  14. // then you may purchase a commercial license. For more information contact
  15. // info@riverbankcomputing.com.
  16. //
  17. // This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
  18. // WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  19. #include "Qsci/qscilexeridl.h"
  20. #include <qcolor.h>
  21. #include <qfont.h>
  22. // The ctor.
  23. QsciLexerIDL::QsciLexerIDL(QObject *parent)
  24. : QsciLexerCPP(parent)
  25. {
  26. }
  27. // The dtor.
  28. QsciLexerIDL::~QsciLexerIDL()
  29. {
  30. }
  31. // Returns the language name.
  32. const char *QsciLexerIDL::language() const
  33. {
  34. return "IDL";
  35. }
  36. // Returns the foreground colour of the text for a style.
  37. QColor QsciLexerIDL::defaultColor(int style) const
  38. {
  39. if (style == UUID)
  40. return QColor(0x80,0x40,0x80);
  41. return QsciLexerCPP::defaultColor(style);
  42. }
  43. // Returns the set of keywords.
  44. const char *QsciLexerIDL::keywords(int set) const
  45. {
  46. if (set != 1)
  47. return 0;
  48. return "aggregatable allocate appobject arrays async async_uuid "
  49. "auto_handle bindable boolean broadcast byte byte_count "
  50. "call_as callback char coclass code comm_status const "
  51. "context_handle context_handle_noserialize "
  52. "context_handle_serialize control cpp_quote custom decode "
  53. "default defaultbind defaultcollelem defaultvalue "
  54. "defaultvtable dispinterface displaybind dllname double dual "
  55. "enable_allocate encode endpoint entry enum error_status_t "
  56. "explicit_handle fault_status first_is float handle_t heap "
  57. "helpcontext helpfile helpstring helpstringcontext "
  58. "helpstringdll hidden hyper id idempotent ignore iid_as iid_is "
  59. "immediatebind implicit_handle import importlib in include "
  60. "in_line int __int64 __int3264 interface last_is lcid "
  61. "length_is library licensed local long max_is maybe message "
  62. "methods midl_pragma midl_user_allocate midl_user_free min_is "
  63. "module ms_union ncacn_at_dsp ncacn_dnet_nsp ncacn_http "
  64. "ncacn_ip_tcp ncacn_nb_ipx ncacn_nb_nb ncacn_nb_tcp ncacn_np "
  65. "ncacn_spx ncacn_vns_spp ncadg_ip_udp ncadg_ipx ncadg_mq "
  66. "ncalrpc nocode nonbrowsable noncreatable nonextensible notify "
  67. "object odl oleautomation optimize optional out out_of_line "
  68. "pipe pointer_default pragma properties propget propput "
  69. "propputref ptr public range readonly ref represent_as "
  70. "requestedit restricted retval shape short signed size_is "
  71. "small source strict_context_handle string struct switch "
  72. "switch_is switch_type transmit_as typedef uidefault union "
  73. "unique unsigned user_marshal usesgetlasterror uuid v1_enum "
  74. "vararg version void wchar_t wire_marshal";
  75. }
  76. // Returns the user name of a style.
  77. QString QsciLexerIDL::description(int style) const
  78. {
  79. if (style == UUID)
  80. return tr("UUID");
  81. return QsciLexerCPP::description(style);
  82. }