Comment more code.
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
#ifndef __RUN_DIALOG_H__
|
#ifndef __RUN_DIALOG_H__
|
||||||
#define __RUN_DIALOG_H__
|
#define __RUN_DIALOG_H__
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param input Pointer to the user-input string.
|
* @param input Pointer to the user-input string.
|
||||||
* @param data Custom data pointer for callback.
|
* @param data Custom data pointer for callback.
|
||||||
|
@@ -30,9 +30,12 @@ typedef enum
|
|||||||
TB_EDITABLE = 1 << 19,
|
TB_EDITABLE = 1 << 19,
|
||||||
} TextboxFlags;
|
} TextboxFlags;
|
||||||
|
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
|
// Render font normally
|
||||||
NORMAL,
|
NORMAL,
|
||||||
|
// Render font highlighted (inverted colors.)
|
||||||
HIGHLIGHT,
|
HIGHLIGHT,
|
||||||
} TextBoxFontType;
|
} TextBoxFontType;
|
||||||
|
|
||||||
@@ -56,16 +59,69 @@ void textbox_free ( textbox *tb );
|
|||||||
*/
|
*/
|
||||||
void textbox_font ( textbox *tb, TextBoxFontType tbft );
|
void textbox_font ( textbox *tb, TextBoxFontType tbft );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param tb Handle to the textbox
|
||||||
|
* @param text The text to show in the textbox
|
||||||
|
*
|
||||||
|
* Set the text to show. Cursor is moved to end (if visible)
|
||||||
|
*/
|
||||||
void textbox_text ( textbox *tb, char *text );
|
void textbox_text ( textbox *tb, char *text );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param tb Handle to the textbox
|
||||||
|
*
|
||||||
|
* Show the textbox (map window)
|
||||||
|
*/
|
||||||
void textbox_show ( textbox *tb );
|
void textbox_show ( textbox *tb );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param tb Handle to the textbox
|
||||||
|
*
|
||||||
|
* Render the textbox.
|
||||||
|
*/
|
||||||
void textbox_draw ( textbox *tb );
|
void textbox_draw ( textbox *tb );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param tb Handle to the textbox
|
||||||
|
* @param ev XEvent key inputs to textbox
|
||||||
|
*
|
||||||
|
* Let the textbox handle the input event.
|
||||||
|
*
|
||||||
|
* @returns if the key was handled (1), unhandled(0) or handled and return was pressed (-1)
|
||||||
|
*/
|
||||||
int textbox_keypress ( textbox *tb, XEvent *ev );
|
int textbox_keypress ( textbox *tb, XEvent *ev );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param tb Handle to the textbox
|
||||||
|
*
|
||||||
|
* Move the cursor to the end of the string.
|
||||||
|
*/
|
||||||
void textbox_cursor_end ( textbox *tb );
|
void textbox_cursor_end ( textbox *tb );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param tb Handle to the textbox
|
||||||
|
* @param pos New cursor position
|
||||||
|
*
|
||||||
|
* Set the cursor position (string index)
|
||||||
|
*/
|
||||||
void textbox_cursor ( textbox *tb, int pos );
|
void textbox_cursor ( textbox *tb, int pos );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param tb Handle to the textbox
|
||||||
|
* @param x The new x coordinate to move the window to
|
||||||
|
* @param y The new y coordinate to move the window to
|
||||||
|
*
|
||||||
|
* Move the window to x,y position.
|
||||||
|
*/
|
||||||
void textbox_move ( textbox *tb, int x, int y );
|
void textbox_move ( textbox *tb, int x, int y );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param tb Handle to the textbox
|
||||||
|
* @param pos The position to insert the string at
|
||||||
|
* @param str The string to insert.
|
||||||
|
*
|
||||||
|
* Insert the string str at position pos.
|
||||||
|
*/
|
||||||
void textbox_insert ( textbox *tb, int pos, char *str );
|
void textbox_insert ( textbox *tb, int pos, char *str );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -169,6 +225,13 @@ void textbox_cursor_dec ( textbox *tb );
|
|||||||
*/
|
*/
|
||||||
void textbox_cursor_inc ( textbox *tb );
|
void textbox_cursor_inc ( textbox *tb );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param tb Handle to the textbox
|
||||||
|
* @param pos The start position
|
||||||
|
* @param dlen The length
|
||||||
|
*
|
||||||
|
* Remove dlen bytes from position pos.
|
||||||
|
*/
|
||||||
void textbox_delete ( textbox *tb, int pos, int dlen );
|
void textbox_delete ( textbox *tb, int pos, int dlen );
|
||||||
|
|
||||||
#endif //__TEXTBOX_H__
|
#endif //__TEXTBOX_H__
|
||||||
|
Reference in New Issue
Block a user