x.c define functions as static where possible
This commit is contained in:
parent
a7b541e503
commit
75ef76946b
29
x.c
29
x.c
@ -49,6 +49,11 @@ static color_t frame_color;
|
|||||||
static void x_shortcut_setup_error_handler(void);
|
static void x_shortcut_setup_error_handler(void);
|
||||||
static int x_shortcut_tear_down_error_handler(void);
|
static int x_shortcut_tear_down_error_handler(void);
|
||||||
static void x_win_move(int width, int height);
|
static void x_win_move(int width, int height);
|
||||||
|
static void setopacity(Window win, unsigned long opacity);
|
||||||
|
static void x_handle_click(XEvent ev);
|
||||||
|
static void x_screen_info(screen_info * scr);
|
||||||
|
static void x_win_setup(void);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static color_t x_color_hex_to_double(int hexValue)
|
static color_t x_color_hex_to_double(int hexValue)
|
||||||
@ -83,7 +88,7 @@ static double _apply_delta(double base, double delta)
|
|||||||
return base;
|
return base;
|
||||||
}
|
}
|
||||||
|
|
||||||
color_t calculate_foreground_color(color_t bg)
|
static color_t calculate_foreground_color(color_t bg)
|
||||||
{
|
{
|
||||||
double c_delta = 0.1;
|
double c_delta = 0.1;
|
||||||
color_t color = bg;
|
color_t color = bg;
|
||||||
@ -119,7 +124,7 @@ static color_t x_get_separator_color(color_t fg, color_t bg)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void x_cairo_setup(void)
|
static void x_cairo_setup(void)
|
||||||
{
|
{
|
||||||
cairo_ctx.surface = cairo_xlib_surface_create(xctx.dpy,
|
cairo_ctx.surface = cairo_xlib_surface_create(xctx.dpy,
|
||||||
xctx.win, DefaultVisual(xctx.dpy, 0), WIDTH, HEIGHT);
|
xctx.win, DefaultVisual(xctx.dpy, 0), WIDTH, HEIGHT);
|
||||||
@ -131,7 +136,7 @@ void x_cairo_setup(void)
|
|||||||
frame_color = x_string_to_color_t(settings.frame_color);
|
frame_color = x_string_to_color_t(settings.frame_color);
|
||||||
}
|
}
|
||||||
|
|
||||||
void r_setup_pango_layout(PangoLayout *layout, int width)
|
static void r_setup_pango_layout(PangoLayout *layout, int width)
|
||||||
{
|
{
|
||||||
pango_layout_set_wrap(layout, PANGO_WRAP_WORD_CHAR);
|
pango_layout_set_wrap(layout, PANGO_WRAP_WORD_CHAR);
|
||||||
pango_layout_set_width(layout, width * PANGO_SCALE);
|
pango_layout_set_width(layout, width * PANGO_SCALE);
|
||||||
@ -249,7 +254,7 @@ static colored_layout *r_create_layout_for_xmore(cairo_t *c, notification *n, in
|
|||||||
return cl;
|
return cl;
|
||||||
}
|
}
|
||||||
|
|
||||||
colored_layout *r_create_layout_from_notification(cairo_t *c, notification *n)
|
static colored_layout *r_create_layout_from_notification(cairo_t *c, notification *n)
|
||||||
{
|
{
|
||||||
|
|
||||||
colored_layout *cl = r_init_shared(c, n);
|
colored_layout *cl = r_init_shared(c, n);
|
||||||
@ -278,7 +283,7 @@ colored_layout *r_create_layout_from_notification(cairo_t *c, notification *n)
|
|||||||
return cl;
|
return cl;
|
||||||
}
|
}
|
||||||
|
|
||||||
GSList *r_create_layouts(cairo_t *c)
|
static GSList *r_create_layouts(cairo_t *c)
|
||||||
{
|
{
|
||||||
GSList *layouts = NULL;
|
GSList *layouts = NULL;
|
||||||
|
|
||||||
@ -312,7 +317,7 @@ GSList *r_create_layouts(cairo_t *c)
|
|||||||
return layouts;
|
return layouts;
|
||||||
}
|
}
|
||||||
|
|
||||||
void r_free_layouts(GSList *layouts)
|
static void r_free_layouts(GSList *layouts)
|
||||||
{
|
{
|
||||||
g_slist_free_full(layouts, free_colored_layout);
|
g_slist_free_full(layouts, free_colored_layout);
|
||||||
}
|
}
|
||||||
@ -437,7 +442,7 @@ static void x_win_move(int width, int height)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void setopacity(Window win, unsigned long opacity)
|
static void setopacity(Window win, unsigned long opacity)
|
||||||
{
|
{
|
||||||
Atom _NET_WM_WINDOW_OPACITY =
|
Atom _NET_WM_WINDOW_OPACITY =
|
||||||
XInternAtom(xctx.dpy, "_NET_WM_WINDOW_OPACITY", false);
|
XInternAtom(xctx.dpy, "_NET_WM_WINDOW_OPACITY", false);
|
||||||
@ -554,7 +559,7 @@ bool x_is_idle(void)
|
|||||||
/*
|
/*
|
||||||
* Handle incoming mouse click events
|
* Handle incoming mouse click events
|
||||||
*/
|
*/
|
||||||
void x_handle_click(XEvent ev)
|
static void x_handle_click(XEvent ev)
|
||||||
{
|
{
|
||||||
if (ev.xbutton.button == Button3) {
|
if (ev.xbutton.button == Button3) {
|
||||||
move_all_to_history();
|
move_all_to_history();
|
||||||
@ -585,7 +590,7 @@ void x_handle_click(XEvent ev)
|
|||||||
* Return the window that currently has
|
* Return the window that currently has
|
||||||
* the keyboard focus.
|
* the keyboard focus.
|
||||||
*/
|
*/
|
||||||
Window get_focused_window(void)
|
static Window get_focused_window(void)
|
||||||
{
|
{
|
||||||
Window focused = 0;
|
Window focused = 0;
|
||||||
Atom type;
|
Atom type;
|
||||||
@ -612,7 +617,7 @@ Window get_focused_window(void)
|
|||||||
* Select the screen on which the Window
|
* Select the screen on which the Window
|
||||||
* should be displayed.
|
* should be displayed.
|
||||||
*/
|
*/
|
||||||
int select_screen(XineramaScreenInfo * info, int info_len)
|
static int select_screen(XineramaScreenInfo * info, int info_len)
|
||||||
{
|
{
|
||||||
if (settings.f_mode == FOLLOW_NONE) {
|
if (settings.f_mode == FOLLOW_NONE) {
|
||||||
return settings.monitor >=
|
return settings.monitor >=
|
||||||
@ -669,7 +674,7 @@ int select_screen(XineramaScreenInfo * info, int info_len)
|
|||||||
* Update the information about the monitor
|
* Update the information about the monitor
|
||||||
* geometry.
|
* geometry.
|
||||||
*/
|
*/
|
||||||
void x_screen_info(screen_info * scr)
|
static void x_screen_info(screen_info * scr)
|
||||||
{
|
{
|
||||||
#ifdef XINERAMA
|
#ifdef XINERAMA
|
||||||
int n;
|
int n;
|
||||||
@ -759,7 +764,7 @@ void x_setup(void)
|
|||||||
/*
|
/*
|
||||||
* Setup the window
|
* Setup the window
|
||||||
*/
|
*/
|
||||||
void x_win_setup(void)
|
static void x_win_setup(void)
|
||||||
{
|
{
|
||||||
|
|
||||||
Window root;
|
Window root;
|
||||||
|
5
x.h
5
x.h
@ -63,13 +63,10 @@ typedef struct _color_t {
|
|||||||
|
|
||||||
extern xctx_t xctx;
|
extern xctx_t xctx;
|
||||||
|
|
||||||
void setopacity(Window win, unsigned long opacity);
|
|
||||||
|
|
||||||
/* window */
|
/* window */
|
||||||
void x_win_draw(void);
|
void x_win_draw(void);
|
||||||
void x_win_hide(void);
|
void x_win_hide(void);
|
||||||
void x_win_show(void);
|
void x_win_show(void);
|
||||||
void x_win_setup(void);
|
|
||||||
|
|
||||||
/* shortcut */
|
/* shortcut */
|
||||||
void x_shortcut_init(keyboard_shortcut * shortcut);
|
void x_shortcut_init(keyboard_shortcut * shortcut);
|
||||||
@ -78,8 +75,6 @@ int x_shortcut_grab(keyboard_shortcut * ks);
|
|||||||
KeySym x_shortcut_string_to_mask(const char *str);
|
KeySym x_shortcut_string_to_mask(const char *str);
|
||||||
|
|
||||||
/* X misc */
|
/* X misc */
|
||||||
void x_handle_click(XEvent ev);
|
|
||||||
void x_screen_info(screen_info * scr);
|
|
||||||
bool x_is_idle(void);
|
bool x_is_idle(void);
|
||||||
void x_setup(void);
|
void x_setup(void);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user