1
0
Fork 0
mirror of https://github.com/davatorium/rofi.git synced 2024-11-11 13:50:48 -05:00
rofi/include/rofi.h

111 lines
2.8 KiB
C
Raw Normal View History

#ifndef __SIMPLESWITCHER_H__
#define __SIMPLESWITCHER_H__
2014-03-18 05:55:25 -04:00
#include <config.h>
#include <X11/X.h>
2014-01-25 17:37:37 -05:00
2014-03-22 16:04:19 -04:00
#define MAX( a, b ) ( ( a ) > ( b ) ? ( a ) : ( b ) )
#define MIN( a, b ) ( ( a ) < ( b ) ? ( a ) : ( b ) )
#define NEAR( a, o, b ) ( ( b ) > ( a ) - ( o ) && ( b ) < ( a ) + ( o ) )
#define OVERLAP( a, b, c, d ) ( ( ( a ) == ( c ) && ( b ) == ( d ) ) || MIN ( ( a ) + ( b ), ( c ) + ( d ) ) - MAX ( ( a ), ( c ) ) > 0 )
#define INTERSECT( x, y, w, h, x1, y1, w1, h1 ) ( OVERLAP ( ( x ), ( w ), ( x1 ), ( w1 ) ) && OVERLAP ( ( y ), ( h ), ( y1 ), ( h1 ) ) )
#ifndef TRUE
2014-05-22 04:03:36 -04:00
#define TRUE 1
#endif
#ifndef FALSE
2014-05-22 04:03:36 -04:00
#define FALSE 0
#endif
2014-01-25 17:37:37 -05:00
extern const char *cache_dir;
2014-03-22 16:04:19 -04:00
typedef enum
{
WINDOW_SWITCHER,
RUN_DIALOG,
2014-01-21 04:01:55 -05:00
SSH_DIALOG,
2014-01-22 03:24:31 -05:00
NUM_DIALOGS,
2014-01-29 18:47:23 -05:00
DMENU_DIALOG,
2014-01-22 03:24:31 -05:00
MODE_EXIT,
NEXT_DIALOG
} SwitcherMode;
2014-03-22 16:04:19 -04:00
typedef enum
{
MENU_OK = 0,
MENU_CANCEL = -1,
MENU_NEXT = -2,
MENU_CUSTOM_INPUT = -3,
MENU_ENTRY_DELETE = -4
} MenuReturn;
2014-01-26 06:59:10 -05:00
2014-01-21 04:13:42 -05:00
typedef int ( *menu_match_cb )( char **tokens, const char *input, int index, void *data );
2014-03-22 16:04:19 -04:00
MenuReturn menu ( char **lines, char **input, char *prompt,
Time *time, int *shift,
menu_match_cb mmc, void *mmc_data,
int *selected_line );
2014-03-22 16:04:19 -04:00
void catch_exit ( __attribute__( ( unused ) ) int sig );
typedef enum _WindowLocation
{
WL_CENTER = 0,
WL_NORTH_WEST = 1,
WL_NORTH = 2,
WL_NORTH_EAST = 3,
WL_EAST = 4,
WL_EAST_SOUTH = 5,
WL_SOUTH = 6,
WL_SOUTH_WEST = 7,
WL_WEST = 8
} WindowLocation;
2014-01-23 05:39:12 -05:00
/**
* Settings
*/
2014-03-22 16:04:19 -04:00
typedef struct _Settings
{
2014-01-23 05:39:12 -05:00
// Window settings
2014-03-22 16:04:19 -04:00
unsigned int window_opacity;
2014-01-23 05:39:12 -05:00
// Menu settings
2014-03-22 16:04:19 -04:00
unsigned int menu_bw;
unsigned int menu_width;
unsigned int menu_lines;
2014-05-19 03:50:09 -04:00
unsigned int menu_columns;
2014-03-22 16:04:19 -04:00
char * menu_font;
char * menu_fg;
char * menu_bg;
char * menu_hlfg;
char * menu_hlbg;
char * menu_bc;
2014-01-23 05:39:12 -05:00
// Behavior
2014-03-22 16:04:19 -04:00
unsigned int zeltak_mode;
char * terminal_emulator;
2014-05-20 05:22:03 -04:00
2014-01-23 05:39:12 -05:00
// Key bindings
2014-03-22 16:04:19 -04:00
char * window_key;
char * run_key;
char * ssh_key;
WindowLocation location;
unsigned int hmode;
2014-03-22 16:04:19 -04:00
unsigned int padding;
2014-05-15 10:54:35 -04:00
int y_offset;
2014-05-15 15:55:23 -04:00
int x_offset;
2014-05-22 04:03:36 -04:00
unsigned int ssh_set_title;
2014-05-17 16:17:07 -04:00
unsigned int fixed_num_lines;
2014-01-23 05:39:12 -05:00
} Settings;
extern Settings config;
2014-02-03 16:49:07 -05:00
int token_match ( char **tokens, const char *input,
2014-03-22 16:04:19 -04:00
__attribute__( ( unused ) ) int index,
__attribute__( ( unused ) ) void *data );
2014-05-19 15:02:05 -04:00
void config_sanity_check ( void );
2014-05-20 03:43:45 -04:00
void config_print ( void );
#endif