2 * Grace - GRaphing, Advanced Computation and Exploration of data
4 * Home page: http://plasma-gate.weizmann.ac.il/Grace/
6 * Copyright (c) 1991-1995 Paul J Turner, Portland, OR
7 * Copyright (c) 1996-2006 Grace Development Team
9 * Maintained by Evgeny Stambulchik
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2 of the License, or
17 * (at your option) any later version.
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software
26 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
30 * for Motif specific items
40 * Accept/Apply/Close for aac_cb callbacks
46 #define LIST_TYPE_SINGLE 0
47 #define LIST_TYPE_MULTIPLE 1
49 #define SPIN_TYPE_INT 0
50 #define SPIN_TYPE_FLOAT 1
52 #define ALIGN_BEGINNING 0
53 #define ALIGN_CENTER 1
56 #define TABLE_CELL_NONE 0
57 #define TABLE_CELL_STRING 1
58 #define TABLE_CELL_PIXMAP 2
60 #define DROP_ACTION_MOVE 0
61 #define DROP_ACTION_COPY 1
63 extern Widget app_shell
; /* defined in xmgapp.c */
73 /* Storage labeling procedure */
74 typedef char * (*Storage_LabelingProc
)(
79 typedef struct _StorageStructure StorageStructure
;
81 typedef void (*SS_PopupCBProc
)(
83 int nselected
/* # of selected list items */
86 struct _StorageStructure
{
92 Storage_LabelingProc labeling_proc
;
94 StorageStructure
*governor
;
101 Widget popup_hide_bt
;
102 Widget popup_show_bt
;
104 Widget popup_delete_bt
;
105 Widget popup_duplicate_bt
;
107 Widget popup_bring_to_front_bt
;
108 Widget popup_send_to_back_bt
;
109 Widget popup_move_up_bt
;
110 Widget popup_move_down_bt
;
112 Widget popup_properties_bt
;
114 Widget popup_select_all_bt
;
115 Widget popup_unselect_all_bt
;
116 Widget popup_invert_selection_bt
;
118 SS_PopupCBProc popup_cb
;
131 Widget duplicate_item
;
166 StorageStructure
*graph_sel
;
167 StorageStructure
*set_sel
;
172 StorageStructure
*ssd_sel
;
173 StorageStructure
*set_sel
;
178 StorageStructure
*ssd_sel
;
179 ListStructure
*col_sel
;
184 SSDSetStructure
*src
;
185 SSDSetStructure
*dest
;
190 OptionStructure
*r_sel
;
192 } RestrictionStructure
;
194 typedef struct _TransformStructure TransformStructure
;
196 typedef void* (*TDBuild_CBProc
)(
197 TransformStructure
*tdialog
200 typedef void* (*TDGet_CBProc
)(
201 void *gui
/* specific GUI structure */
204 typedef void (*TDFree_CBProc
)(
205 void *tddata
/* data */
208 typedef int (*TDRun_CBProc
)(
211 void *tddata
/* data */
214 struct _TransformStructure
{
218 SrcDestStructure
*srcdest
;
220 TDBuild_CBProc build_cb
;
222 TDFree_CBProc free_cb
;
228 TDBuild_CBProc build_cb
;
230 TDFree_CBProc free_cb
;
234 /* List CB procedure */
235 typedef void (*List_CBProc
)(
236 ListStructure
*listp
,
237 int n
, /* # of items selected */
238 int *values
, /* list of values of the selected items */
239 void * /* data the application registered */
242 /* Storage CB procedure */
243 typedef void (*Storage_CBProc
)(
244 StorageStructure
*ss
,
245 int n
, /* # of items selected */
246 Quark
**values
, /* list of values of the selected items */
247 void *data
/* data the application registered */
250 /* Storage double click CB procedure */
251 typedef void (*Storage_DCCBProc
)(
252 StorageStructure
*ss
,
253 Quark
*value
, /* list of values of the selected items */
254 void *data
/* data the application registered */
257 /* AAC Dialog CB procedure */
258 typedef int (*AACDialog_CBProc
)(
259 void * /* data the application registered */
262 /* PenChoice input CB procedure */
263 typedef void (*Pen_CBProc
)(
265 const Pen
*, /* pen value */
266 void * /* data the application registered */
269 typedef struct _FormatStructure FormatStructure
;
271 /* FormatChoice input CB procedure */
272 typedef void (*Format_CBProc
)(
275 void * /* data the application registered */
278 struct _FormatStructure
{
279 OptionStructure
*type
;
280 OptionStructure
*prec
;
281 TextStructure
*fstring
;
283 Format_CBProc cb_proc
;
289 void InitWidgets(void);
291 Pixmap
XpmToPixmap(char **xpm
);
293 SpinStructure
*CreateCharSizeChoice(Widget parent
, char *s
);
295 SpinStructure
*CreateAngleChoice(Widget parent
, char *s
);
296 double GetAngleChoice(SpinStructure
*sp
);
297 void SetAngleChoice(SpinStructure
*sp
, double angle
);
299 ListStructure
*CreateListChoice(Widget parent
, char *labelstr
, int type
,
300 int nvisible
, int nchoices
, OptionItem
*items
);
301 int SelectListChoice(ListStructure
*listp
, int choice
);
302 void SelectListChoices(ListStructure
*listp
, int nchoices
, int *choices
);
303 void UpdateListChoice(ListStructure
*listp
, int nchoices
, OptionItem
*items
);
304 int GetListChoices(ListStructure
*listp
, int **values
);
305 int GetSingleListChoice(ListStructure
*listp
, int *value
);
306 int GetListSelectedCount(ListStructure
*listp
);
307 void AddListChoiceCB(ListStructure
*listp
, List_CBProc cbproc
, void *anydata
);
309 StorageStructure
*CreateStorageChoice(Widget parent
,
310 char *labelstr
, int type
, int nvisible
);
311 void SetStorageChoiceLabeling(StorageStructure
*ss
, Storage_LabelingProc proc
);
312 int GetStorageChoices(StorageStructure
*ss
, Quark
***values
);
313 int GetSingleStorageChoice(StorageStructure
*ss
, Quark
**value
);
314 int SelectStorageChoice(StorageStructure
*ss
, Quark
*choice
);
315 int SelectStorageChoices(StorageStructure
*ss
, int nchoices
, Quark
**choices
);
316 void UpdateStorageChoice(StorageStructure
*ss
);
317 void SetStorageChoiceQuark(StorageStructure
*ss
, Quark
*q
);
318 void AddStorageChoiceCB(StorageStructure
*ss
,
319 Storage_CBProc cbproc
, void *anydata
);
320 void AddStorageChoiceDblClickCB(StorageStructure
*ss
,
321 Storage_DCCBProc cbproc
, void *anydata
);
323 OptionStructure
*CreateFontChoice(Widget parent
, char *s
);
324 OptionStructure
*CreatePatternChoice(Widget parent
, char *s
);
325 OptionStructure
*CreateLineStyleChoice(Widget parent
, char *s
);
326 OptionStructure
*CreateSetTypeChoice(Widget parent
, char *s
);
327 OptionStructure
*CreateColorChoice(Widget parent
, char *s
);
328 OptionStructure
*CreateASChoice(Widget parent
, char *s
);
329 OptionStructure
*CreateTextJustChoice(Widget parent
, char *s
);
330 OptionStructure
*CreateJustChoice(Widget parent
, char *s
);
331 OptionStructure
*CreateFrameTypeChoice(Widget parent
, char *s
);
333 OptionStructure
*CreateCharOptionChoice(Widget parent
, char *s
);
334 void UpdateCharOptionChoice(OptionStructure
*opt
, int font
);
336 Widget
CreatePenChoice(Widget parent
, char *s
);
337 void SetPenChoice(Widget button
, Pen
*pen
);
338 int GetPenChoice(Widget pen_button
, Pen
*pen
);
339 void AddPenChoiceCB(Widget button
, Pen_CBProc cbproc
, void *anydata
);
341 FormatStructure
*CreateFormatChoice(Widget parent
);
342 void SetFormatChoice(FormatStructure
*fstr
, const Format
*format
);
343 Format
*GetFormatChoice(FormatStructure
*fstr
);
344 void AddFormatChoiceCB(FormatStructure
*fstr
, Format_CBProc cbproc
, void *data
);
346 SpinStructure
*CreateViewCoordInput(Widget parent
, char *s
);
348 RestrictionStructure
*CreateRestrictionChoice(Widget parent
, char *s
);
350 StorageStructure
*CreateSSDChoice(Widget parent
, char *labelstr
, int type
);
352 StorageStructure
*CreateFrameChoice(Widget parent
, char *labelstr
, int type
);
354 StorageStructure
*CreateGraphChoice(Widget parent
, char *labelstr
, int type
);
356 StorageStructure
*CreateSetChoice(Widget parent
, char *labelstr
,
357 int type
, StorageStructure
*graphss
);
358 void UpdateSetChoice(StorageStructure
*ss
);
359 Quark
*get_set_choice_gr(StorageStructure
*ss
);
361 GraphSetStructure
*CreateGraphSetSelector(Widget parent
, char *s
, int sel_type
);
362 SSDSetStructure
*CreateSSDSetSelector(Widget parent
, char *s
, int sel_type
);
363 SrcDestStructure
*CreateSrcDestSelector(Widget parent
, int sel_type
);
365 ListStructure
*CreateColChoice(Widget parent
, char *labelstr
, int type
);
366 void UpdateColChoice(ListStructure
*sel
, const Quark
*ssd
);
368 SSDColStructure
*CreateSSDColSelector(Widget parent
, char *s
, int sel_type
);
369 int GetSSDColChoices(SSDColStructure
*sc
, Quark
**ssd
, int **cols
);
371 SpinStructure
*CreateLineWidthChoice(Widget parent
, char *s
);
373 OptionStructure
*CreatePanelChoice(Widget parent
, char *labstr
, ...);
374 OptionStructure
*CreatePrecisionChoice(Widget parent
, char *s
);
375 OptionStructure
*CreatePaperOrientationChoice(Widget parent
, char *s
);
376 OptionStructure
*CreatePaperFormatChoice(Widget parent
, char *s
);
378 WidgetList
CreateAACDialog(Widget form
,
379 Widget container
, AACDialog_CBProc cbproc
, void *data
);
381 TransformStructure
*CreateTransformDialogForm(Widget parent
,
382 const char *s
, int sel_type
, int exclusive
, const TD_CBProcs
*cbs
);
383 int GetTransformDialogSettings(TransformStructure
*tdialog
,
384 int *nssrc
, Quark
***srcsets
, Quark
***destsets
);
385 void RaiseTransformationDialog(TransformStructure
*tdialog
);
387 void AddHelpCB(Widget w
, char *ha
);
388 void ContextHelpCB(Widget w
, void *data
);
390 void DefineDialogCursor(Cursor c
);
391 void UndefineDialogCursor(void);
393 void AddWindowCloseCB(Widget w
, Widget_CBProc cbproc
, void *anydata
);
394 void destroy_dialog_cb(Widget but
, void *data
);
396 void undo_cb(Widget but
, void *data
);
397 void redo_cb(Widget but
, void *data
);
399 void unlink_ssd_ui(Quark
*q
);
401 void set_title(char *title
, char *icon_name
);
404 typedef void TreeItem
;
418 typedef int (*Tree_CBProc
)(TreeEvent
*event
);
425 Widget
CreateTree(Widget parent
);
426 TreeItem
*TreeInsertItem(Widget w
, TreeItem
*parent
, Quark
*q
, int row
);
427 void TreeDeleteItem(Widget w
, TreeItem
*item
);
428 void TreeSetItemOpen(Widget w
, TreeItem
*item
, int open
);
429 void TreeSetItemText(Widget w
, TreeItem
*item
, char *text
);
430 void TreeSetItemPixmap(Widget w
, TreeItem
*item
, Pixmap pixmap
);
431 Quark
*TreeGetQuark(TreeItem
*item
);
432 void TreeGetHighlighted(Widget w
, TreeItemList
*items
);
433 void TreeHighlightItem(Widget w
, TreeItem
*item
);
434 void TreeClearSelection(Widget w
);
435 void TreeScrollToItem(Widget w
, TreeItem
*item
);
436 void TreeRefresh(Widget w
);
438 void AddTreeContextMenuCB(Widget w
, Tree_CBProc cbproc
, void *anydata
);
439 void AddTreeHighlightItemsCB(Widget w
, Tree_CBProc cbproc
, void *anydata
);
440 void AddTreeDropItemsCB(Widget w
, Tree_CBProc cbproc
, void *anydata
);
444 Widget
CreateTable(char *name
, Widget parent
, int nrows
, int ncols
, int nrows_visible
, int ncols_visible
);
445 void TableSSDInit(Widget w
);
446 void TableFontInit(Widget w
);
447 void TableDataSetPropInit(Widget w
);
448 void TableLevalInit(Widget w
);
449 void TableOptionChoiceInit(Widget w
);
450 int TableGetNrows(Widget w
);
451 int TableGetNcols(Widget w
);
452 void TableAddRows(Widget w
, int nrows
);
453 void TableDeleteRows(Widget w
, int nrows
);
454 void TableAddCols(Widget w
, int ncols
);
455 void TableDeleteCols(Widget w
, int ncols
);
456 void TableGetCellDimentions(Widget w
, int *cwidth
, int *cheight
);
457 void TableSetColWidths(Widget w
, int *widths
);
458 void TableSetDefaultRowLabelWidth(Widget w
, int width
);
459 void TableSetDefaultRowLabelAlignment(Widget w
, int align
);
460 void TableSetDefaultColWidth(Widget w
, int width
);
461 void TableSetDefaultColAlignment(Widget w
, int align
);
462 void TableSetDefaultColLabelAlignment(Widget w
, int align
);
463 void TableSetColMaxlengths(Widget w
, int *maxlengths
);
464 void TableSetRowLabels(Widget w
, char **labels
);
465 void TableSetColLabels(Widget w
, char **labels
);
466 void TableSetFixedCols(Widget w
, int nfixed_cols
);
467 void TableUpdateVisibleRowsCols(Widget w
);
468 void TableCommitEdit(Widget w
, int close
);
469 void TableSetCells(Widget w
, char ***cells
);
470 void TableSetCell(Widget w
, int row
, int col
, char *value
);
471 char *TableGetCell(Widget w
, int row
, int col
);
472 void TableSelectCell(Widget w
, int row
, int col
);
473 void TableDeselectCell(Widget w
, int row
, int col
);
474 void TableSelectRow(Widget w
, int row
);
475 void TableDeselectRow(Widget w
, int row
);
476 void TableSelectCol(Widget w
, int col
);
477 void TableDeselectCol(Widget w
, int col
);
478 void TableDeselectAllCells(Widget w
);
479 int TableIsRowSelected(Widget w
, int row
);
480 int TableIsColSelected(Widget w
, int col
);
481 void TableUpdate(Widget w
);
491 unsigned long background
;
492 unsigned long foreground
;
501 typedef int (*Table_CBProc
)(TableEvent
*event
);
508 void AddTableDrawCellCB(Widget w
, Table_CBProc cbproc
, void *anydata
);
509 void AddTableEnterCellCB(Widget w
, Table_CBProc cbproc
, void *anydata
);
510 void AddTableLeaveCellCB(Widget w
, Table_CBProc cbproc
, void *anydata
);
511 void AddTableLabelActivateCB(Widget w
, Table_CBProc cbproc
, void *anydata
);
514 void GetScrollBarValues(Widget w
, int *value
, int *maxvalue
, int *slider_size
, int *increment
);
515 void SetScrollBarValue(Widget w
, int value
);
516 void SetScrollBarIncrement(Widget w
, int increment
);
517 Widget
GetHorizontalScrollBar(Widget w
);
518 Widget
GetVerticalScrollBar(Widget w
);
520 void AddMouseWheelSupport(Widget w
);
522 #endif /* __MOTIFINC_H_ */