mirror of
https://github.com/davatorium/rofi.git
synced 2024-11-11 13:50:48 -05:00
Comment more code.
This commit is contained in:
parent
baec02cf1b
commit
be9bc59c34
4 changed files with 78 additions and 16 deletions
|
@ -10,9 +10,9 @@ extern char *dmenu_prompt;
|
|||
/**
|
||||
* @param input Pointer to the user-input string.
|
||||
*
|
||||
* dmenu dialog.
|
||||
* dmenu dialog.
|
||||
*
|
||||
* @returns TRUE if script was successful.
|
||||
* @returns TRUE if script was successful.
|
||||
*/
|
||||
int dmenu_switcher_dialog ( char **input );
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
* Parses a string into arguments. While replacing keys with values.
|
||||
*
|
||||
* @returns TRUE when successful, FALSE when failed.
|
||||
*/
|
||||
*/
|
||||
int helper_parse_setup ( char * string, char ***output, int *length, ... );
|
||||
|
||||
/**
|
||||
|
@ -36,7 +36,7 @@ char **tokenize ( const char *input );
|
|||
* Parse command line argument 'key' to character.
|
||||
* This one supports character escaping.
|
||||
*
|
||||
* @returns TRUE if key was found and val was set.
|
||||
* @returns TRUE if key was found and val was set.
|
||||
*/
|
||||
int find_arg_char ( const int argc, char * const argv[], const char * const key, char *val );
|
||||
|
||||
|
@ -48,7 +48,7 @@ int find_arg_char ( const int argc, char * const argv[], const char * const key,
|
|||
*
|
||||
* Parse command line argument 'key' to unsigned int.
|
||||
*
|
||||
* @returns TRUE if key was found and val was set.
|
||||
* @returns TRUE if key was found and val was set.
|
||||
*/
|
||||
int find_arg_uint ( const int argc, char * const argv[], const char * const key, unsigned int *val );
|
||||
|
||||
|
@ -60,7 +60,7 @@ int find_arg_uint ( const int argc, char * const argv[], const char * const key,
|
|||
*
|
||||
* Parse command line argument 'key' to int.
|
||||
*
|
||||
* @returns TRUE if key was found and val was set.
|
||||
* @returns TRUE if key was found and val was set.
|
||||
*/
|
||||
int find_arg_int ( const int argc, char * const argv[], const char * const key, int *val );
|
||||
|
||||
|
@ -73,7 +73,7 @@ int find_arg_int ( const int argc, char * const argv[], const char * const key,
|
|||
*
|
||||
* Parse command line argument 'key' to string.
|
||||
*
|
||||
* @returns TRUE if key was found and val was set.
|
||||
* @returns TRUE if key was found and val was set.
|
||||
*/
|
||||
int find_arg_str ( const int argc, char * const argv[], const char * const key, char** val );
|
||||
|
||||
|
@ -84,7 +84,7 @@ int find_arg_str ( const int argc, char * const argv[], const char * const key,
|
|||
*
|
||||
* Check if key is passed as argument.
|
||||
*
|
||||
* @returns return position of string or -1 if not found.
|
||||
* @returns return position of string or -1 if not found.
|
||||
*/
|
||||
int find_arg ( const int argc, char * const argv[], const char * const key );
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
#ifndef __RUN_DIALOG_H__
|
||||
#define __RUN_DIALOG_H__
|
||||
|
||||
|
||||
/**
|
||||
* @param input Pointer to the user-input string.
|
||||
* @param data Custom data pointer for callback.
|
||||
|
|
|
@ -30,9 +30,12 @@ typedef enum
|
|||
TB_EDITABLE = 1 << 19,
|
||||
} TextboxFlags;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
// Render font normally
|
||||
NORMAL,
|
||||
// Render font highlighted (inverted colors.)
|
||||
HIGHLIGHT,
|
||||
} TextBoxFontType;
|
||||
|
||||
|
@ -52,20 +55,73 @@ void textbox_free ( textbox *tb );
|
|||
* @param tb Handle to the textbox
|
||||
* @param tbft The style of font to render.
|
||||
*
|
||||
* Set the font render style.
|
||||
* Set the font render style.
|
||||
*/
|
||||
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 );
|
||||
|
||||
/**
|
||||
* @param tb Handle to the textbox
|
||||
*
|
||||
* Show the textbox (map window)
|
||||
*/
|
||||
void textbox_show ( textbox *tb );
|
||||
|
||||
/**
|
||||
* @param tb Handle to the textbox
|
||||
*
|
||||
* Render the textbox.
|
||||
*/
|
||||
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 );
|
||||
|
||||
/**
|
||||
* @param tb Handle to the textbox
|
||||
*
|
||||
* Move the cursor to the end of the string.
|
||||
*/
|
||||
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 );
|
||||
|
||||
/**
|
||||
* @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 );
|
||||
|
||||
/**
|
||||
* @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 );
|
||||
|
||||
/**
|
||||
|
@ -100,18 +156,18 @@ void textbox_cleanup ();
|
|||
/**
|
||||
* @param tb Handle to the textbox
|
||||
*
|
||||
* Get the height of the textbox
|
||||
* Get the height of the textbox
|
||||
*
|
||||
* @returns the height of the textbox in pixels.
|
||||
* @returns the height of the textbox in pixels.
|
||||
*/
|
||||
int textbox_get_height ( textbox *tb );
|
||||
|
||||
/**
|
||||
* @param tb Handle to the textbox
|
||||
*
|
||||
* Get the width of the textbox
|
||||
* Get the width of the textbox
|
||||
*
|
||||
* @returns the width of the textbox in pixels.
|
||||
* @returns the width of the textbox in pixels.
|
||||
*/
|
||||
int textbox_get_width ( textbox *tb );
|
||||
|
||||
|
@ -120,7 +176,7 @@ int textbox_get_width ( textbox *tb );
|
|||
*
|
||||
* Get the height of the rendered string.
|
||||
*
|
||||
* @returns the height of the string in pixels.
|
||||
* @returns the height of the string in pixels.
|
||||
*/
|
||||
int textbox_get_font_height ( textbox *tb );
|
||||
|
||||
|
@ -129,7 +185,7 @@ int textbox_get_font_height ( textbox *tb );
|
|||
*
|
||||
* Get the width of the rendered string.
|
||||
*
|
||||
* @returns the width of the string in pixels.
|
||||
* @returns the width of the string in pixels.
|
||||
*/
|
||||
int textbox_get_font_width ( textbox *tb );
|
||||
|
||||
|
@ -169,6 +225,13 @@ void textbox_cursor_dec ( 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 );
|
||||
|
||||
#endif //__TEXTBOX_H__
|
||||
|
|
Loading…
Reference in a new issue