HyperPage.h 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. #ifndef _HyperPage_h_
  2. #define _HyperPage_h_
  3. /* HyperPage.h
  4. *
  5. * Copyright (C) 1992-2011,2012,2014,2015,2017 Paul Boersma
  6. *
  7. * This code is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or (at
  10. * your option) any later version.
  11. *
  12. * This code is distributed in the hope that it will be useful, but
  13. * WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  15. * See the GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this work. If not, see <http://www.gnu.org/licenses/>.
  19. */
  20. #include "Editor.h"
  21. #include "Collection.h"
  22. #include "Graphics.h"
  23. Thing_define (HyperLink, Daata) {
  24. double x1DC, x2DC, y1DC, y2DC;
  25. };
  26. autoHyperLink HyperLink_create (conststring32 name, double x1, double x2, double y1, double y2);
  27. Thing_define (HyperPage, Editor) {
  28. GuiDrawingArea drawingArea;
  29. GuiScrollBar verticalScrollBar;
  30. bool d_hasExtraRowOfTools;
  31. autoGraphics graphics;
  32. Graphics ps;
  33. double d_x, d_y, rightMargin, previousBottomSpacing;
  34. integer d_printingPageNumber;
  35. CollectionOf<structHyperLink> links;
  36. bool printing, mirror;
  37. int top;
  38. conststring32 insideHeader, middleHeader, outsideHeader;
  39. conststring32 insideFooter, middleFooter, outsideFooter;
  40. autostring32 entryHint; double entryPosition;
  41. struct { autostring32 page; int top; } history [20];
  42. int historyPointer;
  43. autostring32 currentPageTitle;
  44. GuiMenuItem fontSizeButton_10, fontSizeButton_12, fontSizeButton_14, fontSizeButton_18, fontSizeButton_24;
  45. void *praatApplication, *praatObjects, *praatPicture;
  46. bool scriptErrorHasBeenNotified;
  47. structMelderDir rootDirectory;
  48. void v_destroy () noexcept
  49. override;
  50. bool v_editable ()
  51. override { return false; }
  52. void v_createMenus ()
  53. override;
  54. void v_createChildren ()
  55. override;
  56. void v_dataChanged ()
  57. override;
  58. virtual void v_draw () { }
  59. virtual integer v_getNumberOfPages () { return 0; }
  60. virtual integer v_getCurrentPageNumber () { return 0; }
  61. virtual int v_goToPage (conststring32 /* title */) { return 0; }
  62. virtual void v_goToPage_i (integer /* pageNumber */) { }
  63. virtual void v_defaultHeaders (EditorCommand /* cmd */) { }
  64. virtual bool v_hasHistory () { return false; }
  65. virtual bool v_isOrdered () { return false; }
  66. #include "HyperPage_prefs.h"
  67. };
  68. void HyperPage_clear (HyperPage me);
  69. /* "Methods" */
  70. #define HyperPage_ADD_BORDER 1
  71. #define HyperPage_USE_ENTRY_HINT 2
  72. void HyperPage_any (HyperPage me, conststring32 text, kGraphics_font font, int size, int style, double minFooterDistance,
  73. double x, double secondIndent, double topSpacing, double bottomSpacing, uint32 method);
  74. void HyperPage_pageTitle (HyperPage me, conststring32 title);
  75. void HyperPage_intro (HyperPage me, conststring32 text);
  76. void HyperPage_entry (HyperPage me, conststring32 title);
  77. void HyperPage_paragraph (HyperPage me, conststring32 text);
  78. void HyperPage_listItem (HyperPage me, conststring32 text);
  79. void HyperPage_listItem1 (HyperPage me, conststring32 text);
  80. void HyperPage_listItem2 (HyperPage me, conststring32 text);
  81. void HyperPage_listItem3 (HyperPage me, conststring32 text);
  82. void HyperPage_listTag (HyperPage me, conststring32 text);
  83. void HyperPage_listTag1 (HyperPage me, conststring32 text);
  84. void HyperPage_listTag2 (HyperPage me, conststring32 text);
  85. void HyperPage_listTag3 (HyperPage me, conststring32 text);
  86. void HyperPage_definition (HyperPage me, conststring32 text);
  87. void HyperPage_definition1 (HyperPage me, conststring32 text);
  88. void HyperPage_definition2 (HyperPage me, conststring32 text);
  89. void HyperPage_definition3 (HyperPage me, conststring32 text);
  90. void HyperPage_code (HyperPage me, conststring32 text);
  91. void HyperPage_code1 (HyperPage me, conststring32 text);
  92. void HyperPage_code2 (HyperPage me, conststring32 text);
  93. void HyperPage_code3 (HyperPage me, conststring32 text);
  94. void HyperPage_code4 (HyperPage me, conststring32 text);
  95. void HyperPage_code5 (HyperPage me, conststring32 text);
  96. void HyperPage_prototype (HyperPage me, conststring32 text);
  97. void HyperPage_formula (HyperPage me, conststring32 formula);
  98. void HyperPage_picture (HyperPage me, double width_inches, double height_inches, void (*draw) (Graphics g));
  99. void HyperPage_script (HyperPage me, double width_inches, double height_inches, conststring32 script);
  100. int HyperPage_goToPage (HyperPage me, conststring32 title);
  101. void HyperPage_goToPage_i (HyperPage me, integer i);
  102. void HyperPage_init (HyperPage me, conststring32 title, Daata data);
  103. void HyperPage_setEntryHint (HyperPage me, conststring32 entry);
  104. void HyperPage_initSheetOfPaper (HyperPage me);
  105. /* End of file HyperPage.h */
  106. #endif