MainWindow.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. /*
  2. * CDE - Common Desktop Environment
  3. *
  4. * Copyright (c) 1993-2012, The Open Group. All rights reserved.
  5. *
  6. * These libraries and programs are free software; you can
  7. * redistribute them and/or modify them under the terms of the GNU
  8. * Lesser General Public License as published by the Free Software
  9. * Foundation; either version 2 of the License, or (at your option)
  10. * any later version.
  11. *
  12. * These libraries and programs are distributed in the hope that
  13. * they will be useful, but WITHOUT ANY WARRANTY; without even the
  14. * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  15. * PURPOSE. See the GNU Lesser General Public License for more
  16. * details.
  17. *
  18. * You should have received a copy of the GNU Lesser General Public
  19. * License along with these libraries and programs; if not, write
  20. * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
  21. * Floor, Boston, MA 02110-1301 USA
  22. */
  23. /* $XConsortium: MainWindow.h /main/4 1996/08/12 18:42:19 cde-hp $ */
  24. /*
  25. * dtpdm/MainWindow.h
  26. */
  27. /*
  28. * (c) Copyright 1996 Digital Equipment Corporation.
  29. * (c) Copyright 1996 Hewlett-Packard Company.
  30. * (c) Copyright 1996 International Business Machines Corp.
  31. * (c) Copyright 1996 Sun Microsystems, Inc.
  32. * (c) Copyright 1996 Novell, Inc.
  33. * (c) Copyright 1996 FUJITSU LIMITED.
  34. * (c) Copyright 1996 Hitachi.
  35. */
  36. #ifndef _pdmMainWin_h
  37. #define _pdmMainWin_h
  38. #include "PdmXp.h"
  39. /*
  40. * return codes for a PdmBoxVerifyAttrProc
  41. */
  42. typedef enum { PDM_SUCCESS, PDM_FAILURE } PdmStatus;
  43. /*
  44. * callback procedure types for setup box children of the PDM main window
  45. */
  46. typedef struct _PdmSetupBox* (*PdmBoxNewProc) (void);
  47. typedef void (*PdmBoxDeleteProc)(struct _PdmSetupBox* me);
  48. typedef void (*PdmBoxCreateProc)(struct _PdmSetupBox* me, Widget parent);
  49. typedef PdmStatus (*PdmBoxVerifyAttrProc)(struct _PdmSetupBox* me,
  50. PdmXp* pdm_xp);
  51. typedef void (*PdmBoxGetAttrProc)(struct _PdmSetupBox* me, PdmXp* pdm_xp);
  52. typedef void (*PdmBoxSetAttrProc)(struct _PdmSetupBox* me, PdmXp* pdm_xp);
  53. /*
  54. * instance structure for setup box children of the PDM main window
  55. */
  56. typedef struct _PdmSetupBox
  57. {
  58. /*
  59. * define common setup box functions
  60. */
  61. PdmBoxDeleteProc delete_proc;
  62. PdmBoxCreateProc create_proc;
  63. PdmBoxVerifyAttrProc verify_attr_proc;
  64. PdmBoxGetAttrProc get_attr_proc;
  65. PdmBoxSetAttrProc set_attr_proc;
  66. /*
  67. * the setup box child's widget ID
  68. */
  69. Widget widget;
  70. /*
  71. * the setup box provides its own fallback resources and the
  72. * notebook tab widget instance name
  73. */
  74. const String* fallback_resources;
  75. int fallback_resources_count;
  76. const char* tab_name;
  77. /*
  78. * allow child setup box-specific data
  79. */
  80. void* subclass_data;
  81. } PdmSetupBox;
  82. /*
  83. * node structure for the list of setup box children managed by the PDM
  84. * main window
  85. */
  86. typedef struct _PdmBoxNode
  87. {
  88. PdmSetupBox* box;
  89. Widget tab;
  90. struct _PdmBoxNode* next;
  91. } PdmBoxNode, *PdmBoxList;
  92. /*
  93. * PDM main window instance structure
  94. */
  95. typedef struct _PdmMainWin
  96. {
  97. /*
  98. * widget IDs
  99. */
  100. Widget widget;
  101. Widget notebook;
  102. /*
  103. * printer information
  104. */
  105. char* print_display_spec;
  106. const char* printer_descriptor;
  107. const char* printer_name;
  108. /*
  109. * linked list of setup boxes
  110. */
  111. PdmBoxList box_list_head;
  112. PdmBoxList box_list_tail;
  113. /*
  114. * Xp interface
  115. */
  116. PdmXp* pdm_xp;
  117. /*
  118. * online help
  119. */
  120. Widget help_dialog;
  121. } PdmMainWin;
  122. /*
  123. * public PdmMainWin methods
  124. */
  125. PdmMainWin* PdmMainWinNew(void);
  126. PdmMainWin* PdmMainWinCreate(
  127. PdmMainWin* me,
  128. Widget parent,
  129. String print_display_spec,
  130. String print_context_str);
  131. void PdmMainWinDelete(PdmMainWin* me);
  132. void PdmMainWinAddSetupBox(PdmMainWin* me, PdmSetupBox* box);
  133. String* PdmMainWinMergeFallbacks(PdmMainWin* me,
  134. const String* app_fallbacks,
  135. int count);
  136. #endif /* _pdmMainWin_h */