summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorQC <qball@gmpclient.org>2014-03-22 21:04:19 +0100
committerQC <qball@gmpclient.org>2014-03-22 21:04:19 +0100
commitc87312be3607e0c459f2649736c1b7419eee42ae (patch)
tree0f8e73688884f4843a46ddc6b2a358d3fb4e6061 /include
parent4d37cf35dc0a64abf3ca0f672807dd94e01c02b0 (diff)
Indent o mania.
Diffstat (limited to 'include')
-rw-r--r--include/rofi.h112
-rw-r--r--include/textbox.h60
-rw-r--r--include/xrmoptions.h2
3 files changed, 90 insertions, 84 deletions
diff --git a/include/rofi.h b/include/rofi.h
index 6e6f1310..01e164a3 100644
--- a/include/rofi.h
+++ b/include/rofi.h
@@ -3,18 +3,19 @@
#include <config.h>
#include <X11/X.h>
-#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)))
+#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 ) ) )
extern const char *cache_dir;
#ifdef HAVE_I3_IPC_H
-extern char *i3_socket_path;
+extern char *i3_socket_path;
#endif
-typedef enum {
+typedef enum
+{
WINDOW_SWITCHER,
RUN_DIALOG,
SSH_DIALOG,
@@ -24,46 +25,48 @@ typedef enum {
NEXT_DIALOG
} SwitcherMode;
-typedef enum {
- MENU_OK = 0,
+typedef enum
+{
+ MENU_OK = 0,
MENU_CANCEL = -1,
MENU_NEXT = -2,
MENU_CUSTOM_INPUT = -3,
MENU_ENTRY_DELETE = -4
-
} MenuReturn;
typedef int ( *menu_match_cb )( char **tokens, const char *input, int index, void *data );
-MenuReturn menu( char **lines, char **input, char *prompt,
- Time *time, int *shift,
- menu_match_cb mmc, void *mmc_data,
- int *selected_line );
+MenuReturn menu ( char **lines, char **input, char *prompt,
+ Time *time, int *shift,
+ menu_match_cb mmc, void *mmc_data,
+ int *selected_line );
/**
* Allocator wrappers
*/
-void* allocate( unsigned long bytes ) __attribute__((malloc));
-void* allocate_clear( unsigned long bytes );
-void* reallocate( void *ptr, unsigned long bytes );
-
-
-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
+void* allocate ( unsigned long bytes ) __attribute__( ( malloc ) );
+void* allocate_clear ( unsigned long bytes );
+void* reallocate ( void *ptr, unsigned long bytes );
+
+
+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;
-typedef enum {
+typedef enum
+{
VERTICAL = 0,
HORIZONTAL = 1
} WindowMode;
@@ -71,38 +74,39 @@ typedef enum {
* Settings
*/
-typedef struct _Settings {
+typedef struct _Settings
+{
// Window settings
- unsigned int window_opacity;
+ unsigned int window_opacity;
// Menu settings
- unsigned int menu_bw;
- unsigned int menu_width;
- unsigned int menu_lines;
- char * menu_font;
- char * menu_fg;
- char * menu_bg;
- char * menu_hlfg;
- char * menu_hlbg;
- char * menu_bc;
+ unsigned int menu_bw;
+ unsigned int menu_width;
+ unsigned int menu_lines;
+ char * menu_font;
+ char * menu_fg;
+ char * menu_bg;
+ char * menu_hlfg;
+ char * menu_hlbg;
+ char * menu_bc;
// Behavior
- unsigned int zeltak_mode;
- char * terminal_emulator;
+ unsigned int zeltak_mode;
+ char * terminal_emulator;
#ifdef HAVE_I3_IPC_H
- unsigned int i3_mode;
+ unsigned int i3_mode;
#endif
// Key bindings
- char * window_key;
- char * run_key;
- char * ssh_key;
- WindowLocation location;
- WindowMode wmode;
- unsigned int padding;
+ char * window_key;
+ char * run_key;
+ char * ssh_key;
+ WindowLocation location;
+ WindowMode wmode;
+ unsigned int padding;
} Settings;
extern Settings config;
int token_match ( char **tokens, const char *input,
- __attribute__( ( unused ) )int index,
- __attribute__( ( unused ) )void *data );
+ __attribute__( ( unused ) ) int index,
+ __attribute__( ( unused ) ) void *data );
#endif
diff --git a/include/textbox.h b/include/textbox.h
index 4e4061b1..7fbc3a0e 100644
--- a/include/textbox.h
+++ b/include/textbox.h
@@ -1,47 +1,49 @@
#ifndef __TEXTBOX_H__
#define __TEXTBOX_H__
-typedef struct {
+typedef struct
+{
unsigned long flags;
- Window window, parent;
- short x, y, w, h;
- short cursor;
- XftFont *font;
- XftColor color_fg, color_bg;
- char *text, *prompt;
- XIM xim;
- XIC xic;
- XGlyphInfo extents;
+ Window window, parent;
+ short x, y, w, h;
+ short cursor;
+ XftFont *font;
+ XftColor color_fg, color_bg;
+ char *text, *prompt;
+ XIM xim;
+ XIC xic;
+ XGlyphInfo extents;
} textbox;
-typedef enum {
- TB_AUTOHEIGHT = 1<<0,
- TB_AUTOWIDTH = 1<<1,
- TB_LEFT = 1<<16,
- TB_RIGHT = 1<<17,
- TB_CENTER = 1<<18,
- TB_EDITABLE = 1<<19,
+typedef enum
+{
+ TB_AUTOHEIGHT = 1 << 0,
+ TB_AUTOWIDTH = 1 << 1,
+ TB_LEFT = 1 << 16,
+ TB_RIGHT = 1 << 17,
+ TB_CENTER = 1 << 18,
+ TB_EDITABLE = 1 << 19,
} TextboxFlags;
-textbox* textbox_create( Window parent,
- TextboxFlags flags,
- short x, short y, short w, short h,
- char *font, char *fg, char *bg,
- char *text, char *prompt );
+textbox* textbox_create ( Window parent,
+ TextboxFlags flags,
+ short x, short y, short w, short h,
+ char *font, char *fg, char *bg,
+ char *text, char *prompt );
-void textbox_free( textbox *tb );
+void textbox_free ( textbox *tb );
-void textbox_font( textbox *tb, char *font, char *fg, char *bg );
+void textbox_font ( textbox *tb, char *font, char *fg, char *bg );
-void textbox_text( textbox *tb, char *text );
-void textbox_show( textbox *tb );
-void textbox_draw( textbox *tb );
+void textbox_text ( textbox *tb, char *text );
+void textbox_show ( textbox *tb );
+void textbox_draw ( textbox *tb );
-int textbox_keypress( textbox *tb, XEvent *ev );
+int textbox_keypress ( textbox *tb, XEvent *ev );
-void textbox_cursor_end( textbox *tb );
+void textbox_cursor_end ( textbox *tb );
#endif //__TEXTBOX_H__
diff --git a/include/xrmoptions.h b/include/xrmoptions.h
index e46ba11a..7fa8a522 100644
--- a/include/xrmoptions.h
+++ b/include/xrmoptions.h
@@ -1,5 +1,5 @@
#ifndef __XRMOPTIONS_H__
#define __XRMOPTIONS_H__
-void parse_xresource_options( Display *display );
+void parse_xresource_options ( Display *display );
#endif