X11 Work Bench Toolkit  1.0
__WBChildFrameUI__ Struct Reference

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 WM_CHAR Client Messages (typed-in characters). More...
 
void(* scancode )(WBChildFrame *, XClientMessageEvent *)
 handler for 'other scan code' WM_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(* 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(* mouse_scrollup )(WBChildFrame *, int iX, int iY, int iButtonMask, int iACS)
 'mouse scroll up' notification. More...
 
void(* mouse_scrolldown )(WBChildFrame *, int iX, int iY, int iButtonMask, int iACS)
 'mouse scroll down' 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...
 

Detailed Description

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.

typedef struct __WBChildFrameUI__
{
unsigned int ulTag;
// tag indicating I'm a 'Child Frame UI' structure
void (*do_char)(WBChildFrame *, XClientMessageEvent *);
// handler for regular WM_CHAR Client Messages (typed-in characters).
// NOT called for 'special' characters.
void (*scancode)(WBChildFrame *, XClientMessageEvent *);
// handler for 'other scan code' WM_CHAR Client Messages (typed-in characters)
void (*bkspace)(WBChildFrame *, int iACS);
// 'backspace' delete character (backspace equivalent).
// 'iACS' is the Alt/Ctrl/Shift flags. See Also: aWM_CHAR
void (*del)(WBChildFrame *, int iACS);
// 'delete' char under cursor (delete equivalent).
// 'iACS' is the Alt/Ctrl/Shift flags. See Also: aWM_CHAR
void (*tab)(WBChildFrame *, int iACS);
// 'tab' char, or tab navigation.
// 'iACS' is the Alt/Ctrl/Shift flags. See Also: aWM_CHAR
void (*enter)(WBChildFrame *, int iACS);
// 'enter' char, or 'enter' for navigation.
// 'iACS' is the Alt/Ctrl/Shift flags. See Also: aWM_CHAR
void (*uparrow)(WBChildFrame *, int iACS);
// 'up' arrow navigation.
// 'iACS' is the Alt/Ctrl/Shift flags. See Also: aWM_CHAR
void (*downarrow)(WBChildFrame *, int iACS);
// 'down' arrow navigation.
// 'iACS' is the Alt/Ctrl/Shift flags. See Also: aWM_CHAR
void (*leftarrow)(WBChildFrame *, int iACS);
// 'left' arrow navigation.
// 'iACS' is the Alt/Ctrl/Shift flags. See Also: aWM_CHAR
void (*rightarrow)(WBChildFrame *, int iACS);
// 'right' arrow navigation.
// 'iACS' is the Alt/Ctrl/Shift flags. See Also: aWM_CHAR
void (*home)(WBChildFrame *, int iACS);
// 'home' arrow navigation.
// 'iACS' is the Alt/Ctrl/Shift flags. See Also: aWM_CHAR
void (*end)(WBChildFrame *, int iACS);
// 'end' arrow navigation.
// 'iACS' is the Alt/Ctrl/Shift flags. See Also: aWM_CHAR
void (*pgup)(WBChildFrame *, int iACS);
// 'page up' navigation.
// 'iACS' is the Alt/Ctrl/Shift flags. See Also: aWM_CHAR
void (*pgdown)(WBChildFrame *, int iACS);
// 'page down' navigation.
// 'iACS' is the Alt/Ctrl/Shift flags. See Also: aWM_CHAR
void (*pgleft)(WBChildFrame *, int iACS);
// 'page left' navigation.
// 'iACS' is the Alt/Ctrl/Shift flags. See Also: aWM_CHAR
void (*pgright)(WBChildFrame *, int iACS);
// 'page right' navigation.
// 'iACS' is the Alt/Ctrl/Shift flags. See Also: aWM_CHAR
void (*help)(WBChildFrame *, int iACS);
// 'help' context (F1).
// 'iACS' is the Alt/Ctrl/Shift flags. See Also: aWM_CHAR
void (*hover_notify)(WBChildFrame *, int x, int y);
// 'mouse hover' notification (x and y are pixel coords with respect to upper left corner)
// 'mouse hover' cancel notification (cancel any 'hover' action)
// returns non-zero if in 'insert' mode, 0 for 'overwrite'
// toggles insert mode on/off (press 'INS' key)
// copy selection to clipboard
// paste from clipboard
void (*cut_to_cb)(WBChildFrame *);
// delete selection, copying to clipboard first
// delete selection only
// select all
// select none
void (*save)(WBChildFrame *, const char *szFileName);
// save to specified file name (NULL to keep same file name)
// get (const) pointer to file name string
void (*mouse_click)(WBChildFrame *, int iX, int iY,
int iButtonMask, int iACS);
// 'mouse click' notification. See Also: aWM_POINTER
void (*mouse_dblclick)(WBChildFrame *, int iX, int iY,
int iButtonMask, int iACS);
// 'mouse double click' notification. See Also: aWM_POINTER
void (*mouse_drag)(WBChildFrame *, int iX, int iY,
int iButtonMask, int iACS);
// 'mouse drag' (begin) notification. See Also: aWM_POINTER
void (*mouse_drop)(WBChildFrame *, int iX, int iY,
int iButtonMask, int iACS);
// 'mouse drop' (drag end) notification. See Also: aWM_POINTER
void (*mouse_move)(WBChildFrame *, int iX, int iY);
// 'mouse motion' notification. See Also: aWM_POINTER
void (*mouse_scrollup)(WBChildFrame *, int iX, int iY,
int iButtonMask, int iACS);
// 'mouse scroll up' notification. See Also: aWM_POINTER
void (*mouse_scrolldown)(WBChildFrame *, int iX, int iY,
int iButtonMask, int iACS);
// 'mouse scroll down' notification. See Also: aWM_POINTER
// 'mouse cancel' notification (cancel 'drag', etc.).
// See Also: aWM_POINTER , WBMouseCancel()
void (*get_row_col)(WBChildFrame *, int *piR, int *piC);
// Obtain the current row/column cursor location for 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 (<= 0 is 'error' or 'NA')
// returns non-zero value if there is a selection
void (*undo)(WBChildFrame *);
// perform an undo
void (*redo)(WBChildFrame *);
// perform a re-do
// returns non-zero value if 'can undo'
// returns non-zero value if 'can redo'
// returns non-zero value if contents are 'empty' (cannot select anything)

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 aWM_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 WM_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 'WM_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 661 of file frame_window.h.

Field Documentation

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.

See Also
aWM_CHAR

Definition at line 666 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 714 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 713 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 685 of file frame_window.h.

void(* cut_to_cb)(WBChildFrame *)

delete selection, copying to clipboard first

implements 'cut' functionality

Definition at line 687 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.

See Also
aWM_CHAR

Definition at line 667 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 688 of file frame_window.h.

void(* do_char)(WBChildFrame *, XClientMessageEvent *)

handler for regular WM_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 664 of file frame_window.h.

void(* downarrow)(WBChildFrame *, int iACS)

'down' arrow navigation.

'iACS' is the Alt/Ctrl/Shift flags.

See Also
aWM_CHAR

Definition at line 671 of file frame_window.h.

void(* end)(WBChildFrame *, int iACS)

'end' arrow navigation.

'iACS' is the Alt/Ctrl/Shift flags.

See Also
aWM_CHAR

Definition at line 675 of file frame_window.h.

void(* enter)(WBChildFrame *, int iACS)

'enter' char, or 'enter' for navigation.

'iACS' is the Alt/Ctrl/Shift flags.

See Also
aWM_CHAR

Definition at line 669 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 693 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 709 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 710 of file frame_window.h.

void(* help)(WBChildFrame *, int iACS)

'help' context (F1).

'iACS' is the Alt/Ctrl/Shift flags.

See Also
aWM_CHAR

Definition at line 680 of file frame_window.h.

void(* home)(WBChildFrame *, int iACS)

'home' arrow navigation.

'iACS' is the Alt/Ctrl/Shift flags.

See Also
aWM_CHAR

Definition at line 674 of file frame_window.h.

void(* hover_cancel)(WBChildFrame *)

'mouse hover' cancel notification

This will cancel any 'hover' action

Definition at line 682 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 681 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 715 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 683 of file frame_window.h.

void(* leftarrow)(WBChildFrame *, int iACS)

'left' arrow navigation.

'iACS' is the Alt/Ctrl/Shift flags.

See Also
aWM_CHAR

Definition at line 672 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).

See Also
aWM_POINTER , WBMouseCancel()

Definition at line 708 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 aWM_POINTER Client Message event.

Definition at line 695 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 aWM_POINTER Client Message event.

Definition at line 697 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 aWM_POINTER Client Message event.

Definition at line 699 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 aWM_POINTER Client Message event.

Definition at line 701 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 aWM_POINTER Client Message event.

Definition at line 703 of file frame_window.h.

void(* mouse_scrolldown)(WBChildFrame *, int iX, int iY, int iButtonMask, int iACS)

'mouse scroll down' notification.

part of the mouse UI handling. 'iX', 'iY', 'iButtonMask', and 'iACS' are copied from the aWM_POINTER Client Message event.

Definition at line 706 of file frame_window.h.

void(* mouse_scrollup)(WBChildFrame *, int iX, int iY, int iButtonMask, int iACS)

'mouse scroll up' notification.

part of the mouse UI handling. 'iX', 'iY', 'iButtonMask', and 'iACS' are copied from the aWM_POINTER Client Message event.

Definition at line 704 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 686 of file frame_window.h.

void(* pgdown)(WBChildFrame *, int iACS)

'page down' navigation.

'iACS' is the Alt/Ctrl/Shift flags.

See Also
aWM_CHAR

Definition at line 677 of file frame_window.h.

void(* pgleft)(WBChildFrame *, int iACS)

'page left' navigation.

'iACS' is the Alt/Ctrl/Shift flags.

See Also
aWM_CHAR

Definition at line 678 of file frame_window.h.

void(* pgright)(WBChildFrame *, int iACS)

'page right' navigation.

'iACS' is the Alt/Ctrl/Shift flags.

See Also
aWM_CHAR

Definition at line 679 of file frame_window.h.

void(* pgup)(WBChildFrame *, int iACS)

'page up' navigation.

'iACS' is the Alt/Ctrl/Shift flags.

See Also
aWM_CHAR

Definition at line 676 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 712 of file frame_window.h.

void(* rightarrow)(WBChildFrame *, int iACS)

'right' arrow navigation.

'iACS' is the Alt/Ctrl/Shift flags.

See Also
aWM_CHAR

Definition at line 673 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 691 of file frame_window.h.

void(* scancode)(WBChildFrame *, XClientMessageEvent *)

handler for 'other scan code' WM_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 665 of file frame_window.h.

void(* select_all)(WBChildFrame *)

select all

implements the 'select all' functionality

Definition at line 689 of file frame_window.h.

void(* select_none)(WBChildFrame *)

select none

implements the 'select none' functionality

Definition at line 690 of file frame_window.h.

void(* tab)(WBChildFrame *, int iACS)

'tab' char, or tab navigation.

'iACS' is the Alt/Ctrl/Shift flags.

See Also
aWM_CHAR

Definition at line 668 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 684 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 711 of file frame_window.h.

void(* uparrow)(WBChildFrame *, int iACS)

'up' arrow navigation.

'iACS' is the Alt/Ctrl/Shift flags.

See Also
aWM_CHAR

Definition at line 670 of file frame_window.h.


The documentation for this struct was generated from the following file: