1 /* $XConsortium: NotebookP.h /main/4 1995/07/15 20:53:46 drk $ */ 2 /* 3 * Motif 4 * 5 * Copyright (c) 1987-2012, The Open Group. All rights reserved. 6 * 7 * These libraries and programs are free software; you can 8 * redistribute them and/or modify them under the terms of the GNU 9 * Lesser General Public License as published by the Free Software 10 * Foundation; either version 2 of the License, or (at your option) 11 * any later version. 12 * 13 * These libraries and programs are distributed in the hope that 14 * they will be useful, but WITHOUT ANY WARRANTY; without even the 15 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 16 * PURPOSE. See the GNU Lesser General Public License for more 17 * details. 18 * 19 * You should have received a copy of the GNU Lesser General Public 20 * License along with these librararies and programs; if not, write 21 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth 22 * Floor, Boston, MA 02110-1301 USA 23 */ 24 /* 25 * HISTORY 26 */ 27 #ifndef _XmNotebookP_h 28 #define _XmNotebookP_h 29 30 #include <Xm/XmP.h> 31 #include <Xm/ManagerP.h> 32 #include <Xm/ScrollFrameT.h> 33 #include <Xm/Notebook.h> 34 35 #ifdef __cplusplus 36 extern "C" { 37 #endif 38 39 /* Notebook's constraint info. fields */ 40 typedef struct _XmNotebookConstraintPart 41 { 42 /* resources */ 43 int page_number; /* page number */ 44 unsigned char child_type; /* notebook child type */ 45 Boolean resizable; /* is this child resizable? */ 46 47 /* private variables */ 48 Boolean active; /* True if the child is active */ 49 } XmNotebookConstraintPart, *XmNotebookConstraint; 50 51 typedef struct _XmNotebookConstraintRec 52 { 53 XmManagerConstraintPart manager; 54 XmNotebookConstraintPart notebook; 55 } XmNotebookConstraintRec, *XmNotebookConstraintPtr; 56 57 58 /* New fields for the Notebook widget class record */ 59 typedef struct _XmNotebookClassPart 60 { 61 XtPointer extension; 62 } XmNotebookClassPart; 63 64 65 /* Full class record declaration */ 66 typedef struct _NotebookClassRec 67 { 68 CoreClassPart core_class; 69 CompositeClassPart composite_class; 70 ConstraintClassPart constraint_class; 71 XmManagerClassPart manager_class; 72 XmNotebookClassPart notebook_class; 73 } XmNotebookClassRec; 74 75 externalref XmNotebookClassRec xmNotebookClassRec; 76 77 78 /* New fields for the Notebook widget instance record */ 79 typedef struct _XmNotebookPart 80 { 81 /* resources */ 82 int current_page_number; /* the current page number */ 83 int first_page_number; /* the first page number */ 84 int last_page_number; /* the last page number */ 85 unsigned char orientation; /* notebook orientation */ 86 unsigned char back_page_pos; /* position of back pages */ 87 Cardinal back_page_number; /* the of back page lines */ 88 Dimension back_page_size; /* the thickness of back pages */ 89 Pixel back_page_foreground; /* foreground color for bk pgs */ 90 Pixel back_page_background; /* background color for bk pgs */ 91 Pixel frame_background; /* background color for frame */ 92 unsigned char binding_type; /* binding type */ 93 Pixmap binding_pixmap; /* pixmap for the binding */ 94 Pixmap spiral_pixmap; /* pixmap for the spiral binding */ 95 Dimension binding_width; /* the width of the binding */ 96 Dimension margin_width; /* horizontal margin between widgets */ 97 Dimension margin_height; /* vertical margin between widgets */ 98 Dimension major_spacing; /* gap between major tabs */ 99 Dimension minor_spacing; /* gap between minor tabs */ 100 Dimension shadow_thickness; /* notebook frame shadow thickness */ 101 XtCallbackList page_change_callback;/* the page change callback */ 102 103 /* child widgets */ 104 Widget scroller; /* the page scroller widget */ 105 Widget scroller_child; /* TextF child of def page scroller */ 106 Widget next_major; /* next major tab scroll button */ 107 Widget prev_major; /* prev major tab scroll button */ 108 Widget next_minor; /* next minor tab scroll button */ 109 Widget prev_minor; /* prev minor tab scroll button */ 110 111 /* preferred children sizes */ 112 Dimension real_binding_width; /* real binding width */ 113 Dimension real_back_page_number; /* real back page number */ 114 Dimension page_width; /* width of page widgets */ 115 Dimension page_height; /* height of page widgets */ 116 Dimension status_width; /* width of the status areas */ 117 Dimension status_height; /* height of the status areas */ 118 Dimension major_width; /* width of major tabs */ 119 Dimension major_height; /* height of major tabs */ 120 Dimension minor_width; /* width of minor tabs */ 121 Dimension minor_height; /* height of minor tabs */ 122 Dimension scroller_width; /* width of the page scroller */ 123 Dimension scroller_height; /* height of the page scroller */ 124 Dimension major_scroller_width; /* width of major scrollers */ 125 Dimension major_scroller_height; /* height of major scroller */ 126 Dimension minor_scroller_width; /* width of minor scrollers */ 127 Dimension minor_scroller_height; /* height of minor scrollers */ 128 Dimension frame_width; /* width of the frame */ 129 Dimension frame_height; /* height of the frame */ 130 131 /* for layouting tabs */ 132 Widget first_major; /* the first major tab */ 133 Widget old_top_major; /* the old top major tab */ 134 Widget top_major; /* the top major tab */ 135 Widget last_major; /* the last major tab */ 136 Widget first_minor; /* the first minor tab */ 137 Widget old_top_minor; /* the old top minor tab */ 138 Widget top_minor; /* the top minor tab */ 139 Widget last_minor; /* the last minor tab */ 140 Widget constraint_child; /* changing geom during ConstraintSV */ 141 142 /* shadow thickness state for current page major and minor tab */ 143 Dimension major_shadow_thickness; /* joined major tab shadow thickness */ 144 Dimension minor_shadow_thickness; /* joined minor tab shadow thickness */ 145 Widget major_shadow_child; /* saved shadow thickness tab */ 146 Widget minor_shadow_child; /* saved shadow thickness tab */ 147 Boolean in_setshadow; /* setting tab shadow thickness */ 148 149 /* extra position information */ 150 unsigned char major_pos; /* position of major tabs */ 151 unsigned char minor_pos; /* position of minor tabs */ 152 unsigned char binding_pos; /* binding position */ 153 154 /* other misc. variables */ 155 unsigned char which_tab; /* currently active tab type */ 156 int last_alloc_num; /* lastly allocated page number */ 157 unsigned char scroller_status; /* status of the page scroller */ 158 unsigned short need_scroller; /* need for tab scrollers */ 159 Boolean dynamic_last_page_num; /* True if using dynamic last page# */ 160 Boolean in_callback; /* True if processing a callback */ 161 GC back_page_gc; /* GC for drawing backpages */ 162 GC frame_gc; /* GC for drawing frame */ 163 GC binding_gc; /* GC for drawing binding */ 164 GC foreground_gc; /* GC for drawing foreground */ 165 GC background_gc; /* GC for drawing background */ 166 167 Boolean first_change_managed; /* flags 1st call to ChangeManaged */ 168 XmScrollFrameData scroll_frame_data; /* data for ScrollFrame trait */ 169 } XmNotebookPart; 170 171 172 /* Full instance record declaration */ 173 typedef struct _XmNotebookRec 174 { 175 CorePart core; 176 CompositePart composite; 177 ConstraintPart constraint; 178 XmManagerPart manager; 179 XmNotebookPart notebook; 180 } XmNotebookRec; 181 182 183 /****************************************************************************** 184 * * 185 * constants & useful macros * 186 * * 187 ******************************************************************************/ 188 189 /* internal child types, must not conflict with XmRNBChildType enum */ 190 #define XmMAJOR_TAB_SCROLLER 12 191 #define XmMINOR_TAB_SCROLLER 13 192 #define XmTAB_SCROLLER 14 193 194 #ifdef __cplusplus 195 } 196 #endif 197 198 #endif /* _XmNotebookP_h */ 199 200