mirror of
https://github.com/davatorium/rofi.git
synced 2024-11-18 13:54:36 -05:00
More docu updates
This commit is contained in:
parent
ce341f6885
commit
9293c8b8ce
6 changed files with 162 additions and 7 deletions
|
@ -1,11 +1,35 @@
|
|||
#ifndef ROFI_MODE_PRIVATE_H
|
||||
#define ROFI_MODE_PRIVATE_H
|
||||
|
||||
/**
|
||||
* @param data The #self pointer.
|
||||
*
|
||||
* Mode free function.
|
||||
*/
|
||||
typedef void ( *_mode_free )( Mode *data );
|
||||
|
||||
/**
|
||||
* @param sw The #Mode pointer
|
||||
* @param selected_line The selected line
|
||||
* @param state The state to display [out]
|
||||
* @param get_entry if it should only return the state
|
||||
*
|
||||
* Get the value for displaying.
|
||||
*
|
||||
* @return the string and state for displaying.
|
||||
*/
|
||||
typedef char * ( *_mode_get_display_value )( const Mode *sw, unsigned int selected_line, int *state, int get_entry );
|
||||
|
||||
/**
|
||||
* @param sw The #Mode pointer
|
||||
* @param selected_line The selected line
|
||||
*
|
||||
* Obtains the string to complete.
|
||||
*
|
||||
* @return Get the completion string
|
||||
*/
|
||||
typedef char * ( *_mode_get_completion )( const Mode *sw, unsigned int selected_line );
|
||||
|
||||
/**
|
||||
* @param tokens List of (input) tokens to match.
|
||||
* @param input The entry to match against.
|
||||
|
@ -19,14 +43,52 @@ typedef char * ( *_mode_get_completion )( const Mode *sw, unsigned int selected_
|
|||
*/
|
||||
typedef int ( *_mode_token_match )( const Mode *data, GRegex **tokens, unsigned int index );
|
||||
|
||||
/**
|
||||
* @param sw The #Mode pointer
|
||||
*
|
||||
* Initialize the mode.
|
||||
*
|
||||
* @returns TRUE is successfull
|
||||
*/
|
||||
typedef int ( *__mode_init )( Mode *sw );
|
||||
|
||||
/**
|
||||
* @param sw The #Mode pointer
|
||||
*
|
||||
* Get the number of entries.
|
||||
*
|
||||
* @returns the number of entries
|
||||
*/
|
||||
typedef unsigned int ( *__mode_get_num_entries )( const Mode *sw );
|
||||
|
||||
/**
|
||||
* @param sw The #Mode pointer
|
||||
*
|
||||
* Destroy the current mode. Still ready to restart.
|
||||
*
|
||||
*/
|
||||
typedef void ( *__mode_destroy )( Mode *sw );
|
||||
|
||||
/**
|
||||
* @param sw The #Mode pointer
|
||||
* @param menu_retv The return value
|
||||
* @param input The input string
|
||||
* @param selected_line The selected line
|
||||
*
|
||||
* Handle the user accepting an entry.
|
||||
*
|
||||
* @returns the next action to take
|
||||
*/
|
||||
typedef ModeMode ( *_mode_result )( Mode *sw, int menu_retv, char **input, unsigned int selected_line );
|
||||
|
||||
/**
|
||||
* @param sw The #Mode pointer
|
||||
* @param input The input string
|
||||
*
|
||||
* Preprocess the input for sorting.
|
||||
*
|
||||
* @returns Entry stripped from markup for sorting
|
||||
*/
|
||||
typedef char* ( *_mode_preprocess_input )( Mode *sw, const char *input );
|
||||
|
||||
/**
|
||||
|
|
|
@ -72,18 +72,82 @@ void listview_nav_page_next ( listview *lv );
|
|||
* - Clip at top/bottom
|
||||
*/
|
||||
void listview_nav_page_prev ( listview *lv );
|
||||
|
||||
/**
|
||||
* Configuration.
|
||||
* @param lv Handler to the listview object
|
||||
* @param padding The padding
|
||||
*
|
||||
* Padding on between the widgets.
|
||||
*/
|
||||
void listview_set_padding ( listview *lv, unsigned int padding );
|
||||
|
||||
/**
|
||||
* @param lv Handler to the listview object
|
||||
* @param lines The maximum number of lines
|
||||
*
|
||||
* Set the maximum number of lines to show.
|
||||
*/
|
||||
void listview_set_max_lines ( listview *lv, unsigned int lines );
|
||||
|
||||
/**
|
||||
* @param lv Handler to the listview object
|
||||
* @param columns The maximum number of columns
|
||||
*
|
||||
* Set the maximum number of columns to show.
|
||||
*/
|
||||
void listview_set_max_columns ( listview *lv, unsigned int columns );
|
||||
|
||||
/**
|
||||
* @param lv Handler to the listview object
|
||||
* @param enabled enable
|
||||
*
|
||||
* Set fixed num lines mode.
|
||||
*/
|
||||
void listview_set_fixed_num_lines ( listview *lv, gboolean enabled );
|
||||
/**
|
||||
* @param lv Handler to the listview object
|
||||
* @param enabled enable
|
||||
*
|
||||
* Hide the scrollbar.
|
||||
*/
|
||||
void listview_set_hide_scrollbar ( listview *lv, gboolean enabled );
|
||||
/**
|
||||
* @param lv Handler to the listview object
|
||||
* @param width Width in pixels
|
||||
*
|
||||
* Set the width of the scrollbar
|
||||
*/
|
||||
void listview_set_scrollbar_width ( listview *lv, unsigned int width );
|
||||
|
||||
/**
|
||||
* @param lv Handler to the listview object
|
||||
* @param cycle True for cycle mode
|
||||
*
|
||||
* Set cycle mode. On last entry go to first.
|
||||
*/
|
||||
void listview_set_cycle ( listview *lv, gboolean cycle );
|
||||
/**
|
||||
* @param lv Handler to the listview object
|
||||
* @param type ScrollType
|
||||
*
|
||||
* Set the scroll type ScrollType::LISTVIEW_SCROLL_CONTINIOUS or ScrollType::LISTVIEW_SCROLL_PER_PAGE
|
||||
*/
|
||||
void listview_set_scroll_type ( listview *lv, ScrollType type );
|
||||
|
||||
/**
|
||||
* @param lv Handler to the listview object
|
||||
* @param cb The callback
|
||||
* @param udata User data
|
||||
*
|
||||
* Set the mouse activated callback.
|
||||
*/
|
||||
void listview_set_mouse_activated_cb ( listview *lv, listview_mouse_activated_cb cb, void *udata );
|
||||
/**
|
||||
* @param lv Handler to the listview object
|
||||
* @param enabled
|
||||
*
|
||||
* Enable,disable multi-select.
|
||||
*/
|
||||
void listview_set_multi_select ( listview *lv, gboolean enable );
|
||||
/* @} */
|
||||
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
#ifndef WIDGET_INTERNAL_H
|
||||
#define WIDGET_INTERNAL_H
|
||||
|
||||
/**
|
||||
* Data structure holding the internal state of the Widget
|
||||
*/
|
||||
struct _widget
|
||||
{
|
||||
/** X position relative to parent */
|
||||
|
@ -13,26 +16,31 @@ struct _widget
|
|||
short h;
|
||||
/** enabled or not */
|
||||
gboolean enabled;
|
||||
/** Information about packing. */
|
||||
/** Expand the widget when packed */
|
||||
gboolean expand;
|
||||
/** Place widget at end of parent */
|
||||
gboolean end;
|
||||
|
||||
/** Parent widget */
|
||||
struct _widget *parent;
|
||||
/** Internal */
|
||||
gboolean need_redraw;
|
||||
/** Function prototypes */
|
||||
/** get width of widget implementation function */
|
||||
int ( *get_width )( struct _widget * );
|
||||
/** get height of widget implementation function */
|
||||
int ( *get_height )( struct _widget * );
|
||||
|
||||
/** draw widget implementation function */
|
||||
void ( *draw )( struct _widget *widget, cairo_t *draw );
|
||||
/** resize widget implementation function */
|
||||
void ( *resize )( struct _widget *, short, short );
|
||||
/** update widget implementation function */
|
||||
void ( *update )( struct _widget * );
|
||||
|
||||
// Signals.
|
||||
/** widget clicked callback */
|
||||
widget_clicked_cb clicked;
|
||||
/** user data for ::clicked callback */
|
||||
void *clicked_cb_data;
|
||||
|
||||
// Free
|
||||
/** Free widget callback */
|
||||
void ( *free )( struct _widget *widget );
|
||||
};
|
||||
#endif // WIDGET_INTERNAL_H
|
||||
|
|
|
@ -6,15 +6,24 @@
|
|||
|
||||
struct xkb_stuff
|
||||
{
|
||||
/** connection to the X server*/
|
||||
xcb_connection_t *xcb_connection;
|
||||
/** Keyboard context */
|
||||
struct xkb_context *context;
|
||||
/** Flag indicating first event */
|
||||
uint8_t first_event;
|
||||
/** Keyboard device id */
|
||||
int32_t device_id;
|
||||
/** Current keymap */
|
||||
struct xkb_keymap *keymap;
|
||||
/** Keyboard state */
|
||||
struct xkb_state *state;
|
||||
/** Compose information */
|
||||
struct
|
||||
{
|
||||
/** Compose table */
|
||||
struct xkb_compose_table *table;
|
||||
/** Compose state */
|
||||
struct xkb_compose_state * state;
|
||||
} compose;
|
||||
};
|
||||
|
|
|
@ -39,9 +39,14 @@
|
|||
|
||||
#define HISTORY_MAX_ENTRIES 25
|
||||
|
||||
/**
|
||||
* History element
|
||||
*/
|
||||
typedef struct __element
|
||||
{
|
||||
/** Index in history */
|
||||
long int index;
|
||||
/** Entry */
|
||||
char *name;
|
||||
}_element;
|
||||
|
||||
|
|
|
@ -56,11 +56,18 @@ typedef struct
|
|||
Color hlbg;
|
||||
} RowColor;
|
||||
|
||||
/** Number of states */
|
||||
#define num_states 3
|
||||
/**
|
||||
* Different colors for the different states
|
||||
*/
|
||||
RowColor colors[num_states];
|
||||
|
||||
/** Default pango context */
|
||||
static PangoContext *p_context = NULL;
|
||||
/** The pango font metrics */
|
||||
static PangoFontMetrics *p_metrics = NULL;
|
||||
|
||||
static gboolean textbox_blink ( gpointer data )
|
||||
{
|
||||
textbox *tb = (textbox *) data;
|
||||
|
|
Loading…
Reference in a new issue