This commit is contained in:
Qball Cow 2014-05-27 08:31:59 +02:00
parent d573f3db4d
commit 749d3e6223
4 changed files with 42 additions and 8 deletions

View File

@ -1,5 +1,6 @@
#ifndef __TEXTBOX_H__
#define __TEXTBOX_H__
#include <X11/Xft/Xft.h>
typedef struct
{
@ -52,13 +53,35 @@ int textbox_keypress ( textbox *tb, XEvent *ev );
void textbox_cursor_end ( textbox *tb );
void textbox_move ( textbox *tb, int x, int y );
/**
* @param tb Handle to the textbox
*
* Unmap the textbox window. Effectively hiding it.
*/
void textbox_hide ( textbox *tb );
/**
* @param font_str The font to use.
* @param font_active_str The font to use for active entries.
* @param bg The background color.
* @param fg The foreground color.
* @param hlbg The background color for a highlighted entry.
* @param hlfg The foreground color for a highlighted entry.
*
* Setup the cached fonts. This is required to do
* before any of the textbox_ functions is called.
* Clean with textbox_cleanup()
*/
void textbox_setup (
const char *font_str, const char *font_active_str,
const char *bg, const char *fg,
const char *hlbg, const char *hlfg
);
/**
* Cleanup the allocated colors and fonts by textbox_setup().
*/
void textbox_cleanup ();
#endif //__TEXTBOX_H__

View File

@ -1,9 +1,23 @@
#ifndef __XRMOPTIONS_H__
#define __XRMOPTIONS_H__
/**
* @param display Handler of the display to fetch the settings from.
*
* Parse the rofi related X resource options of the
* connected X server.
*/
void parse_xresource_options ( Display *display );
/**
* Free any allocated memory.
*/
void parse_xresource_free ( void );
/**
* Dump the settings in a Xresources compatible way to
* stdout.
*/
void xresource_dump ( void );
#endif

View File

@ -71,8 +71,7 @@ SwitcherMode dmenu_switcher_dialog ( char **input )
{
int selected_line = 0;
SwitcherMode retv = MODE_EXIT;
// act as a launcher
char **list = get_dmenu ( );
char **list = get_dmenu ( );
int mretv = menu ( list, input, dmenu_prompt, NULL, NULL,
token_match, NULL, &selected_line );

View File

@ -47,8 +47,6 @@
#include <X11/Xproto.h>
#include <X11/keysym.h>
#include <X11/XKBlib.h>
#include <X11/Xft/Xft.h>
#include <X11/Xresource.h>
#include <X11/extensions/Xinerama.h>
#include "rofi.h"
@ -1805,7 +1803,7 @@ static void handle_keypress ( XEvent *ev )
}
// convert a Mod+key arg to mod mask and keysym
void parse_key ( char *combo, unsigned int *mod, KeySym *key )
static void parse_key ( char *combo, unsigned int *mod, KeySym *key )
{
unsigned int modmask = 0;
@ -1870,7 +1868,7 @@ void parse_key ( char *combo, unsigned int *mod, KeySym *key )
}
// bind a key combination on a root window, compensating for Lock* states
void grab_key ( unsigned int modmask, KeySym key )
static void grab_key ( unsigned int modmask, KeySym key )
{
Screen *screen = DefaultScreenOfDisplay ( display );
Window root = RootWindow ( display, XScreenNumberOfScreen ( screen ) );
@ -1922,7 +1920,7 @@ static inline void display_get_i3_path ( Display *display )
/**
* Help function. This calls man.
*/
void help ()
static void help ()
{
int code = execlp ( "man", "man", MANPAGE_PATH, NULL );