UNIXworkcode

1 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- 2 * 3 * ***** BEGIN LICENSE BLOCK ***** 4 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 5 * 6 * The contents of this file are subject to the Mozilla Public License Version 7 * 1.1 (the "License"); you may not use this file except in compliance with 8 * the License. You may obtain a copy of the License at 9 * http://www.mozilla.org/MPL/ 10 * 11 * Software distributed under the License is distributed on an "AS IS" basis, 12 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 13 * for the specific language governing rights and limitations under the 14 * License. 15 * 16 * The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data <http://www.neurondata.com>. 17 * 18 * The Initial Developer of the Original Code is 19 * Netscape Communications Corporation. 20 * Portions created by the Initial Developer are Copyright (C) 1998 21 * the Initial Developer. All Rights Reserved. 22 * 23 * Contributor(s): 24 * 25 * Alternatively, the contents of this file may be used under the terms of 26 * either the GNU General Public License Version 2 or later (the "GPL"), or 27 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 28 * in which case the provisions of the GPL or the LGPL are applicable instead 29 * of those above. If you wish to allow use of your version of this file only 30 * under the terms of either the GPL or the LGPL, and not to allow others to 31 * use your version of this file under the terms of the MPL, indicate your 32 * decision by deleting the provisions above and replace them with the notice 33 * and other provisions required by the GPL or the LGPL. If you do not delete 34 * the provisions above, a recipient may use your version of this file under 35 * the terms of any one of the MPL, the GPL or the LGPL. 36 * 37 * In addition, as a special exception to the GNU GPL, the copyright holders 38 * give permission to link the code of this program with the Motif and Open 39 * Motif libraries (or with modified versions of these that use the same 40 * license), and distribute linked combinations including the two. You 41 * must obey the GNU General Public License in all respects for all of 42 * the code used other than linking with Motif/Open Motif. If you modify 43 * this file, you may extend this exception to your version of the file, 44 * but you are not obligated to do so. If you do not wish to do so, 45 * delete this exception statement from your version. 46 * 47 * ***** END LICENSE BLOCK ***** */ 48 49 50 #ifndef XmLGridH 51 #define XmLGridH 52 53 #include "XmL.h" 54 #include <stdio.h> 55 56 #ifdef XmL_CPP 57 extern "C" { 58 #endif 59 60 extern WidgetClass xmlGridWidgetClass; 61 typedef struct _XmLGridClassRec *XmLGridWidgetClass; 62 typedef struct _XmLGridRec *XmLGridWidget; 63 typedef struct _XmLGridRowRec *XmLGridRow; 64 typedef struct _XmLGridColumnRec *XmLGridColumn; 65 typedef struct _XmLGridCellRec *XmLGridCell; 66 67 #define XmLIsGrid(w) XtIsSubclass((w), xmlGridWidgetClass) 68 69 Widget XmLCreateGrid(Widget parent, char *name, ArgList arglist, 70 Cardinal argcount); 71 void XmLGridAddColumns(Widget w, unsigned char type, int position, int count); 72 void XmLGridAddRows(Widget w, unsigned char type, int position, int count); 73 Boolean XmLGridColumnIsVisible(Widget w, int column); 74 Boolean XmLGridCopyPos(Widget w, Time time, unsigned char rowType, int row, 75 unsigned char columnType, int column, int nrow, int ncolumn); 76 Boolean XmLGridCopySelected(Widget w, Time time); 77 void XmLGridDeleteAllColumns(Widget w, unsigned char type); 78 void XmLGridDeleteAllRows(Widget w, unsigned char type); 79 void XmLGridDeleteColumns(Widget w, unsigned char type, int position, 80 int count); 81 void XmLGridDeleteRows(Widget w, unsigned char type, int position, int count); 82 void XmLGridDeselectAllCells(Widget w, Boolean notify); 83 void XmLGridDeselectAllColumns(Widget w, Boolean notify); 84 void XmLGridDeselectAllRows(Widget w, Boolean notify); 85 void XmLGridDeselectCell(Widget w, int row, int column, Boolean notify); 86 void XmLGridDeselectColumn(Widget w, int column, Boolean notify); 87 void XmLGridDeselectRow(Widget w, int row, Boolean notify); 88 int XmLGridEditBegin(Widget w, Boolean insert, int row, int column); 89 void XmLGridEditCancel(Widget w); 90 void XmLGridEditComplete(Widget w); 91 XmLGridColumn XmLGridGetColumn(Widget w, unsigned char columnType, int column); 92 void XmLGridGetFocus(Widget w, int *row, int *column, Boolean *focusIn); 93 XmLGridRow XmLGridGetRow(Widget w, unsigned char rowType, int row); 94 int XmLGridGetSelectedCellCount(Widget w); 95 int XmLGridGetSelectedCells(Widget w, int *rowPositions, 96 int *columnPositions, int count); 97 int XmLGridGetSelectedColumnCount(Widget w); 98 int XmLGridGetSelectedColumns(Widget w, int *positions, int count); 99 int XmLGridGetSelectedRow(Widget w); 100 int XmLGridGetSelectedRowCount(Widget w); 101 int XmLGridGetSelectedRows(Widget w, int *positions, int count); 102 void XmLGridMoveColumns(Widget w, int newPosition, int position, int count); 103 void XmLGridMoveRows(Widget w, int newPosition, int position, int count); 104 Boolean XmLGridPaste(Widget w); 105 Boolean XmLGridPastePos(Widget w, unsigned char rowType, int row, 106 unsigned char columnType, int column); 107 int XmLGridRead(Widget w, FILE *file, int format, char delimiter); 108 int XmLGridReadPos(Widget w, FILE *file, int format, char delimiter, 109 unsigned char rowType, int row, unsigned char columnType, int column); 110 void XmLGridRedrawAll(Widget w); 111 void XmLGridRedrawCell(Widget w, unsigned char rowType, int row, 112 unsigned char columnType, int column); 113 void XmLGridRedrawColumn(Widget w, unsigned char type, int column); 114 void XmLGridRedrawRow(Widget w, unsigned char type, int row); 115 void XmLGridReorderColumns(Widget w, int *newPositions, 116 int position, int count); 117 void XmLGridReorderRows(Widget w, int *newPositions, 118 int position, int count); 119 int XmLGridRowColumnToXY(Widget w, unsigned char rowType, int row, 120 unsigned char columnType, int column, Boolean clipped, XRectangle *rect); 121 Boolean XmLGridRowIsVisible(Widget w, int row); 122 void XmLGridSelectAllCells(Widget w, Boolean notify); 123 void XmLGridSelectAllColumns(Widget w, Boolean notify); 124 void XmLGridSelectAllRows(Widget w, Boolean notify); 125 void XmLGridSelectCell(Widget w, int row, int column, Boolean notify); 126 void XmLGridSelectColumn(Widget w, int column, Boolean notify); 127 void XmLGridSelectRow(Widget w, int row, Boolean notify); 128 int XmLGridSetFocus(Widget w, int row, int column); 129 int XmLGridSetStrings(Widget w, char *data); 130 int XmLGridSetStringsPos(Widget w, unsigned char rowType, int row, 131 unsigned char columnType, int column, char *data); 132 int XmLGridWrite(Widget w, FILE *file, int format, char delimiter, 133 Boolean skipHidden); 134 int XmLGridWritePos(Widget w, FILE *file, int format, char delimiter, 135 Boolean skipHidden, unsigned char rowType, int row, 136 unsigned char columnType, int column, int nrow, int ncolumn); 137 int XmLGridXYToRowColumn(Widget w, int x, int y, unsigned char *rowType, 138 int *row, unsigned char *columnType, int *column); 139 140 int XmLGridPosIsResize(Widget g, int x, int y); 141 142 void XmLGridSetVisibleColumnCount(Widget w, int num_visible); 143 void XmLGridHideRightColumn(Widget w); 144 void XmLGridUnhideRightColumn(Widget w); 145 146 int XmLGridGetRowCount(Widget w); 147 int XmLGridGetColumnCount(Widget w); 148 149 int XmLGridColumnWidthInPixels(XmLGridColumn column); 150 int XmLGridVSBWidth(Widget w); 151 152 /* extern */ void 153 XmLGridXYToCellTracking(Widget widget, 154 int x, /* input only args. */ 155 int y, /* input only args. */ 156 Boolean * m_inGrid, /* input/output args. */ 157 int * m_lastRow, /* input/output args. */ 158 int * m_lastCol, /* input/output args. */ 159 unsigned char * m_lastRowtype,/* input/output args. */ 160 unsigned char * m_lastColtype,/* input/output args. */ 161 int * outRow, /* output only args. */ 162 int * outCol, /* output only args. */ 163 Boolean * enter, /* output only args. */ 164 Boolean * leave); /* output only args. */ 165 166 void XmLGridGetSort(Widget w, int *column, unsigned char *sortType); 167 void XmLGridSetSort(Widget w, int column, unsigned char sortType); 168 169 /* BEGIN XNEDIT EXTENSION */ 170 void XmLGridSetIgnoreModifyVerify(Widget g, Boolean set); 171 void XmLGridFocusAndShowRow(Widget g, int row); 172 /* END XNEDIT EXTENSION */ 173 174 #ifdef XmL_CPP 175 } 176 #endif 177 #endif 178