ide_support.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. //
  2. // "$Id: ide_support.h 8063 2010-12-19 21:20:10Z matt $"
  3. //
  4. // IDE and Build FIle generation for the Fast Light Tool Kit (FLTK).
  5. //
  6. // Copyright 2010 by Matthias Melcher.
  7. //
  8. // This library is free software; you can redistribute it and/or
  9. // modify it under the terms of the GNU Library General Public
  10. // License as published by the Free Software Foundation; either
  11. // version 2 of the License, or (at your option) any later version.
  12. //
  13. // This library is distributed in the hope that it will be useful,
  14. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. // Library General Public License for more details.
  17. //
  18. // You should have received a copy of the GNU Library General Public
  19. // License along with this library; if not, write to the Free Software
  20. // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
  21. // USA.
  22. //
  23. // Please report all bugs and problems on the following page:
  24. //
  25. // http://www.fltk.org/str.php
  26. //
  27. #ifndef FLUID_IDE_SUPPORT_H
  28. #define FLUID_IDE_SUPPORT_H
  29. #include <FL/Fl.H>
  30. #include <FL/Fl_Preferences.H>
  31. #include <FL/filename.H>
  32. typedef char Fl_UUID[40];
  33. typedef char Fl_XCID[25];
  34. extern void fl_getUUID(Fl_Preferences &db, const char *key, char *buffer);
  35. extern void fl_getXCID(Fl_Preferences &db, const char *key, char *buffer);
  36. /* Shortcut to retrieve or create a UUID from the database */
  37. #define MAKE_UUID(name, db) \
  38. char name[40]; fl_getUUID(db, #name, name);
  39. /* Shortcut to retrieve, but not create a UUID from the database */
  40. #define GET_UUID(name, db) \
  41. char name[40]; db.get(#name, name, "DBERROR", 40);
  42. /* Shortcut to retrieve or create a UUID from the database */
  43. #define MAKE_XCID(name, db) \
  44. char name[25]; fl_getXCID(db, #name, name);
  45. /* Shortcut to retrieve, but not create a UUID from the database */
  46. #define GET_XCID(name, db) \
  47. char name[25]; db.get(#name, name, "DBERROR", 40);
  48. /* A preferences node with some additional functionality */
  49. class Fl_IDE_Prefs : public Fl_Preferences {
  50. public:
  51. Fl_IDE_Prefs(Fl_Preferences &parent, const char *name);
  52. Fl_IDE_Prefs(Fl_Preferences &parent, int ix);
  53. Fl_IDE_Prefs(Fl_Preferences::ID id);
  54. Fl_Preferences::ID find_by_name(const char *name);
  55. Fl_Preferences::ID find_by_key(const char *key, const char *value);
  56. Fl_Preferences::ID add_with_key(const char *key, const char *value, const char *uuid=0);
  57. };
  58. class Fl_Target_Prefs : public Fl_IDE_Prefs {
  59. public:
  60. Fl_Target_Prefs(Fl_Preferences::ID id);
  61. Fl_Preferences::ID add_source(Fl_IDE_Prefs &fdb, const char *pathAndName);
  62. Fl_Preferences::ID add_header(Fl_IDE_Prefs &fdb, const char *pathAndName);
  63. Fl_Preferences::ID add_fl(Fl_IDE_Prefs &fdb, const char *pathAndName);
  64. Fl_Preferences::ID depends_on(Fl_IDE_Prefs &dep);
  65. Fl_Preferences::ID add_lib(Fl_IDE_Prefs &lib);
  66. Fl_Preferences::ID add_external_lib(Fl_IDE_Prefs &fdb, const char *pathAndName);
  67. };
  68. class Fl_File_Prefs : public Fl_Preferences {
  69. char pPath[FL_PATH_MAX];
  70. char pName[80];
  71. char pFullName[100];
  72. char pExt[20];
  73. public:
  74. Fl_File_Prefs(Fl_Preferences &parent, const char *name);
  75. Fl_File_Prefs(Fl_Preferences &parent, int ix);
  76. Fl_File_Prefs(Fl_Preferences::ID id);
  77. const char *filePath();
  78. const char *fileName();
  79. const char *fullName();
  80. const char *fileExt();
  81. };
  82. void xcode_only(Fl_Preferences::ID id);
  83. void visualc_only(Fl_Preferences::ID id);
  84. void makefile_only(Fl_Preferences::ID id);
  85. char with_xcode(Fl_Preferences::ID id);
  86. char with_visualc(Fl_Preferences::ID id);
  87. char with_makefile(Fl_Preferences::ID id);
  88. void ui_load_database(const char *filename);
  89. #endif
  90. //
  91. // End of "$Id: ide_support.h 8063 2010-12-19 21:20:10Z matt $".
  92. //