X11workbench Toolkit
1.0
|
Structure that defines a Child Frame's UI, mainly for a 'superclass'. More...
#include <frame_window.h>
Data Fields | |
unsigned int | ulTag |
tag indicating I'm a 'Child Frame UI' structure | |
void(* | do_char )(WBChildFrame *, XClientMessageEvent *) |
handler for regular WB_CHAR Client Messages (typed-in characters). More... | |
void(* | scancode )(WBChildFrame *, XClientMessageEvent *) |
handler for 'other scan code' WB_CHAR Client Messages. More... | |
void(* | bkspace )(WBChildFrame *, int iACS) |
'backspace' delete character (backspace equivalent), or perform related 'backspace' operation via ctrl/alt/shift. More... | |
void(* | del )(WBChildFrame *, int iACS) |
'delete' char under cursor (delete equivalent), or perform related 'delete' operation via ctrl/alt/shift. More... | |
void(* | tab )(WBChildFrame *, int iACS) |
'tab' char, or tab navigation. More... | |
void(* | enter )(WBChildFrame *, int iACS) |
'enter' char, or 'enter' for navigation. More... | |
void(* | properties )(WBChildFrame *) |
display the property sheet for the displayed document (optional) | |
void(* | uparrow )(WBChildFrame *, int iACS) |
'up' arrow navigation. More... | |
void(* | downarrow )(WBChildFrame *, int iACS) |
'down' arrow navigation. More... | |
void(* | leftarrow )(WBChildFrame *, int iACS) |
'left' arrow navigation. More... | |
void(* | rightarrow )(WBChildFrame *, int iACS) |
'right' arrow navigation. More... | |
void(* | home )(WBChildFrame *, int iACS) |
'home' arrow navigation. More... | |
void(* | end )(WBChildFrame *, int iACS) |
'end' arrow navigation. More... | |
void(* | pgup )(WBChildFrame *, int iACS) |
'page up' navigation. More... | |
void(* | pgdown )(WBChildFrame *, int iACS) |
'page down' navigation. More... | |
void(* | pgleft )(WBChildFrame *, int iACS) |
'page left' navigation. More... | |
void(* | pgright )(WBChildFrame *, int iACS) |
'page right' navigation. More... | |
void(* | help )(WBChildFrame *, int iACS) |
'help' context (F1). More... | |
void(* | hover_notify )(WBChildFrame *, int x, int y) |
'mouse hover' notification More... | |
void(* | hover_cancel )(WBChildFrame *) |
'mouse hover' cancel notification More... | |
int(* | is_ins_mode )(WBChildFrame *) |
Use this to determine whether you are in 'insert' or 'overwrite' mode. More... | |
void(* | toggle_ins_mode )(WBChildFrame *) |
toggles insert mode on or off More... | |
void(* | copy_to_cb )(WBChildFrame *) |
copy selection to clipboard More... | |
void(* | paste_from_cb )(WBChildFrame *) |
paste from clipboard More... | |
void(* | cut_to_cb )(WBChildFrame *) |
delete selection, copying to clipboard first More... | |
void(* | delete_sel )(WBChildFrame *) |
delete selection only More... | |
void(* | select_all )(WBChildFrame *) |
select all More... | |
void(* | select_none )(WBChildFrame *) |
select none More... | |
void(* | save )(WBChildFrame *, const char *szFileName) |
save to specified file name More... | |
WB_PCSTR(* | get_file_name )(WBChildFrame *) |
get a (const) pointer to the file name string More... | |
void(* | mouse_click )(WBChildFrame *, int iX, int iY, int iButtonMask, int iACS) |
'mouse click' notification. More... | |
void(* | mouse_dblclick )(WBChildFrame *, int iX, int iY, int iButtonMask, int iACS) |
'mouse double click' notification. More... | |
void(* | mouse_drag )(WBChildFrame *, int iX, int iY, int iButtonMask, int iACS) |
'mouse drag' (begin) notification. More... | |
void(* | mouse_drop )(WBChildFrame *, int iX, int iY, int iButtonMask, int iACS) |
'mouse drop' (drag end) notification. More... | |
void(* | mouse_move )(WBChildFrame *, int iX, int iY) |
'mouse motion' notification. More... | |
void(* | scroll_vert )(WBChildFrame *, int iMode, int iValue) |
'scroll vertical' notification. More... | |
void(* | scroll_horiz )(WBChildFrame *, int iMode, int iValue) |
'scroll vertical' notification. More... | |
void(* | mouse_cancel )(WBChildFrame *) |
'mouse cancel' notification (cancel 'drag', etc.). More... | |
void(* | get_row_col )(WBChildFrame *, int *piR, int *piC) |
Obtain the current row/column cursor locationfor UI notification. More... | |
int(* | has_selection )(WBChildFrame *) |
returns non-zero value if there is a selection More... | |
void(* | undo )(WBChildFrame *) |
perform an undo operation More... | |
void(* | redo )(WBChildFrame *) |
perform a re-do More... | |
int(* | can_undo )(WBChildFrame *) |
returns non-zero value if 'can undo' More... | |
int(* | can_redo )(WBChildFrame *) |
returns non-zero value if 'can redo' More... | |
int(* | is_empty )(WBChildFrame *) |
returns non-zero value if contents are 'empty' More... | |
Structure that defines a Child Frame's UI, mainly for a 'superclass'.
The base user interface for a child frame does very little except interact with tabs and the Frame Window. To make it really do something, you need some kind of interface. This function table defines the UI interface for a Child Frame that will allow it to perform basic editing and navigation functions. If you need additional capabilities, you can hook the messages with the assigned callback function. Otherwise, most of the work will already be done for your custom child frame.
A window interface derived from 'WBChildFrame' needs a way for the 'abstract class' to invoke the UI functionality. To make this work, the 'superclass' (i.e. derived) window interface can populate a WBChildFrameUI structure with function pointers, as needed, to implement the necessary elements.
For those elements that are NOT implemented, you can use NULL for the function pointer. That way if the derived window interface does not need 'hover' support, you can leave the 'hover_notify' and 'hover_cancel' function pointers as NULL, but populate everything else.
For the 'iACS' parameters, use the 'iACS' information from the aWB_CHAR. This is the 'Alt/Ctrl/Shift' flag that indicates which of those buttons were being held down at the time of the character translation. For more information on THAT, see WB_CHAR.
The basic difference between 'do_char' and 'scancode' is that the 'character' events will be passed along to the 'do_char' callback, but 'scan code' events (NOT processed by one of the other callbacks) will be passed along via the 'scancode' callback. This will allow your custom UI handler to interpret additional 'special' keys as needed. The ones normally processed are: insert, delete, home, end, pgup, pgdown, and the 'F1' key.
NOTE: if a menu defines hotkey combinations, no 'WB_CHAR' event will be generated for any of those. Instead, the menu handler needs to interpret them correctly if the UI callback will need to be invoked. One example in the X11workbench.c handler (for the main edit window UI) is the handling of the 'Edit' sub-menu, which includes hotkey combinations such as 'CTRL+V' for 'paste'. When the 'paste' menu is invoked, the handler will need to grab the WBChildFrameUI structure for the currently active Child Window, and invoke its 'paste_from_cb' callback function directly. Similarly, if 'F1' is invoked, it will need to call the 'help' function directly, passing the correct 'iACS' parameter value.
Definition at line 677 of file frame_window.h.
void(* bkspace) (WBChildFrame *, int iACS) |
'backspace' delete character (backspace equivalent), or perform related 'backspace' operation via ctrl/alt/shift.
'iACS' is the Alt/Ctrl/Shift flags.
Definition at line 682 of file frame_window.h.
int(* can_redo) (WBChildFrame *) |
returns non-zero value if 'can redo'
Interfaces/Objects that support 're-do' AND have a non-empty re-do buffer will return non-zero.
Definition at line 731 of file frame_window.h.
int(* can_undo) (WBChildFrame *) |
returns non-zero value if 'can undo'
Interfaces/Objects that support 'undo' AND have a non-empty undo buffer will return non-zero.
Definition at line 730 of file frame_window.h.
void(* copy_to_cb) (WBChildFrame *) |
copy selection to clipboard
implements 'copy' functionality. The current selection will be copied to the clipboard
Definition at line 702 of file frame_window.h.
void(* cut_to_cb) (WBChildFrame *) |
delete selection, copying to clipboard first
implements 'cut' functionality
Definition at line 704 of file frame_window.h.
void(* del) (WBChildFrame *, int iACS) |
'delete' char under cursor (delete equivalent), or perform related 'delete' operation via ctrl/alt/shift.
'iACS' is the Alt/Ctrl/Shift flags.
Definition at line 683 of file frame_window.h.
void(* delete_sel) (WBChildFrame *) |
delete selection only
deletes the current selection, but has no effect if there is no selection. To delete a character, see 'del()'
Definition at line 705 of file frame_window.h.
void(* do_char) (WBChildFrame *, XClientMessageEvent *) |
handler for regular WB_CHAR Client Messages (typed-in characters).
The XClientMessageEvent will be interpreted and characters added to the associated document or object. This function should NOT be called for 'special' characters, like cursors, backspace, and so on.
Definition at line 680 of file frame_window.h.
void(* downarrow) (WBChildFrame *, int iACS) |
'down' arrow navigation.
'iACS' is the Alt/Ctrl/Shift flags.
Definition at line 688 of file frame_window.h.
void(* end) (WBChildFrame *, int iACS) |
'end' arrow navigation.
'iACS' is the Alt/Ctrl/Shift flags.
Definition at line 692 of file frame_window.h.
void(* enter) (WBChildFrame *, int iACS) |
'enter' char, or 'enter' for navigation.
'iACS' is the Alt/Ctrl/Shift flags.
Definition at line 685 of file frame_window.h.
WB_PCSTR(* get_file_name) (WBChildFrame *) |
get a (const) pointer to the file name string
Use this function to find out what the currently assigned file name is. The returned pointer is NOT persistent across function calls. If you need a copy, use SBCopyString() or similar
Definition at line 710 of file frame_window.h.
void(* get_row_col) (WBChildFrame *, int *piR, int *piC) |
Obtain the current row/column cursor locationfor UI notification.
'piR' points to an integer to get the row, and 'piC' points to an integer to get the column. Both are 1-based values, so a value <\= 0 is considered 'error' or 'NA'
Definition at line 726 of file frame_window.h.
int(* has_selection) (WBChildFrame *) |
returns non-zero value if there is a selection
Since this affects specific UI behavior, you should use this to control enabling of the 'copy' and 'cut' menus, as an example
Definition at line 727 of file frame_window.h.
void(* help) (WBChildFrame *, int iACS) |
'help' context (F1).
'iACS' is the Alt/Ctrl/Shift flags.
Definition at line 697 of file frame_window.h.
void(* home) (WBChildFrame *, int iACS) |
'home' arrow navigation.
'iACS' is the Alt/Ctrl/Shift flags.
Definition at line 691 of file frame_window.h.
void(* hover_cancel) (WBChildFrame *) |
'mouse hover' cancel notification
This will cancel any 'hover' action
Definition at line 699 of file frame_window.h.
void(* hover_notify) (WBChildFrame *, int x, int y) |
'mouse hover' notification
x and y are pixel coords with respect to upper left corner
Definition at line 698 of file frame_window.h.
int(* is_empty) (WBChildFrame *) |
returns non-zero value if contents are 'empty'
If the contents are such that a selection cannot be made, this function will return a non-zero value
Definition at line 732 of file frame_window.h.
int(* is_ins_mode) (WBChildFrame *) |
Use this to determine whether you are in 'insert' or 'overwrite' mode.
returns non-zero if in 'insert' mode, 0 for 'overwrite'
Definition at line 700 of file frame_window.h.
void(* leftarrow) (WBChildFrame *, int iACS) |
'left' arrow navigation.
'iACS' is the Alt/Ctrl/Shift flags.
Definition at line 689 of file frame_window.h.
void(* mouse_cancel) (WBChildFrame *) |
'mouse cancel' notification (cancel 'drag', etc.).
This is a notification only (any mouse capture must already have been handled).
Definition at line 725 of file frame_window.h.
void(* mouse_click) (WBChildFrame *, int iX, int iY, int iButtonMask, int iACS) |
'mouse click' notification.
part of the mouse UI handling. 'iX', 'iY', 'iButtonMask', and 'iACS' are copied from the aWB_POINTER Client Message event.
Definition at line 712 of file frame_window.h.
void(* mouse_dblclick) (WBChildFrame *, int iX, int iY, int iButtonMask, int iACS) |
'mouse double click' notification.
part of the mouse UI handling. 'iX', 'iY', 'iButtonMask', and 'iACS' are copied from the aWB_POINTER Client Message event.
Definition at line 714 of file frame_window.h.
void(* mouse_drag) (WBChildFrame *, int iX, int iY, int iButtonMask, int iACS) |
'mouse drag' (begin) notification.
part of the mouse UI handling. 'iX', 'iY', 'iButtonMask', and 'iACS' are copied from the aWB_POINTER Client Message event.
Definition at line 716 of file frame_window.h.
void(* mouse_drop) (WBChildFrame *, int iX, int iY, int iButtonMask, int iACS) |
'mouse drop' (drag end) notification.
part of the mouse UI handling. 'iX', 'iY', 'iButtonMask', and 'iACS' are copied from the aWB_POINTER Client Message event.
Definition at line 718 of file frame_window.h.
void(* mouse_move) (WBChildFrame *, int iX, int iY) |
'mouse motion' notification.
part of the mouse UI handling. 'iX' and 'iY' are copied from the aWB_POINTER Client Message event.
Definition at line 720 of file frame_window.h.
void(* paste_from_cb) (WBChildFrame *) |
paste from clipboard
implements 'paste' functionality. The current clipboard contents will be pasted, either at the cursor location, or replacing the current selection
Definition at line 703 of file frame_window.h.
void(* pgdown) (WBChildFrame *, int iACS) |
'page down' navigation.
'iACS' is the Alt/Ctrl/Shift flags.
Definition at line 694 of file frame_window.h.
void(* pgleft) (WBChildFrame *, int iACS) |
'page left' navigation.
'iACS' is the Alt/Ctrl/Shift flags.
Definition at line 695 of file frame_window.h.
void(* pgright) (WBChildFrame *, int iACS) |
'page right' navigation.
'iACS' is the Alt/Ctrl/Shift flags.
Definition at line 696 of file frame_window.h.
void(* pgup) (WBChildFrame *, int iACS) |
'page up' navigation.
'iACS' is the Alt/Ctrl/Shift flags.
Definition at line 693 of file frame_window.h.
void(* redo) (WBChildFrame *) |
perform a re-do
Use 'can_redo()' to determine whether a re-do is possible
Definition at line 729 of file frame_window.h.
void(* rightarrow) (WBChildFrame *, int iACS) |
'right' arrow navigation.
'iACS' is the Alt/Ctrl/Shift flags.
Definition at line 690 of file frame_window.h.
void(* save) (WBChildFrame *, const char *szFileName) |
save to specified file name
A value of 'NULL' will keep same file name. If the file name is also NULL (or blank), nothing will be saved.
Definition at line 708 of file frame_window.h.
void(* scancode) (WBChildFrame *, XClientMessageEvent *) |
handler for 'other scan code' WB_CHAR Client Messages.
For those characters NOT already processed as actual characters or 'special' characters, call this function. The XClientMessageEvent will be interpreted, and characters may be added to the associated document or object. In some cases, there may be additional actions performed. This function should rarely be needed.
Definition at line 681 of file frame_window.h.
void(* scroll_horiz) (WBChildFrame *, int iMode, int iValue) |
'scroll vertical' notification.
A higher-level scrolling notification. 'iMode' is 0 for absolute, 1 for relative. 'iValue' is the absolute (or relative) new horizontal scroll position to assign
Definition at line 723 of file frame_window.h.
void(* scroll_vert) (WBChildFrame *, int iMode, int iValue) |
'scroll vertical' notification.
A higher-level scrolling notification. 'iMode' is 0 for absolute, 1 for relative. 'iValue' is the absolute (or relative) new vertical scroll position to assign
Definition at line 722 of file frame_window.h.
void(* select_all) (WBChildFrame *) |
void(* select_none) (WBChildFrame *) |
select none
implements the 'select none' functionality
Definition at line 707 of file frame_window.h.
void(* tab) (WBChildFrame *, int iACS) |
'tab' char, or tab navigation.
'iACS' is the Alt/Ctrl/Shift flags.
Definition at line 684 of file frame_window.h.
void(* toggle_ins_mode) (WBChildFrame *) |
toggles insert mode on or off
You can determine the current insert/overwrite state by calling is_ins_mode()
Definition at line 701 of file frame_window.h.
void(* undo) (WBChildFrame *) |
perform an undo operation
Use 'can_undo()' to determine whether an undo is possible
Definition at line 728 of file frame_window.h.
void(* uparrow) (WBChildFrame *, int iACS) |
'up' arrow navigation.
'iACS' is the Alt/Ctrl/Shift flags.
Definition at line 687 of file frame_window.h.