From 92ff0dd54b1fb65ad0502d430768827c8b67c381 Mon Sep 17 00:00:00 2001 From: Carsten Haitzler Date: Mon, 6 Dec 1999 17:12:20 +0000 Subject: [PATCH] Mon Dec 6 14:52:40 PST 1999 (Raster) gettext internationalisation support & patch fix to allow setting of which mouse button do what on the pager fix to border width handlign in icccm fix to warp foucs some other stuff i probabyl forgot about... SVN revision: 1507 --- src/ChangeLog | 11 + src/E.h | 1999 +++++++++++++++++--------------- src/Makefile.am | 3 +- src/actions.c | 397 ++++--- src/alert.c | 23 +- src/areas.c | 65 +- src/arrange.c | 73 +- src/arrange.h | 10 +- src/atoms.c | 6 +- src/borders.c | 336 +++--- src/buttons.c | 17 +- src/clone.c | 4 +- src/comms.c | 164 +-- src/conf.h | 1 + src/config.c | 629 +++++----- src/containers.c | 6 +- src/coords.c | 8 +- src/desktops.c | 163 ++- src/dialog.c | 114 +- src/draw.c | 206 ++-- src/events.c | 12 +- src/evhandlers.c | 338 ++++-- src/file.c | 12 +- src/finders.c | 12 +- src/focus.c | 70 +- src/fx.c | 269 ++--- src/gnome.c | 15 +- src/grabs.c | 6 +- src/groups.c | 116 +- src/handlers.c | 126 +- src/icccm.c | 48 +- src/iclass.c | 11 +- src/iconify.c | 495 +++++--- src/init.c | 15 +- src/ipc.c | 1145 +++++++++--------- src/kde.c | 65 +- src/main.c | 25 +- src/memory.c | 160 ++- src/menus.c | 186 +-- src/misc.c | 132 ++- src/modules.c | 18 +- src/mwm.c | 22 +- src/network.c | 13 +- src/pager.c | 223 ++-- src/progress.c | 3 +- src/scursor.c | 27 +- src/session.c | 156 ++- src/settings.c | 797 ++++++++----- src/setup.c | 156 ++- src/size.c | 12 +- src/slideout.c | 12 +- src/snaps.c | 100 +- src/snprintf.c | 15 +- src/sound.c | 27 +- src/startup.c | 42 +- src/sticky.c | 3 +- src/tclass.c | 3 +- src/text.c | 139 ++- src/theme.c | 51 +- src/themes/configs/definitions | 1 + src/tooltips.c | 388 +++++-- src/ttfont.c | 69 +- src/update.c | 3 +- src/warp.c | 21 +- src/windowmatch.c | 2 +- src/x.c | 25 +- src/zoom.c | 9 +- 67 files changed, 5344 insertions(+), 4486 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 3aae6e45..f4329104 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -3995,3 +3995,14 @@ Mon Nov 22 12:42:56 PST 1999 (Mandrake) added "current" option to win_op ipc command for walt :) + +------------------------------------------------------------------------------- + +Mon Dec 6 14:52:40 PST 1999 +(Raster) + +gettext internationalisation support & patch +fix to allow setting of which mouse button do what on the pager +fix to border width handlign in icccm +fix to warp foucs +some other stuff i probabyl forgot about... diff --git a/src/E.h b/src/E.h index 0aa3266e..ab961134 100644 --- a/src/E.h +++ b/src/E.h @@ -217,10 +217,12 @@ extern char *call_stack[1024]; } #endif -int Evsnprintf(char *str, size_t count, const char *fmt, va_list args); +int Evsnprintf(char *str, size_t count, const char *fmt, + + va_list args); #ifdef HAVE_STDARGS -int Esnprintf(char *str, size_t count, const char *fmt,...); +int Esnprintf(char *str, size_t count, const char *fmt, ...); #else int Esnprintf(va_alist); @@ -240,6 +242,16 @@ int Esnprintf(va_alist); #include "arrange.h" +/* This is a start to providing internationalization by means */ +/* of gettext */ + +/* #ifdef HAVE_GETTEXT */ + +#include +#include + +/* #define _(String) gettext (String) */ + #define TT_VALID( handle ) ( ( handle ).z != NULL ) #ifndef MAX #define MAX(a,b) ((a)>(b)?(a):(b)) @@ -509,860 +521,863 @@ typedef struct _iconbox Iconbox; typedef struct _group Group; typedef struct _icondef - { - char *title_match; - char *name_match; - char *class_match; - char *icon_file; - } +{ + char *title_match; + char *name_match; + char *class_match; + char *icon_file; +} Icondef; typedef struct _exid - { - Window parent; - Window win; - int x, y, w, h; - char mapped; - int num_rect; - int ord; - XRectangle *rects; - int depth; - Pixmap bgpmap; - int bgcol; - } +{ + Window parent; + Window win; + int x, y, w, h; + char mapped; + int num_rect; + int ord; + XRectangle *rects; + int depth; + Pixmap bgpmap; + int bgcol; +} EXID; typedef struct _actiontype - { - void *params; - struct _actiontype *Next; - int Type; - } +{ + void *params; + struct _actiontype *Next; + int Type; +} ActionType; typedef struct _list - { - char *name; - int id; - void *item; +{ + char *name; + int id; + void *item; - struct _list *next; - } + struct _list *next; +} List; typedef struct _client - { - char *name; - Window win; - char *msg; - char *clientname; - char *version; - char *author; - char *email; - char *web; - char *address; - char *info; - Pixmap pmap; - } +{ + char *name; + Window win; + char *msg; + char *clientname; + char *version; + char *author; + char *email; + char *web; + char *address; + char *info; + Pixmap pmap; +} Client; typedef struct _root - { - Window win; - Visual *vis; - int depth; - Colormap cmap; - int scr; - int w, h; - Window focuswin; - } +{ + Window win; + Visual *vis; + int depth; + Colormap cmap; + int scr; + int w, h; + Window focuswin; +} Root; typedef struct _modcurve - { - int num; - unsigned char *px; - unsigned char *py; - unsigned char map[256]; - } +{ + int num; + unsigned char *px; + unsigned char *py; + unsigned char map[256]; +} ModCurve; typedef struct _colormodifierclass - { - char *name; - ModCurve red, green, blue; - unsigned int ref_count; - } +{ + char *name; + ModCurve red, green, blue; + unsigned int ref_count; +} ColorModifierClass; typedef struct _imagestate - { - char *im_file; - char *real_file; - char unloadable; - ImlibImage *im; - ImlibColor *transp; - ImlibBorder *border; - int pixmapfillstyle; - ImlibColor bg, hi, lo, hihi, lolo; - int bevelstyle; - ColorModifierClass *colmod; - } +{ + char *im_file; + char *real_file; + char unloadable; + ImlibImage *im; + ImlibColor *transp; + ImlibBorder *border; + int pixmapfillstyle; + ImlibColor bg, hi, lo, hihi, lolo; + int bevelstyle; + ColorModifierClass *colmod; +} ImageState; typedef struct _ImageStateArray - { - ImageState *normal; - ImageState *hilited; - ImageState *clicked; - ImageState *disabled; - } +{ + ImageState *normal; + ImageState *hilited; + ImageState *clicked; + ImageState *disabled; +} ImageStateArray; typedef struct _imageclass - { - char *name; - char external; - ImageStateArray norm, active, sticky, sticky_active; - ImlibBorder padding; - ColorModifierClass *colmod; - unsigned int ref_count; - } +{ + char *name; + char external; + ImageStateArray norm, active, sticky, sticky_active; + ImlibBorder padding; + ColorModifierClass *colmod; + unsigned int ref_count; +} ImageClass; typedef struct _efont - { - TT_Engine engine; - TT_Face face; - TT_Instance instance; - TT_Face_Properties properties; - int num_glyph; - TT_Glyph *glyphs; - TT_Raster_Map **glyphs_cached; - int max_descent; - int max_ascent; - } +{ + TT_Engine engine; + TT_Face face; + TT_Instance instance; + TT_Face_Properties properties; + int num_glyph; + TT_Glyph *glyphs; + TT_Raster_Map **glyphs_cached; + int max_descent; + int max_ascent; +} Efont; typedef struct _textstate - { - char *fontname; - FnlibStyle style; - FnlibFont *font; - ImlibColor fg_col; - ImlibColor bg_col; - int effect; - Efont *efont; - XFontStruct *xfont; - XFontSet xfontset; - int xfontset_ascent; - } +{ + char *fontname; + FnlibStyle style; + FnlibFont *font; + ImlibColor fg_col; + ImlibColor bg_col; + int effect; + Efont *efont; + XFontStruct *xfont; + XFontSet xfontset; + int xfontset_ascent; +} TextState; typedef struct _textclass - { - char *name; - struct - { - TextState *normal; - TextState *hilited; - TextState *clicked; - TextState *disabled; - } - norm , active, sticky, sticky_active; - int justification; - unsigned int ref_count; - } +{ + char *name; + struct + { + TextState *normal; + TextState *hilited; + TextState *clicked; + TextState *disabled; + } + norm , active, sticky, sticky_active; + int justification; + unsigned int ref_count; +} TextClass; typedef struct _action - { - char event; - char anymodifier; - int modifiers; - char anybutton; - int button; - char anykey; - KeyCode key; - char *key_str; - char *tooltipstring; - ActionType *action; - } +{ + char event; + char anymodifier; + int modifiers; + char anybutton; + int button; + char anykey; + KeyCode key; + char *key_str; + char *tooltipstring; + ActionType *action; +} Action; typedef struct _actionclass - { - char *name; - int num; - Action **list; - char *tooltipstring; - unsigned int ref_count; - } +{ + char *name; + int num; + Action **list; + char *tooltipstring; + unsigned int ref_count; +} ActionClass; typedef struct _constraints - { - int min, max; - } +{ + int min, max; +} Constraints; typedef struct _winpoint - { - int originbox; - struct - { - int percent; - int absolute; - } - x , y; - } +{ + int originbox; + struct + { + int percent; + int absolute; + } + x , y; +} WinPoint; typedef struct _geometry - { - Constraints width, height; - WinPoint topleft, bottomright; - } +{ + Constraints width, height; + WinPoint topleft, bottomright; +} Geometry; typedef struct _ecursor - { - char *name; - ImlibColor fg, bg; - char *file; - Cursor cursor; - unsigned int ref_count; - char inroot; - } +{ + char *name; + ImlibColor fg, bg; + char *file; + Cursor cursor; + unsigned int ref_count; + char inroot; +} ECursor; typedef struct _winpart - { - Geometry geom; - ImageClass *iclass; - ActionClass *aclass; - TextClass *tclass; - ECursor *ec; - char ontop; - int flags; - char keep_for_shade; - } +{ + Geometry geom; + ImageClass *iclass; + ActionClass *aclass; + TextClass *tclass; + ECursor *ec; + char ontop; + int flags; + char keep_for_shade; +} WinPart; typedef struct _border - { - char *name; - char *group_border_name; - ImlibBorder border; - int num_winparts; - WinPart *part; - char changes_shape; - char shadedir; - unsigned int ref_count; - } +{ + char *name; + char *group_border_name; + ImlibBorder border; + int num_winparts; + WinPart *part; + char changes_shape; + char shadedir; + unsigned int ref_count; +} Border; typedef struct _ewinbit - { - Window win; - int x, y, w, h; - int cx, cy, cw, ch; - int state; - char expose; - char no_expose; - char left; - } +{ + Window win; + int x, y, w, h; + int cx, cy, cw, ch; + int state; + char expose; + char no_expose; + char left; +} EWinBit; typedef struct _winclient - { - Window win; - char *title; - int x, y, w, h; - Colormap cmap; - Window icon_win; - Pixmap icon_pmap; - Pixmap icon_mask; - char start_iconified; - Window group; - Window client_leader; - char need_input; - char transient; - Window transient_for; - char *class; - char *name; - char *role; - char *command; - char *machine; - char *icon_name; - char is_group_leader; - char no_resize_h; - char no_resize_v; - char shaped; - Constraints width, height; - int base_w, base_h; - int w_inc, h_inc; - int grav; - double aspect_min, aspect_max; - char already_placed; - char mwm_decor_border; - char mwm_decor_resizeh; - char mwm_decor_title; - char mwm_decor_menu; - char mwm_decor_minimize; - char mwm_decor_maximize; - char mwm_func_resize; - char mwm_func_move; - char mwm_func_minimize; - char mwm_func_maximize; - char mwm_func_close; - unsigned int app_state; - } +{ + Window win; + char *title; + int x, y, w, h, bw; + Colormap cmap; + Window icon_win; + Pixmap icon_pmap; + Pixmap icon_mask; + char start_iconified; + Window group; + Window client_leader; + char need_input; + char transient; + Window transient_for; + char *class; + char *name; + char *role; + char *command; + char *machine; + char *icon_name; + char is_group_leader; + char no_resize_h; + char no_resize_v; + char shaped; + Constraints width, height; + int base_w, base_h; + int w_inc, h_inc; + int grav; + double aspect_min, aspect_max; + char already_placed; + char mwm_decor_border; + char mwm_decor_resizeh; + char mwm_decor_title; + char mwm_decor_menu; + char mwm_decor_minimize; + char mwm_decor_maximize; + char mwm_func_resize; + char mwm_func_move; + char mwm_func_minimize; + char mwm_func_maximize; + char mwm_func_close; + unsigned int app_state; +} WinClient; typedef struct _ewin - { - Window win; - int x, y, w, h, reqx, reqy; - int lx, ly, lw, lh; - char toggle; - Window win_container; - WinClient client; - Border *border; - Border *previous_border; - char border_new; - EWinBit *bits; - int flags; - int desktop; - Group **groups; - int num_groups; - int docked; - char sticky; - char visible; - char iconified; - char shaded; - char active; - int layer; - char never_use_area; - Window parent; - char floating; - char shapedone; - char fixedpos; - int expanded_x; - int expanded_y; - int expanded_width; - int expanded_height; - char ignorearrange; - char skiptask; - char skipfocus; - char skipwinlist; - char focusclick; - char internal; - Menu *menu; - Window shownmenu; - Dialog *dialog; - Pager *pager; - Iconbox *ibox; - int area_x; - int area_y; - char *session_id; - int has_transients; - int mini_w, mini_h; - Pixmap mini_pmap, mini_mask; - Snapshot *snap; - int icon_pmap_w, icon_pmap_h; - Pixmap icon_pmap, icon_mask; - char kde_hint; - } +{ + Window win; + int x, y, w, h, reqx, reqy; + int lx, ly, lw, lh; + char toggle; + Window win_container; + WinClient client; + Border *border; + Border *previous_border; + char border_new; + EWinBit *bits; + int flags; + int desktop; + Group **groups; + int num_groups; + int docked; + char sticky; + char visible; + char iconified; + char shaded; + char active; + int layer; + char never_use_area; + Window parent; + char floating; + char shapedone; + char fixedpos; + int expanded_x; + int expanded_y; + int expanded_width; + int expanded_height; + char ignorearrange; + char skiptask; + char skipfocus; + char skipwinlist; + char focusclick; + char internal; + Menu *menu; + Window shownmenu; + Dialog *dialog; + Pager *pager; + Iconbox *ibox; + int area_x; + int area_y; + char *session_id; + int has_transients; + int mini_w, mini_h; + Pixmap mini_pmap, mini_mask; + Snapshot *snap; + int icon_pmap_w, icon_pmap_h; + Pixmap icon_pmap, icon_mask; + char kde_hint; +} EWin; typedef struct _groupconfig - { - char iconify; - char kill; - char move; - char raise; - char set_border; - char stick; - char shade; - char mirror; - } +{ + char iconify; + char kill; + char move; + char raise; + char set_border; + char stick; + char shade; + char mirror; +} GroupConfig; struct _group - { - int index; - EWin **members; - int num_members; - GroupConfig cfg; - }; +{ + int index; + EWin **members; + int num_members; + GroupConfig cfg; +}; typedef struct _awaiticlass - { - Window client_win; - int ewin_bit; - ImageClass *iclass; - } +{ + Window client_win; + int ewin_bit; + ImageClass *iclass; +} AwaitIclass; typedef struct _bgeometry - { - Constraints width, height; - int xorigin, yorigin; - int xabs, xrel; - int yabs, yrel; - int xsizerel, xsizeabs; - int ysizerel, ysizeabs; - char size_from_image; - } +{ + Constraints width, height; + int xorigin, yorigin; + int xabs, xrel; + int yabs, yrel; + int xsizerel, xsizeabs; + int ysizerel, ysizeabs; + char size_from_image; +} BGeometry; typedef struct _strip Strip; typedef struct _stripjoint Stripjoint; typedef struct _button - { - char *name; - BGeometry geom; - ImageClass *iclass; - ActionClass *aclass; - TextClass *tclass; - char *label; - char ontop; - int flags; - char sticky; - int desktop; - char visible; - char internal; - char default_show; - char used; +{ + char *name; + BGeometry geom; + ImageClass *iclass; + ActionClass *aclass; + TextClass *tclass; + char *label; + char ontop; + int flags; + char sticky; + int desktop; + char visible; + char internal; + char default_show; + char used; - Window win; - int x, y, w, h; - int cx, cy, cw, ch; - int state; - char expose; - Window inside_win; - Window event_win; - char destroy_inside_win; - char left; - unsigned int ref_count; - } + Window win; + int x, y, w, h; + int cx, cy, cw, ch; + int state; + char expose; + Window inside_win; + Window event_win; + char destroy_inside_win; + char left; + unsigned int ref_count; +} Button; typedef struct _buttoncontainer - { - char *name; - ImageClass *iclass; +{ + char *name; + ImageClass *iclass; - Window win; - int w, h; - int state; - char expose; - char orientation; - Button **ButtonList; - int numofbuttonsinlist; - } + Window win; + int w, h; + int state; + char expose; + char orientation; + Button **ButtonList; + int numofbuttonsinlist; +} Container; struct _strip - { - char *name; - int xabs, yabs; - int xrel, yrel; - char ontop; - char sticky; - int desktop; - char orientation; - char out; - int justification; - int spacing; +{ + char *name; + int xabs, yabs; + int xrel, yrel; + char ontop; + char sticky; + int desktop; + char orientation; + char out; + int justification; + int spacing; - char *anchor_name; - char *bg_name; - Button *anchor; - Button *bg; + char *anchor_name; + char *bg_name; + Button *anchor; + Button *bg; - int num_buttons; - Button *button; + int num_buttons; + Button *button; - Window win; - int x, y, w, h; - int cx, cy, cw, ch; - }; + Window win; + int x, y, w, h; + int cx, cy, cw, ch; +}; typedef struct _background - { - char *name; - Pixmap pmap; - time_t last_viewed; - struct _bg - { - ImlibColor solid; - char *file; - char *real_file; - ImlibImage *im; - char tile; - char keep_aspect; - int xjust, yjust; - int xperc, yperc; - } - bg; - struct _top - { - char *file; - char *real_file; - ImlibImage *im; - char keep_aspect; - int xjust, yjust; - int xperc, yperc; - } - top; - ColorModifierClass *cmclass; - char keepim; - unsigned int ref_count; - } +{ + char *name; + Pixmap pmap; + time_t last_viewed; + struct _bg + { + ImlibColor solid; + char *file; + char *real_file; + ImlibImage *im; + char tile; + char keep_aspect; + int xjust, yjust; + int xperc, yperc; + } + bg; + struct _top + { + char *file; + char *real_file; + ImlibImage *im; + char keep_aspect; + int xjust, yjust; + int xperc, yperc; + } + top; + ColorModifierClass *cmclass; + char keepim; + unsigned int ref_count; +} Background; typedef struct _desk - { - char viewable; - Window win; - int x, y; - Background *bg; - int num; - EWin **list; - Button *tag; - int current_area_x; - int current_area_y; - } +{ + char viewable; + Window win; + int x, y; + Background *bg; + int num; + EWin **list; + Button *tag; + int current_area_x; + int current_area_y; +} Desk; typedef struct _desktops - { - int current; - Desk desk[ENLIGHTENMENT_CONF_NUM_DESKTOPS]; - int dragdir; - int dragbar_width; - int dragbar_ordering; - int dragbar_length; - char slidein; - int slidespeed; - char hiqualitybg; - } +{ + int current; + Desk desk[ENLIGHTENMENT_CONF_NUM_DESKTOPS]; + int dragdir; + int dragbar_width; + int dragbar_ordering; + int dragbar_length; + char slidein; + int slidespeed; + char hiqualitybg; +} Desktops; typedef struct _sample - { - char *file; - int rate; - int format; - int samples; - unsigned char *data; - int id; - } +{ + char *file; + int rate; + int format; + int samples; + unsigned char *data; + int id; +} Sample; typedef struct _soundclass - { - char *name; - char *file; - Sample *sample; - unsigned int ref_count; - } +{ + char *name; + char *file; + Sample *sample; + unsigned int ref_count; +} SoundClass; typedef struct _windowmatch - { - char *name; - char *win_title; - char *win_name; - char *win_class; - Constraints width; - Constraints height; - signed char transient; - signed char no_resize_h; - signed char no_resize_v; - signed char shaped; - Border *border; - ImageClass *icon; - int desk; - char make_sticky; - } +{ + char *name; + char *win_title; + char *win_name; + char *win_class; + Constraints width; + Constraints height; + signed char transient; + signed char no_resize_h; + signed char no_resize_v; + signed char shaped; + Border *border; + ImageClass *icon; + int desk; + char make_sticky; +} WindowMatch; typedef struct - { - char *name; - char direction; - int num_buttons; - Button **button; - int w, h; - Window win; - Window from_win; - unsigned int ref_count; - } +{ + char *name; + char direction; + int num_buttons; + Button **button; + int w, h; + Window win; + Window from_win; + unsigned int ref_count; +} Slideout; typedef struct _emode - { - int mode; - int deskmode; - char place; - char flipp; - char startup; - char xselect; - int next_move_x_plus; - int next_move_y_plus; - EWin *ewin; - Button *button; - int resize_detail; - int win_x, win_y, win_w, win_h; - int start_x, start_y; - char noewin; - char have_place_grab; - int focusmode; - char dockdirmode; - char primaryicondir; - char click_focus_grabbed; - EWin *focuswin; - EWin *realfocuswin; - EWin *mouse_over_win; - EWin *context_ewin; - int px, py, x, y; - char firstlast; - int movemode; - int resizemode; - int slidemode; - char cleanupslide; - char mapslide; - int slidespeedmap; - int slidespeedcleanup; - char animate_shading; - int shadespeed; - char doingslide; - int server_grabbed; - int desktop_bg_timeout; - int deskdrag; - char sound; - int button_move_resistance; - char button_move_pending; - Colormap current_cmap; - char autosave; - char memory_paranoia; - char destroy; - char adestroy; - Slideout *slideout; - Window context_win; - char tooltips; - double tiptime; - char autoraise; - double autoraisetime; - int dockstartx; - int dockstarty; - char save_under; - char cur_menu_mode; - int cur_menu_depth; - Menu *cur_menu[256]; - char menuslide; - char menusonscreen; - char numdesktops; - char transientsfollowleader; - char switchfortransientmap; - char showicons; - char snap; - int edge_snap_dist; - int screen_snap_dist; - Window menu_cover_win; - char all_new_windows_get_focus; - char new_transients_get_focus; - char new_transients_get_focus_if_group_focused; - char manual_placement; - char raise_on_next_focus; - char raise_after_next_focus; - char display_warp; - char warp_on_next_focus; - char warp_after_next_focus; - int edge_flip_resistance; - EWin *moveresize_pending_ewin; - char borderpartpress; - char windowdestroy; - int context_w; - int context_h; - char autoupgrade; - char activenetwork; - int motddate; - char motd; - char alreadytestingnetwork; - char show_pagers; - Pager *context_pager; - char pager_hiq; - char pager_snap; - char user_bg; - char pager_zoom; - char pager_title; - char constrained; - int pager_scanspeed; - TextClass *icon_textclass; - int icon_mode; - char nogroup; - GroupConfig group_config; - Window kde_dock; - int kde_support; - int kde_x1; - int kde_x2; - int kde_y1; - int kde_y2; - char clickalways; - char keybinds_changed; - char firsttime; - char showroottooltip; - } +{ + int mode; + int deskmode; + char place; + char flipp; + char startup; + char xselect; + int next_move_x_plus; + int next_move_y_plus; + EWin *ewin; + Button *button; + int resize_detail; + int win_x, win_y, win_w, win_h; + int start_x, start_y; + char noewin; + char have_place_grab; + int focusmode; + char dockdirmode; + char primaryicondir; + char click_focus_grabbed; + EWin *focuswin; + EWin *realfocuswin; + EWin *mouse_over_win; + EWin *context_ewin; + int px, py, x, y; + char firstlast; + int movemode; + int resizemode; + int slidemode; + char cleanupslide; + char mapslide; + int slidespeedmap; + int slidespeedcleanup; + char animate_shading; + int shadespeed; + char doingslide; + int server_grabbed; + int desktop_bg_timeout; + int deskdrag; + char sound; + int button_move_resistance; + char button_move_pending; + Colormap current_cmap; + char autosave; + char memory_paranoia; + char destroy; + char adestroy; + Slideout *slideout; + Window context_win; + char tooltips; + double tiptime; + char autoraise; + double autoraisetime; + int dockstartx; + int dockstarty; + char save_under; + char cur_menu_mode; + int cur_menu_depth; + Menu *cur_menu[256]; + char menuslide; + char menusonscreen; + char numdesktops; + char transientsfollowleader; + char switchfortransientmap; + char showicons; + char snap; + int edge_snap_dist; + int screen_snap_dist; + Window menu_cover_win; + char all_new_windows_get_focus; + char new_transients_get_focus; + char new_transients_get_focus_if_group_focused; + char manual_placement; + char raise_on_next_focus; + char raise_after_next_focus; + char display_warp; + char warp_on_next_focus; + char warp_after_next_focus; + int edge_flip_resistance; + EWin *moveresize_pending_ewin; + char borderpartpress; + char windowdestroy; + int context_w; + int context_h; + char autoupgrade; + char activenetwork; + int motddate; + char motd; + char alreadytestingnetwork; + char show_pagers; + Pager *context_pager; + char pager_hiq; + char pager_snap; + char user_bg; + char pager_zoom; + char pager_title; + char constrained; + int pager_scanspeed; + TextClass *icon_textclass; + int icon_mode; + char nogroup; + GroupConfig group_config; + Window kde_dock; + int kde_support; + int kde_x1; + int kde_x2; + int kde_y1; + int kde_y2; + char clickalways; + char keybinds_changed; + char firsttime; + char showroottooltip; + int pager_sel_button; + int pager_win_button; + int pager_menu_button; +} EMode; typedef struct _handlestruct - { - void (*func) (XEvent * ev); - } +{ + void (*func) (XEvent * ev); +} HandleStruct; typedef struct _IPCstruct - { - void (*func) (char *params, Client * c); - char *commandname; - char *help_text; - char *extended_help_text; - } +{ + void (*func) (char *params, Client * c); + char *commandname; + char *help_text; + char *extended_help_text; +} IPCStruct; typedef struct _tooltip - { - char *name; +{ + char *name; - ImageClass *iclass; - ImageClass *s_iclass[4]; - TextClass *tclass; - int dist; - Window win; - Window iwin; - Window s_win[4]; - char visible; - ImageClass *tooltippic; - unsigned int ref_count; - } + ImageClass *iclass; + ImageClass *s_iclass[4]; + TextClass *tclass; + int dist; + Window win; + Window iwin; + Window s_win[4]; + char visible; + ImageClass *tooltippic; + unsigned int ref_count; +} ToolTip; typedef struct _qentry - { - char *name; - double in_time; - void (*func) (int val, void *data); - struct _qentry *next; - int runtime_val; - void *runtime_data; - char just_added; - } +{ + char *name; + double in_time; + void (*func) (int val, void *data); + struct _qentry *next; + int runtime_val; + void *runtime_data; + char just_added; +} Qentry; typedef struct _menustyle - { - char *name; - TextClass *tclass; - ImageClass *bg_iclass; - ImageClass *item_iclass; - ImageClass *sub_iclass; - char use_item_bg; - char iconpos; - int maxx; - int maxy; - char *border_name; - unsigned int ref_count; - } +{ + char *name; + TextClass *tclass; + ImageClass *bg_iclass; + ImageClass *item_iclass; + ImageClass *sub_iclass; + char use_item_bg; + char iconpos; + int maxx; + int maxy; + char *border_name; + unsigned int ref_count; +} MenuStyle; typedef struct _menuitem - { - ImageClass *icon_iclass; - char *text; - short act_id; - void *params; - Menu *child; - char state; - Pixmap pmap[3]; - Pixmap mask[3]; - Window win; - Window icon_win; - short icon_w; - short icon_h; - short text_w; - short text_h; - short text_x; - short text_y; - } +{ + ImageClass *icon_iclass; + char *text; + short act_id; + void *params; + Menu *child; + char state; + Pixmap pmap[3]; + Pixmap mask[3]; + Window win; + Window icon_win; + short icon_w; + short icon_h; + short text_w; + short text_h; + short text_x; + short text_y; +} MenuItem; struct _menu - { - char *name; - char *title; - MenuStyle *style; - int num; - MenuItem **items; - Window win; - Pixmap pmap; - Pixmap mask; - char stuck; - Menu *parent; - MenuItem *sel_item; - time_t last_change; - void *data; - Menu *ref_menu; - unsigned int ref_count; - }; +{ + char *name; + char *title; + MenuStyle *style; + int num; + MenuItem **items; + Window win; + Pixmap pmap; + Pixmap mask; + char stuck; + Menu *parent; + MenuItem *sel_item; + time_t last_change; + void *data; + Menu *ref_menu; + unsigned int ref_count; +}; typedef struct _progressbar - { - char *name; - int value; - int x; - int y; - int w; - int h; - Window win; - Window n_win; - Window p_win; - ImageClass *ic, *inc, *ipc; - TextClass *tc, *tnc; - } +{ + char *name; + int value; + int x; + int y; + int w; + int h; + Window win; + Window n_win; + Window p_win; + ImageClass *ic, *inc, *ipc; + TextClass *tc, *tnc; +} Progressbar; struct _snapshot - { - char *name; - char *win_title; - char *win_name; - char *win_class; - char *border_name; - char use_desktop; - int desktop; - int area_x, area_y; - char use_wh; - int w, h; - char use_xy; - int x, y; - char use_layer; - int layer; - char use_sticky; - char sticky; - char *iclass_name; - char use_shade; - char shade; - char use_cmd; - char *cmd; - int *groups; - int num_groups; - int used; - }; +{ + char *name; + char *win_title; + char *win_name; + char *win_class; + char *border_name; + char use_desktop; + int desktop; + int area_x, area_y; + char use_wh; + int w, h; + char use_xy; + int x, y; + char use_layer; + int layer; + char use_sticky; + char sticky; + char *iclass_name; + char use_shade; + char shade; + char use_cmd; + char *cmd; + int *groups; + int num_groups; + int used; +}; typedef struct _ditembutton DItemButton; typedef struct _ditemcheckbutton DItemCheckButton; @@ -1376,99 +1391,99 @@ typedef struct _ditemarea DItemArea; typedef struct _ditem DItem; struct _ditemslider - { - char horizontal; +{ + char horizontal; - char numeric; - char numeric_side; + char numeric; + char numeric_side; - int upper; - int lower; - int unit; - int jump; - int val; - int *val_ptr; + int upper; + int lower; + int unit; + int jump; + int val; + int *val_ptr; - int min_length; + int min_length; - int base_orig_w, base_orig_h; - int knob_orig_w, knob_orig_h; - int border_orig_w, border_orig_h; + int base_orig_w, base_orig_h; + int knob_orig_w, knob_orig_h; + int border_orig_w, border_orig_h; - int base_x, base_y, base_w, base_h; - int knob_x, knob_y, knob_w, knob_h; - int border_x, border_y, border_w, border_h; - int numeric_x, numeric_y, numeric_w, numeric_h; + int base_x, base_y, base_w, base_h; + int knob_x, knob_y, knob_w, knob_h; + int border_x, border_y, border_w, border_h; + int numeric_x, numeric_y, numeric_w, numeric_h; - ImageClass *ic_base; - ImageClass *ic_knob; - ImageClass *ic_border; + ImageClass *ic_base; + ImageClass *ic_knob; + ImageClass *ic_border; - char in_drag; - int wanted_val; + char in_drag; + int wanted_val; - Window base_win; - Window knob_win; - Window border_win; - }; + Window base_win; + Window knob_win; + Window border_win; +}; struct _ditemarea - { - Window area_win; - int w, h; - void (*event_func) (int val, void *data); - }; +{ + Window area_win; + int w, h; + void (*event_func) (int val, void *data); +}; struct _ditembutton - { - char *text; - }; +{ + char *text; +}; struct _ditemcheckbutton - { - char *text; - Window check_win; - int check_orig_w, check_orig_h; - char onoff; - char *onoff_ptr; - }; +{ + char *text; + Window check_win; + int check_orig_w, check_orig_h; + char onoff; + char *onoff_ptr; +}; struct _ditemtext - { - char *text; - }; +{ + char *text; +}; struct _ditemimage - { - char *image; - }; +{ + char *image; +}; struct _ditemseparator - { - char horizontal; - }; +{ + char horizontal; +}; struct _ditemtable - { - int num_columns; - char border; - char homogenous_h; - char homogenous_v; - int num_items; - DItem **items; - }; +{ + int num_columns; + char border; + char homogenous_h; + char homogenous_v; + int num_items; + DItem **items; +}; struct _ditemradiobutton - { - char *text; - Window radio_win; - int radio_orig_w, radio_orig_h; - char onoff; - int val; - int *val_ptr; - DItem *next; - DItem *first; - }; +{ + char *text; + Window radio_win; + int radio_orig_w, radio_orig_h; + char onoff; + int val; + int *val_ptr; + DItem *next; + DItem *first; +}; #define DITEM_NONE 0 #define DITEM_BUTTON 1 @@ -1482,211 +1497,211 @@ struct _ditemradiobutton #define DITEM_AREA 9 struct _ditem - { - int type; - void (*func) (int val, void *data); - int val; - void *data; - ImageClass *iclass; - TextClass *tclass; - ImlibBorder padding; - char fill_h; - char fill_v; - int align_h; - int align_v; - int row_span; - int col_span; +{ + int type; + void (*func) (int val, void *data); + int val; + void *data; + ImageClass *iclass; + TextClass *tclass; + ImlibBorder padding; + char fill_h; + char fill_v; + int align_h; + int align_v; + int row_span; + int col_span; - int x, y, w, h; - char hilited; - char clicked; - Window win; - union - { - DItemButton button; - DItemCheckButton check_button; - DItemText text; - DItemTable table; - DItemImage image; - DItemSeparator separator; - DItemRadioButton radio_button; - DItemSlider slider; - DItemArea area; - } - item; - }; + int x, y, w, h; + char hilited; + char clicked; + Window win; + union + { + DItemButton button; + DItemCheckButton check_button; + DItemText text; + DItemTable table; + DItemImage image; + DItemSeparator separator; + DItemRadioButton radio_button; + DItemSlider slider; + DItemArea area; + } + item; +}; typedef struct _dbutton - { - char *text; - void (*func) (int val, void *data); - Window win; - int x, y, w, h; - char hilited; - char clicked; - char close; - TextClass *tclass; - ImageClass *iclass; - } +{ + char *text; + void (*func) (int val, void *data); + Window win; + int x, y, w, h; + char hilited; + char clicked; + char close; + TextClass *tclass; + ImageClass *iclass; +} DButton; typedef struct _Dkeybind - { - KeyCode key; - int val; - void *data; - void (*func) (int val, void *data); - } +{ + KeyCode key; + int val; + void *data; + void (*func) (int val, void *data); +} DKeyBind; struct _dialog - { - char *name; - char *title; - char *text; - int num_buttons; - Window win; - DButton **button; - TextClass *tclass; - ImageClass *iclass; - int w, h; - DItem *item; - void (*exit_func) (int val, void *data); - int exit_val; - void *exit_data; - int num_bindings; - DKeyBind *keybindings; - }; +{ + char *name; + char *title; + char *text; + int num_buttons; + Window win; + DButton **button; + TextClass *tclass; + ImageClass *iclass; + int w, h; + DItem *item; + void (*exit_func) (int val, void *data); + int exit_val; + void *exit_data; + int num_bindings; + DKeyBind *keybindings; +}; typedef struct _PixImg - { - XImage *xim; - XShmSegmentInfo *shminfo; - Pixmap pmap; - GC gc; - } +{ + XImage *xim; + XShmSegmentInfo *shminfo; + Pixmap pmap; + GC gc; +} PixImg; typedef struct _Clone - { - char *name; - Window win; - EWin *ewin; - } +{ + char *name; + Window win; + EWin *ewin; +} Clone; struct _iconbox - { - /* user settings */ - char *name; - char orientation; - char animate; - char scrollbar_side; - char arrow_side; - char shownames; - char nobg; - int iconsize; - int icon_mode; +{ + /* user settings */ + char *name; + char orientation; + char animate; + char scrollbar_side; + char arrow_side; + char shownames; + char nobg; + int iconsize; + int icon_mode; - char auto_resize; - char draw_icon_base; - char scrollbar_hide; - char cover_hide; - int auto_resize_anchor; + char auto_resize; + char draw_icon_base; + char scrollbar_hide; + char cover_hide; + int auto_resize_anchor; - /* internally set stuff */ - int w, h; - int pos; - int max; - char arrow1_hilited; - char arrow1_clicked; - char arrow2_hilited; - char arrow2_clicked; - char icon_clicked; - char scrollbar_hilited; - char scrollbar_clicked; - char scrollbox_clicked; + /* internally set stuff */ + int w, h; + int pos; + int max; + char arrow1_hilited; + char arrow1_clicked; + char arrow2_hilited; + char arrow2_clicked; + char icon_clicked; + char scrollbar_hilited; + char scrollbar_clicked; + char scrollbox_clicked; - Pixmap pmap; + Pixmap pmap; - Window win; - Window cover_win; - Window icon_win; - Window scroll_win; - Window arrow1_win; - Window arrow2_win; - Window scrollbar_win; - Window scrollbarknob_win; - EWin *ewin; + Window win; + Window cover_win; + Window icon_win; + Window scroll_win; + Window arrow1_win; + Window arrow2_win; + Window scrollbar_win; + Window scrollbarknob_win; + EWin *ewin; - int num_icons; - EWin **icons; + int num_icons; + EWin **icons; - /* these are theme-settable parameters */ - int scroll_thickness; - int arrow_thickness; - int bar_thickness; - int knob_length; + /* these are theme-settable parameters */ + int scroll_thickness; + int arrow_thickness; + int bar_thickness; + int knob_length; - }; +}; struct _pager - { - char *name; - Window win; - Pixmap pmap; - Pixmap bgpmap; - int desktop; - int w, h; - int dw, dh; - char visible; - int update_phase; - EWin *ewin; - char *border_name; - Window sel_win; - char hi_visible; - Window hi_win; - EWin *hi_ewin; - }; +{ + char *name; + Window win; + Pixmap pmap; + Pixmap bgpmap; + int desktop; + int w, h; + int dw, dh; + char visible; + int update_phase; + EWin *ewin; + char *border_name; + Window sel_win; + char hi_visible; + Window hi_win; + EWin *hi_ewin; +}; typedef struct _drawqueue - { - Window win; - ImageClass *iclass; - int w, h, active, sticky, state, expose; - TextClass *tclass; - char *text; - char shape_propagate; - Pager *pager; - Pager *redraw_pager; - char newbg; - Dialog *d; - DItem *di; - int x, y; - } +{ + Window win; + ImageClass *iclass; + int w, h, active, sticky, state, expose; + TextClass *tclass; + char *text; + char shape_propagate; + Pager *pager; + Pager *redraw_pager; + char newbg; + Dialog *d; + DItem *di; + int x, y; +} DrawQueue; /* some kde hint enums here */ typedef enum - { - StickyFlag = (1 << 0), - MaximizedFlag = (1 << 1), - IconifiedFlag = (1 << 2), - AllFlags = 7 - } +{ + StickyFlag = (1 << 0), + MaximizedFlag = (1 << 1), + IconifiedFlag = (1 << 2), + AllFlags = 7 +} KStates; typedef enum - { - AddWindow, - RemoveWindow, - FocusWindow, - RaiseWindow, - LowerWindow, - ChangedClient, - IconChange - } +{ + AddWindow, + RemoveWindow, + FocusWindow, + RaiseWindow, + LowerWindow, + ChangedClient, + IconChange +} KMessage; /* function prototypes */ @@ -1694,6 +1709,7 @@ KMessage; void Efont_extents(Efont * f, char *text, int *font_ascent_return, int *font_descent_return, int *width_return, + int *max_ascent_return, int *max_descent_return, int *lbearing_return, int *rbearing_return); @@ -1797,10 +1813,12 @@ void EMapRaised(Display * d, Window win); int EGetGeometry(Display * d, Window win, Window * root_return, int *x, int *y, unsigned int *w, unsigned int *h, unsigned int *bw, + unsigned int *depth); void EConfigureWindow(Display * d, Window win, unsigned int mask, XWindowChanges * wc); void ESetWindowBackgroundPixmap(Display * d, Window win, + Pixmap pmap); void ESetWindowBackground(Display * d, Window win, int col); EXID *NewXID(void); @@ -1809,13 +1827,17 @@ EXID *FindXID(Window win); void DelXID(Window win); Pixmap ECreatePixmap(Display * display, Drawable d, unsigned int width, unsigned int height, + unsigned depth); void EFreePixmap(Display * display, Pixmap pixmap); Window ECreateWindow(Window parent, int x, int y, int w, int h, + int saveunder); Window ECreateEventWindow(Window parent, int x, int y, int w, + int h); Window ECreateFocusWindow(Window parent, int x, int y, int w, + int h); void GrabX(void); void UngrabX(void); @@ -1827,8 +1849,10 @@ int WinExists(Window win); Window WindowAtXY_0(Window base, int bx, int by, int x, int y); Window WindowAtXY(int x, int y); void PointerAt(int *x, int *y); -void PastePixmap(Display * d, Drawable w, Pixmap p, Mask m, int x, int y); -void PasteMask(Display * d, Drawable w, Pixmap p, int x, int y, int wd, int ht); +void PastePixmap(Display * d, Drawable w, Pixmap p, Mask m, + int x, int y); +void PasteMask(Display * d, Drawable w, Pixmap p, int x, int y, + int wd, int ht); char *NukeBoringevents(XEvent * ev, int num); void DebugEvent(XEvent * ev); @@ -1842,11 +1866,13 @@ EWin *GetEwinPointerInClient(void); EWin *GetEwin(void); EWin *GetFocusEwin(void); void SlideEwinTo(EWin * ewin, int fx, int fy, int tx, int ty, + int speed); void SlideEwinsTo(EWin ** ewin, int *fx, int *fy, int *tx, int *ty, int num_wins, int speed); void AddToFamily(Window win); -EWin *AddInternalToFamily(Window win, char noshow, char *bname, int type, void *ptr); +EWin *AddInternalToFamily(Window win, char noshow, char *bname, + int type, void *ptr); void SetEwinBorder(EWin * ewin); void SetEwinToBorder(EWin * ewin, Border * b); void HonorIclass(char *s, int id); @@ -1860,7 +1886,9 @@ int ChangeEwinWinpartContents(EWin * ewin, int i); void CalcEwinWinpart(EWin * ewin, int i); void CalcEwinSizes(EWin * ewin); EWin *Adopt(Window win); -EWin *AdoptInternal(Window win, Border * border, int type, void *ptr); +EWin *AdoptInternal(Window win, Border * border, int type, + + void *ptr); EWin *CreateEwin(void); void FreeEwin(EWin * ewin); @@ -1871,7 +1899,10 @@ Border *MatchEwinBorder(EWin * ewin, WindowMatch * b); ImageClass *MatchEwinIcon(EWin * ewin, WindowMatch * b); int MatchEwinDesktop(EWin * ewin, WindowMatch * b); void *MatchEwinByFunction(EWin * ewin, - void * (*FunctionToTest) (EWin *, WindowMatch *)); + void *(*FunctionToTest) (EWin *, + WindowMatch + + *)); void RemoveWindowMatch(WindowMatch * wm); /* borders.c functions */ @@ -1914,8 +1945,7 @@ void ImageStatePopulate(ImageState * is); void ImageStateRealize(ImageState * is); void IclassPopulate(ImageClass * iclass); void IclassApply(ImageClass * iclass, Window win, int w, int h, - int active, int sticky, int state, - char expose); + int active, int sticky, int state, char expose); void IclassApplyCopy(ImageClass * iclass, Window win, int w, int h, int active, int sticky, int state, Pixmap * pret, Pixmap * mret); @@ -1924,8 +1954,10 @@ void IclassApplyCopy(ImageClass * iclass, Window win, int w, void HandleDrawQueue(void); char IsPropagateEwinOnQueue(EWin * ewin); void EFillPixmap(Window win, Pixmap pmap, int x, int y, + int w, int h); void EPastePixmap(Window win, Pixmap pmap, int x, int y, + int w, int h); void EBlendRemoveShape(EWin * ewin, Pixmap pmap, int x, int y); PixImg *ECreatePixImg(Window win, int w, int h); @@ -1981,7 +2013,9 @@ void GrabButtonGrabs(EWin * ewin); void UnGrabButtonGrabs(EWin * ewin); ActionClass *CreateAclass(char *name); Action *CreateAction(char event, char anymod, int mod, int anybut, - int but, char anykey, char *key, char *tooltipstring); + int but, char anykey, char *key, + + char *tooltipstring); void RemoveActionType(ActionType * ActionTypeToRemove); void RemoveAction(Action * ActionToRemove); void RemoveActionClass(ActionClass * ActionToRemove); @@ -2108,6 +2142,7 @@ void HideDesktopTabs(void); void MoveToDeskTop(int num); void MoveToDeskBottom(int num); void SlideWindowTo(Window win, int fx, int fy, int tx, int ty, + int speed); void KeepBGimages(Background * bg, char onoff); void RemoveImagesFromBG(Background * bg); @@ -2158,6 +2193,7 @@ void TclassPopulate(TextClass * tclass); void TclassApply(ImageClass * iclass, Window win, int w, int h, int active, int sticky, int state, char expose, + TextClass * tclass, char *text); void HandleClientMessage(XEvent * ev); @@ -2189,7 +2225,8 @@ Menu *FindMenuItem(Window win, MenuItem ** mi); Menu *FindMenu(Window win); EWin *FindEwinByMenu(Menu * m); Group **ListWinGroups(EWin * ewin, char group_select, int *num); -EWin **ListWinGroupMembersForEwin(EWin * ewin, int action, char nogroup, int *num); +EWin **ListWinGroupMembersForEwin(EWin * ewin, int action, + char nogroup, int *num); EWin **ListTransientsFor(Window win, int *num); EWin **ListGroupMembers(Window win, int *num); EWin *FindEwinByDialog(Dialog * d); @@ -2206,7 +2243,9 @@ void MWM_SetInfo(void); /* containers.c functions */ Container *InitializeContainer(char *name, ImageClass * iclass, - int width, int height, char orientation); + int width, int height, + + char orientation); void AddButtonToContainer(Container * bc, Button * b); void RemoveButtonFromContainer(Container * bc, Button * b); void DestroyContainer(Container * bc); @@ -2229,8 +2268,10 @@ void HideButton(Button * b); void DrawButton(Button * b); void MovebuttonToCoord(Button * b, int x, int y); int EmbedWindowIntoButton(Button * ButtonToUse, + Window WindowToEmbed); void FindEmptySpotForButton(Button * bt, char *listname, + char dirtomove); /* atoms.c functions */ @@ -2265,6 +2306,7 @@ void GNOME_DelHints(EWin * ewin); /* kde.c functions */ void KDE_ClientMessage(Window win, Atom atom, long data, + Time timestamp); void KDE_ClientTextMessage(Window win, Atom atom, char *data); void KDE_SendMessagesToModules(Atom atom, long data); @@ -2305,7 +2347,8 @@ int matchregexp(char *rx, char *s); double GetTime(void); void DoIn(char *name, double in_time, - void (*func) (int val, void *data), + void (*func) (int val, void *data), + int runtime_val, void *runtime_data); Qentry *GetHeadTimerQueue(void); void HandleTimerEvent(void); @@ -2319,12 +2362,14 @@ ColorModifierClass *CreateCMClass(char *name, int rnum, unsigned char *rpx, unsigned char *rpy, int gnum, unsigned char *gpx, unsigned char *gpy, + int bnum, unsigned char *bpx, unsigned char *bpy); void ModifyCMClass(char *name, int rnum, unsigned char *rpx, unsigned char *rpy, int gnum, unsigned char *gpx, unsigned char *gpy, + int bnum, unsigned char *bpx, unsigned char *bpy); @@ -2433,9 +2478,11 @@ void IB_SnapEWin(EWin * ewin); void IB_GetAppIcon(EWin * ewin); void IB_PasteDefaultBase(Drawable d, int x, int y, int w, int h); void IB_PasteDefaultBaseMask(Drawable d, int x, int y, int w, + int h); void IB_GetEIcon(EWin * ewin); void IB_AddIcondef(char *title, char *name, char *class, + char *file); void IB_RemoveIcondef(Icondef * idef); Icondef *IB_MatchIcondef(char *title, char *name, char *class); @@ -2451,6 +2498,7 @@ Iconbox *SelectIconboxForEwin(EWin * ewin); void SlideWindowSizeTo(Window win, int fx, int fy, int tx, int ty, int fw, int fh, + int tw, int th, int speed); Slideout *CreateSlideout(char *name, char dir); void ShowSlideout(Slideout * s, Window win); @@ -2471,11 +2519,13 @@ void RepackStrip(Strip * s); Strip *IsInStrip(int x, int y); TextState *TextGetState(TextClass * tclass, int active, int sticky, + int state); char **TextGetLines(char *text, int *count); void TextStateLoadFont(TextState * ts); void TextSize(TextClass * tclass, int active, int sticky, int state, char *text, int *width, int *height, + int fsize); void TextDraw(TextClass * tclass, Window win, int active, int sticky, int state, char *text, int x, int y, @@ -2505,6 +2555,7 @@ void ShowMenu(Menu * m, char noshow); MenuStyle *CreateMenuStyle(void); MenuItem *CreateMenuItem(char *text, ImageClass * iclass, int action_id, char *action_params, + Menu * child); Menu *CreateMenu(void); void DestroyMenu(Menu * m); @@ -2513,12 +2564,14 @@ void AddTitleToMenu(Menu * menu, char *title); void RealizeMenu(Menu * m); void DrawMenuItem(Menu * m, MenuItem * mi, char shape); Menu *CreateMenuFromDirectory(char *name, MenuStyle * ms, + char *dir); Menu *CreateMenuFromFlatFile(char *name, MenuStyle * ms, char *file, Menu * parent); Menu *CreateMenuFromGnome(char *name, MenuStyle * ms, char *dir); Menu *CreateMenuFromAllEWins(char *name, MenuStyle * ms); Menu *CreateMenuFromDesktopEWins(char *name, MenuStyle * ms, + int desk); Menu *CreateMenuFromDesktops(char *name, MenuStyle * ms); Menu *CreateMenuFromThemes(char *name, MenuStyle * ms); @@ -2545,12 +2598,14 @@ void SetCurrentLinearArea(int a); int GetCurrentLinearArea(void); void MoveCurrentLinearAreaBy(int a); void SlideWindowsBy(Window * win, int num, int dx, int dy, + int speed); void MoveEwinToLinearArea(EWin * ewin, int a); void MoveEwinLinearAreaBy(EWin * ewin, int a); int Emkstemp(char *template); void SnapEwin(EWin * ewin, int dx, int dy, int *new_dx, + int *new_dy); void ArrangeEwin(EWin * ewin); @@ -2602,13 +2657,16 @@ __Erealloc(x, y, "", 0) char *duplicate(char *s); -void Alert(char *fmt,...); +void Alert(char *fmt, ...); void InitStringList(void); void AssignIgnoreFunction(int (*FunctionToAssign) (void *), + void *params); void AssignRestartFunction(int (*FunctionToAssign) (void *), + void *params); void AssignExitFunction(int (*FunctionToAssign) (void *), + void *params); void AssignTitleText(char *text); void AssignIgnoreText(char *text); @@ -2696,18 +2754,20 @@ void SetDefaultTheme(char *theme); char SanitiseThemeDir(char *dir); void Quicksort(void **a, int l, int r, - int (*CompareFunc) (void *d1, void *d2)); + int (*CompareFunc) (void *d1, void *d2)); Dialog *CreateDialog(char *name); void DialogBindKey(Dialog * d, char *key, - void (*func) (int val, void *data), + void (*func) (int val, void *data), + int val, void *data); void FreeDButton(DButton * db); void FreeDialog(Dialog * d); void DialogSetText(Dialog * d, char *text); void DialogSetTitle(Dialog * d, char *title); void DialogAddButton(Dialog * d, char *text, - void (*func) (int val, void *data), + void (*func) (int val, void *data), + char close); void DialogDrawButton(Dialog * d, int bnum); void DialogActivateButton(Window win, int inclick); @@ -2716,15 +2776,15 @@ void DialogDrawArea(Dialog * d, int x, int y, int w, int h); void DialogRedraw(Dialog * d); void ShowDialog(Dialog * d); void DialogClose(Dialog * d); -void DialogSetParamText(Dialog * d, char *fmt,...); -void DialogAlert(char *fmt,...); -void DialogAlertOK(char *fmt,...); +void DialogSetParamText(Dialog * d, char *fmt, ...); +void DialogAlert(char *fmt, ...); +void DialogAlertOK(char *fmt, ...); void DialogRestart(int val, void *data); void DialogQuit(int val, void *data); DItem *DialogInitItem(Dialog * d); DItem *DialogAddItem(DItem * dii, int type); void DialogItemSetCallback(DItem * di, - void (*func) (int val, void *data), + void (*func) (int val, void *data), int val, char *data); void DialogItemSetClass(DItem * di, ImageClass * iclass, TextClass * tclass); @@ -2734,6 +2794,7 @@ void DialogItemSetFill(DItem * di, char fill_h, char fill_v); void DialogItemSetAlign(DItem * di, int align_h, int align_v); void DialogRealizeItem(Dialog * d, DItem * di); void DialogDrawItems(Dialog * d, DItem * di, int x, int y, + int w, int h); void DialogItemsRealize(Dialog * d); void DialogItemButtonSetText(DItem * di, char *text); @@ -2743,8 +2804,10 @@ void DialogItemCheckButtonSetState(DItem * di, char onoff); void DialogItemCheckButtonSetPtr(DItem * di, char *onoff_ptr); void DialogItemTableSetOptions(DItem * di, int num_columns, char border, char homogenous_h, + char homogenous_v); void DialogItemSeparatorSetOrientation(DItem * di, + char horizontal); void DialogItemImageSetFile(DItem * di, char *image); void DialogFreeItem(DItem * di); @@ -2752,11 +2815,12 @@ DItem *DialogItemFindWindow(DItem * di, Window win); void DialogItemSetRowSpan(DItem * di, int row_span); void DialogItemSetColSpan(DItem * di, int col_span); void DialogSetExitFunction(Dialog * d, - void (*func) (int val, void *data), + void (*func) (int val, void *data), int val, void *data); void DialogItemRadioButtonSetText(DItem * di, char *text); void DialogItemRadioButtonSetFirst(DItem * di, DItem * first); void DialogItemRadioButtonGroupSetValPtr(DItem * di, + int *val_ptr); void DialogItemRadioButtonGroupSetVal(DItem * di, int val); void MoveTableBy(Dialog * d, DItem * di, int dx, int dy); @@ -2770,7 +2834,10 @@ void DialogItemSliderSetOrientation(DItem * di, char horizontal); void DialogItemAreaSetSize(DItem * di, int w, int h); void DialogItemAreaGetSize(DItem * di, int *w, int *h); Window DialogItemAreaGetWindow(DItem * di); -void DialogItemAreaSetEventFunc(DItem * di, void (*func) (int val, void *data)); +void DialogItemAreaSetEventFunc(DItem * di, + void (*func) (int val, + + void *data)); Window SC_GetDestWin(void); void SC_PassEvent(XEvent * ev); @@ -2821,6 +2888,7 @@ void PagerScaleLine(Pixmap dest, Window src, int dx, int dy, int sw, int pw, int sy, int sh); void PagerScaleRect(Pixmap dest, Window src, int sx, int sy, int dx, int dy, int sw, int sh, int dw, + int dh); Pager *CreatePager(void); EWin *EwinInPagerAt(Pager * p, int x, int y); @@ -2846,6 +2914,7 @@ void EnableAllPagers(void); void DisableAllPagers(void); void PagerHideHi(Pager * p); void PagerShowHi(Pager * p, EWin * ewin, int x, int y, int w, + int h); void PagerSetHiQ(char onoff); void PagerSetSnap(char onoff); @@ -2856,8 +2925,10 @@ int PagerForDesktop(int desk); void DisablePagersForDesktop(int desk); int CompareNetVersion(int major, int minor, int patchlevel, + char *date); int RetrieveUpdate(int major, int minor, int patchlevel, + char *date); int InstallUpdate(void); void SpawnNetworkTester(void); diff --git a/src/Makefile.am b/src/Makefile.am index 8a84d559..2dbc9dfd 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -93,6 +93,7 @@ enlightenment_SOURCES = \ zoom.c LDADD = \ + @INTLLIBS@ \ $(FNLIB_LIBS) \ $(TTF_LIBS) \ $(ESD_LIBS) \ @@ -103,7 +104,7 @@ LDADD = \ $(DL_LIBS) \ -lm -INCLUDES=-I$(top_srcdir) $(ESD_CFLAGS) $(IMLIB_CFLAGS) -I$(includedir) -I.. +INCLUDES=-I$(top_srcdir) $(ESD_CFLAGS) $(IMLIB_CFLAGS) -I$(includedir) -I.. -I../intl -I$(top_srcdir)/intl DEFS=-DENLIGHTENMENT_ROOT=\"@ENLIGHTENMENT_ROOT@\" -DENLIGHTENMENT_BIN=\"@ENLIGHTENMENT_BIN@\" diff --git a/src/actions.c b/src/actions.c index 597c1254..db377c0b 100644 --- a/src/actions.c +++ b/src/actions.c @@ -71,8 +71,7 @@ GrabButtonGrabs(EWin * ewin) Action *a; ac = (ActionClass *) FindItem("BUTTONBINDINGS", 0, - LIST_FINDBY_NAME, - LIST_TYPE_ACLASS); + LIST_FINDBY_NAME, LIST_TYPE_ACLASS); if (ac) { @@ -119,7 +118,8 @@ GrabButtonGrabs(EWin * ewin) None, None); XGrabButton(disp, button, mod | mask_mod_combos[i], ewin->win, False, mask, - GrabModeSync, GrabModeAsync, None, None); + GrabModeSync, GrabModeAsync, None, + None); } } } @@ -135,8 +135,7 @@ UnGrabButtonGrabs(EWin * ewin) Action *a; ac = (ActionClass *) FindItem("BUTTONBINDINGS", 0, - LIST_FINDBY_NAME, - LIST_TYPE_ACLASS); + LIST_FINDBY_NAME, LIST_TYPE_ACLASS); if (ac) { @@ -177,8 +176,7 @@ UnGrabButtonGrabs(EWin * ewin) mod | mask_mod_combos[i], ewin->pager->hi_win); XUngrabButton(disp, button, - mod | mask_mod_combos[i], - ewin->win); + mod | mask_mod_combos[i], ewin->win); } } } @@ -539,9 +537,10 @@ spawnMenu(void *params) { if ((ewin) && (ewin->win != mode.context_win) && (mode.context_win)) { - EGetGeometry(disp, mode.context_win, &dw, &di, &di, &w, &h, &d, &d); - XTranslateCoordinates(disp, mode.context_win, root.win, - 0, 0, &x, &y, &dw); + EGetGeometry(disp, mode.context_win, &dw, &di, &di, &w, &h, &d, + &d); + XTranslateCoordinates(disp, mode.context_win, root.win, 0, 0, &x, + &y, &dw); if (w >= h) mode.y = -(y + h); @@ -593,8 +592,7 @@ spawnMenu(void *params) if (((ewin) && (ewin->win == mode.context_win)) || (ewin = FindEwinByChildren(mode.context_win))) { - if ((ewin) && (mode.cur_menu_depth > 0) && - (mode.cur_menu[0])) + if ((ewin) && (mode.cur_menu_depth > 0) && (mode.cur_menu[0])) ewin->shownmenu = mode.cur_menu[0]->win; } params = NULL; @@ -662,26 +660,25 @@ runApp(char *exe, char *params) #else if (_fnisabs((char *)exe)) #endif - DialogAlertOK("There was an error running the program:\n" - "%s\n" - "This program could not be executed.\n" - "This is because the file does not exist.\n", + DialogAlertOK(gettext + ("There was an error running the program:\n" + "%s\n" + "This program could not be executed.\n" + "This is because the file does not exist.\n"), (char *)exe); /* relative path */ else - DialogAlertOK("There was an error running the program:\n" - "%s\n" - "This program could not be executed.\n" - "This is most probably because this program " - "is not in the\n" - "path for your shell which is %s. I suggest " - "you read " - "the manual\n" - "page for that shell and read up how to " - "change or add " - "to your\n" - "execution path.\n", - (char *)exe, sh); + DialogAlertOK(gettext + ("There was an error running the program:\n" + "%s\n" + "This program could not be executed.\n" + "This is most probably because this program " + "is not in the\n" + "path for your shell which is %s. I suggest " + "you read " "the manual\n" + "page for that shell and read up how to " + "change or add " "to your\n" + "execution path.\n"), (char *)exe, sh); } else /* it is a node on the filing sys */ @@ -691,28 +688,26 @@ runApp(char *exe, char *params) { /* can execute it */ if (canexec((char *)path)) - DialogAlertOK("There was an error running the program:\n" - "%s\n" - "This program could not be executed.\n" - "I am unsure as to why you could not " - "do this. " - "The file exists,\n" - "is a file, and you are allowed to " - "execute it. I " - "suggest you look\n" - "into this.\n", - (char *)path); + DialogAlertOK(gettext + ("There was an error running the program:\n" + "%s\n" + "This program could not be executed.\n" + "I am unsure as to why you could not " + "do this. " "The file exists,\n" + "is a file, and you are allowed to " + "execute it. I " "suggest you look\n" + "into this.\n"), (char *)path); /* not executable file */ else - DialogAlertOK("There was an error running the program:\n" - "%s\n" - "This program could not be executed.\n" - "This is because the file exists, is a" - " file, but " - "you are unable\n" - "to execute it because you do not " - "have execute " - "access to this file.\n", + DialogAlertOK(gettext + ("There was an error running the program:\n" + "%s\n" + "This program could not be executed.\n" + "This is because the file exists, is a" + " file, but " "you are unable\n" + "to execute it because you do not " + "have execute " + "access to this file.\n"), (char *)path); } /* it's not a file */ @@ -720,20 +715,20 @@ runApp(char *exe, char *params) { /* its a dir */ if (isdir((char *)path)) - DialogAlertOK("There was an error running the program:\n" - "%s\n" - "This program could not be executed.\n" - "This is because the file is infact " - "a directory.\n", - (char *)path); + DialogAlertOK(gettext + ("There was an error running the program:\n" + "%s\n" + "This program could not be executed.\n" + "This is because the file is infact " + "a directory.\n"), (char *)path); /* its not a file or a dir */ else - DialogAlertOK("There was an error running the program:\n" - "%s\n" - "This program could not be executed.\n" - "This is because the file is not a " - "regular file.\n", - (char *)path); + DialogAlertOK(gettext + ("There was an error running the program:\n" + "%s\n" + "This program could not be executed.\n" + "This is because the file is not a " + "regular file.\n"), (char *)path); } if (path) Efree(path); @@ -1097,7 +1092,8 @@ doMoveImpl(void *params, char constrained) FloatEwinAt(gwins[i], gwins[i]->x, gwins[i]->y); if (!mode.moveresize_pending_ewin) DrawEwinShape(gwins[i], mode.movemode, gwins[i]->x, gwins[i]->y, - gwins[i]->client.w, gwins[i]->client.h, mode.firstlast); + gwins[i]->client.w, gwins[i]->client.h, + mode.firstlast); } Efree(gwins); mode.firstlast = 1; @@ -1166,8 +1162,9 @@ doMoveEnd(void *params) { wasresize = 1; for (i = 0; i < num; i++) - DrawEwinShape(gwins[i], mode.movemode, gwins[i]->x, gwins[i]->y, gwins[i]->client.w, - gwins[i]->client.h, mode.firstlast); + DrawEwinShape(gwins[i], mode.movemode, gwins[i]->x, gwins[i]->y, + gwins[i]->client.w, gwins[i]->client.h, + mode.firstlast); for (i = 0; i < num; i++) MoveEwin(gwins[i], gwins[i]->x, gwins[i]->y); } @@ -1179,9 +1176,11 @@ doMoveEnd(void *params) if (gwins[i]->floating) MoveEwinToDesktopAt(gwins[i], d, gwins[i]->x - (desks.desk[d].x - - desks.desk[gwins[i]->desktop].x), + desks.desk[gwins[i]-> + desktop].x), gwins[i]->y - (desks.desk[d].y - - desks.desk[gwins[i]->desktop].y)); + desks.desk[gwins[i]-> + desktop].y)); else MoveEwinToDesktopAt(gwins[i], d, gwins[i]->x, gwins[i]->y); gwins[i]->floating = 0; @@ -1350,15 +1349,14 @@ doCleanup(void *params) for (i = 0; i < num; i++) { if ((((EWin *) lst[i])->desktop == desks.current) && - (!((EWin *) lst[i])->sticky) && (!((EWin *) lst[i])->floating) && - (!((EWin *) lst[i])->iconified) && - (!((EWin *) lst[i])->ignorearrange) && - (!((EWin *) lst[i])->menu) && - (((EWin *) lst[i])->area_x == - desks.desk[((EWin *) lst[i])->desktop].current_area_x) && - (((EWin *) lst[i])->area_y == - desks.desk[((EWin *) lst[i])->desktop].current_area_y) - ) + (!((EWin *) lst[i])->sticky) && (!((EWin *) lst[i])->floating) + && (!((EWin *) lst[i])->iconified) + && (!((EWin *) lst[i])->ignorearrange) + && (!((EWin *) lst[i])->menu) + && (((EWin *) lst[i])->area_x == + desks.desk[((EWin *) lst[i])->desktop].current_area_x) + && (((EWin *) lst[i])->area_y == + desks.desk[((EWin *) lst[i])->desktop].current_area_y)) { floating[j].data = lst[i]; floating[j].x = ((EWin *) lst[i])->x; @@ -1368,14 +1366,11 @@ doCleanup(void *params) floating[j++].h = ((EWin *) lst[i])->h; } else if ( - ( - (((EWin *) lst[i])->desktop == desks.current) || - (((EWin *) lst[i])->sticky) - ) && - (((EWin *) lst[i])->layer != 4) && - (((EWin *) lst[i])->layer != 0) && - (!((EWin *) lst[i])->menu) - ) + ( + (((EWin *) lst[i])->desktop == desks.current) || + (((EWin *) lst[i])->sticky)) && +(((EWin *) lst[i])->layer != 4) && +(((EWin *) lst[i])->layer != 0) && (!((EWin *) lst[i])->menu)) { fixed = Erealloc(fixed, sizeof(RectBox) * (k + 1)); fixed[k].data = lst[i]; @@ -1521,7 +1516,8 @@ doCleanup(void *params) if (ewin) { if ((ewin->x != ret[i].x) || (ewin->y != ret[i].y)) - MoveEwin((EWin *) ret[i].data, ret[i].x, ret[i].y); + MoveEwin((EWin *) ret[i].data, ret[i].x, + ret[i].y); } } } @@ -1724,9 +1720,11 @@ doStick(void *params) for (i = 0; i < num; i++) { curr_group = EwinsInGroup(ewin, gwins[i]); - if (gwins[i]->sticky && ((curr_group && !curr_group->cfg.mirror) || sticky)) + if (gwins[i]->sticky + && ((curr_group && !curr_group->cfg.mirror) || sticky)) MakeWindowUnSticky(gwins[i]); - else if (!gwins[i]->sticky && ((curr_group && !curr_group->cfg.mirror) || !sticky)) + else if (!gwins[i]->sticky + && ((curr_group && !curr_group->cfg.mirror) || !sticky)) MakeWindowSticky(gwins[i]); params = NULL; GNOME_SetHint(gwins[i]); @@ -2204,8 +2202,7 @@ doPlaySoundClass(void *params) if (!params) EDBUG_RETURN(0); - ApplySclass(FindItem((char *)params, 0, LIST_FINDBY_NAME, - LIST_TYPE_SCLASS)); + ApplySclass(FindItem((char *)params, 0, LIST_FINDBY_NAME, LIST_TYPE_SCLASS)); EDBUG_RETURN(0); } @@ -2331,7 +2328,7 @@ doHideShowButton(void *params) if (matchregexp(ss, lst[i]->name)) { if ((strcmp(lst[i]->name, - "_DESKTOP_DESKRAY_DRAG_CONTROL") && + "_DESKTOP_DESKRAY_DRAG_CONTROL") && (!lst[i]->used))) { if (!(lst[i]->visible)) @@ -2361,7 +2358,7 @@ doHideShowButton(void *params) if (!matchregexp(ss, lst[i]->name)) { if ((strcmp(lst[i]->name, - "_DESKTOP_DESKRAY_DRAG_CONTROL") && + "_DESKTOP_DESKRAY_DRAG_CONTROL") && (!lst[i]->used))) { if (!(lst[i]->visible)) @@ -2461,11 +2458,13 @@ doIconifyWindow(void *params) for (i = 0; i < num; i++) { curr_group = EwinsInGroup(ewin, gwins[i]); - if (gwins[i]->iconified && ((curr_group && !curr_group->cfg.mirror) || iconified)) + if (gwins[i]->iconified + && ((curr_group && !curr_group->cfg.mirror) || iconified)) { DeIconifyEwin(gwins[i]); } - else if (!gwins[i]->iconified && ((curr_group && !curr_group->cfg.mirror) || !iconified)) + else if (!gwins[i]->iconified + && ((curr_group && !curr_group->cfg.mirror) || !iconified)) { IconifyEwin(gwins[i]); } @@ -2568,12 +2567,14 @@ doShade(void *params) for (i = 0; i < num; i++) { curr_group = EwinsInGroup(ewin, gwins[i]); - if (gwins[i]->shaded && ((curr_group && !curr_group->cfg.mirror) || shaded)) + if (gwins[i]->shaded + && ((curr_group && !curr_group->cfg.mirror) || shaded)) { AUDIO_PLAY("SOUND_UNSHADE"); UnShadeEwin(gwins[i]); } - else if (!gwins[i]->shaded && ((curr_group && !curr_group->cfg.mirror) || !shaded)) + else if (!gwins[i]->shaded + && ((curr_group && !curr_group->cfg.mirror) || !shaded)) { AUDIO_PLAY("SOUND_SHADE"); ShadeEwin(gwins[i]); @@ -3019,7 +3020,9 @@ doSetWinBorder(void *params) if (!params) EDBUG_RETURN(0); - gwins = ListWinGroupMembersForEwin(ewin, ACTION_SET_WINDOW_BORDER, mode.nogroup, &num); + gwins = + ListWinGroupMembersForEwin(ewin, ACTION_SET_WINDOW_BORDER, mode.nogroup, + &num); sscanf((char *)params, "%1000s", buf); b = (Border *) FindItem(buf, 0, LIST_FINDBY_NAME, LIST_TYPE_BORDER); @@ -3038,8 +3041,7 @@ doSetWinBorder(void *params) { if ((b->border.left == 0) && (b->border.right == 0) && - (b->border.top == 0) && - (b->border.bottom == 0)) + (b->border.top == 0) && (b->border.bottom == 0)) EDBUG_RETURN(0); } for (i = 0; i < num; i++) @@ -3058,8 +3060,8 @@ doSetWinBorder(void *params) if (shadechange) InstantShadeEwin(gwins[i]); ICCCM_MatchSize(gwins[i]); - MoveResizeEwin(gwins[i], gwins[i]->x, gwins[i]->y, gwins[i]->client.w, - gwins[i]->client.h); + MoveResizeEwin(gwins[i], gwins[i]->x, gwins[i]->y, + gwins[i]->client.w, gwins[i]->client.h); } RememberImportantInfoForEwin(gwins[i]); } @@ -3129,7 +3131,7 @@ doAbout(void *params) { char stuff[255]; - Esnprintf(stuff, sizeof(stuff), "About Enlightenment %s", + Esnprintf(stuff, sizeof(stuff), gettext("About Enlightenment %s"), ENLIGHTENMENT_VERSION); DialogSetTitle(d, stuff); } @@ -3145,29 +3147,29 @@ doAbout(void *params) DialogItemSetPadding(di, 2, 2, 2, 2); DialogItemSetFill(di, 1, 0); DialogItemTextSetText(di, - "Welcome to the " - ENLIGHTENMENT_VERSION - " version\n" - "of the Enlightenment " - "window manager.\n Enlightenment is still under " - "development, but\n" - "we have tried to iron out all the bugs " - "that\nwe can find. If " - "you find a bug in the software,\n please do " - "not hesitate to send " - "in a bug report.\nSee \"Help\" for information " - "on joining the\n" - "mailing list.\n" - "\n" - "This code last updated on:\n" - E_CHECKOUT_DATE "\n" - "\n" - "Good luck. We hope you enjoy the software.\n" - "\n" - "The Rasterman - raster@rasterman.com\n" - "Mandrake - mandrake@mandrake.net\n"); + gettext("Welcome to the " + ENLIGHTENMENT_VERSION + " version\n" + "of the Enlightenment " + "window manager.\n Enlightenment is still under " + "development, but\n" + "we have tried to iron out all the bugs " + "that\nwe can find. If " + "you find a bug in the software,\n please do " + "not hesitate to send " + "in a bug report.\nSee \"Help\" for information " + "on joining the\n" + "mailing list.\n" + "\n" + "This code last updated on:\n" + E_CHECKOUT_DATE "\n" + "\n" + "Good luck. We hope you enjoy the software.\n" + "\n" + "The Rasterman - raster@rasterman.com\n" + "Mandrake - mandrake@mandrake.net\n")); - DialogAddButton(d, "OK", NULL, 1); + DialogAddButton(d, gettext("OK"), NULL, 1); ShowDialog(d); params = NULL; @@ -3320,7 +3322,8 @@ doConfigure(void *params) if (ewin) { ChooseGroupDialog(ewin, - " Pick the group the window will belong to: \n", + gettext + (" Pick the group the window will belong to: \n"), GROUP_SELECT_ALL_EXCEPT_EWIN, ACTION_ADD_TO_GROUP); } @@ -3339,8 +3342,7 @@ struct _keyset int doInsertKeys(void *params) { - const struct _keyset ks[] = - { + const struct _keyset ks[] = { {"a", 0, "a"}, {"b", 0, "b"}, {"c", 0, "c"}, @@ -3462,14 +3464,17 @@ doInsertKeys(void *params) ev.y = mode.y; ev.x_root = mode.x; ev.y_root = mode.y; - for (j = 0; j < (int)(sizeof(ks) / sizeof(struct _keyset)); j++) + for (j = 0; j < (int)(sizeof(ks) / sizeof(struct _keyset)); + + j++) { if (!strncmp(ks[j].ch, &(s[i]), strlen(ks[j].ch))) { i += (strlen(ks[j].ch) - 1); ev.keycode = - XKeysymToKeycode(disp, XStringToKeysym(ks[j].sym)); + XKeysymToKeycode(disp, + XStringToKeysym(ks[j].sym)); ev.state = ks[j].state; ev.type = KeyPress; XSendEvent(disp, win, False, 0, (XEvent *) & ev); @@ -3551,7 +3556,8 @@ doRaiseLower(void *params) if (!ewin) EDBUG_RETURN(0); - gwins = ListWinGroupMembersForEwin(ewin, ACTION_RAISE_LOWER, mode.nogroup, &num); + gwins = + ListWinGroupMembersForEwin(ewin, ACTION_RAISE_LOWER, mode.nogroup, &num); for (j = 0; j < num; j++) { ewin = gwins[j]; @@ -3561,7 +3567,8 @@ doRaiseLower(void *params) { if (desks.desk[ewin->desktop].list[i]->layer == ewin->layer && (desks.desk[ewin->desktop].list[i] == ewin || - !FindEwinInList(desks.desk[ewin->desktop].list[i], gwins, num))) + !FindEwinInList(desks.desk[ewin->desktop].list[i], gwins, + num))) { if (desks.desk[ewin->desktop].list[i] != ewin) raise = 1; @@ -3665,13 +3672,13 @@ doAddToGroup(void *params) if (!current_group) { ChooseGroupDialog(ewin, - "\n There's no current group at the moment. \n" - " The current group is the last one you created, \n" - " and it exists until you create a new one or break \n" - " the latest one. \n\n" - " Pick another group that the window will belong to here: \n\n", - GROUP_SELECT_ALL_EXCEPT_EWIN, - ACTION_ADD_TO_GROUP); + gettext + ("\n There's no current group at the moment. \n" + " The current group is the last one you created, \n" + " and it exists until you create a new one or break \n" + " the latest one. \n\n" + " Pick another group that the window will belong to here: \n\n"), + GROUP_SELECT_ALL_EXCEPT_EWIN, ACTION_ADD_TO_GROUP); EDBUG_RETURN(0); } else @@ -3699,9 +3706,9 @@ doRemoveFromGroup(void *params) EDBUG_RETURN(0); ChooseGroupDialog(ewin, - " Select the group to remove the window from. ", - GROUP_SELECT_EWIN_ONLY, - ACTION_REMOVE_FROM_GROUP); + gettext + (" Select the group to remove the window from. "), + GROUP_SELECT_EWIN_ONLY, ACTION_REMOVE_FROM_GROUP); SaveGroups(); EDBUG_RETURN(0); @@ -3725,9 +3732,8 @@ doBreakGroup(void *params) EDBUG_RETURN(0); ChooseGroupDialog(ewin, - " Select the group to break ", - GROUP_SELECT_EWIN_ONLY, - ACTION_BREAK_GROUP); + gettext(" Select the group to break "), + GROUP_SELECT_EWIN_ONLY, ACTION_BREAK_GROUP); SaveGroups(); EDBUG_RETURN(0); @@ -3752,22 +3758,23 @@ doZoom(void *params) f = fopen(s, "w"); if (f) { - fprintf(f, "You have been warned abotu the dangers of Zoom mode\n"); + fprintf(f, + gettext + ("You have been warned about the dangers of Zoom mode\n")); fclose(f); } - DIALOG_OK("Warning !!!", - "This feature is heavily reliant on a feature of your\n" - "X Server called the Vid Mode Extension. This feature exists\n" - "in XFree86 Servers, but is not a heavily used part of the\n" - "Server and thus isn't tested much.\n" - "\n" - "It is possible your X Server does not deal well with being\n" - "asked to switch modes quickly and it may hang, glitch,\n" - "display artifacts or perhaps simply refuse to work.\n" - "\n" - "This is a warning and will only be displayed this one time.\n" - "If your Server does not behave well then you will probably\n" - "have to avoid using this feature.\n"); + DIALOG_OK(gettext("Warning !!!"), + gettext + ("This feature is heavily reliant on a feature of your\n" + "X Server called the Vid Mode Extension. This feature exists\n" + "in XFree86 Servers, but is not a heavily used part of the\n" + "Server and thus isn't tested much.\n" "\n" + "It is possible your X Server does not deal well with being\n" + "asked to switch modes quickly and it may hang, glitch,\n" + "display artifacts or perhaps simply refuse to work.\n" "\n" + "This is a warning and will only be displayed this one time.\n" + "If your Server does not behave well then you will probably\n" + "have to avoid using this feature.\n")); EDBUG_RETURN(0); } ewin = GetFocusEwin(); @@ -3807,31 +3814,43 @@ initFunctionArray(void) ActionFunctions[ACTION_DESKTOP_LOWER] = (int (*)(void *))(doLowerDesktop); ActionFunctions[ACTION_DESKTOP_DRAG] = (int (*)(void *))(doDragDesktop); ActionFunctions[ACTION_STICK] = (int (*)(void *))(doStick); - ActionFunctions[ACTION_DESKTOP_INPLACE] = (int (*)(void *))(doInplaceDesktop); + ActionFunctions[ACTION_DESKTOP_INPLACE] = + (int (*)(void *))(doInplaceDesktop); ActionFunctions[ACTION_DRAG_BUTTON] = (int (*)(void *))(doDragButtonStart); ActionFunctions[ACTION_FOCUSMODE_SET] = (int (*)(void *))(doFocusModeSet); ActionFunctions[ACTION_MOVEMODE_SET] = (int (*)(void *))(doMoveModeSet); ActionFunctions[ACTION_RESIZEMODE_SET] = (int (*)(void *))(doResizeModeSet); ActionFunctions[ACTION_SLIDEMODE_SET] = (int (*)(void *))(doSlideModeSet); - ActionFunctions[ACTION_CLEANUPSILDE_SET] = (int (*)(void *))(doCleanupSlideSet); + ActionFunctions[ACTION_CLEANUPSILDE_SET] = + (int (*)(void *))(doCleanupSlideSet); ActionFunctions[ACTION_MAPSLIDE_SET] = (int (*)(void *))(doMapSlideSet); ActionFunctions[ACTION_SOUND_SET] = (int (*)(void *))(doSoundSet); - ActionFunctions[ACTION_BUTTONMOVE_RESIST_SET] = (int (*)(void *))(doButtonMoveResistSet); - ActionFunctions[ACTION_DESKTOPBG_TIMEOUT_SET] = (int (*)(void *))(doDesktopBgTimeoutSet); - ActionFunctions[ACTION_MAPSLIDE_SPEED_SET] = (int (*)(void *))(doMapSlideSpeedSet); - ActionFunctions[ACTION_CLEANUPSLIDE_SPEED_SET] = (int (*)(void *))(doCleanupSlideSpeedSet); + ActionFunctions[ACTION_BUTTONMOVE_RESIST_SET] = + (int (*)(void *))(doButtonMoveResistSet); + ActionFunctions[ACTION_DESKTOPBG_TIMEOUT_SET] = + (int (*)(void *))(doDesktopBgTimeoutSet); + ActionFunctions[ACTION_MAPSLIDE_SPEED_SET] = + (int (*)(void *))(doMapSlideSpeedSet); + ActionFunctions[ACTION_CLEANUPSLIDE_SPEED_SET] = + (int (*)(void *))(doCleanupSlideSpeedSet); ActionFunctions[ACTION_DRAGDIR_SET] = (int (*)(void *))(doDragdirSet); - ActionFunctions[ACTION_DRAGBAR_ORDER_SET] = (int (*)(void *))(doDragbarOrderSet); - ActionFunctions[ACTION_DRAGBAR_WIDTH_SET] = (int (*)(void *))(doDragbarWidthSet); - ActionFunctions[ACTION_DRAGBAR_LENGTH_SET] = (int (*)(void *))(doDragbarLengthSet); + ActionFunctions[ACTION_DRAGBAR_ORDER_SET] = + (int (*)(void *))(doDragbarOrderSet); + ActionFunctions[ACTION_DRAGBAR_WIDTH_SET] = + (int (*)(void *))(doDragbarWidthSet); + ActionFunctions[ACTION_DRAGBAR_LENGTH_SET] = + (int (*)(void *))(doDragbarLengthSet); ActionFunctions[ACTION_DESKSLIDE_SET] = (int (*)(void *))(doDeskSlideSet); - ActionFunctions[ACTION_DESKSLIDE_SPEED_SET] = (int (*)(void *))(doDeskSlideSpeedSet); - ActionFunctions[ACTION_HIQUALITYBG_SET] = (int (*)(void *))(doHiQualityBgSet); + ActionFunctions[ACTION_DESKSLIDE_SPEED_SET] = + (int (*)(void *))(doDeskSlideSpeedSet); + ActionFunctions[ACTION_HIQUALITYBG_SET] = + (int (*)(void *))(doHiQualityBgSet); ActionFunctions[ACTION_PLAYSOUNDCLASS] = (int (*)(void *))(doPlaySoundClass); ActionFunctions[ACTION_GOTO_DESK] = (int (*)(void *))(doGotoDesktop); ActionFunctions[ACTION_DESKRAY] = (int (*)(void *))(doDeskray); ActionFunctions[ACTION_AUTOSAVE_SET] = (int (*)(void *))(doAutosaveSet); - ActionFunctions[ACTION_HIDESHOW_BUTTON] = (int (*)(void *))(doHideShowButton); + ActionFunctions[ACTION_HIDESHOW_BUTTON] = + (int (*)(void *))(doHideShowButton); ActionFunctions[ACTION_ICONIFY] = (int (*)(void *))(doIconifyWindow); ActionFunctions[ACTION_SLIDEOUT] = (int (*)(void *))(doSlideout); ActionFunctions[ACTION_SCROLL_WINDOWS] = (int (*)(void *))(doScrollWindows); @@ -3839,10 +3858,13 @@ initFunctionArray(void) ActionFunctions[ACTION_MAX_HEIGHT] = (int (*)(void *))(doMaxH); ActionFunctions[ACTION_MAX_WIDTH] = (int (*)(void *))(doMaxW); ActionFunctions[ACTION_MAX_SIZE] = (int (*)(void *))(doMax); - ActionFunctions[ACTION_SEND_TO_NEXT_DESK] = (int (*)(void *))(doSendToNextDesk); - ActionFunctions[ACTION_SEND_TO_PREV_DESK] = (int (*)(void *))(doSendToPrevDesk); + ActionFunctions[ACTION_SEND_TO_NEXT_DESK] = + (int (*)(void *))(doSendToNextDesk); + ActionFunctions[ACTION_SEND_TO_PREV_DESK] = + (int (*)(void *))(doSendToPrevDesk); ActionFunctions[ACTION_SNAPSHOT] = (int (*)(void *))(doSnapshot); - ActionFunctions[ACTION_SCROLL_CONTAINER] = (int (*)(void *))(doScrollContainer); + ActionFunctions[ACTION_SCROLL_CONTAINER] = + (int (*)(void *))(doScrollContainer); ActionFunctions[ACTION_TOOLTIP_SET] = (int (*)(void *))(doToolTipSet); ActionFunctions[ACTION_FOCUS_NEXT] = (int (*)(void *))(doFocusNext); ActionFunctions[ACTION_FOCUS_PREV] = (int (*)(void *))(doFocusPrev); @@ -3853,37 +3875,48 @@ initFunctionArray(void) ActionFunctions[ACTION_TOGGLE_FIXED] = (int (*)(void *))(doToggleFixedPos); ActionFunctions[ACTION_SET_LAYER] = (int (*)(void *))(doSetLayer); ActionFunctions[ACTION_WARP_POINTER] = (int (*)(void *))(doWarpPointer); - ActionFunctions[ACTION_MOVE_WINDOW_TO_AREA] = (int (*)(void *))(doMoveWinToArea); - ActionFunctions[ACTION_MOVE_WINDOW_BY_AREA] = (int (*)(void *))(doMoveWinByArea); - ActionFunctions[ACTION_SET_WINDOW_BORDER] = (int (*)(void *))(doSetWinBorder); + ActionFunctions[ACTION_MOVE_WINDOW_TO_AREA] = + (int (*)(void *))(doMoveWinToArea); + ActionFunctions[ACTION_MOVE_WINDOW_BY_AREA] = + (int (*)(void *))(doMoveWinByArea); + ActionFunctions[ACTION_SET_WINDOW_BORDER] = + (int (*)(void *))(doSetWinBorder); ActionFunctions[ACTION_LINEAR_AREA_SET] = (int (*)(void *))(doLinearAreaSet); - ActionFunctions[ACTION_LINEAR_MOVE_BY] = (int (*)(void *))(doLinearAreaMoveBy); + ActionFunctions[ACTION_LINEAR_MOVE_BY] = + (int (*)(void *))(doLinearAreaMoveBy); ActionFunctions[ACTION_ABOUT] = (int (*)(void *))(doAbout); ActionFunctions[ACTION_FX] = (int (*)(void *))(doFX); - ActionFunctions[ACTION_MOVE_WINDOW_TO_LINEAR_AREA] = (int (*)(void *))(doMoveWinToLinearArea); - ActionFunctions[ACTION_MOVE_WINDOW_BY_LINEAR_AREA] = (int (*)(void *))(doMoveWinByArea); + ActionFunctions[ACTION_MOVE_WINDOW_TO_LINEAR_AREA] = + (int (*)(void *))(doMoveWinToLinearArea); + ActionFunctions[ACTION_MOVE_WINDOW_BY_LINEAR_AREA] = + (int (*)(void *))(doMoveWinByArea); ActionFunctions[ACTION_SET_PAGER_HIQ] = (int (*)(void *))(doSetPagerHiq); ActionFunctions[ACTION_SET_PAGER_SNAP] = (int (*)(void *))(doSetPagerSnap); ActionFunctions[ACTION_CONFIG] = (int (*)(void *))(doConfigure); - ActionFunctions[ACTION_MOVE_CONSTRAINED] = (int (*)(void *))(doMoveConstrained); + ActionFunctions[ACTION_MOVE_CONSTRAINED] = + (int (*)(void *))(doMoveConstrained); ActionFunctions[ACTION_INSERT_KEYS] = (int (*)(void *))(doInsertKeys); ActionFunctions[ACTION_START_GROUP] = (int (*)(void *))(doStartGroup); ActionFunctions[ACTION_ADD_TO_GROUP] = (int (*)(void *))(doAddToGroup); - ActionFunctions[ACTION_REMOVE_FROM_GROUP] = (int (*)(void *))(doRemoveFromGroup); + ActionFunctions[ACTION_REMOVE_FROM_GROUP] = + (int (*)(void *))(doRemoveFromGroup); ActionFunctions[ACTION_BREAK_GROUP] = (int (*)(void *))(doBreakGroup); ActionFunctions[ACTION_SHOW_HIDE_GROUP] = (int (*)(void *))(doShowHideGroup); ActionFunctions[ACTION_CREATE_ICONBOX] = (int (*)(void *))(doCreateIconbox); ActionFunctions[ACTION_RAISE_LOWER] = (int (*)(void *))(doRaiseLower); ActionFunctions[ACTION_ZOOM] = (int (*)(void *))(doZoom); - ActionFunctions[ACTION_SET_WINDOW_BORDER_NG] = (int (*)(void *))(doSetWinBorderNoGroup); - ActionFunctions[ACTION_ICONIFY_NG] = (int (*)(void *))(doIconifyWindowNoGroup); + ActionFunctions[ACTION_SET_WINDOW_BORDER_NG] = + (int (*)(void *))(doSetWinBorderNoGroup); + ActionFunctions[ACTION_ICONIFY_NG] = + (int (*)(void *))(doIconifyWindowNoGroup); ActionFunctions[ACTION_KILL_NG] = (int (*)(void *))(doKillNoGroup); ActionFunctions[ACTION_MOVE_NG] = (int (*)(void *))(doMoveNoGroup); ActionFunctions[ACTION_RAISE_NG] = (int (*)(void *))(doRaiseNoGroup); ActionFunctions[ACTION_LOWER_NG] = (int (*)(void *))(doLowerNoGroup); ActionFunctions[ACTION_STICK_NG] = (int (*)(void *))(doStickNoGroup); ActionFunctions[ACTION_SHADE_NG] = (int (*)(void *))(doShadeNoGroup); - ActionFunctions[ACTION_RAISE_LOWER_NG] = (int (*)(void *))(doRaiseLowerNoGroup); + ActionFunctions[ACTION_RAISE_LOWER_NG] = + (int (*)(void *))(doRaiseLowerNoGroup); EDBUG_RETURN(0); } diff --git a/src/alert.c b/src/alert.c index 7c48af46..6348549b 100644 --- a/src/alert.c +++ b/src/alert.c @@ -42,7 +42,7 @@ int debug_level; char *call_stack[1024]; void -Alert(char *fmt,...) +Alert(char *fmt, ...) { char text[10240]; va_list ap; @@ -175,13 +175,13 @@ ShowAlert(char *text) str2 = RestartText; str3 = ExitText; if (!title) - title = "Enlightenment Error"; + title = gettext("Enlightenment Error"); if (!str1) - str1 = "Ignore"; + str1 = gettext("Ignore"); if (!str2) - str2 = "Restart"; + str2 = gettext("Restart"); if (!str3) - str3 = "Exit"; + str3 = gettext("Exit"); #define DRAW_BOX_OUT(mdd, mgc, mwin, mx, my, mw, mh) \ if (colorful) { \ @@ -308,7 +308,9 @@ goto CN; \ hih = DisplayHeight(dd, DefaultScreen(dd)); w = (wid - 600) / 2; h = (hih - 440) / 2; - mask = CWBackPixel | CWBorderPixel | CWOverrideRedirect | CWSaveUnder | CWBackingStore; + mask = + CWBackPixel | CWBorderPixel | CWOverrideRedirect | CWSaveUnder | + CWBackingStore; if (colorful) att.background_pixel = cols[1]; else @@ -401,21 +403,24 @@ goto CN; \ h = XTextWidth(xfs, str1, strlen(str1)); w = 10 + (((580 - mh) * 0) / 4); XMoveResizeWindow(dd, b1, w - 5, 440 - 15 - fh, mh + 10, fh + 10); - XSelectInput(dd, b1, ButtonPressMask | ButtonReleaseMask | ExposureMask); + XSelectInput(dd, b1, + ButtonPressMask | ButtonReleaseMask | ExposureMask); } if (sscanf(str2, "%s", line) > 0) { h = XTextWidth(xfs, str2, strlen(str2)); w = 10 + (((580 - mh) * 1) / 2); XMoveResizeWindow(dd, b2, w - 5, 440 - 15 - fh, mh + 10, fh + 10); - XSelectInput(dd, b2, ButtonPressMask | ButtonReleaseMask | ExposureMask); + XSelectInput(dd, b2, + ButtonPressMask | ButtonReleaseMask | ExposureMask); } if (sscanf(str3, "%s", line) > 0) { h = XTextWidth(xfs, str3, strlen(str3)); w = 10 + (((580 - mh) * 2) / 2); XMoveResizeWindow(dd, b3, w - 5, 440 - 15 - fh, mh + 10, fh + 10); - XSelectInput(dd, b3, ButtonPressMask | ButtonReleaseMask | ExposureMask); + XSelectInput(dd, b3, + ButtonPressMask | ButtonReleaseMask | ExposureMask); } XSync(dd, False); XSelectInput(dd, win, KeyPressMask | KeyReleaseMask | ExposureMask); diff --git a/src/areas.c b/src/areas.c index 4ef14b32..339959e3 100644 --- a/src/areas.c +++ b/src/areas.c @@ -171,9 +171,9 @@ SlideWindowsBy(Window * win, int num, int dx, int dy, int speed) int dsec, dusec; double tm; struct _xy - { - int x, y; - } + { + int x, y; + } *xy; EDBUG(5, "SlideWindowsBy"); @@ -224,8 +224,7 @@ SetCurrentArea(int ax, int ay) EDBUG(4, "SetCurrentArea"); if ((mode.mode == MODE_RESIZE) || - (mode.mode == MODE_RESIZE_H) || - (mode.mode == MODE_RESIZE_V)) + (mode.mode == MODE_RESIZE_H) || (mode.mode == MODE_RESIZE_V)) EDBUG_RETURN_; AREA_FIX(ax, ay); @@ -257,15 +256,15 @@ SetCurrentArea(int ax, int ay) if ((mode.mode == MODE_MOVE) && (mode.ewin) && (mode.movemode > 0) && (!mode.moveresize_pending_ewin)) { - lst = ListWinGroupMembersForEwin(mode.ewin, ACTION_MOVE, mode.nogroup, &num); + lst = + ListWinGroupMembersForEwin(mode.ewin, ACTION_MOVE, mode.nogroup, + &num); for (i = 0; i < num; i++) { x = lst[i]->x; y = lst[i]->y; DrawEwinShape(lst[i], mode.movemode, - x, y, - lst[i]->client.w, lst[i]->client.h, - 3); + x, y, lst[i]->client.w, lst[i]->client.h, 3); } Efree(lst); } @@ -307,8 +306,12 @@ SetCurrentArea(int ax, int ay) if (wl) { SlideWindowsBy(wl, wnum, - -(root.w * (ax - desks.desk[desks.current].current_area_x)), - -(root.h * (ay - desks.desk[desks.current].current_area_y)), + -(root.w * + (ax - + desks.desk[desks.current].current_area_x)), + -(root.h * + (ay - + desks.desk[desks.current].current_area_y)), desks.slidespeed); Efree(wl); } @@ -331,8 +334,16 @@ SetCurrentArea(int ax, int ay) mode.flipp = 1; } MoveEwin(lst[i], - lst[i]->x - (root.w * (ax - desks.desk[desks.current].current_area_x)), - lst[i]->y - (root.h * (ay - desks.desk[desks.current].current_area_y))); + lst[i]->x - + (root.w * + (ax - + desks.desk[desks.current]. + current_area_x)), + lst[i]->y - + (root.h * + (ay - + desks.desk[desks.current]. + current_area_y))); if (setflip) mode.flipp = 0; lst[i]->area_x = a1; @@ -360,8 +371,16 @@ SetCurrentArea(int ax, int ay) { GetWinXY(lst[i]->win, &x, &y); EMoveWindow(disp, lst[i]->win, - x - (root.w * (ax - desks.desk[desks.current].current_area_x)), - y - (root.h * (ay - desks.desk[desks.current].current_area_y))); + x - + (root.w * + (ax - + desks.desk[desks.current]. + current_area_x)), + y - + (root.h * + (ay - + desks.desk[desks.current]. + current_area_y))); } } /* if we're not moving it... move it across */ @@ -377,8 +396,16 @@ SetCurrentArea(int ax, int ay) mode.flipp = 1; } MoveEwin(lst[i], - lst[i]->x - (root.w * (ax - desks.desk[desks.current].current_area_x)), - lst[i]->y - (root.h * (ay - desks.desk[desks.current].current_area_y))); + lst[i]->x - + (root.w * + (ax - + desks.desk[desks.current]. + current_area_x)), + lst[i]->y - + (root.h * + (ay - + desks.desk[desks.current]. + current_area_y))); if (setflip) mode.flipp = 0; lst[i]->area_x = a1; @@ -422,12 +449,12 @@ SetCurrentArea(int ax, int ay) if (mode.movemode == 5) DrawEwinShape(lst[i], mode.movemode, x, y, - lst[i]->client.w, lst[i]->client.h, + lst[i]->client.w, lst[i]->client.h, 4); else DrawEwinShape(lst[i], mode.movemode, x, y, - lst[i]->client.w, lst[i]->client.h, + lst[i]->client.w, lst[i]->client.h, 0); if (mode.flipp) { diff --git a/src/arrange.c b/src/arrange.c index b508ffce..c09a3bd1 100644 --- a/src/arrange.c +++ b/src/arrange.c @@ -210,11 +210,13 @@ ArrangeRects(RectBox * fixed, int fixed_count, RectBox * floating, if (sorted[j].x < width) xsize = ArrangeAddToList(&xarray, xsize, sorted[j].x); if ((sorted[j].x + sorted[j].w) < width) - xsize = ArrangeAddToList(&xarray, xsize, sorted[j].x + sorted[j].w); + xsize = + ArrangeAddToList(&xarray, xsize, sorted[j].x + sorted[j].w); if (sorted[j].y < height) ysize = ArrangeAddToList(&yarray, ysize, sorted[j].y); if ((sorted[j].y + sorted[j].h) < height) - ysize = ArrangeAddToList(&yarray, ysize, sorted[j].y + sorted[j].h); + ysize = + ArrangeAddToList(&yarray, ysize, sorted[j].y + sorted[j].h); } /* fill the allocation array */ for (j = 0; j < (xsize - 1) * (ysize - 1); filled[j++] = 0); @@ -250,7 +252,8 @@ ArrangeRects(RectBox * fixed, int fixed_count, RectBox * floating, { for (x = x1; x <= x2; x++) { - if (filled[(y * (xsize - 1)) + x] < (sorted[j].p + 1)) + if (filled[(y * (xsize - 1)) + x] < + (sorted[j].p + 1)) filled[(y * (xsize - 1)) + x] = sorted[j].p + 1; } } @@ -355,11 +358,13 @@ ArrangeRects(RectBox * fixed, int fixed_count, RectBox * floating, if (a1 >= 0) sorted[num_sorted].x = spaces[k].x; else - sorted[num_sorted].x = spaces[k].x + spaces[k].w - floating[i].w; + sorted[num_sorted].x = + spaces[k].x + spaces[k].w - floating[i].w; if (a2 >= 0) sorted[num_sorted].y = spaces[k].y; else - sorted[num_sorted].y = spaces[k].y + spaces[k].h - floating[i].h; + sorted[num_sorted].y = + spaces[k].y + spaces[k].h - floating[i].h; } else { @@ -391,11 +396,13 @@ ArrangeRects(RectBox * fixed, int fixed_count, RectBox * floating, if (sorted[j].x < width) xsize = ArrangeAddToList(&xarray, xsize, sorted[j].x); if ((sorted[j].x + sorted[j].w) < width) - xsize = ArrangeAddToList(&xarray, xsize, sorted[j].x + sorted[j].w); + xsize = + ArrangeAddToList(&xarray, xsize, sorted[j].x + sorted[j].w); if (sorted[j].y < height) ysize = ArrangeAddToList(&yarray, ysize, sorted[j].y); if ((sorted[j].y + sorted[j].h) < height) - ysize = ArrangeAddToList(&yarray, ysize, sorted[j].y + sorted[j].h); + ysize = + ArrangeAddToList(&yarray, ysize, sorted[j].y + sorted[j].h); } /* fill the allocation array */ for (j = 0; j < (xsize - 1) * (ysize - 1); filled[j++] = 0); @@ -431,7 +438,8 @@ ArrangeRects(RectBox * fixed, int fixed_count, RectBox * floating, { for (x = x1; x <= x2; x++) { - if (filled[(y * (xsize - 1)) + x] < (sorted[j].p + 1)) + if (filled[(y * (xsize - 1)) + x] < + (sorted[j].p + 1)) filled[(y * (xsize - 1)) + x] = sorted[j].p + 1; } } @@ -609,8 +617,7 @@ SnapEwin(EWin * ewin, int dx, int dy, int *new_dx, int *new_dy) ody = dy; if (dx < 0) { - if (IN_BELOW(ewin->x + dx, 0, screen_snap_dist) - && (ewin->x >= 0)) + if (IN_BELOW(ewin->x + dx, 0, screen_snap_dist) && (ewin->x >= 0)) dx = 0 - ewin->x; else if (lst) { @@ -621,12 +628,13 @@ SnapEwin(EWin * ewin, int dx, int dy, int *new_dx, int *new_dy) if (((ewin->desktop == lst[i]->desktop) || (lst[i]->sticky)) && (!(lst[i]->floating)) && - (!(lst[i]->iconified)) && - (!(lst[i]->ignorearrange))) + (!(lst[i]->iconified)) && (!(lst[i]->ignorearrange))) { - if (IN_BELOW(ewin->x + dx, lst[i]->x + lst[i]->w - 1, - mode.edge_snap_dist) && - SPANS_COMMON(ewin->y, ewin->h, lst[i]->y, lst[i]->h) + if (IN_BELOW + (ewin->x + dx, lst[i]->x + lst[i]->w - 1, + mode.edge_snap_dist) + && SPANS_COMMON(ewin->y, ewin->h, lst[i]->y, + lst[i]->h) && (ewin->x >= (lst[i]->x + lst[i]->w))) { dx = (lst[i]->x + lst[i]->w) - ewin->x; @@ -653,12 +661,12 @@ SnapEwin(EWin * ewin, int dx, int dy, int *new_dx, int *new_dy) if (((ewin->desktop == lst[i]->desktop) || (lst[i]->sticky)) && (!(lst[i]->floating)) && - (!(lst[i]->iconified)) && - (!(lst[i]->ignorearrange))) + (!(lst[i]->iconified)) && (!(lst[i]->ignorearrange))) { if (IN_ABOVE(ewin->x + ewin->w + dx - 1, lst[i]->x, mode.edge_snap_dist) && - SPANS_COMMON(ewin->y, ewin->h, lst[i]->y, lst[i]->h) + SPANS_COMMON(ewin->y, ewin->h, lst[i]->y, + lst[i]->h) && ((ewin->x + ewin->w) <= lst[i]->x)) { dx = lst[i]->x - (ewin->x + ewin->w); @@ -673,8 +681,7 @@ SnapEwin(EWin * ewin, int dx, int dy, int *new_dx, int *new_dy) } if (dy < 0) { - if (IN_BELOW(ewin->y + dy, 0, screen_snap_dist) - && (ewin->y >= 0)) + if (IN_BELOW(ewin->y + dy, 0, screen_snap_dist) && (ewin->y >= 0)) dy = 0 - ewin->y; else if (lst) { @@ -685,12 +692,13 @@ SnapEwin(EWin * ewin, int dx, int dy, int *new_dx, int *new_dy) if (((ewin->desktop == lst[i]->desktop) || (lst[i]->sticky)) && (!(lst[i]->floating)) && - (!(lst[i]->iconified)) && - (!(lst[i]->ignorearrange))) + (!(lst[i]->iconified)) && (!(lst[i]->ignorearrange))) { - if (IN_BELOW(ewin->y + dy, lst[i]->y + lst[i]->h - 1, - mode.edge_snap_dist) && - SPANS_COMMON(ewin->x, ewin->w, lst[i]->x, lst[i]->w) + if (IN_BELOW + (ewin->y + dy, lst[i]->y + lst[i]->h - 1, + mode.edge_snap_dist) + && SPANS_COMMON(ewin->x, ewin->w, lst[i]->x, + lst[i]->w) && (ewin->y >= (lst[i]->y + lst[i]->h))) { dy = (lst[i]->y + lst[i]->h) - ewin->y; @@ -717,12 +725,12 @@ SnapEwin(EWin * ewin, int dx, int dy, int *new_dx, int *new_dy) if (((ewin->desktop == lst[i]->desktop) || (lst[i]->sticky)) && (!(lst[i]->floating)) && - (!(lst[i]->iconified)) && - (!(lst[i]->ignorearrange))) + (!(lst[i]->iconified)) && (!(lst[i]->ignorearrange))) { if (IN_ABOVE(ewin->y + ewin->h + dy - 1, lst[i]->y, mode.edge_snap_dist) && - SPANS_COMMON(ewin->x, ewin->w, lst[i]->x, lst[i]->w) + SPANS_COMMON(ewin->x, ewin->w, lst[i]->x, + lst[i]->w) && ((ewin->y + ewin->h) <= lst[i]->y)) { dy = lst[i]->y - (ewin->y + ewin->h); @@ -773,10 +781,11 @@ ArrangeEwin(EWin * ewin) { if ((lst[i] != ewin) && (!lst[i]->iconified) && (!lst[i]->ignorearrange) && (lst[i]->layer != 0) && - (((lst[i]->area_x == desks.desk[ewin->desktop].current_area_x) && - (lst[i]->area_y == desks.desk[ewin->desktop].current_area_y) && - (lst[i]->desktop == ewin->desktop)) || - (lst[i]->sticky))) + (((lst + [i]->area_x == desks.desk[ewin->desktop].current_area_x) + && (lst[i]->area_y == + desks.desk[ewin->desktop].current_area_y) + && (lst[i]->desktop == ewin->desktop)) || (lst[i]->sticky))) { fixed[j].data = lst[i]; fixed[j].x = (lst[i])->x; diff --git a/src/arrange.h b/src/arrange.h index 0f026186..dd41fd1b 100644 --- a/src/arrange.h +++ b/src/arrange.h @@ -29,11 +29,11 @@ #define ARRANGE_BY_POSITION 2 typedef struct _rectbox - { - void *data; - int x, y, w, h; - int p; - } +{ + void *data; + int x, y, w, h; + int p; +} RectBox; void ArrangeRects(RectBox * fixed, int fixed_count, diff --git a/src/atoms.c b/src/atoms.c index cdbf5af0..5f5ca941 100644 --- a/src/atoms.c +++ b/src/atoms.c @@ -40,11 +40,7 @@ AtomGet(Window win, Atom to_get, Atom type, int *size) XGetWindowProperty(disp, win, to_get, 0, length, False, type, - &type_ret, - &format_ret, - &num_ret, - &bytes_after, - &retval); + &type_ret, &format_ret, &num_ret, &bytes_after, &retval); if ((retval) && (num_ret > 0) && (format_ret > 0)) { if (format_ret == 32) diff --git a/src/borders.c b/src/borders.c index 72b0c578..dfa4db9b 100644 --- a/src/borders.c +++ b/src/borders.c @@ -85,23 +85,20 @@ DetermineEwinFloat(EWin * ewin, int dx, int dy) ((ewin->x + dx + ewin->w <= root.w) && ((DesktopAt(desks.desk[ewin->desktop].x + ewin->x + dx + ewin->w - 1, - desks.desk[ewin->desktop].y) - != ewin->desktop)))))) + desks.desk[ewin->desktop].y) != ewin->desktop)))))) dofloat = 1; if ((desks.dragdir == 1) && (((ewin->x + dx + ewin->w > root.w) || ((ewin->x + dx >= 0) && ((DesktopAt(desks.desk[ewin->desktop].x + ewin->x + dx, - desks.desk[ewin->desktop].y) - != ewin->desktop)))))) + desks.desk[ewin->desktop].y) != ewin->desktop)))))) dofloat = 1; if ((desks.dragdir == 2) && (((ewin->y + dy < 0) || ((ewin->y + dy + ewin->h <= root.h) && ((DesktopAt(desks.desk[ewin->desktop].x, desks.desk[ewin->desktop].y + ewin->y + dy + - ewin->h - 1) - != ewin->desktop)))))) + ewin->h - 1) != ewin->desktop)))))) dofloat = 1; if ((desks.dragdir == 3) && (((ewin->y + dy + ewin->h > root.h) || @@ -239,7 +236,8 @@ SlideEwinTo(EWin * ewin, int fx, int fy, int tx, int ty, int speed) if (mode.slidemode == 0) EMoveWindow(disp, ewin->win, tmpx, tmpy); else - DrawEwinShape(ewin, mode.slidemode, tmpx, tmpy, tmpw, tmph, firstlast); + DrawEwinShape(ewin, mode.slidemode, tmpx, tmpy, tmpw, tmph, + firstlast); if (firstlast == 0) firstlast = 1; XSync(disp, False); @@ -256,8 +254,7 @@ SlideEwinTo(EWin * ewin, int fx, int fy, int tx, int ty, int speed) if (spd < min) spd = min; } - DrawEwinShape(ewin, mode.slidemode, x, y, ewin->client.w, - ewin->client.h, 2); + DrawEwinShape(ewin, mode.slidemode, x, y, ewin->client.w, ewin->client.h, 2); MoveEwin(ewin, tx, ty); mode.doingslide = 0; if (mode.slidemode > 0) @@ -272,7 +269,7 @@ SlideEwinsTo(EWin ** ewin, int *fx, int *fy, int *tx, int *ty, int num_wins, int speed) { int k, spd, *x = NULL, *y = NULL, min, tmpx, tmpy, tmpw, - tmph, i; + tmph, i; struct timeval timev1, timev2; int dsec, dusec; double tm; @@ -309,7 +306,8 @@ SlideEwinsTo(EWin ** ewin, int *fx, int *fy, int *tx, int *ty, if (ewin[i]->menu) EMoveWindow(disp, ewin[i]->win, tmpx, tmpy); else - DrawEwinShape(ewin[i], 0, tmpx, tmpy, tmpw, tmph, firstlast); + DrawEwinShape(ewin[i], 0, tmpx, tmpy, tmpw, tmph, + firstlast); if (firstlast == 0) firstlast = 1; XSync(disp, False); @@ -421,8 +419,7 @@ AddToFamily(Window win) if (ewin2) ewin2->has_transients++; } - if ((mode.transientsfollowleader) && - (ewin->client.transient)) + if ((mode.transientsfollowleader) && (ewin->client.transient)) { ewin2 = FindItem(NULL, ewin->client.transient_for, LIST_FINDBY_ID, LIST_TYPE_EWIN); @@ -430,8 +427,7 @@ AddToFamily(Window win) { ewin->desktop = ewin2->desktop; if ((mode.switchfortransientmap) && - (ewin->desktop != desks.current) && - (!ewin->iconified)) + (ewin->desktop != desks.current) && (!ewin->iconified)) { GotoDesktop(ewin->desktop); SetCurrentArea(ewin2->area_x, ewin2->area_y); @@ -445,8 +441,7 @@ AddToFamily(Window win) { ewin->desktop = ewin2->desktop; if ((mode.switchfortransientmap) && - (ewin->desktop != desks.current) && - (!ewin->iconified)) + (ewin->desktop != desks.current) && (!ewin->iconified)) { GotoDesktop(ewin->desktop); SetCurrentArea(ewin2->area_x, ewin2->area_y); @@ -468,7 +463,8 @@ AddToFamily(Window win) (!ewin->iconified)) { GotoDesktop(ewin->desktop); - SetCurrentArea(lst[i]->area_x, lst[i]->area_y); + SetCurrentArea(lst[i]->area_x, + lst[i]->area_y); } i = num; } @@ -515,10 +511,13 @@ AddToFamily(Window win) { if ((lst[i] != ewin) && (!lst[i]->iconified) && (!lst[i]->ignorearrange) && (lst[i]->layer != 0) && - (((lst[i]->area_x == desks.desk[ewin->desktop].current_area_x) && - (lst[i]->area_y == desks.desk[ewin->desktop].current_area_y) && - (lst[i]->desktop == ewin->desktop)) || - (lst[i]->sticky))) + (((lst + [i]->area_x == + desks.desk[ewin->desktop].current_area_x) + && (lst[i]->area_y == + desks.desk[ewin->desktop].current_area_y) + && (lst[i]->desktop == ewin->desktop)) + || (lst[i]->sticky))) { fixed[j].data = lst[i]; fixed[j].x = (lst[i])->x; @@ -637,35 +636,39 @@ AddToFamily(Window win) switch (ewin->client.grav) { case NorthWestGravity: + x += (ewin->client.bw * 2); + y += (ewin->client.bw * 2); break; case NorthGravity: - if (ewin->border) - y -= ewin->border->border.top + 2; + y += (ewin->client.bw * 2); break; case NorthEastGravity: + y += (ewin->client.bw * 2); if (ewin->border) - x -= ewin->border->border.left + 2; + x -= ewin->border->border.left + (ewin->client.bw * 2); break; case EastGravity: if (ewin->border) - x -= ewin->border->border.left + 2; + x -= ewin->border->border.left + (ewin->client.bw * 2); break; case SouthEastGravity: if (ewin->border) { - x -= ewin->border->border.left + 2; - y -= ewin->border->border.top + 2; + x -= ewin->border->border.left + (ewin->client.bw * 2); + y -= ewin->border->border.top + (ewin->client.bw * 2); } break; case SouthGravity: if (ewin->border) - y -= ewin->border->border.top + 2; + y -= ewin->border->border.top + (ewin->client.bw * 2); break; case SouthWestGravity: + x += (ewin->client.bw * 2); if (ewin->border) - y -= ewin->border->border.top + 2; + y -= ewin->border->border.top + (ewin->client.bw * 2); break; case WestGravity: + x += (ewin->client.bw * 2); break; case CenterGravity: break; @@ -826,8 +829,7 @@ AddToFamily(Window win) if (mode.all_new_windows_get_focus) { FocusToEWin(ewin); - if ((ewin->desktop != desks.current) && - (!ewin->iconified)) + if ((ewin->desktop != desks.current) && (!ewin->iconified)) { GotoDesktop(ewin->desktop); SetCurrentArea(ewin->area_x, ewin->area_y); @@ -838,8 +840,7 @@ AddToFamily(Window win) if (ewin->client.transient) { FocusToEWin(ewin); - if ((ewin->desktop != desks.current) && - (!ewin->iconified)) + if ((ewin->desktop != desks.current) && (!ewin->iconified)) { GotoDesktop(ewin->desktop); SetCurrentArea(ewin->area_x, ewin->area_y); @@ -853,8 +854,7 @@ AddToFamily(Window win) if ((ewin2) && (mode.focuswin == ewin2)) { FocusToEWin(ewin); - if ((ewin->desktop != desks.current) && - (!ewin->iconified)) + if ((ewin->desktop != desks.current) && (!ewin->iconified)) { GotoDesktop(ewin->desktop); SetCurrentArea(ewin->area_x, ewin->area_y); @@ -1030,13 +1030,13 @@ DrawEwinWinpart(EWin * ewin, int i) { state = ewin->bits[i].state; IclassApply(ewin->border->part[i].iclass, ewin->bits[i].win, - ewin->bits[i].w, ewin->bits[i].h, ewin->active, ewin->sticky, state, - ewin->bits[i].expose); + ewin->bits[i].w, ewin->bits[i].h, ewin->active, + ewin->sticky, state, ewin->bits[i].expose); if (ewin->border->part[i].flags == FLAG_TITLE) TclassApply(ewin->border->part[i].iclass, ewin->bits[i].win, - ewin->bits[i].w, ewin->bits[i].h, ewin->active, ewin->sticky, - state, ewin->bits[i].expose, ewin->border->part[i].tclass, - ewin->client.title); + ewin->bits[i].w, ewin->bits[i].h, ewin->active, + ewin->sticky, state, ewin->bits[i].expose, + ewin->border->part[i].tclass, ewin->client.title); ret = 1; } if ((move) || (resize)) @@ -1059,12 +1059,12 @@ ChangeEwinWinpart(EWin * ewin, int i) EDBUG(3, "ChangeEwinWinpart"); state = ewin->bits[i].state; IclassApply(ewin->border->part[i].iclass, ewin->bits[i].win, - ewin->bits[i].w, ewin->bits[i].h, ewin->active, ewin->sticky, state, - ewin->bits[i].expose); + ewin->bits[i].w, ewin->bits[i].h, ewin->active, ewin->sticky, + state, ewin->bits[i].expose); if (ewin->border->part[i].flags == FLAG_TITLE) TclassApply(ewin->border->part[i].iclass, ewin->bits[i].win, - ewin->bits[i].w, ewin->bits[i].h, ewin->active, ewin->sticky, state, - ewin->bits[i].expose, ewin->border->part[i].tclass, + ewin->bits[i].w, ewin->bits[i].h, ewin->active, ewin->sticky, + state, ewin->bits[i].expose, ewin->border->part[i].tclass, ewin->client.title); if (ewin->bits[i].win) ChangeEwinWinpartContents(ewin, i); @@ -1093,13 +1093,13 @@ DrawEwin(EWin * ewin) { state = ewin->bits[i].state; IclassApply(ewin->border->part[i].iclass, ewin->bits[i].win, - ewin->bits[i].w, ewin->bits[i].h, ewin->active, ewin->sticky, state, - ewin->bits[i].expose); + ewin->bits[i].w, ewin->bits[i].h, ewin->active, + ewin->sticky, state, ewin->bits[i].expose); if (ewin->border->part[i].flags == FLAG_TITLE) TclassApply(ewin->border->part[i].iclass, ewin->bits[i].win, - ewin->bits[i].w, ewin->bits[i].h, ewin->active, ewin->sticky, state, - ewin->bits[i].expose, ewin->border->part[i].tclass, - ewin->client.title); + ewin->bits[i].w, ewin->bits[i].h, ewin->active, + ewin->sticky, state, ewin->bits[i].expose, + ewin->border->part[i].tclass, ewin->client.title); } if (!ewin->shapedone) PropagateShapes(ewin->win); @@ -1123,9 +1123,9 @@ ChangeEwinWinpartContents(EWin * ewin, int i) { case FLAG_TITLE: TclassApply(ewin->border->part[i].iclass, ewin->bits[i].win, - ewin->bits[i].w, ewin->bits[i].h, ewin->active, ewin->sticky, state, - ewin->bits[i].expose, ewin->border->part[i].tclass, - ewin->client.title); + ewin->bits[i].w, ewin->bits[i].h, ewin->active, + ewin->sticky, state, ewin->bits[i].expose, + ewin->border->part[i].tclass, ewin->client.title); break; case FLAG_MINIICON: break; @@ -1170,9 +1170,13 @@ CalcEwinWinpart(EWin * ewin, int i) ox = oy = 0; if (bottomright == -1) { - ox = ((ewin->border->part[i].geom.bottomright.x.percent * ewin->w) >> 10) + + ox = + ((ewin-> + border->part[i].geom.bottomright.x.percent * ewin->w) >> 10) + ewin->border->part[i].geom.bottomright.x.absolute; - oy = ((ewin->border->part[i].geom.bottomright.y.percent * ewin->h) >> 10) + + oy = + ((ewin-> + border->part[i].geom.bottomright.y.percent * ewin->h) >> 10) + ewin->border->part[i].geom.bottomright.y.absolute; } else if (bottomright >= 0) @@ -1224,15 +1228,9 @@ CalcEwinWinpart(EWin * ewin, int i) iclass = ewin->border->part[i].iclass; tclass = ewin->border->part[i].tclass; - TextSize(tclass, \ - ewin->active, \ - ewin->sticky, \ - ewin->bits[i].state, \ - ewin->client.title, \ - &max, \ - &dummyheight, \ - h - (iclass->padding.top + iclass->padding.bottom) \ - ); + TextSize(tclass, \ewin->active, \ewin->sticky, \ewin->bits[i].state, + \ewin->client.title, \&max, \&dummyheight, + \h - (iclass->padding.top + iclass->padding.bottom) \); max += iclass->padding.left + iclass->padding.right; if (w > max) @@ -1376,8 +1374,10 @@ AdoptInternal(Window win, Border * border, int type, void *ptr) * else */ if (!border) { - b = MatchEwinByFunction(ewin, (void *(*)(EWin *, WindowMatch *)) - MatchEwinBorder); + b = + MatchEwinByFunction(ewin, + (void + *(*)(EWin *, WindowMatch *))MatchEwinBorder); if (b) { ewin->border = b; @@ -1539,8 +1539,7 @@ CreateEwin() EMapWindow(disp, ewin->win_container); if ((mode.clickalways) || (mode.focusmode == FOCUS_CLICK)) XGrabButton(disp, AnyButton, 0, ewin->win_container, False, - ButtonPressMask, - GrabModeSync, GrabModeAsync, None, None); + ButtonPressMask, GrabModeSync, GrabModeAsync, None, None); att.event_mask = StructureNotifyMask | PointerMotionMask | ButtonPressMask | ButtonReleaseMask | EnterWindowMask | LeaveWindowMask; @@ -1683,8 +1682,7 @@ SetEwinBorder(EWin * ewin) b = (Border *) FindItem("BORDERLESS", 0, LIST_FINDBY_NAME, LIST_TYPE_BORDER); if (!b) - b = (Border *) FindItem("DEFAULT", 0, LIST_FINDBY_NAME, - LIST_TYPE_BORDER); + b = (Border *) FindItem("DEFAULT", 0, LIST_FINDBY_NAME, LIST_TYPE_BORDER); ewin->border = b; SetFrameProperty(ewin); EDBUG_RETURN_; @@ -1701,8 +1699,7 @@ SetEwinToBorder(EWin * ewin, Border * b) EDBUG(4, "SetEwinToBorder"); if (!b) - b = FindItem("__FALLBACK_BORDER", 0, - LIST_FINDBY_NAME, LIST_TYPE_BORDER); + b = FindItem("__FALLBACK_BORDER", 0, LIST_FINDBY_NAME, LIST_TYPE_BORDER); if ((!b) || (ewin->border == b) || (!ewin->border_new)) EDBUG_RETURN_; @@ -1744,8 +1741,7 @@ SetEwinToBorder(EWin * ewin, Border * b) if (await->iclass) await->iclass->ref_count++; - AddItem(await, b->part[i].iclass->name, 0, - LIST_TYPE_AWAIT_ICLASS); + AddItem(await, b->part[i].iclass->name, 0, LIST_TYPE_AWAIT_ICLASS); } else { @@ -1775,8 +1771,7 @@ SetEwinToBorder(EWin * ewin, Border * b) ButtonPressMask | ButtonReleaseMask | EnterWindowMask | - LeaveWindowMask | - PointerMotionMask); + LeaveWindowMask | PointerMotionMask); } else { @@ -1786,8 +1781,7 @@ SetEwinToBorder(EWin * ewin, Border * b) ButtonPressMask | ButtonReleaseMask | EnterWindowMask | - LeaveWindowMask | - PointerMotionMask); + LeaveWindowMask | PointerMotionMask); } ewin->bits[i].x = -10; ewin->bits[i].y = -10; @@ -1881,9 +1875,11 @@ DetermineEwinArea(EWin * ewin) pax = ewin->area_x; pay = ewin->area_y; ewin->area_x = (ewin->x + (ewin->w / 2) + - (desks.desk[ewin->desktop].current_area_x * root.w)) / root.w; - ewin->area_y = (ewin->y + (ewin->h / 2) + - (desks.desk[ewin->desktop].current_area_y * root.h)) / root.h; + (desks.desk[ewin->desktop].current_area_x * root.w)) / + root.w; + ewin->area_y = + (ewin->y + (ewin->h / 2) + + (desks.desk[ewin->desktop].current_area_y * root.h)) / root.h; if ((pax != ewin->area_x) || (pay != ewin->area_y)) { GNOME_SetEwinArea(ewin); @@ -2206,8 +2202,7 @@ RestackEwin(EWin * ewin) for (i = 0; i < bnum; i++) { if ((blst[i]->desktop == ewin->desktop) && - (blst[i]->ontop == -1) && - (!blst[i]->sticky)) + (blst[i]->ontop == -1) && (!blst[i]->sticky)) { tot++; wl = Erealloc(wl, tot * sizeof(Window)); @@ -2532,12 +2527,16 @@ MinShadeSize(EWin * ewin, int *mw, int *mh) { if (ewin->border->part[i].keep_for_shade) { - if (ewin->border->border.left - ewin->bits[i].x > leftborderwidth) - leftborderwidth = ewin->border->border.left - ewin->bits[i].x; + if (ewin->border->border.left - ewin->bits[i].x > + leftborderwidth) + leftborderwidth = + ewin->border->border.left - ewin->bits[i].x; if ((ewin->bits[i].x + ewin->bits[i].w) - - (ewin->w - ewin->border->border.right) > rightborderwidth) - rightborderwidth = (ewin->bits[i].x + ewin->bits[i].w) - - (ewin->w - ewin->border->border.right); + (ewin->w - ewin->border->border.right) > rightborderwidth) + rightborderwidth = + (ewin->bits[i].x + ewin->bits[i].w) - (ewin->w - + ewin->border-> + border.right); } } ewin->w = rightborderwidth + leftborderwidth; @@ -2554,12 +2553,17 @@ MinShadeSize(EWin * ewin, int *mw, int *mh) { if (ewin->border->part[i].keep_for_shade) { - if (ewin->border->border.top - ewin->bits[i].y > topborderwidth) - topborderwidth = ewin->border->border.top - ewin->bits[i].y; + if (ewin->border->border.top - ewin->bits[i].y > + topborderwidth) + topborderwidth = + ewin->border->border.top - ewin->bits[i].y; if ((ewin->bits[i].y + ewin->bits[i].h) - - (ewin->h - ewin->border->border.bottom) > bottomborderwidth) - bottomborderwidth = (ewin->bits[i].y + ewin->bits[i].h) - - (ewin->h - ewin->border->border.bottom); + (ewin->h - ewin->border->border.bottom) > + bottomborderwidth) + bottomborderwidth = + (ewin->bits[i].y + ewin->bits[i].h) - (ewin->h - + ewin->border-> + border.bottom); } } ewin->h = bottomborderwidth + topborderwidth; @@ -2584,8 +2588,7 @@ InstantShadeEwin(EWin * ewin) if ((ewin->border->border.left == 0) && (ewin->border->border.right == 0) && - (ewin->border->border.top == 0) && - (ewin->border->border.bottom == 0)) + (ewin->border->border.top == 0) && (ewin->border->border.bottom == 0)) EDBUG_RETURN_; if (GetZoomEWin() == ewin) EDBUG_RETURN_; @@ -2601,8 +2604,7 @@ InstantShadeEwin(EWin * ewin) MinShadeSize(ewin, &b, &d); ewin->shaded = 2; ewin->w = b; - EMoveResizeWindow(disp, ewin->win, ewin->x, ewin->y, - ewin->w, ewin->h); + EMoveResizeWindow(disp, ewin->win, ewin->x, ewin->y, ewin->w, ewin->h); EMoveResizeWindow(disp, ewin->win_container, -30, -30, 1, 1); CalcEwinSizes(ewin); XSync(disp, False); @@ -2616,8 +2618,7 @@ InstantShadeEwin(EWin * ewin) ewin->w = b; ewin->x = d; ewin->reqx = d; - EMoveResizeWindow(disp, ewin->win, ewin->x, ewin->y, - ewin->w, ewin->h); + EMoveResizeWindow(disp, ewin->win, ewin->x, ewin->y, ewin->w, ewin->h); EMoveResizeWindow(disp, ewin->win_container, -30, -30, 1, 1); CalcEwinSizes(ewin); XSync(disp, False); @@ -2629,8 +2630,7 @@ InstantShadeEwin(EWin * ewin) b = d; ewin->shaded = 2; ewin->h = b; - EMoveResizeWindow(disp, ewin->win, ewin->x, ewin->y, - ewin->w, ewin->h); + EMoveResizeWindow(disp, ewin->win, ewin->x, ewin->y, ewin->w, ewin->h); EMoveResizeWindow(disp, ewin->win_container, -30, -30, 1, 1); CalcEwinSizes(ewin); XSync(disp, False); @@ -2645,8 +2645,7 @@ InstantShadeEwin(EWin * ewin) ewin->h = b; ewin->y = d; ewin->reqy = d; - EMoveResizeWindow(disp, ewin->win, ewin->x, ewin->y, - ewin->w, ewin->h); + EMoveResizeWindow(disp, ewin->win, ewin->x, ewin->y, ewin->w, ewin->h); EMoveResizeWindow(disp, ewin->win_container, -30, -30, 1, 1); CalcEwinSizes(ewin); XSync(disp, False); @@ -2688,8 +2687,7 @@ InstantUnShadeEwin(EWin * ewin) ewin->border->border.right; ewin->shaded = 0; ewin->w = b; - MoveResizeEwin(ewin, ewin->x, ewin->y, - ewin->client.w, ewin->client.h); + MoveResizeEwin(ewin, ewin->x, ewin->y, ewin->client.w, ewin->client.h); XSync(disp, False); break; case 1: @@ -2698,14 +2696,12 @@ InstantUnShadeEwin(EWin * ewin) b = ewin->client.w + ewin->border->border.left + ewin->border->border.right; d = ewin->x + ewin->w - (ewin->border->border.right - + ewin->client.w - + ewin->border->border.left); + + ewin->client.w + ewin->border->border.left); ewin->shaded = 0; ewin->w = b; ewin->x = d; ewin->reqx = d; - MoveResizeEwin(ewin, ewin->x, ewin->y, - ewin->client.w, ewin->client.h); + MoveResizeEwin(ewin, ewin->x, ewin->y, ewin->client.w, ewin->client.h); XSync(disp, False); break; case 2: @@ -2715,8 +2711,7 @@ InstantUnShadeEwin(EWin * ewin) ewin->border->border.bottom; ewin->shaded = 0; ewin->h = b; - MoveResizeEwin(ewin, ewin->x, ewin->y, - ewin->client.w, ewin->client.h); + MoveResizeEwin(ewin, ewin->x, ewin->y, ewin->client.w, ewin->client.h); XSync(disp, False); break; case 3: @@ -2725,14 +2720,12 @@ InstantUnShadeEwin(EWin * ewin) b = ewin->client.h + ewin->border->border.top + ewin->border->border.bottom; d = ewin->y + ewin->h - (ewin->border->border.bottom - + ewin->client.h - + ewin->border->border.top); + + ewin->client.h + ewin->border->border.top); ewin->shaded = 0; ewin->h = b; ewin->y = d; ewin->reqy = d; - MoveResizeEwin(ewin, ewin->x, ewin->y, - ewin->client.w, ewin->client.h); + MoveResizeEwin(ewin, ewin->x, ewin->y, ewin->client.w, ewin->client.h); XSync(disp, False); break; default: @@ -2764,8 +2757,7 @@ ShadeEwin(EWin * ewin) if ((ewin->border->border.left == 0) && (ewin->border->border.right == 0) && - (ewin->border->border.top == 0) && - (ewin->border->border.bottom == 0)) + (ewin->border->border.top == 0) && (ewin->border->border.bottom == 0)) EDBUG_RETURN_; if (GetZoomEWin() == ewin) EDBUG_RETURN_; @@ -2800,9 +2792,10 @@ ShadeEwin(EWin * ewin) ww = 1; hh = ewin->client.h; EMoveResizeWindow(disp, ewin->win_container, - ewin->border->border.left, ewin->border->border.top, ww, hh); - EMoveResizeWindow(disp, ewin->win, ewin->x, ewin->y, - ewin->w, ewin->h); + ewin->border->border.left, + ewin->border->border.top, ww, hh); + EMoveResizeWindow(disp, ewin->win, ewin->x, ewin->y, ewin->w, + ewin->h); CalcEwinSizes(ewin); if (ewin->client.shaped) EShapeCombineShape(disp, ewin->win_container, ShapeBounding, @@ -2826,8 +2819,7 @@ ShadeEwin(EWin * ewin) ewin->shaded = 2; ewin->w = b; EMoveResizeWindow(disp, ewin->win_container, -30, -30, 1, 1); - EMoveResizeWindow(disp, ewin->win, ewin->x, ewin->y, - ewin->w, ewin->h); + EMoveResizeWindow(disp, ewin->win, ewin->x, ewin->y, ewin->w, ewin->h); CalcEwinSizes(ewin); XSync(disp, False); break; @@ -2855,9 +2847,10 @@ ShadeEwin(EWin * ewin) ww = 1; hh = ewin->client.h; EMoveResizeWindow(disp, ewin->win_container, - ewin->border->border.left, ewin->border->border.top, ww, hh); - EMoveResizeWindow(disp, ewin->win, ewin->x, ewin->y, - ewin->w, ewin->h); + ewin->border->border.left, + ewin->border->border.top, ww, hh); + EMoveResizeWindow(disp, ewin->win, ewin->x, ewin->y, ewin->w, + ewin->h); CalcEwinSizes(ewin); if (ewin->client.shaped) EShapeCombineShape(disp, ewin->win_container, ShapeBounding, @@ -2883,8 +2876,7 @@ ShadeEwin(EWin * ewin) ewin->x = d; ewin->reqx = d; EMoveResizeWindow(disp, ewin->win_container, -30, -30, 1, 1); - EMoveResizeWindow(disp, ewin->win, ewin->x, ewin->y, - ewin->w, ewin->h); + EMoveResizeWindow(disp, ewin->win, ewin->x, ewin->y, ewin->w, ewin->h); CalcEwinSizes(ewin); XSync(disp, False); break; @@ -2908,14 +2900,16 @@ ShadeEwin(EWin * ewin) hh = 1; ww = ewin->client.w; EMoveResizeWindow(disp, ewin->win_container, - ewin->border->border.left, ewin->border->border.top, ww, hh); - EMoveResizeWindow(disp, ewin->win, ewin->x, ewin->y, - ewin->w, ewin->h); + ewin->border->border.left, + ewin->border->border.top, ww, hh); + EMoveResizeWindow(disp, ewin->win, ewin->x, ewin->y, ewin->w, + ewin->h); CalcEwinSizes(ewin); if (ewin->client.shaped) EShapeCombineShape(disp, ewin->win_container, ShapeBounding, 0, -(ewin->client.h - hh), - ewin->client.win, ShapeBounding, ShapeSet); + ewin->client.win, ShapeBounding, + ShapeSet); PropagateShapes(ewin->win); gettimeofday(&timev2, NULL); dsec = timev2.tv_sec - timev1.tv_sec; @@ -2933,8 +2927,7 @@ ShadeEwin(EWin * ewin) ewin->shaded = 2; ewin->h = b; EMoveResizeWindow(disp, ewin->win_container, -30, -30, 1, 1); - EMoveResizeWindow(disp, ewin->win, ewin->x, ewin->y, - ewin->w, ewin->h); + EMoveResizeWindow(disp, ewin->win, ewin->x, ewin->y, ewin->w, ewin->h); CalcEwinSizes(ewin); XSync(disp, False); break; @@ -2963,9 +2956,10 @@ ShadeEwin(EWin * ewin) hh = 1; ww = ewin->client.w; EMoveResizeWindow(disp, ewin->win_container, - ewin->border->border.left, ewin->border->border.top, ww, hh); - EMoveResizeWindow(disp, ewin->win, ewin->x, ewin->y, - ewin->w, ewin->h); + ewin->border->border.left, + ewin->border->border.top, ww, hh); + EMoveResizeWindow(disp, ewin->win, ewin->x, ewin->y, ewin->w, + ewin->h); CalcEwinSizes(ewin); if (ewin->client.shaped) EShapeCombineShape(disp, ewin->win_container, ShapeBounding, @@ -2991,8 +2985,7 @@ ShadeEwin(EWin * ewin) ewin->y = d; ewin->reqy = d; EMoveResizeWindow(disp, ewin->win_container, -30, -30, 1, 1); - EMoveResizeWindow(disp, ewin->win, ewin->x, ewin->y, - ewin->w, ewin->h); + EMoveResizeWindow(disp, ewin->win, ewin->x, ewin->y, ewin->w, ewin->h); CalcEwinSizes(ewin); XSync(disp, False); break; @@ -3047,8 +3040,7 @@ UnShadeEwin(EWin * ewin) ewin->shaded = 0; EMoveResizeWindow(disp, ewin->win_container, ewin->border->border.left, - ewin->border->border.top, - 1, ewin->client.h); + ewin->border->border.top, 1, ewin->client.h); EMoveResizeWindow(disp, ewin->client.win, -ewin->client.w, 0, ewin->client.w, ewin->client.h); EMapWindow(disp, ewin->client.win); @@ -3060,12 +3052,12 @@ UnShadeEwin(EWin * ewin) i = ((a * (1024 - k)) + (b * k)) >> 10; ewin->w = i; EMoveResizeWindow(disp, ewin->win_container, - ewin->border->border.left, ewin->border->border.top, + ewin->border->border.left, + ewin->border->border.top, ewin->w - ewin->border->border.left - - ewin->border->border.right, - ewin->client.h); - EMoveResizeWindow(disp, ewin->win, ewin->x, ewin->y, - ewin->w, ewin->h); + ewin->border->border.right, ewin->client.h); + EMoveResizeWindow(disp, ewin->win, ewin->x, ewin->y, ewin->w, + ewin->h); CalcEwinSizes(ewin); if (ewin->client.shaped) EShapeCombineShape(disp, ewin->win_container, ShapeBounding, @@ -3073,7 +3065,8 @@ UnShadeEwin(EWin * ewin) (ewin->w - ewin->border->border.left - ewin->border->border.right)), 0, - ewin->client.win, ShapeBounding, ShapeSet); + ewin->client.win, ShapeBounding, + ShapeSet); PropagateShapes(ewin->win); gettimeofday(&timev2, NULL); dsec = timev2.tv_sec - timev1.tv_sec; @@ -3090,8 +3083,7 @@ UnShadeEwin(EWin * ewin) } ewin->w = b; queue_up = 1; - MoveResizeEwin(ewin, ewin->x, ewin->y, - ewin->client.w, ewin->client.h); + MoveResizeEwin(ewin, ewin->x, ewin->y, ewin->client.w, ewin->client.h); XSync(disp, False); break; case 1: @@ -3102,13 +3094,11 @@ UnShadeEwin(EWin * ewin) ewin->border->border.right; c = ewin->x; d = ewin->x + ewin->w - (ewin->border->border.right - + ewin->client.w - + ewin->border->border.left); + + ewin->client.w + ewin->border->border.left); ewin->shaded = 0; EMoveResizeWindow(disp, ewin->win_container, ewin->border->border.left, - ewin->border->border.top, - 1, ewin->client.h); + ewin->border->border.top, 1, ewin->client.h); EMoveResizeWindow(disp, ewin->client.win, 0, 0, ewin->client.w, ewin->client.h); EMapWindow(disp, ewin->client.win); @@ -3123,18 +3113,19 @@ UnShadeEwin(EWin * ewin) ewin->x = j; ewin->reqx = j; EMoveResizeWindow(disp, ewin->win_container, - ewin->border->border.left, ewin->border->border.top, + ewin->border->border.left, + ewin->border->border.top, ewin->w - ewin->border->border.left - - ewin->border->border.right, - ewin->client.h); - EMoveResizeWindow(disp, ewin->win, ewin->x, ewin->y, - ewin->w, ewin->h); + ewin->border->border.right, ewin->client.h); + EMoveResizeWindow(disp, ewin->win, ewin->x, ewin->y, ewin->w, + ewin->h); CalcEwinSizes(ewin); if (ewin->client.shaped) EShapeCombineShape(disp, ewin->win_container, ShapeBounding, 0, 0, - ewin->client.win, ShapeBounding, ShapeSet); + ewin->client.win, ShapeBounding, + ShapeSet); PropagateShapes(ewin->win); gettimeofday(&timev2, NULL); dsec = timev2.tv_sec - timev1.tv_sec; @@ -3153,8 +3144,7 @@ UnShadeEwin(EWin * ewin) ewin->x = d; ewin->reqx = d; queue_up = 1; - MoveResizeEwin(ewin, ewin->x, ewin->y, - ewin->client.w, ewin->client.h); + MoveResizeEwin(ewin, ewin->x, ewin->y, ewin->client.w, ewin->client.h); XSync(disp, False); break; case 2: @@ -3166,8 +3156,7 @@ UnShadeEwin(EWin * ewin) ewin->shaded = 0; EMoveResizeWindow(disp, ewin->win_container, ewin->border->border.left, - ewin->border->border.top, - ewin->client.w, 1); + ewin->border->border.top, ewin->client.w, 1); EMoveResizeWindow(disp, ewin->client.win, 0, -ewin->client.h, ewin->client.w, ewin->client.h); EMapWindow(disp, ewin->client.win); @@ -3179,12 +3168,12 @@ UnShadeEwin(EWin * ewin) i = ((a * (1024 - k)) + (b * k)) >> 10; ewin->h = i; EMoveResizeWindow(disp, ewin->win_container, - ewin->border->border.left, ewin->border->border.top, - ewin->client.w, + ewin->border->border.left, + ewin->border->border.top, ewin->client.w, ewin->h - ewin->border->border.top - ewin->border->border.bottom); - EMoveResizeWindow(disp, ewin->win, ewin->x, ewin->y, - ewin->w, ewin->h); + EMoveResizeWindow(disp, ewin->win, ewin->x, ewin->y, ewin->w, + ewin->h); CalcEwinSizes(ewin); if (ewin->client.shaped) EShapeCombineShape(disp, ewin->win_container, ShapeBounding, @@ -3192,7 +3181,8 @@ UnShadeEwin(EWin * ewin) -(ewin->client.h - (ewin->h - ewin->border->border.top - ewin->border->border.bottom)), - ewin->client.win, ShapeBounding, ShapeSet); + ewin->client.win, ShapeBounding, + ShapeSet); PropagateShapes(ewin->win); gettimeofday(&timev2, NULL); dsec = timev2.tv_sec - timev1.tv_sec; @@ -3209,8 +3199,7 @@ UnShadeEwin(EWin * ewin) } ewin->h = b; queue_up = 1; - MoveResizeEwin(ewin, ewin->x, ewin->y, - ewin->client.w, ewin->client.h); + MoveResizeEwin(ewin, ewin->x, ewin->y, ewin->client.w, ewin->client.h); XSync(disp, False); break; case 3: @@ -3221,13 +3210,11 @@ UnShadeEwin(EWin * ewin) ewin->border->border.bottom; c = ewin->y; d = ewin->y + ewin->h - (ewin->border->border.bottom - + ewin->client.h - + ewin->border->border.top); + + ewin->client.h + ewin->border->border.top); ewin->shaded = 0; EMoveResizeWindow(disp, ewin->win_container, ewin->border->border.left, - ewin->border->border.top, - ewin->client.w, 1); + ewin->border->border.top, ewin->client.w, 1); EMoveResizeWindow(disp, ewin->client.win, 0, 0, ewin->client.w, ewin->client.h); EMapWindow(disp, ewin->client.win); @@ -3274,8 +3261,7 @@ UnShadeEwin(EWin * ewin) ewin->y = d; ewin->reqy = d; queue_up = 1; - MoveResizeEwin(ewin, ewin->x, ewin->y, - ewin->client.w, ewin->client.h); + MoveResizeEwin(ewin, ewin->x, ewin->y, ewin->client.w, ewin->client.h); XSync(disp, False); break; default: diff --git a/src/buttons.c b/src/buttons.c index f2e22249..e0e438fe 100644 --- a/src/buttons.c +++ b/src/buttons.c @@ -88,12 +88,13 @@ CreateButton(char *name, ImageClass * iclass, ActionClass * aclass, b->default_show = 1; b->used = 0; b->left = 0; - b->win = ECreateWindow(desks.desk[desk % ENLIGHTENMENT_CONF_NUM_DESKTOPS].win, - -100, -100, 50, 50, 0); + b->win = + ECreateWindow(desks.desk[desk % ENLIGHTENMENT_CONF_NUM_DESKTOPS].win, + -100, -100, 50, 50, 0); XSelectInput(disp, b->win, - ExposureMask | KeyPressMask | KeyReleaseMask | - ButtonPressMask | ButtonReleaseMask | - EnterWindowMask | LeaveWindowMask | PointerMotionMask); + ExposureMask | KeyPressMask | KeyReleaseMask | ButtonPressMask | + ButtonReleaseMask | EnterWindowMask | LeaveWindowMask | + PointerMotionMask); b->x = -1; b->y = -1; b->w = -1; @@ -443,13 +444,15 @@ FindEmptySpotForButton(Button * bt, char *listname, char dirtomove) { for (j = 0; j < num; j++) { - if ((bt->x + bt->w) <= blst[j]->x || bt->x >= (blst[j]->x + blst[j]->w)) + if ((bt->x + bt->w) <= blst[j]->x + || bt->x >= (blst[j]->x + blst[j]->w)) { done = 1; } else { - if ((bt->y + bt->h) <= blst[j]->y || bt->y > (blst[j]->y + blst[j]->h)) + if ((bt->y + bt->h) <= blst[j]->y + || bt->y > (blst[j]->y + blst[j]->h)) done = 1; else done = 0; diff --git a/src/clone.c b/src/clone.c index d48131b3..021eb105 100644 --- a/src/clone.c +++ b/src/clone.c @@ -53,9 +53,7 @@ CloneEwin(EWin * ewin) InputOutput, root.vis, CWOverrideRedirect | CWSaveUnder | CWBackingStore | CWColormap | - CWBackPixmap | CWBackPixel | - CWBorderPixel, - &attr); + CWBackPixmap | CWBackPixel | CWBorderPixel, &attr); pmap = XCreatePixmap(disp, c->win, ewin->w, ewin->h, root.depth); XSetWindowBackgroundPixmap(disp, c->win, pmap); XCopyArea(disp, ewin->win, pmap, gc, 0, 0, ewin->w, ewin->h, 0, 0); diff --git a/src/comms.c b/src/comms.c index b4153ca7..885686b2 100644 --- a/src/comms.c +++ b/src/comms.c @@ -78,8 +78,8 @@ CommsFindCommsWindow() if (comms_win) { XGetWindowProperty(disp, comms_win, a, 0, 14, False, - AnyPropertyType, &ar, &format, &num, &after, - &s); + AnyPropertyType, &ar, &format, &num, + &after, &s); if (s) XFree(s); else @@ -382,8 +382,7 @@ void HandleComms(XEvent * ev) { Client *c; - char *s, w[FILEPATH_LEN_MAX], w2[FILEPATH_LEN_MAX], *s1, - *s2; + char *s, w[FILEPATH_LEN_MAX], w2[FILEPATH_LEN_MAX], *s1, *s2; char sunknown[] = "UNKNOWN"; int unknown; @@ -699,7 +698,8 @@ HandleComms(XEvent * ev) mod = 5; else if (a->modifiers == (ShiftMask | Mod1Mask)) mod = 6; - else if (a->modifiers == (ShiftMask | ControlMask | Mod1Mask)) + else if (a->modifiers == + (ShiftMask | ControlMask | Mod1Mask)) mod = 7; else if (a->modifiers == (Mod2Mask)) mod = 8; @@ -719,13 +719,15 @@ HandleComms(XEvent * ev) mod = 15; else if (a->modifiers == (Mod4Mask | ControlMask)) mod = 16; - else if (a->modifiers == (Mod4Mask | ControlMask | ShiftMask)) + else if (a->modifiers == + (Mod4Mask | ControlMask | ShiftMask)) mod = 17; else if (a->modifiers == (Mod5Mask | ShiftMask)) mod = 18; else if (a->modifiers == (Mod5Mask | ControlMask)) mod = 19; - else if (a->modifiers == (Mod5Mask | ControlMask | ShiftMask)) + else if (a->modifiers == + (Mod5Mask | ControlMask | ShiftMask)) mod = 20; if (a->action->params) Esnprintf(buf2, sizeof(buf2), @@ -737,7 +739,9 @@ HandleComms(XEvent * ev) a->action->Type); if (buf) { - buf = Erealloc(buf, strlen(buf) + strlen(buf2) + 1); + buf = + Erealloc(buf, + strlen(buf) + strlen(buf2) + 1); strcat(buf, buf2); } else @@ -877,8 +881,7 @@ HandleComms(XEvent * ev) bg->pmap = 0; for (i = 0; i < ENLIGHTENMENT_CONF_NUM_DESKTOPS; i++) { - if ((desks.desk[i].bg == bg) && - (desks.desk[i].viewable)) + if ((desks.desk[i].bg == bg) && (desks.desk[i].viewable)) RefreshDesktop(i); } } @@ -1010,7 +1013,9 @@ HandleComms(XEvent * ev) ModifyCMClass(name, rnum, rpx, rpy, gnum, gpx, gpy, bnum, bpx, bpy); else { - cm = CreateCMClass(name, rnum, rpx, rpy, gnum, gpx, gpy, bnum, bpx, bpy); + cm = + CreateCMClass(name, rnum, rpx, rpy, gnum, gpx, gpy, bnum, bpx, + bpy); AddItem(cm, cm->name, 0, LIST_TYPE_COLORMODIFIER); } Efree(name); @@ -1033,7 +1038,9 @@ HandleComms(XEvent * ev) char buf[FILEPATH_LEN_MAX]; sscanf(s, "%*s %1000s", w); - bg = (Background *) FindItem(w, 0, LIST_FINDBY_NAME, LIST_TYPE_BACKGROUND); + bg = + (Background *) FindItem(w, 0, LIST_FINDBY_NAME, + LIST_TYPE_BACKGROUND); Esnprintf(buf, sizeof(buf), "(null)"); if (bg) { @@ -1043,36 +1050,40 @@ HandleComms(XEvent * ev) bg->name, bg->bg.solid.r, bg->bg.solid.g, bg->bg.solid.b, bg->bg.file, bg->bg.tile, bg->bg.keep_aspect, - bg->bg.xjust, bg->bg.yjust, bg->bg.xperc, bg->bg.yperc, - bg->top.file, bg->top.keep_aspect, bg->top.xjust, - bg->top.yjust, bg->top.xperc, bg->top.yperc); + bg->bg.xjust, bg->bg.yjust, bg->bg.xperc, + bg->bg.yperc, bg->top.file, bg->top.keep_aspect, + bg->top.xjust, bg->top.yjust, bg->top.xperc, + bg->top.yperc); else if ((!(bg->bg.file)) && (bg->top.file)) Esnprintf(buf, sizeof(buf), "%s %i %i %i %s %i %i %i %i %i %i %s %i %i %i %i %i", bg->name, bg->bg.solid.r, bg->bg.solid.g, bg->bg.solid.b, "(null)", bg->bg.tile, bg->bg.keep_aspect, - bg->bg.xjust, bg->bg.yjust, bg->bg.xperc, bg->bg.yperc, - bg->top.file, bg->top.keep_aspect, bg->top.xjust, - bg->top.yjust, bg->top.xperc, bg->top.yperc); + bg->bg.xjust, bg->bg.yjust, bg->bg.xperc, + bg->bg.yperc, bg->top.file, bg->top.keep_aspect, + bg->top.xjust, bg->top.yjust, bg->top.xperc, + bg->top.yperc); else if ((bg->bg.file) && (!(bg->top.file))) Esnprintf(buf, sizeof(buf), "%s %i %i %i %s %i %i %i %i %i %i %s %i %i %i %i %i", bg->name, bg->bg.solid.r, bg->bg.solid.g, bg->bg.solid.b, bg->bg.file, bg->bg.tile, bg->bg.keep_aspect, - bg->bg.xjust, bg->bg.yjust, bg->bg.xperc, bg->bg.yperc, - "(null)", bg->top.keep_aspect, bg->top.xjust, - bg->top.yjust, bg->top.xperc, bg->top.yperc); + bg->bg.xjust, bg->bg.yjust, bg->bg.xperc, + bg->bg.yperc, "(null)", bg->top.keep_aspect, + bg->top.xjust, bg->top.yjust, bg->top.xperc, + bg->top.yperc); else if ((!(bg->bg.file)) && (!(bg->top.file))) Esnprintf(buf, sizeof(buf), "%s %i %i %i %s %i %i %i %i %i %i %s %i %i %i %i %i", bg->name, bg->bg.solid.r, bg->bg.solid.g, bg->bg.solid.b, "(null)", bg->bg.tile, bg->bg.keep_aspect, - bg->bg.xjust, bg->bg.yjust, bg->bg.xperc, bg->bg.yperc, - "(null)", bg->top.keep_aspect, bg->top.xjust, - bg->top.yjust, bg->top.xperc, bg->top.yperc); + bg->bg.xjust, bg->bg.yjust, bg->bg.xperc, + bg->bg.yperc, "(null)", bg->top.keep_aspect, + bg->top.xjust, bg->top.yjust, bg->top.xperc, + bg->top.yperc); } CommsSend(c, buf); } @@ -1085,16 +1096,20 @@ HandleComms(XEvent * ev) char *name = NULL, *bgf = NULL, *topf = NULL; int updated = 0, tile, keep_aspect, tkeep_aspect; int xjust, yjust, xperc, yperc, txjust, tyjust, txperc, - typerc; + + typerc; sscanf(s, "%1000s %1000s", tmp, w); - bg = (Background *) FindItem(w, 0, LIST_FINDBY_NAME, LIST_TYPE_BACKGROUND); + bg = + (Background *) FindItem(w, 0, LIST_FINDBY_NAME, + LIST_TYPE_BACKGROUND); icl.r = 99; - i = sscanf(s, "%1000s %1000s %i %i %i %1000s %i %i %i %i %i %i %1000s %i %i %i %i %i", - tmp, tmp, - &(icl.r), &(icl.g), &(icl.b), tmp, &tile, (int *)&keep_aspect, - &xjust, &yjust, &xperc, &yperc, tmp, &tkeep_aspect, &txjust, - &tyjust, &txperc, &typerc); + i = + sscanf(s, + "%1000s %1000s %i %i %i %1000s %i %i %i %i %i %i %1000s %i %i %i %i %i", + tmp, tmp, &(icl.r), &(icl.g), &(icl.b), tmp, &tile, + (int *)&keep_aspect, &xjust, &yjust, &xperc, &yperc, tmp, + &tkeep_aspect, &txjust, &tyjust, &txperc, &typerc); if (bg) { name = duplicate(w); @@ -1216,7 +1231,9 @@ HandleComms(XEvent * ev) Background *bg; sscanf(s, "%*s %x %1000s", (unsigned int *)&win, w); - bg = (Background *) FindItem(w, 0, LIST_FINDBY_NAME, LIST_TYPE_BACKGROUND); + bg = + (Background *) FindItem(w, 0, LIST_FINDBY_NAME, + LIST_TYPE_BACKGROUND); if (bg) SetBackgroundTo(id, win, bg, 0); CommsSend(c, "done"); @@ -1503,8 +1520,10 @@ HandleComms(XEvent * ev) { Button *b; - while ((b = RemoveItem("_DESKTOP_DRAG_CONTROL", 0, LIST_FINDBY_NAME, - LIST_TYPE_BUTTON))) + while ( + (b = + RemoveItem("_DESKTOP_DRAG_CONTROL", 0, LIST_FINDBY_NAME, + LIST_TYPE_BUTTON))) DestroyButton(b); InitDesktopControls(); ShowDesktopControls(); @@ -1569,7 +1588,6 @@ HandleComms(XEvent * ev) "SAVEUNDER: %i\n" "MENUSLIDE: %i\n" "NUMDESKTOPS: %i\n" - "DRAGDIR: %i\n" "DRAGBARWIDTH: %i\n" "DRAGBARORDERING: %i\n" @@ -1577,7 +1595,6 @@ HandleComms(XEvent * ev) "DESKSLIDEIN: %i\n" "DESKSLIDESPEED: %i\n" "HIQUALITYBG: %i\n" - "TRANSIENTSFOLLOWLEADER: %i\n" "SWITCHFORTRANSIENTMAP: %i\n" "SHOWICONS: %i\n" @@ -1591,8 +1608,7 @@ HandleComms(XEvent * ev) "DISPLAY_WARP: %i\n" "WARP_ON_NEXT_FOCUS: %i\n" "WARP_AFTER_NEXT_FOCUS: %i\n" - "EDGE_FLIP_RESISTANCE: %i\n" - , + "EDGE_FLIP_RESISTANCE: %i\n", mode.focusmode, mode.dockdirmode, mode.primaryicondir, mode.movemode, mode.resizemode, mode.slidemode, mode.cleanupslide, mode.mapslide, mode.slidespeedmap, @@ -1603,11 +1619,9 @@ HandleComms(XEvent * ev) mode.autoraise, mode.autoraisetime, mode.dockstartx, mode.dockstarty, mode.save_under, mode.menuslide, mode.numdesktops, - desks.dragdir, desks.dragbar_width, desks.dragbar_ordering, desks.dragbar_length, desks.slidein, desks.slidespeed, desks.hiqualitybg, - mode.transientsfollowleader, mode.switchfortransientmap, mode.showicons, a, b, mode.all_new_windows_get_focus, @@ -1618,9 +1632,7 @@ HandleComms(XEvent * ev) mode.raise_after_next_focus, mode.display_warp, mode.warp_on_next_focus, - mode.warp_after_next_focus, - mode.edge_flip_resistance - ); + mode.warp_after_next_focus, mode.edge_flip_resistance); CommsSend(c, buf); } else if (!strcmp(w, "call_raw")) @@ -1739,56 +1751,7 @@ HandleComms(XEvent * ev) "MWM_TITLE: %5i\n" "MWM_MENU: %5i\n" "MWM_MINIMIZE: %5i\n" - "MWM_MAXIMIZE: %5i\n" - "APP_STATE: %5i\n", - ewin->client.win, - ewin->win, - ewin->x, - ewin->y, - ewin->w, - ewin->h, - ewin->border->name, - ewin->border->border.left, - ewin->border->border.right, - ewin->border->border.top, - ewin->border->border.bottom, - ewin->desktop, - ewin->num_groups, - ewin->docked, - ewin->sticky, - ewin->visible, - ewin->iconified, - ewin->shaded, - ewin->active, - ewin->layer, - ewin->never_use_area, - ewin->floating, - ewin->client.w, - ewin->client.h, - ewin->client.icon_win, - ewin->client.icon_pmap, - ewin->client.icon_mask, - ewin->client.group, - ewin->client.need_input, - ewin->client.transient, - ewin->client.title, - ewin->client.class, - ewin->client.name, - ewin->client.command, - ewin->client.machine, - ewin->client.icon_name, - ewin->client.is_group_leader, - ewin->client.no_resize_h, - ewin->client.no_resize_v, - ewin->client.shaped, - ewin->client.width.min, - ewin->client.height.min, - ewin->client.width.max, - ewin->client.height.max, - ewin->client.base_w, - ewin->client.base_h, - ewin->client.w_inc, - ewin->client.h_inc, + "MWM_MAXIMIZE: %5i\n" "APP_STATE: %5i\n", ewin->client.win, ewin->win, ewin->x, ewin->y, ewin->w, ewin->h, ewin->border->name, ewin->border->border.left, ewin->border->border.right, ewin->border->border.top, ewin->border->border.bottom, ewin->desktop, ewin->num_groups, ewin->docked, ewin->sticky, ewin->visible, ewin->iconified, ewin->shaded, ewin->active, ewin->layer, ewin->never_use_area, ewin->floating, ewin->client.w, ewin->client.h, ewin->client.icon_win, ewin->client.icon_pmap, ewin->client.icon_mask, ewin->client.group, ewin->client.need_input, ewin->client.transient, ewin->client.title, ewin->client.class, ewin->client.name, ewin->client.command, ewin->client.machine, ewin->client.icon_name, ewin->client.is_group_leader, ewin->client.no_resize_h, ewin->client.no_resize_v, ewin->client.shaped, ewin->client.width.min, ewin->client.height.min, ewin->client.width.max, ewin->client.height.max, ewin->client.base_w, ewin->client.base_h, ewin->client.w_inc, ewin->client.h_inc, ewin->client.aspect_min, ewin->client.aspect_max, ewin->client.mwm_decor_border, @@ -1970,7 +1933,9 @@ HandleComms(XEvent * ev) } else if (!strcmp(w, "list_clients")) { - char buf[FILEPATH_LEN_MAX], *ret = NULL, none[] = "-NONE-"; + char buf[FILEPATH_LEN_MAX], *ret = NULL, none[] = + + "-NONE-"; EWin **lst; int i, num; @@ -2248,12 +2213,11 @@ HandleComms(XEvent * ev) { char buf[FILEPATH_LEN_MAX]; - Esnprintf(buf, sizeof(buf), "Received Unknown Client Message.\n" - "Client Name: %s\n" - "Client Version: %s\n" - "Message Contents:\n\n" - "%s\n", s1, s2, s); - DIALOG_OK("E IPC Error", buf); + Esnprintf(buf, sizeof(buf), + gettext("Received Unknown Client Message.\n" + "Client Name: %s\n" "Client Version: %s\n" + "Message Contents:\n\n" "%s\n"), s1, s2, s); + DIALOG_OK(gettext("E IPC Error"), buf); AUDIO_PLAY("SOUND_ERROR_IPC"); } } diff --git a/src/conf.h b/src/conf.h index c3becbab..9b8ac83f 100644 --- a/src/conf.h +++ b/src/conf.h @@ -128,6 +128,7 @@ #define CONTROL_KDESUPPORT 1366 #define CONTROL_CLICK_ALWAYS 1367 #define CONTROL_SHOWROOTTOOLTIP 1368 +#define CONTROL_PAGER_BUTTONS 1369 #define ICLASS_NAME 350 #define ICLASS_NORMAL 351 diff --git a/src/config.c b/src/config.c index 3c7a172b..4697ee8a 100644 --- a/src/config.c +++ b/src/config.c @@ -77,7 +77,9 @@ GetLine(char *s, int size, FILE * f) line_stack_size--; if (line_stack_size > 0) { - line_stack = Erealloc(line_stack, line_stack_size * sizeof(char *)); + line_stack = + + Erealloc(line_stack, line_stack_size * sizeof(char *)); } else { @@ -175,6 +177,7 @@ GetLine(char *s, int size, FILE * f) else line_stack = Erealloc(line_stack, + line_stack_size * sizeof(char *)); line_stack[line_stack_size - 1] = Emalloc(j + 1); @@ -196,6 +199,7 @@ GetLine(char *s, int size, FILE * f) if (line_stack_size > 0) { line_stack = Erealloc(line_stack, + line_stack_size * sizeof(char *)); } @@ -235,13 +239,14 @@ Config_Text(FILE * ConfigFile) else if (i1 == CONFIG_CLOSE) { if (fields != 1) - Alert("CONFIG: ignoring extra data in \"%s\"\n", s); + Alert(gettext("CONFIG: ignoring extra data in \"%s\"\n"), s); } else if (i1 != CONFIG_INVALID) { if (fields != 2) { - Alert("CONFIG: missing required data in \"%s\"\n", s); + Alert(gettext("CONFIG: missing required data in \"%s\"\n"), + s); i1 = CONFIG_INVALID; } } @@ -423,27 +428,24 @@ Config_Text(FILE * ConfigFile) case TEXT_FG_COL: if (ts) sscanf(s, "%*s %i %i %i", - &ts->fg_col.r, - &ts->fg_col.g, - &ts->fg_col.b); + &ts->fg_col.r, &ts->fg_col.g, &ts->fg_col.b); break; case TEXT_BG_COL: if (ts) sscanf(s, "%*s %i %i %i", - &ts->bg_col.r, - &ts->bg_col.g, - &ts->bg_col.b); + &ts->bg_col.r, &ts->bg_col.g, &ts->bg_col.b); break; default: - Alert("Warning: unable to determine what to do with\n" - "the following text in the middle of current Text" - " definition:\n" - "%s\nWill ignore and continue...\n", s); + Alert(gettext("Warning: unable to determine what to do with\n" + "the following text in the middle of current Text" + " definition:\n" + "%s\nWill ignore and continue...\n"), s); } } - Alert("Warning: Configuration appears to have ended before we were\n" - "Done loading a text block. Outcome is likely not good.\n"); + Alert(gettext + ("Warning: Configuration appears to have ended before we were\n" + "Done loading a text block. Outcome is likely not good.\n")); } void @@ -472,13 +474,14 @@ Config_Slideout(FILE * ConfigFile) else if (i1 == CONFIG_CLOSE) { if (fields != 1) - Alert("CONFIG: ignoring extra data in \"%s\"\n", s); + Alert(gettext("CONFIG: ignoring extra data in \"%s\"\n"), s); } else if (i1 != CONFIG_INVALID) { if (fields != 2) { - Alert("CONFIG: missing required data in \"%s\"\n", s); + Alert(gettext("CONFIG: missing required data in \"%s\"\n"), + s); i1 = CONFIG_INVALID; } } @@ -512,15 +515,16 @@ Config_Slideout(FILE * ConfigFile) } break; default: - Alert("Warning: unable to determine what to do with\n" - "the following text in the middle of current Text " - "definition:\n" - "%s\nWill ignore and continue...\n", s); + Alert(gettext("Warning: unable to determine what to do with\n" + "the following text in the middle of current Text " + "definition:\n" + "%s\nWill ignore and continue...\n"), s); } } - Alert("Warning: Configuration appears to have ended before we were\n" - "Done loading a Slideout block. Outcome is likely not good.\n"); + Alert(gettext + ("Warning: Configuration appears to have ended before we were\n" + "Done loading a Slideout block. Outcome is likely not good.\n")); } void @@ -550,7 +554,7 @@ Config_Control(FILE * ConfigFile) if (fields != 1) { RecoverUserConfig(); - Alert("CONFIG: ignoring extra data in \"%s\"\n", s); + Alert(gettext("CONFIG: ignoring extra data in \"%s\"\n"), s); } } else if (i1 != CONFIG_INVALID) @@ -558,7 +562,8 @@ Config_Control(FILE * ConfigFile) if (fields != 2) { RecoverUserConfig(); - Alert("CONFIG: missing required data in \"%s\"\n", s); + Alert(gettext("CONFIG: missing required data in \"%s\"\n"), + s); i1 = CONFIG_INVALID; } } @@ -759,8 +764,7 @@ Config_Control(FILE * ConfigFile) mode.user_bg = i2; break; case CONTROL_DOCKSTARTPOS: - sscanf(s, "%*s %d %d ", &mode.dockstartx, - &mode.dockstarty); + sscanf(s, "%*s %d %d ", &mode.dockstartx, &mode.dockstarty); break; case CONTROL_KDESUPPORT: mode.kde_support = i2; @@ -768,6 +772,10 @@ Config_Control(FILE * ConfigFile) case CONTROL_SHOWROOTTOOLTIP: mode.showroottooltip = i2; break; + case CONTROL_PAGER_BUTTONS: + sscanf(s, "%*s %i %i %i ", &mode.pager_sel_button, + &mode.pager_win_button, &mode.pager_menu_button); + break; case CONTROL_CLICK_ALWAYS: mode.clickalways = i2; break; @@ -786,15 +794,16 @@ Config_Control(FILE * ConfigFile) break; default: RecoverUserConfig(); - Alert("Warning: unable to determine what to do with\n" - "the following text in the middle of current Control " - "definition:\n" - "%s\nWill ignore and continue...\n", s); + Alert(gettext("Warning: unable to determine what to do with\n" + "the following text in the middle of current Control " + "definition:\n" + "%s\nWill ignore and continue...\n"), s); } } RecoverUserConfig(); - Alert("Warning: Configuration appears to have ended before we were\n" - "Done loading a Control block. Outcome is likely not good.\n"); + Alert(gettext + ("Warning: Configuration appears to have ended before we were\n" + "Done loading a Control block. Outcome is likely not good.\n")); } void @@ -819,13 +828,14 @@ Config_MenuStyle(FILE * ConfigFile) else if (i1 == CONFIG_CLOSE) { if (fields != 1) - Alert("CONFIG: ignoring extra data in \"%s\"\n", s); + Alert(gettext("CONFIG: ignoring extra data in \"%s\"\n"), s); } else if (i1 != CONFIG_INVALID) { if (fields != 2) { - Alert("CONFIG: missing required data in \"%s\"\n", s); + Alert(gettext("CONFIG: missing required data in \"%s\"\n"), + s); } } switch (i1) @@ -840,8 +850,7 @@ Config_MenuStyle(FILE * ConfigFile) ms->name = duplicate(s2); break; case CONFIG_TEXT: - ms->tclass = FindItem(s2, 0, - LIST_FINDBY_NAME, LIST_TYPE_TCLASS); + ms->tclass = FindItem(s2, 0, LIST_FINDBY_NAME, LIST_TYPE_TCLASS); if (ms->tclass) ms->tclass->ref_count++; break; @@ -903,8 +912,9 @@ Config_MenuStyle(FILE * ConfigFile) break; } } - Alert("Warning: Configuration appears to have ended before we were\n" - "Done loading a Menu block. Outcome is likely not good.\n"); + Alert(gettext + ("Warning: Configuration appears to have ended before we were\n" + "Done loading a Menu block. Outcome is likely not good.\n")); } void @@ -936,13 +946,14 @@ Config_Menu(FILE * ConfigFile) else if (i1 == CONFIG_CLOSE) { if (fields != 1) - Alert("CONFIG: ignoring extra data in \"%s\"\n", s); + Alert(gettext("CONFIG: ignoring extra data in \"%s\"\n"), s); } else if (i1 != CONFIG_INVALID) { if (fields != 2) { - Alert("CONFIG: missing required data in \"%s\"\n", s); + Alert(gettext("CONFIG: missing required data in \"%s\"\n"), + s); i1 = CONFIG_INVALID; } } @@ -956,14 +967,12 @@ Config_Menu(FILE * ConfigFile) } return; case MENU_PREBUILT: - sscanf(s, "%i %4000s %4000s %4000s %4000s", - &i1, s2, s3, s4, s5); + sscanf(s, "%i %4000s %4000s %4000s %4000s", &i1, s2, s3, s4, s5); if (!strcmp(s4, "dirscan")) { MenuStyle *ms; - ms = FindItem(s3, 0, - LIST_FINDBY_NAME, LIST_TYPE_MENU_STYLE); + ms = FindItem(s3, 0, LIST_FINDBY_NAME, LIST_TYPE_MENU_STYLE); if (!ms) { ms = FindItem("DEFAULT", 0, @@ -981,8 +990,7 @@ Config_Menu(FILE * ConfigFile) { MenuStyle *ms; - ms = FindItem(s3, 0, - LIST_FINDBY_NAME, LIST_TYPE_MENU_STYLE); + ms = FindItem(s3, 0, LIST_FINDBY_NAME, LIST_TYPE_MENU_STYLE); if (ms) { m = CreateMenuFromGnome(s2, ms, s5); @@ -993,8 +1001,7 @@ Config_Menu(FILE * ConfigFile) { MenuStyle *ms; - ms = FindItem(s3, 0, - LIST_FINDBY_NAME, LIST_TYPE_MENU_STYLE); + ms = FindItem(s3, 0, LIST_FINDBY_NAME, LIST_TYPE_MENU_STYLE); if (ms) { m = CreateMenuFromBorders(s2, ms); @@ -1005,8 +1012,7 @@ Config_Menu(FILE * ConfigFile) { MenuStyle *ms; - ms = FindItem(s3, 0, - LIST_FINDBY_NAME, LIST_TYPE_MENU_STYLE); + ms = FindItem(s3, 0, LIST_FINDBY_NAME, LIST_TYPE_MENU_STYLE); if (ms) { m = CreateMenuFromThemes(s2, ms); @@ -1017,8 +1023,7 @@ Config_Menu(FILE * ConfigFile) { MenuStyle *ms; - ms = FindItem(s3, 0, - LIST_FINDBY_NAME, LIST_TYPE_MENU_STYLE); + ms = FindItem(s3, 0, LIST_FINDBY_NAME, LIST_TYPE_MENU_STYLE); if (ms) { m = CreateMenuFromFlatFile(s2, ms, s5, NULL); @@ -1029,8 +1034,7 @@ Config_Menu(FILE * ConfigFile) { MenuStyle *ms; - ms = FindItem(s3, 0, - LIST_FINDBY_NAME, LIST_TYPE_MENU_STYLE); + ms = FindItem(s3, 0, LIST_FINDBY_NAME, LIST_TYPE_MENU_STYLE); if (ms) { m = CreateMenuFromAllEWins(s2, ms); @@ -1041,8 +1045,7 @@ Config_Menu(FILE * ConfigFile) { MenuStyle *ms; - ms = FindItem(s3, 0, - LIST_FINDBY_NAME, LIST_TYPE_MENU_STYLE); + ms = FindItem(s3, 0, LIST_FINDBY_NAME, LIST_TYPE_MENU_STYLE); if (ms) { m = CreateMenuFromDesktops(s2, ms); @@ -1143,8 +1146,9 @@ Config_Menu(FILE * ConfigFile) break; } } - Alert("Warning: Configuration appears to have ended before we were\n" - "Done loading a Menu block. Outcome is likely not good.\n"); + Alert(gettext + ("Warning: Configuration appears to have ended before we were\n" + "Done loading a Menu block. Outcome is likely not good.\n")); } void @@ -1166,7 +1170,7 @@ BorderPartLoad(FILE * ConfigFile, char type, Border * b) int flags = FLAG_BUTTON; char isregion = 0, keepshade = 1; int wmin = 0, wmax = 0, hmin = 0, hmax = 0, torigin = 0, - txp = 0, txa = 0, typ = 0, tya = 0, borigin = 0; + txp = 0, txa = 0, typ = 0, tya = 0, borigin = 0; int bxp = 0, bxa = 0, byp = 0, bya = 0; int fields; @@ -1184,13 +1188,14 @@ BorderPartLoad(FILE * ConfigFile, char type, Border * b) else if (i1 == CONFIG_CLOSE) { if (fields != 1) - Alert("CONFIG: ignoring extra data in \"%s\"\n", s); + Alert(gettext("CONFIG: ignoring extra data in \"%s\"\n"), s); } else if (i1 != CONFIG_INVALID) { if (fields != 2) { - Alert("CONFIG: missing required data in \"%s\"\n", s); + Alert(gettext("CONFIG: missing required data in \"%s\"\n"), + s); i1 = CONFIG_INVALID; } } @@ -1279,8 +1284,9 @@ BorderPartLoad(FILE * ConfigFile, char type, Border * b) break; } } - Alert("Warning: Configuration appears to have ended before we were\n" - "Done loading a BorderPart block. Outcome is likely not good.\n"); + Alert(gettext + ("Warning: Configuration appears to have ended before we were\n" + "Done loading a BorderPart block. Outcome is likely not good.\n")); } void @@ -1311,13 +1317,14 @@ Config_Border(FILE * ConfigFile) else if (i1 == CONFIG_CLOSE) { if (fields != 1) - Alert("CONFIG: ignoring extra data in \"%s\"\n", s); + Alert(gettext("CONFIG: ignoring extra data in \"%s\"\n"), s); } else if (i1 != CONFIG_INVALID) { if (fields != 2) { - Alert("CONFIG: missing required data in \"%s\"\n", s); + Alert(gettext("CONFIG: missing required data in \"%s\"\n"), + s); i1 = CONFIG_INVALID; } } @@ -1368,8 +1375,9 @@ Config_Border(FILE * ConfigFile) } } } - Alert("Warning: Configuration appears to have ended before we were\n" - "Done loading a Main Border block. Outcome is likely not good.\n"); + Alert(gettext + ("Warning: Configuration appears to have ended before we were\n" + "Done loading a Main Border block. Outcome is likely not good.\n")); } void @@ -1392,7 +1400,8 @@ Config_Button(FILE * ConfigFile) int flags = 0, minw = 1, maxw = 99999, minh = 1; int maxh = 99999, xo = 0, yo = 0, xa = 0; int xr = 0, ya = 0, yr = 0, xsr = 0, xsa = 0, ysr = 0, - ysa = 0; + + ysa = 0; char simg = 0; int desk = 0; char sticky = 0; @@ -1415,7 +1424,7 @@ Config_Button(FILE * ConfigFile) if (fields != 1) { RecoverUserConfig(); - Alert("CONFIG: ignoring extra data in \"%s\"\n", s); + Alert(gettext("CONFIG: ignoring extra data in \"%s\"\n"), s); } } else if (i1 != CONFIG_INVALID) @@ -1423,7 +1432,8 @@ Config_Button(FILE * ConfigFile) if (fields != 2) { RecoverUserConfig(); - Alert("CONFIG: missing required data in \"%s\"\n", s); + Alert(gettext("CONFIG: missing required data in \"%s\"\n"), + s); i1 = CONFIG_INVALID; } } @@ -1434,7 +1444,7 @@ Config_Button(FILE * ConfigFile) { bt = CreateButton(name, ic, ac, tc, label, ontop, flags, minw, maxw, minh, maxh, xo, yo, xa, xr, ya, - yr, xsr, xsa, ysr, ysa, simg, desk, sticky); + yr, xsr, xsa, ysr, ysa, simg, desk, sticky); bt->default_show = show; bt->internal = internal; AddItem(bt, bt->name, 0, LIST_TYPE_BUTTON); @@ -1585,8 +1595,9 @@ Config_Button(FILE * ConfigFile) Efree(name); RecoverUserConfig(); - Alert("Warning: Configuration appears to have ended before we were\n" - "Done loading a Button block. Outcome is likely not good.\n"); + Alert(gettext + ("Warning: Configuration appears to have ended before we were\n" + "Done loading a Button block. Outcome is likely not good.\n")); return; } @@ -1629,7 +1640,7 @@ Config_Desktop(FILE * ConfigFile) if (fields != 1) { RecoverUserConfig(); - Alert("CONFIG: ignoring extra data in \"%s\"\n", s); + Alert(gettext("CONFIG: ignoring extra data in \"%s\"\n"), s); } } else if (ii1 != CONFIG_INVALID) @@ -1637,7 +1648,8 @@ Config_Desktop(FILE * ConfigFile) if (fields != 2) { RecoverUserConfig(); - Alert("CONFIG: missing required data in \"%s\"\n", s); + Alert(gettext("CONFIG: missing required data in \"%s\"\n"), + s); ii1 = CONFIG_INVALID; } } @@ -1679,7 +1691,8 @@ Config_Desktop(FILE * ConfigFile) if (ok) { bg = CreateDesktopBG(name, &icl, bg1, i1, i2, - i3, i4, i5, i6, bg2, j1, j2, j3, j4, j5); + i3, i4, i5, i6, bg2, j1, j2, + j3, j4, j5); AddItem(bg, bg->name, 0, LIST_TYPE_BACKGROUND); if (cm) { @@ -1704,8 +1717,7 @@ Config_Desktop(FILE * ConfigFile) break; case CONFIG_CLASSNAME: case BG_NAME: - if ((bg = FindItem(s2, 0, - LIST_FINDBY_NAME, LIST_TYPE_BACKGROUND))) + if ((bg = FindItem(s2, 0, LIST_FINDBY_NAME, LIST_TYPE_BACKGROUND))) { ignore = 1; } @@ -1724,15 +1736,15 @@ Config_Desktop(FILE * ConfigFile) if ((atoi(s2) < ENLIGHTENMENT_CONF_NUM_DESKTOPS) && (atoi(s2) >= 0)) { - if ((desks.desk[atoi(s2)].bg == NULL) || - (mode.user_bg)) + if ((desks.desk[atoi(s2)].bg == NULL) || (mode.user_bg)) { if ((ird) && (atoi(s2) == 0)) bg = NULL; if (!bg) { bg = CreateDesktopBG(name, &icl, bg1, i1, i2, - i3, i4, i5, i6, bg2, j1, j2, j3, j4, j5); + i3, i4, i5, i6, bg2, j1, + j2, j3, j4, j5); AddItem(bg, bg->name, 0, LIST_TYPE_BACKGROUND); } if (!strcmp(bg->name, "NONE")) @@ -1753,8 +1765,7 @@ Config_Desktop(FILE * ConfigFile) if ((atoi(s2) < ENLIGHTENMENT_CONF_NUM_DESKTOPS) && (atoi(s2) >= 0)) { - if ((desks.desk[atoi(s2)].bg == NULL) || - (mode.user_bg)) + if ((desks.desk[atoi(s2)].bg == NULL) || (mode.user_bg)) { if (bg) { @@ -1841,8 +1852,9 @@ Config_Desktop(FILE * ConfigFile) Efree(bg2); RecoverUserConfig(); - Alert("Warning: Configuration appears to have ended before we were\n" - "Done loading a Desktop block. Outcome is likely not good.\n"); + Alert(gettext + ("Warning: Configuration appears to have ended before we were\n" + "Done loading a Desktop block. Outcome is likely not good.\n")); return; } @@ -1876,13 +1888,14 @@ Config_ECursor(FILE * ConfigFile) else if (ii1 == CONFIG_CLOSE) { if (fields != 1) - Alert("CONFIG: ignoring extra data in \"%s\"\n", s); + Alert(gettext("CONFIG: ignoring extra data in \"%s\"\n"), s); } else if (ii1 != CONFIG_INVALID) { if (fields != 2) { - Alert("CONFIG: missing required data in \"%s\"\n", s); + Alert(gettext("CONFIG: missing required data in \"%s\"\n"), + s); } } switch (ii1) @@ -1919,8 +1932,9 @@ Config_ECursor(FILE * ConfigFile) Efree(name); if (file) Efree(file); - Alert("Warning: Configuration appears to have ended before we were\n" - "Done loading a Desktop block. Outcome is likely not good.\n"); + Alert(gettext + ("Warning: Configuration appears to have ended before we were\n" + "Done loading a Desktop block. Outcome is likely not good.\n")); } void @@ -1931,7 +1945,7 @@ Config_Iconbox(FILE * ConfigFile) int i1; int fields; - Alert("Easter Egg! Iconboxes aren't implemented yet.\n"); + Alert(gettext("Easter Egg! Iconboxes aren't implemented yet.\n")); while (GetLine(s, sizeof(s), ConfigFile)) { @@ -1944,13 +1958,14 @@ Config_Iconbox(FILE * ConfigFile) else if (i1 == CONFIG_CLOSE) { if (fields != 1) - Alert("CONFIG: ignoring extra data in \"%s\"\n", s); + Alert(gettext("CONFIG: ignoring extra data in \"%s\"\n"), s); } else if (i1 != CONFIG_INVALID) { if (fields != 2) { - Alert("CONFIG: missing required data in \"%s\"\n", s); + Alert(gettext("CONFIG: missing required data in \"%s\"\n"), + s); } } switch (i1) @@ -1961,8 +1976,9 @@ Config_Iconbox(FILE * ConfigFile) break; } } - Alert("Warning: Configuration appears to have ended before we were\n" - "Done loading an Iconbox block. Outcome is likely not good.\n"); + Alert(gettext + ("Warning: Configuration appears to have ended before we were\n" + "Done loading an Iconbox block. Outcome is likely not good.\n")); } void @@ -1996,8 +2012,9 @@ Config_Sound(FILE * ConfigFile) AddItem(sc, sc->name, 0, LIST_TYPE_SCLASS); } } - Alert("Warning: Configuration appears to have ended before we were\n" - "Done loading an Sound block. Outcome is likely not good.\n"); + Alert(gettext + ("Warning: Configuration appears to have ended before we were\n" + "Done loading an Sound block. Outcome is likely not good.\n")); } void @@ -2037,7 +2054,7 @@ Config_ActionClass(FILE * ConfigFile) if (fields != 1) { RecoverUserConfig(); - Alert("CONFIG: ignoring extra data in \"%s\"\n", s); + Alert(gettext("CONFIG: ignoring extra data in \"%s\"\n"), s); } } else if (i1 != CONFIG_INVALID) @@ -2045,7 +2062,8 @@ Config_ActionClass(FILE * ConfigFile) if (fields != 2) { RecoverUserConfig(); - Alert("CONFIG: missing required data in \"%s\"\n", s); + Alert(gettext("CONFIG: missing required data in \"%s\"\n"), + s); } } switch (i1) @@ -2198,7 +2216,8 @@ Config_ActionClass(FILE * ConfigFile) if (first) { a = CreateAction(event, anymod, - mod, anybut, but, anykey, key, action_tooltipstring); + mod, anybut, but, anykey, key, + action_tooltipstring); /* the correct place to grab an action key */ if (action_tooltipstring) { @@ -2224,10 +2243,11 @@ Config_ActionClass(FILE * ConfigFile) if (action_tooltipstring) { action_tooltipstring = Erealloc(action_tooltipstring, - (strlen(action_tooltipstring) + - strlen(atword(s, 2)) + 2)); + (strlen(action_tooltipstring) + + strlen(atword(s, 2)) + 2)); action_tooltipstring = strcat(action_tooltipstring, "\n"); - action_tooltipstring = strcat(action_tooltipstring, atword(s, 2)); + action_tooltipstring = + strcat(action_tooltipstring, atword(s, 2)); } else action_tooltipstring = duplicate(atword(s, 2)); @@ -2246,10 +2266,10 @@ Config_ActionClass(FILE * ConfigFile) break; default: RecoverUserConfig(); - Alert("Warning: unable to determine what to do with\n" - "the following text in the middle of current" - " ActionClass definition:\n" - "%s\nWill ignore and continue...\n", s); + Alert(gettext("Warning: unable to determine what to do with\n" + "the following text in the middle of current" + " ActionClass definition:\n" + "%s\nWill ignore and continue...\n"), s); break; } } @@ -2260,8 +2280,9 @@ Config_ActionClass(FILE * ConfigFile) if (action_tooltipstring) Efree(action_tooltipstring); RecoverUserConfig(); - Alert("Warning: Configuration appears to have ended before we were\n" - "Done loading an Action Class block. Outcome is likely not good.\n"); + Alert(gettext + ("Warning: Configuration appears to have ended before we were\n" + "Done loading an Action Class block. Outcome is likely not good.\n")); } void @@ -2290,13 +2311,14 @@ Config_ImageClass(FILE * ConfigFile) else if (i1 == CONFIG_CLOSE) { if (fields != 1) - Alert("CONFIG: ignoring extra data in \"%s\"\n", s); + Alert(gettext("CONFIG: ignoring extra data in \"%s\"\n"), s); } else if (i1 != CONFIG_INVALID) { if (fields != 2) { - Alert("CONFIG: missing required data in \"%s\"\n", s); + Alert(gettext("CONFIG: missing required data in \"%s\"\n"), + s); } } switch (i1) @@ -2458,15 +2480,16 @@ Config_ImageClass(FILE * ConfigFile) ICToRead = ic->sticky_active.disabled; break; default: - Alert("Warning: unable to determine what to do with\n" - "the following text in the middle of current " - "ImageClass definition:\n" - "%s\nWill ignore and continue...\n", s); + Alert(gettext("Warning: unable to determine what to do with\n" + "the following text in the middle of current " + "ImageClass definition:\n" + "%s\nWill ignore and continue...\n"), s); break; } } - Alert("Warning: Configuration appears to have ended before we were\n" - "Done loading an ImageClass block. Outcome is likely not good.\n"); + Alert(gettext + ("Warning: Configuration appears to have ended before we were\n" + "Done loading an ImageClass block. Outcome is likely not good.\n")); } void @@ -2505,7 +2528,7 @@ Config_ColorModifier(FILE * ConfigFile) if (fields != 1) { RecoverUserConfig(); - Alert("CONFIG: ignoring extra data in \"%s\"\n", s); + Alert(gettext("CONFIG: ignoring extra data in \"%s\"\n"), s); } } else if (i1 != CONFIG_INVALID) @@ -2513,7 +2536,8 @@ Config_ColorModifier(FILE * ConfigFile) if (fields != 2) { RecoverUserConfig(); - Alert("CONFIG: missing required data in \"%s\"\n", s); + Alert(gettext("CONFIG: missing required data in \"%s\"\n"), + s); } } switch (i1) @@ -2523,8 +2547,7 @@ Config_ColorModifier(FILE * ConfigFile) LIST_TYPE_COLORMODIFIER); if (cm) { - ModifyCMClass(name, rnum, rx, ry, gnum, - gx, gy, bnum, bx, by); + ModifyCMClass(name, rnum, rx, ry, gnum, gx, gy, bnum, bx, by); } else { @@ -2705,10 +2728,10 @@ Config_ColorModifier(FILE * ConfigFile) break; default: RecoverUserConfig(); - Alert("Warning: unable to determine what to do with\n" - "the following text in the middle of current " - " ColorModifier definition:\n" - "%s\nWill ignore and continue...\n", s); + Alert(gettext("Warning: unable to determine what to do with\n" + "the following text in the middle of current " + " ColorModifier definition:\n" + "%s\nWill ignore and continue...\n"), s); break; } } @@ -2729,9 +2752,10 @@ Config_ColorModifier(FILE * ConfigFile) Efree(by); RecoverUserConfig(); - Alert("Warning: Configuration appears to have ended before we were\n" - "Done loading an ColorModifier block.\n" - "Outcome is likely not good.\n"); + Alert(gettext + ("Warning: Configuration appears to have ended before we were\n" + "Done loading an ColorModifier block.\n" + "Outcome is likely not good.\n")); return; } @@ -2768,13 +2792,14 @@ Config_ToolTip(FILE * ConfigFile) else if (i1 == CONFIG_CLOSE) { if (fields != 1) - Alert("CONFIG: ignoring extra data in \"%s\"\n", s); + Alert(gettext("CONFIG: ignoring extra data in \"%s\"\n"), s); } else if (i1 != CONFIG_INVALID) { if (fields != 2) { - Alert("CONFIG: missing required data in \"%s\"\n", s); + Alert(gettext("CONFIG: missing required data in \"%s\"\n"), + s); } } switch (i1) @@ -2796,8 +2821,7 @@ Config_ToolTip(FILE * ConfigFile) break; case TOOLTIP_DRAWICLASS: case CONFIG_IMAGECLASS: - drawiclass = FindItem(s2, 0, LIST_FINDBY_NAME, - LIST_TYPE_ICLASS); + drawiclass = FindItem(s2, 0, LIST_FINDBY_NAME, LIST_TYPE_ICLASS); break; case TOOLTIP_BUBBLE1: bubble1 = FindItem(s2, 0, LIST_FINDBY_NAME, LIST_TYPE_ICLASS); @@ -2822,15 +2846,15 @@ Config_ToolTip(FILE * ConfigFile) LIST_FINDBY_NAME, LIST_TYPE_ICLASS); break; default: - Alert("Warning: unable to determine what to do with\n" - "the following text in the middle of current " - "ToolTip definition:\n" - "%s\nWill ignore and continue...\n", s); + Alert(gettext("Warning: unable to determine what to do with\n" + "the following text in the middle of current " + "ToolTip definition:\n" + "%s\nWill ignore and continue...\n"), s); break; } } - Alert("Warning: Configuration appears to have ended before we were\n" - "Done loading an ToolTip block. Outcome is likely not good.\n"); + Alert(gettext("Warning: Configuration appears to have ended before we were\n" + "Done loading an ToolTip block. Outcome is likely not good.\n")); } @@ -2861,14 +2885,14 @@ Config_FX(FILE * ConfigFile) if (fields != 1) { RecoverUserConfig(); - Alert("CONFIG: ignoring extra data in \"%s\"\n", s); + Alert(gettext("CONFIG: ignoring extra data in \"%s\"\n"), s); } return; } } RecoverUserConfig(); - Alert("Warning: Configuration appears to have ended before we were\n" - "Done loading an FX block. Outcome is likely not good.\n"); + Alert(gettext("Warning: Configuration appears to have ended before we were\n" + "Done loading an FX block. Outcome is likely not good.\n")); } void @@ -2903,16 +2927,16 @@ Config_Extras(FILE * ConfigFile) return; break; default: - Alert("Warning: unable to determine what to do with\n" - "the following text in the middle of current " - "Extras definition:\n" - "%s\nWill ignore and continue...\n", s); + Alert(gettext("Warning: unable to determine what to do with\n" + "the following text in the middle of current " + "Extras definition:\n" + "%s\nWill ignore and continue...\n"), s); break; } } RecoverUserConfig(); - Alert("Warning: Configuration appears to have ended before we were\n" - "Done loading an Extras block. Outcome is likely not good.\n"); + Alert(gettext("Warning: Configuration appears to have ended before we were\n" + "Done loading an Extras block. Outcome is likely not good.\n")); } void @@ -2938,7 +2962,7 @@ Config_Ibox(FILE * ConfigFile) else if (i1 == CONFIG_CLOSE) { if (fields != 1) - Alert("CONFIG: ignoring extra data in \"%s\"\n", s); + Alert(gettext("CONFIG: ignoring extra data in \"%s\"\n"), s); } switch (i1) { @@ -3001,16 +3025,16 @@ Config_Ibox(FILE * ConfigFile) return; break; default: - Alert("Warning: unable to determine what to do with\n" - "the following text in the middle of current " - "Iconbox definition:\n" - "%s\nWill ignore and continue...\n", s); + Alert(gettext("Warning: unable to determine what to do with\n" + "the following text in the middle of current " + "Iconbox definition:\n" + "%s\nWill ignore and continue...\n"), s); break; } } RecoverUserConfig(); - Alert("Warning: Configuration appears to have ended before we were\n" - "Done loading an Iconbox block. Outcome is likely not good.\n"); + Alert(gettext("Warning: Configuration appears to have ended before we were\n" + "Done loading an Iconbox block. Outcome is likely not good.\n")); } void @@ -3039,13 +3063,14 @@ Config_WindowMatch(FILE * ConfigFile) else if (i1 == CONFIG_CLOSE) { if (fields != 1) - Alert("CONFIG: ignoring extra data in \"%s\"\n", s); + Alert(gettext("CONFIG: ignoring extra data in \"%s\"\n"), s); } else if (i1 != CONFIG_INVALID) { if (fields != 2) { - Alert("CONFIG: missing required data in \"%s\"\n", s); + Alert(gettext("CONFIG: missing required data in \"%s\"\n"), + s); } } switch (i1) @@ -3058,8 +3083,7 @@ Config_WindowMatch(FILE * ConfigFile) break; case CONFIG_BORDER: case WINDOWMATCH_USEBORDER: - bm->border = FindItem(s2, 0, - LIST_FINDBY_NAME, LIST_TYPE_BORDER); + bm->border = FindItem(s2, 0, LIST_FINDBY_NAME, LIST_TYPE_BORDER); if (bm->border) bm->border->ref_count++; break; @@ -3078,8 +3102,7 @@ Config_WindowMatch(FILE * ConfigFile) break; case WINDOWMATCH_ICON: case CONFIG_ICONBOX: - bm->icon = FindItem(s2, 0, - LIST_FINDBY_NAME, LIST_TYPE_ICLASS); + bm->icon = FindItem(s2, 0, LIST_FINDBY_NAME, LIST_TYPE_ICLASS); if (bm->icon) bm->icon->ref_count++; break; @@ -3117,15 +3140,15 @@ Config_WindowMatch(FILE * ConfigFile) bm->make_sticky = atoi(s2); break; default: - Alert("Warning: unable to determine what to do with\n" - "the following text in the middle of current " - "WindowMatch definition:\n" - "%s\nWill ignore and continue...\n", s); + Alert(gettext("Warning: unable to determine what to do with\n" + "the following text in the middle of current " + "WindowMatch definition:\n" + "%s\nWill ignore and continue...\n"), s); break; } } - Alert("Warning: Configuration appears to have ended before we were\n" - "Done loading an WindowMatch block. Outcome is likely not good.\n"); + Alert(gettext("Warning: Configuration appears to have ended before we were\n" + "Done loading an WindowMatch block. Outcome is likely not good.\n")); } int @@ -3173,14 +3196,14 @@ OpenConfigFileForReading(char *path, char preprocess) if ((!have_epp) && (!(isfile(epp_path)) && (canexec(epp_path)))) { - Alert("Help! Cannot find epp!\n" - "Enlightenment is looking for epp here:\n" - "%s\n" - "This is a FATAL ERROR.\n" - "This is probably due to either the program not existing or\n" - "it not being able to be executed by you.\n", + Alert(gettext("Help! Cannot find epp!\n" + "Enlightenment is looking for epp here:\n" + "%s\n" + "This is a FATAL ERROR.\n" + "This is probably due to either the program not existing or\n" + "it not being able to be executed by you.\n"), epp_path); - doExit("error"); + doExit(gettext("error")); } else have_epp = 1; @@ -3200,26 +3223,20 @@ OpenConfigFileForReading(char *path, char preprocess) s[i] = '.'; i++; } - Esnprintf(execline, sizeof(execline), - "%s " - "-P " - "-nostdinc " - "-undef " + Esnprintf(execline, sizeof(execline), "%s " "-P " "-nostdinc " "-undef " #ifndef __EMX__ "-include %s/config/definitions " "-I%s " "-I%s/config " "-D ENLIGHTENMENT_VERSION=%s " - "-D ENLIGHTENMENT_ROOT=%s " - "-D ENLIGHTENMENT_BIN=%s " + "-D ENLIGHTENMENT_ROOT=%s " "-D ENLIGHTENMENT_BIN=%s " #else "-include %s%s/config/definitions " "-I%s " "-I%s%s/config " "-D ENLIGHTENMENT_VERSION=%s " "-D ENLIGHTENMENT_ROOT=%s%s " - "-D ENLIGHTENMENT_BIN=%s%s " - "-D X11ROOT=%s " + "-D ENLIGHTENMENT_BIN=%s%s " "-D X11ROOT=%s " #endif "-D ENLIGHTENMENT_THEME=%s " "-D SCREEN_RESOLUTION_%ix%i=1 " @@ -3240,17 +3257,14 @@ OpenConfigFileForReading(char *path, char preprocess) x11root, ENLIGHTENMENT_ROOT, ENLIGHTENMENT_VERSION, x11root, ENLIGHTENMENT_ROOT, - x11root, ENLIGHTENMENT_BIN, - x11root, + x11root, ENLIGHTENMENT_BIN, x11root, #endif themepath, root.w, root.h, root.w, root.h, root.depth, - def_user, def_home, def_shell, - path, UserEDir(), s); + def_user, def_home, def_shell, path, UserEDir(), s); system(execline); Esnprintf(execline, sizeof(execline), - "%s/cached/cfg/%s.preparsed", - UserEDir(), s); + "%s/cached/cfg/%s.preparsed", UserEDir(), s); #ifndef __EMX__ fpin = fopen(execline, "r"); #else @@ -3283,7 +3297,8 @@ LoadConfigFile(char *f) { FILE *ConfigFile; char s[FILEPATH_LEN_MAX], s2[FILEPATH_LEN_MAX], *file, - *ppfile; + + *ppfile; int i; char notheme = 0; @@ -3371,7 +3386,7 @@ LoadOpenConfigFile(FILE * ConfigFile) if (fields != 1) { RecoverUserConfig(); - Alert("CONFIG: ignoring extra data in \"%s\"\n", s); + Alert(gettext("CONFIG: ignoring extra data in \"%s\"\n"), s); } } else if (i1 != CONFIG_INVALID) @@ -3379,7 +3394,8 @@ LoadOpenConfigFile(FILE * ConfigFile) if (fields != 2) { RecoverUserConfig(); - Alert("CONFIG: missing required data in \"%s\"\n", s); + Alert(gettext("CONFIG: missing required data in \"%s\"\n"), + s); } } if (i2 == CONFIG_OPEN) @@ -3388,34 +3404,33 @@ LoadOpenConfigFile(FILE * ConfigFile) { if (!is_autosave) { - ASSIGN_ALERT("Theme versioning ERROR", - "Restart with Defaults", - " ", - "Abort and Exit"); - Alert("ERROR:\n" - "\n" - "The configuration for the theme you are " - "running is\n" - "incompatible. It's config revision is %i. " - "It needs to\n" - "be marked as being revision %i\n" - "\n" - "Please contact the theme author or " - "maintainer and\n" - "inform them that in order for their theme " - "to function\n" - "with this version of Enlightenment, they " - "have to\n" - "update it to the current settings, and " - "then match\n" - "the revision number.\n" - "\n" - "If the theme revision is higher than " - "Enlightenment's\n" - "it may be that you haven't upgraded " - "Enlightenment for\n" - "a while and this theme takes advantages of new\n" - "features in Enlightenment in new versions.\n", + ASSIGN_ALERT(gettext("Theme versioning ERROR"), + gettext("Restart with Defaults"), + " ", gettext("Abort and Exit")); + Alert(gettext("ERROR:\n" + "\n" + "The configuration for the theme you are " + "running is\n" + "incompatible. It's config revision is %i. " + "It needs to\n" + "be marked as being revision %i\n" + "\n" + "Please contact the theme author or " + "maintainer and\n" + "inform them that in order for their theme " + "to function\n" + "with this version of Enlightenment, they " + "have to\n" + "update it to the current settings, and " + "then match\n" + "the revision number.\n" + "\n" + "If the theme revision is higher than " + "Enlightenment's\n" + "it may be that you haven't upgraded " + "Enlightenment for\n" + "a while and this theme takes advantages of new\n" + "features in Enlightenment in new versions.\n"), e_cfg_ver, min_e_cfg_ver); RESET_ALERT; doExit("restart_theme DEFAULT"); @@ -3423,25 +3438,24 @@ LoadOpenConfigFile(FILE * ConfigFile) else { mode.autosave = 0; - ASSIGN_ALERT("User Config Version ERROR", - "Restart with Defaults", - " ", - "Abort and Exit"); - Alert("ERROR:\n" - "\n" - "The settings you are using are " - "incompatible with\n" - "this version of Enlightenment.\n" - "It's revision is %i It needs to be revision " - "%i to\n" - "be compatible.\n" - "\n" - "If you just upgraded to a new version of E\n" - "Restarting with Defaults will remove your current\n" - "user preferences and start cleanly with system\n" - "defaults. You can then modify your " - "configuration to\n" - "your liking again safely.\n", + ASSIGN_ALERT(gettext("User Config Version ERROR"), + gettext("Restart with Defaults"), + " ", gettext("Abort and Exit")); + Alert(gettext("ERROR:\n" + "\n" + "The settings you are using are " + "incompatible with\n" + "this version of Enlightenment.\n" + "It's revision is %i It needs to be revision " + "%i to\n" + "be compatible.\n" + "\n" + "If you just upgraded to a new version of E\n" + "Restarting with Defaults will remove your current\n" + "user preferences and start cleanly with system\n" + "defaults. You can then modify your " + "configuration to\n" + "your liking again safely.\n"), e_cfg_ver, min_e_cfg_ver); RESET_ALERT; doExit("restart"); @@ -3560,7 +3574,8 @@ FindFile(char *file) #ifndef __EMX__ Esnprintf(s, sizeof(s), "%s/config/%s", ENLIGHTENMENT_ROOT, file); #else - Esnprintf(s, sizeof(s), "%s/config/%s", __XOS2RedirRoot(ENLIGHTENMENT_ROOT), file); + Esnprintf(s, sizeof(s), "%s/config/%s", __XOS2RedirRoot(ENLIGHTENMENT_ROOT), + file); #endif if (isfile(s)) EDBUG_RETURN(duplicate(s)); @@ -3599,7 +3614,8 @@ FindNoThemeFile(char *file) #ifndef __EMX__ Esnprintf(s, sizeof(s), "%s/config/%s", ENLIGHTENMENT_ROOT, file); #else - Esnprintf(s, sizeof(s), "%s/config/%s", __XOS2RedirRoot(ENLIGHTENMENT_ROOT), file); + Esnprintf(s, sizeof(s), "%s/config/%s", __XOS2RedirRoot(ENLIGHTENMENT_ROOT), + file); #endif if (isfile(s)) EDBUG_RETURN(duplicate(s)); @@ -3639,43 +3655,40 @@ LoadEConfig(char *themelocation) rm(ss); mv(s, ss); if (!isfile(ss)) - Alert("WARNING!\n" - "There was an error writing the file:\n" - "%s\n" - "This may be due to lack of disk space, quota or\n" - "filesystem permissions.\n", - ss - ); + Alert(gettext("WARNING!\n" + "There was an error writing the file:\n" + "%s\n" + "This may be due to lack of disk space, quota or\n" + "filesystem permissions.\n"), ss); } strcpy(themename, themelocation); theme = FindTheme(themelocation); if (!theme) { - Alert("Enlightenment has just experienced some major problems in\n" - "attempting to load the theme you specified or the default\n" - "configuration directory:\n" - "%s/config/\n" - "This will prevent Enlightenment from loading any " - "configuration\n" - "files at all.\n" - "Since this couldn't be found Enlightenment is probably not\n" - "going to find any configuration files anywhere on your\n" - "system, and so it will have almost no configuration loaded\n" - "when it starts up. This is most likely the sign of a bad\n" - "installation of Enlightenment if this directory is missing.\n" - "The likely causes are that the package was improperly built,\n" - "if a binary package, or 'make install' hasn't been typed\n" - "or during the installation the directory above was not\n" - "able to be copied over for installation perhaps due to\n" - "permissions or lack of disk space. It also could be that the\n" - "config directory has been inadvertently deleted since\n" - "installation.\n" - "This is a serious problem and should be rectified immediately\n" - "Please contact your system administrator or package " - "maintainer.\n" - "If you are the administrator of your own system please\n" - "consult the documentation that came with Enlightenment for\n" - "additional information.\n", ENLIGHTENMENT_ROOT); + Alert(gettext + ("Enlightenment has just experienced some major problems in\n" + "attempting to load the theme you specified or the default\n" + "configuration directory:\n" "%s/config/\n" + "This will prevent Enlightenment from loading any " + "configuration\n" "files at all.\n" + "Since this couldn't be found Enlightenment is probably not\n" + "going to find any configuration files anywhere on your\n" + "system, and so it will have almost no configuration loaded\n" + "when it starts up. This is most likely the sign of a bad\n" + "installation of Enlightenment if this directory is missing.\n" + "The likely causes are that the package was improperly built,\n" + "if a binary package, or 'make install' hasn't been typed\n" + "or during the installation the directory above was not\n" + "able to be copied over for installation perhaps due to\n" + "permissions or lack of disk space. It also could be that the\n" + "config directory has been inadvertently deleted since\n" + "installation.\n" + "This is a serious problem and should be rectified immediately\n" + "Please contact your system administrator or package " + "maintainer.\n" + "If you are the administrator of your own system please\n" + "consult the documentation that came with Enlightenment for\n" + "additional information.\n"), ENLIGHTENMENT_ROOT); EDBUG_RETURN(0); } strcpy(themepath, theme); @@ -3684,8 +3697,7 @@ LoadEConfig(char *themelocation) { Progressbar *p = NULL; int i; - char *config_files[] = - { + char *config_files[] = { "init.cfg", "control.cfg", "textclasses.cfg", @@ -3719,7 +3731,9 @@ LoadEConfig(char *themelocation) CreateStartupDisplay(1); if ((i > 0) && (!p) && (!init_win_ext)) { - p = CreateProgressbar("Enlightenment Starting...", 400, 16); + p = + CreateProgressbar(gettext("Enlightenment Starting..."), 400, + 16); if (p) ShowProgressbar(p); } @@ -3740,7 +3754,10 @@ LoadEConfig(char *themelocation) else LoadConfigFile(config_files[i]); if (p) - SetProgressbar(p, (i * 100) / (int)(sizeof(config_files) / sizeof(char *))); + SetProgressbar(p, + + (i * 100) / (int)(sizeof(config_files) / + sizeof(char *))); } if (p) @@ -3838,6 +3855,8 @@ SaveUserControlConfig(FILE * autosavefile) fprintf(autosavefile, "1366 %i\n", (int)mode.kde_support); fprintf(autosavefile, "1367 %i\n", (int)mode.clickalways); fprintf(autosavefile, "1368 %i\n", (int)mode.showroottooltip); + fprintf(autosavefile, "1369 %i %i %i\n", (int)mode.pager_sel_button, + (int)mode.pager_win_button, (int)mode.pager_menu_button); fprintf(autosavefile, "1000\n"); fprintf(autosavefile, "1001 0\n"); if (mode.keybinds_changed) @@ -3853,8 +3872,8 @@ SaveUserControlConfig(FILE * autosavefile) for (i = 0; i < ac->num; i++) { aa = ac->list[i]; - if ((aa) && (aa->action) && (aa->event == EVENT_KEY_DOWN) && - (aa->key_str)) + if ((aa) && (aa->action) && (aa->event == EVENT_KEY_DOWN) + && (aa->key_str)) { int mod; @@ -3913,10 +3932,12 @@ SaveUserControlConfig(FILE * autosavefile) fprintf(autosavefile, "101 %i\n", mod); /* action */ if (aa->action->params) - fprintf(autosavefile, "104 %i %s\n", aa->action->Type, + fprintf(autosavefile, "104 %i %s\n", + aa->action->Type, (char *)aa->action->params); else - fprintf(autosavefile, "104 %i\n", aa->action->Type); + fprintf(autosavefile, "104 %i\n", + aa->action->Type); } } fprintf(autosavefile, "1000\n"); @@ -4014,18 +4035,26 @@ SaveUserControlConfig(FILE * autosavefile) { fprintf(autosavefile, "19 999\n"); fprintf(autosavefile, "100 %s\n", iblist[i]->name); - fprintf(autosavefile, "200 %i\n", (int)iblist[i]->orientation); + fprintf(autosavefile, "200 %i\n", + (int)iblist[i]->orientation); fprintf(autosavefile, "2001 %i\n", (int)iblist[i]->nobg); fprintf(autosavefile, "2002 %i\n", (int)iblist[i]->shownames); fprintf(autosavefile, "2003 %i\n", iblist[i]->iconsize); fprintf(autosavefile, "2004 %i\n", (int)iblist[i]->icon_mode); - fprintf(autosavefile, "2005 %i\n", (int)iblist[i]->scrollbar_side); - fprintf(autosavefile, "2006 %i\n", (int)iblist[i]->arrow_side); - fprintf(autosavefile, "2007 %i\n", (int)iblist[i]->auto_resize); - fprintf(autosavefile, "2008 %i\n", (int)iblist[i]->draw_icon_base); - fprintf(autosavefile, "2009 %i\n", (int)iblist[i]->scrollbar_hide); - fprintf(autosavefile, "2010 %i\n", (int)iblist[i]->cover_hide); - fprintf(autosavefile, "2011 %i\n", (int)iblist[i]->auto_resize_anchor); + fprintf(autosavefile, "2005 %i\n", + (int)iblist[i]->scrollbar_side); + fprintf(autosavefile, "2006 %i\n", + (int)iblist[i]->arrow_side); + fprintf(autosavefile, "2007 %i\n", + (int)iblist[i]->auto_resize); + fprintf(autosavefile, "2008 %i\n", + (int)iblist[i]->draw_icon_base); + fprintf(autosavefile, "2009 %i\n", + (int)iblist[i]->scrollbar_hide); + fprintf(autosavefile, "2010 %i\n", + (int)iblist[i]->cover_hide); + fprintf(autosavefile, "2011 %i\n", + (int)iblist[i]->auto_resize_anchor); fprintf(autosavefile, "2012 %i\n", (int)iblist[i]->animate); fprintf(autosavefile, "1000\n"); } @@ -4131,19 +4160,17 @@ RecoverUserConfig(void) { if (is_autosave) { - ASSIGN_ALERT("Recover system config?", - "Yes, Attempt recovery", - "Restart and try again", - "Quit and give up"); - Alert("Enlightenment has encountered parsing errors in your autosaved\n" - "configuration.\n" - "\n" - "This may be due to filing system errors, Minor bugs or" - " unforeseen\n" - "system shutdowns.\n" - "\n" - "Do you wish Enlightenment to recover its original system\n" - "configuration and try again?\n"); + ASSIGN_ALERT(gettext("Recover system config?"), + gettext("Yes, Attempt recovery"), + gettext("Restart and try again"), + gettext("Quit and give up")); + Alert(gettext + ("Enlightenment has encountered parsing errors in your autosaved\n" + "configuration.\n" "\n" + "This may be due to filing system errors, Minor bugs or" + " unforeseen\n" "system shutdowns.\n" "\n" + "Do you wish Enlightenment to recover its original system\n" + "configuration and try again?\n")); RESET_ALERT; mode.autosave = 0; MapUnmap(1); diff --git a/src/containers.c b/src/containers.c index cdf039fd..c3314773 100644 --- a/src/containers.c +++ b/src/containers.c @@ -69,7 +69,8 @@ AddButtonToContainer(Container * bc, Button * b) else { bc->ButtonList = Erealloc(bc->ButtonList, - (bc->numofbuttonsinlist + 1) * sizeof(Container *)); + (bc->numofbuttonsinlist + + 1) * sizeof(Container *)); } bc->ButtonList[bc->numofbuttonsinlist++] = b; b->ref_count++; @@ -103,7 +104,8 @@ RemoveButtonFromContainer(Container * bc, Button * b) if (found && ((bc->numofbuttonsinlist - 1) > 0)) { bc->ButtonList = Erealloc(bc->ButtonList, - (bc->numofbuttonsinlist * sizeof(Container *))); + (bc->numofbuttonsinlist * + sizeof(Container *))); for (i = 0; i <= bc->numofbuttonsinlist; i++) { if (i != j) diff --git a/src/coords.c b/src/coords.c index ce7142ff..b71375e0 100644 --- a/src/coords.c +++ b/src/coords.c @@ -68,8 +68,12 @@ SetCoords(int x, int y, int w, int h) case 0: case 1: case 2: - cx = ewin->x + ((ewin->w - cw) / 2) + desks.desk[ewin->desktop].x; - cy = ewin->y + ((ewin->h - ch) / 2) + desks.desk[ewin->desktop].y; + cx = + ewin->x + ((ewin->w - cw) / 2) + + desks.desk[ewin->desktop].x; + cy = + ewin->y + ((ewin->h - ch) / 2) + + desks.desk[ewin->desktop].y; break; case 3: cx = 0; diff --git a/src/desktops.c b/src/desktops.c index dc4a149b..47362e63 100644 --- a/src/desktops.c +++ b/src/desktops.c @@ -28,10 +28,10 @@ GetUniqueBGString(Background * bg) char s[256]; const char *chmap = #ifndef __EMX__ - "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_"; + "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_"; #else - "0123456789abcdefghijklmnopqrstuvwxyz€‚ƒ„…†‡ˆŠ‹ŒŽ‘’“”•–—˜™-_"; + "0123456789abcdefghijklmnopqrstuvwxyz€‚ƒ„…†‡ˆŠ‹ŒŽ‘’“”•–—˜™-_"; /* cyrillic symbols from 866 page correctly handled instead of eng. capitals */ #endif @@ -87,8 +87,7 @@ GetUniqueBGString(Background * bg) "%c%c%c%c%c%c" "%c%c%c%c%c%c" "%c%c%c%c%c%c" - "%c%c%c%c%c%c" - , + "%c%c%c%c%c%c", chmap[(n1 >> 0) & 0x3f], chmap[(n1 >> 6) & 0x3f], chmap[(n1 >> 12) & 0x3f], @@ -153,9 +152,7 @@ GetUniqueBGString(Background * bg) chmap[(f6 >> 6) & 0x3f], chmap[(f6 >> 12) & 0x3f], chmap[(f6 >> 18) & 0x3f], - chmap[(f6 >> 24) & 0x3f], - chmap[(f6 >> 28) & 0x3f] - ); + chmap[(f6 >> 24) & 0x3f], chmap[(f6 >> 28) & 0x3f]); return duplicate(s); } @@ -632,21 +629,15 @@ SetBackgroundTo(ImlibData * imd, Window win, Background * dsk, char setbg) cm->ref_count++; if (dsk->top.im) { - Imlib_set_image_red_curve(id, dsk->top.im, - cm->red.map); - Imlib_set_image_green_curve(id, dsk->top.im, - cm->green.map); - Imlib_set_image_blue_curve(id, dsk->top.im, - cm->blue.map); + Imlib_set_image_red_curve(id, dsk->top.im, cm->red.map); + Imlib_set_image_green_curve(id, dsk->top.im, cm->green.map); + Imlib_set_image_blue_curve(id, dsk->top.im, cm->blue.map); } if (dsk->bg.im) { - Imlib_set_image_red_curve(id, dsk->bg.im, - cm->red.map); - Imlib_set_image_green_curve(id, dsk->bg.im, - cm->green.map); - Imlib_set_image_blue_curve(id, dsk->bg.im, - cm->blue.map); + Imlib_set_image_red_curve(id, dsk->bg.im, cm->red.map); + Imlib_set_image_green_curve(id, dsk->bg.im, cm->green.map); + Imlib_set_image_blue_curve(id, dsk->bg.im, cm->blue.map); } } } @@ -764,16 +755,20 @@ SetBackgroundTo(ImlibData * imd, Window win, Background * dsk, char setbg) if (dsk->top.yperc <= 0) { if (((ww << 10) / hh) != - ((dsk->top.im->rgb_width << 10) / dsk->top.im->rgb_height)) - hh = ((ww * dsk->top.im->rgb_height) - / dsk->top.im->rgb_width); + ((dsk->top.im->rgb_width << 10) / + dsk->top.im->rgb_height)) + hh = + ((ww * dsk->top.im->rgb_height) / + dsk->top.im->rgb_width); } else { if (((hh << 10) / ww) != - ((dsk->top.im->rgb_height << 10) / dsk->top.im->rgb_width)) - ww = ((hh * dsk->top.im->rgb_width) - / dsk->top.im->rgb_height); + ((dsk->top.im->rgb_height << 10) / + dsk->top.im->rgb_width)) + ww = + ((hh * dsk->top.im->rgb_width) / + dsk->top.im->rgb_height); } } Imlib_render(imd, dsk->top.im, ww, hh); @@ -935,16 +930,20 @@ SetBackgroundTo(ImlibData * imd, Window win, Background * dsk, char setbg) if (dsk->top.yperc <= 0) { if (((ww << 10) / hh) != - ((dsk->top.im->rgb_width << 10) / dsk->top.im->rgb_height)) - hh = ((ww * dsk->top.im->rgb_height) - / dsk->top.im->rgb_width); + ((dsk->top.im->rgb_width << 10) / + dsk->top.im->rgb_height)) + hh = + ((ww * dsk->top.im->rgb_height) / + dsk->top.im->rgb_width); } else { if (((hh << 10) / ww) != - ((dsk->top.im->rgb_height << 10) / dsk->top.im->rgb_width)) - ww = ((hh * dsk->top.im->rgb_width) - / dsk->top.im->rgb_height); + ((dsk->top.im->rgb_height << 10) / + dsk->top.im->rgb_width)) + ww = + ((hh * dsk->top.im->rgb_width) / + dsk->top.im->rgb_height); } } Imlib_render(imd, dsk->top.im, ww, hh); @@ -1043,13 +1042,14 @@ InitDesktopBgs() } else { - d->win = ECreateWindow(root.win, -root.w, -root.h, root.w, root.h, 0); + d->win = + ECreateWindow(root.win, -root.w, -root.h, root.w, root.h, 0); XSelectInput(disp, d->win, SubstructureNotifyMask | ButtonPressMask | - ButtonReleaseMask | EnterWindowMask | - LeaveWindowMask | ButtonMotionMask | - PropertyChangeMask | SubstructureRedirectMask | - KeyPressMask | KeyReleaseMask | PointerMotionMask); + ButtonReleaseMask | EnterWindowMask | LeaveWindowMask + | ButtonMotionMask | PropertyChangeMask | + SubstructureRedirectMask | KeyPressMask | + KeyReleaseMask | PointerMotionMask); d->viewable = 0; } at = XInternAtom(disp, "ENLIGHTENMENT_DESKTOP", False); @@ -1105,33 +1105,27 @@ InitDesktopControls() AddToAction(a, ACTION_SHOW_MENU, duplicate(s)); if (i > 0) { - ac->tooltipstring = duplicate("Hold down the mouse button " - "and drag\n" - "the mouse to be able to " - "drag the desktop\n" - "back and forth.\n" - "Click right mouse button " - "for a list of all\n" - "Desktops and their " - "applications.\n" - "Click middle mouse button " - "for a list of all\n" - "applications currently" - " running.\n"); + ac->tooltipstring = + duplicate(gettext + ("Hold down the mouse button " "and drag\n" + "the mouse to be able to " "drag the desktop\n" + "back and forth.\n" "Click right mouse button " + "for a list of all\n" "Desktops and their " + "applications.\n" "Click middle mouse button " + "for a list of all\n" "applications currently" + " running.\n")); } else { - ac->tooltipstring = duplicate("This is the Root desktop.\n" - "You cannot drag the " - "root desktop around.\n" - "Click right mouse button " - "for a list of all\n" - "Desktops and their " - "applications.\n" - "Click middle mouse button " - "for a list of all\n" - "applications currently " - "running.\n"); + ac->tooltipstring = + duplicate(gettext + ("This is the Root desktop.\n" + "You cannot drag the " "root desktop around.\n" + "Click right mouse button " + "for a list of all\n" "Desktops and their " + "applications.\n" "Click middle mouse button " + "for a list of all\n" "applications currently " + "running.\n")); } } Esnprintf(s, sizeof(s), "RAISEBUTTON_DESKTOP_%i", i); @@ -1145,8 +1139,10 @@ InitDesktopControls() param = Emalloc(3); Esnprintf(param, 3, "%i", i); AddToAction(a, ACTION_DESKTOP_RAISE, param); - ac2->tooltipstring = duplicate("Click here to raise this desktop\n" - "to the top.\n"); + ac2->tooltipstring = + duplicate(gettext + ("Click here to raise this desktop\n" + "to the top.\n")); } Esnprintf(s, sizeof(s), "LOWERBUTTON_DESKTOP_%i", i); ac3 = FindItem(s, 0, LIST_FINDBY_NAME, LIST_TYPE_ACLASS); @@ -1159,8 +1155,10 @@ InitDesktopControls() param = Emalloc(3); Esnprintf(param, 3, "%i", i); AddToAction(a, ACTION_DESKTOP_LOWER, param); - ac3->tooltipstring = duplicate("Click here to lower this desktop\n" - "to the bottom.\n"); + ac3->tooltipstring = + duplicate(gettext + ("Click here to lower this desktop\n" + "to the bottom.\n")); } b = NULL; @@ -1312,17 +1310,17 @@ InitDesktopControls() else if (desks.dragdir == 2) { b = CreateButton("_DESKTOP_DESKRAY_DRAG_CONTROL", ic4, ac, - NULL, NULL, 1, FLAG_FIXED_HORIZ, 1, 99999, 1, + NULL, NULL, 1, FLAG_FIXED_HORIZ, 1, 99999, 1, 99999, 0, 0, desks.desk[i].x, 0, desks.desk[i].y, 0, 0, 0, 0, 0, 1, 0, 1); } else { b = CreateButton("_DESKTOP_DESKRAY_DRAG_CONTROL", ic4, ac, - NULL, NULL, 1, FLAG_FIXED_HORIZ, 1, 99999, 1, + NULL, NULL, 1, FLAG_FIXED_HORIZ, 1, 99999, 1, 99999, 0, 0, desks.desk[i].x, 0, - desks.desk[i].y + root.h - desks.dragbar_width, - 0, 0, 0, 0, 0, 1, 0, 1); + desks.desk[i].y + root.h - + desks.dragbar_width, 0, 0, 0, 0, 0, 1, 0, 1); } AddItem(b, b->name, 2, LIST_TYPE_BUTTON); desks.desk[i].tag = b; @@ -1377,8 +1375,7 @@ ConformEwinToDesktop(EWin * ewin) EDBUG(3, "ConformEwinToDesktop"); - if ((ewin->iconified) && - (ewin->parent != desks.desk[ewin->desktop].win)) + if ((ewin->iconified) && (ewin->parent != desks.desk[ewin->desktop].win)) { ewin->parent = desks.desk[ewin->desktop].win; DesktopAddEwinToTop(ewin); @@ -1460,8 +1457,9 @@ MoveStickyWindowsToCurrentDesk(void) DesktopRemoveEwin(ewin); ewin->desktop = DESKTOPS_WRAP_NUM(desks.current); ewin->parent = desks.desk[ewin->desktop].win; - EReparentWindow(disp, ewin->win, desks.desk[ewin->desktop].win, - root.w, root.h); + EReparentWindow(disp, ewin->win, + desks.desk[ewin->desktop].win, root.w, + root.h); XLowerWindow(disp, ewin->win); EMoveWindow(disp, ewin->win, ewin->x, ewin->y); DesktopAddEwinToTop(ewin); @@ -1511,8 +1509,7 @@ GotoDesktop(int num) } if ((mode.mode == MODE_RESIZE) || - (mode.mode == MODE_RESIZE_H) || - (mode.mode == MODE_RESIZE_V)) + (mode.mode == MODE_RESIZE_H) || (mode.mode == MODE_RESIZE_V)) { doResizeEnd(NULL); } @@ -1530,8 +1527,7 @@ GotoDesktop(int num) mode.ewin->reqy = -99999; DrawEwinShape(mode.ewin, mode.movemode, x, y, - mode.ewin->client.w, mode.ewin->client.h, - 3); + mode.ewin->client.w, mode.ewin->client.h, 3); } } else @@ -1626,14 +1622,12 @@ GotoDesktop(int num) if (mode.movemode == 5) { DrawEwinShape(mode.ewin, mode.movemode, x, y, - mode.ewin->client.w, mode.ewin->client.h, - 4); + mode.ewin->client.w, mode.ewin->client.h, 4); } else { DrawEwinShape(mode.ewin, mode.movemode, x, y, - mode.ewin->client.w, mode.ewin->client.h, - 0); + mode.ewin->client.w, mode.ewin->client.h, 0); } } } @@ -1720,7 +1714,8 @@ MoveDesktop(int num, int x, int y) if ((!v) && (desks.desk[deskorder[i]].viewable) && (desks.desk[deskorder[i]].bg)) { - desks.desk[deskorder[i]].bg->last_viewed = time(NULL); + desks.desk[deskorder[i]].bg->last_viewed = + time(NULL); } desks.desk[deskorder[i]].viewable = v; } @@ -2053,7 +2048,8 @@ DesktopRemoveEwin(EWin * ewin) int i, j; EDBUG(5, "DesktopRemoveEwin"); - if ((ewin->desktop < 0) || (ewin->desktop > ENLIGHTENMENT_CONF_NUM_DESKTOPS - 1)) + if ((ewin->desktop < 0) + || (ewin->desktop > ENLIGHTENMENT_CONF_NUM_DESKTOPS - 1)) EDBUG_RETURN_; for (i = 0; i < desks.desk[ewin->desktop].num; i++) { @@ -2191,7 +2187,8 @@ MoveEwinToDesktopAt(EWin * ewin, int num, int x, int y) { for (i = 0; i < nn; i++) { - MoveEwinToDesktopAt(lst[i], num, lst[i]->x + dx, lst[i]->y + dy); + MoveEwinToDesktopAt(lst[i], num, lst[i]->x + dx, + lst[i]->y + dy); } Efree(lst); } diff --git a/src/dialog.c b/src/dialog.c index 17691d4e..bf596a2b 100644 --- a/src/dialog.c +++ b/src/dialog.c @@ -174,7 +174,8 @@ DialogBindKey(Dialog * d, char *key, void (*func) (int val, void *data), if (!d->keybindings) d->keybindings = Emalloc(sizeof(DKeyBind) * d->num_bindings); else - d->keybindings = Erealloc(d->keybindings, sizeof(DKeyBind) * d->num_bindings); + d->keybindings = + Erealloc(d->keybindings, sizeof(DKeyBind) * d->num_bindings); d->keybindings[d->num_bindings - 1].val = val; d->keybindings[d->num_bindings - 1].data = data; d->keybindings[d->num_bindings - 1].func = func; @@ -279,7 +280,7 @@ DialogQuit(int val, void *data) } void -DialogAlert(char *fmt,...) +DialogAlert(char *fmt, ...) { char text[10240]; va_list ap; @@ -292,7 +293,7 @@ DialogAlert(char *fmt,...) } void -DialogAlertOK(char *fmt,...) +DialogAlertOK(char *fmt, ...) { char text[10240]; va_list ap; @@ -300,13 +301,13 @@ DialogAlertOK(char *fmt,...) va_start(ap, fmt); Evsnprintf(text, 10240, fmt, ap); va_end(ap); - ASSIGN_ALERT("Attention !!!", "OK", " ", " "); + ASSIGN_ALERT(gettext("Attention !!!"), gettext("OK"), " ", " "); Alert(text); RESET_ALERT; } void -DialogSetParamText(Dialog * d, char *fmt,...) +DialogSetParamText(Dialog * d, char *fmt, ...) { char text[10240]; va_list ap; @@ -419,12 +420,10 @@ DialogDrawButton(Dialog * d, int bnum) state = STATE_CLICKED; } IclassApply(d->button[bnum]->iclass, d->button[bnum]->win, - d->button[bnum]->w, d->button[bnum]->h, 0, 0, - state, 0); + d->button[bnum]->w, d->button[bnum]->h, 0, 0, state, 0); TclassApply(d->button[bnum]->iclass, d->button[bnum]->win, d->button[bnum]->w, d->button[bnum]->h, - 0, 0, state, 1, d->button[bnum]->tclass, - d->button[bnum]->text); + 0, 0, state, 1, d->button[bnum]->tclass, d->button[bnum]->text); } void @@ -464,8 +463,7 @@ DialogDraw(Dialog * d) if (d->text) { TclassApply(d->iclass, d->win, d->w, d->h, - 0, 0, STATE_NORMAL, 1, d->tclass, - d->text); + 0, 0, STATE_NORMAL, 1, d->tclass, d->text); } else if (d->item) { @@ -482,8 +480,7 @@ DialogDrawArea(Dialog * d, int x, int y, int w, int h) if (d->text) { TclassApply(d->iclass, d->win, d->w, d->h, - 0, 0, STATE_NORMAL, 1, d->tclass, - d->text); + 0, 0, STATE_NORMAL, 1, d->tclass, d->text); } else if (d->item) { @@ -554,8 +551,7 @@ ShowDialog(Dialog * d) if ((d->iclass->padding.left + d->iclass->padding.right + (d->num_buttons * (mw + d->iclass->padding.left + - d->iclass->padding.right))) - > w) + d->iclass->padding.right))) > w) w = d->iclass->padding.left + d->iclass->padding.right + (d->num_buttons * (mw + d->iclass->padding.left + d->iclass->padding.right)); @@ -587,8 +583,7 @@ ShowDialog(Dialog * d) for (i = 0; i < d->num_buttons; i++) IclassApply(d->button[i]->iclass, d->button[i]->win, - d->button[i]->w, d->button[i]->h, 0, 0, - STATE_NORMAL, 0); + d->button[i]->w, d->button[i]->h, 0, 0, STATE_NORMAL, 0); queue_up = pq; ewin = AddInternalToFamily(d->win, 1, NULL, 0, d); @@ -993,8 +988,7 @@ DialogRealizeItem(Dialog * d, DItem * di) EnterWindowMask | LeaveWindowMask | ButtonPressMask | ButtonReleaseMask); XSelectInput(disp, di->item.slider.knob_win, - ButtonPressMask | - ButtonReleaseMask | PointerMotionMask); + ButtonPressMask | ButtonReleaseMask | PointerMotionMask); if (!di->item.slider.ic_base) { if (di->item.slider.horizontal) @@ -1086,14 +1080,16 @@ DialogRealizeItem(Dialog * d, DItem * di) { ImlibImage *im; - im = ELoadImage(di->item.slider.ic_border->norm.normal->im_file); + im = + ELoadImage(di->item.slider.ic_border->norm.normal-> + im_file); if (im) { di->item.slider.border_orig_w = im->rgb_width; di->item.slider.border_orig_h = im->rgb_height; Imlib_destroy_image(id, im); di->item.slider.border_win = ECreateWindow(d->win, -20, - -20, 2, 2, 0); + -20, 2, 2, 0); EMapWindow(disp, di->item.slider.border_win); } } @@ -1241,7 +1237,7 @@ DialogRealizeItem(Dialog * d, DItem * di) if ((cols > 0) && (rows > 0)) { int i, *col_size, *row_size = NULL, r = 0, - c = 0, x = 0, y = 0; + c = 0, x = 0, y = 0; col_size = Emalloc(sizeof(int) * cols); row_size = Erealloc(row_size, sizeof(int)); @@ -1320,11 +1316,9 @@ DialogRealizeItem(Dialog * d, DItem * di) for (j = 0; j < dii->row_span; j++) sh += row_size[r + j]; if (dii->fill_h) - dii->w = sw - (dii->padding.left - + dii->padding.right); + dii->w = sw - (dii->padding.left + dii->padding.right); if (dii->fill_v) - dii->h = sh - (dii->padding.top - + dii->padding.bottom); + dii->h = sh - (dii->padding.top + dii->padding.bottom); if (dii->type == DITEM_TABLE) { int dx, dy, newx, newy; @@ -1359,20 +1353,26 @@ DialogRealizeItem(Dialog * d, DItem * di) dii->w, dii->h); if (dii->type == DITEM_CHECKBUTTON) EMoveResizeWindow(disp, - dii->item.check_button.check_win, + dii->item.check_button.check_win, dii->x, dii->y + ((dii->h - - dii->item.check_button.check_orig_h) / 2), - dii->item.check_button.check_orig_w, - dii->item.check_button.check_orig_h); + dii->item.check_button. + check_orig_h) / 2), + dii->item.check_button. + check_orig_w, + dii->item.check_button. + check_orig_h); if (dii->type == DITEM_RADIOBUTTON) EMoveResizeWindow(disp, - dii->item.radio_button.radio_win, + dii->item.radio_button.radio_win, dii->x, dii->y + ((dii->h - - dii->item.radio_button.radio_orig_h) / 2), - dii->item.radio_button.radio_orig_w, - dii->item.radio_button.radio_orig_h); + dii->item.radio_button. + radio_orig_h) / 2), + dii->item.radio_button. + radio_orig_w, + dii->item.radio_button. + radio_orig_h); if (dii->type == DITEM_AREA) { dii->item.area.w = dii->w - @@ -1404,23 +1404,29 @@ DialogRealizeItem(Dialog * d, DItem * di) if (dii->item.slider.base_win) EMoveResizeWindow(disp, dii->item.slider.base_win, - dii->x + dii->item.slider.base_x, - dii->y + dii->item.slider.base_y, + dii->x + + dii->item.slider.base_x, + dii->y + + dii->item.slider.base_y, dii->item.slider.base_w, dii->item.slider.base_h); if (dii->item.slider.border_win) EMoveResizeWindow(disp, - dii->item.slider.border_win, - dii->x + dii->item.slider.border_x, - dii->y + dii->item.slider.border_y, + dii->item.slider.border_win, + dii->x + + dii->item.slider.border_x, + dii->y + + dii->item.slider.border_y, dii->item.slider.border_w, dii->item.slider.border_h); if (dii->win) EMoveResizeWindow(disp, dii->win, - dii->x + dii->item.slider.numeric_x, - dii->y + dii->item.slider.numeric_y, + dii->x + + dii->item.slider.numeric_x, + dii->y + + dii->item.slider.numeric_y, dii->item.slider.numeric_w, - dii->item.slider.numeric_h); + dii->item.slider.numeric_h); } } x += sw; @@ -1544,16 +1550,14 @@ DialogDrawItems(Dialog * d, DItem * di, int x, int y, int w, int h) { int i; - if (INTERSECTS(x, y, w, h, - di->x, di->y, di->w, di->h)) + if (INTERSECTS(x, y, w, h, di->x, di->y, di->w, di->h)) { for (i = 0; i < di->item.table.num_items; i++) DialogDrawItems(d, di->item.table.items[i], x, y, w, h); } return; } - if (INTERSECTS(x, y, w, h, - di->x, di->y, di->w, di->h)) + if (INTERSECTS(x, y, w, h, di->x, di->y, di->w, di->h)) { switch (di->type) { @@ -1634,13 +1638,11 @@ DialogDrawItems(Dialog * d, DItem * di, int x, int y, int w, int h) if (di->item.check_button.onoff) IclassApply(di->iclass, di->item.check_button.check_win, di->item.check_button.check_orig_w, - di->item.check_button.check_orig_h, 1, 0, - state, 0); + di->item.check_button.check_orig_h, 1, 0, state, 0); else IclassApply(di->iclass, di->item.check_button.check_win, di->item.check_button.check_orig_w, - di->item.check_button.check_orig_h, 0, 0, - state, 0); + di->item.check_button.check_orig_h, 0, 0, state, 0); XClearArea(disp, d->win, di->x, di->y, di->w, di->h, False); TextDraw(di->tclass, d->win, 0, 0, STATE_NORMAL, di->item.check_button.text, @@ -1677,13 +1679,11 @@ DialogDrawItems(Dialog * d, DItem * di, int x, int y, int w, int h) if (di->item.radio_button.onoff) IclassApply(di->iclass, di->item.radio_button.radio_win, di->item.radio_button.radio_orig_w, - di->item.radio_button.radio_orig_h, 1, 0, - state, 0); + di->item.radio_button.radio_orig_h, 1, 0, state, 0); else IclassApply(di->iclass, di->item.radio_button.radio_win, di->item.radio_button.radio_orig_w, - di->item.radio_button.radio_orig_w, 0, 0, - state, 0); + di->item.radio_button.radio_orig_w, 0, 0, state, 0); XClearArea(disp, d->win, di->x, di->y, di->w, di->h, False); TextDraw(di->tclass, d->win, 0, 0, STATE_NORMAL, di->item.radio_button.text, @@ -1882,8 +1882,7 @@ DialogItemAreaSetSize(DItem * di, int w, int h) di->item.area.h = h; } -Window -DialogItemAreaGetWindow(DItem * di) +Window DialogItemAreaGetWindow(DItem * di) { return di->item.area.area_win; } @@ -1973,8 +1972,7 @@ DialogItemFindWindow(DItem * di, Window win) else if ((di->win == win) || ((di->type == DITEM_SLIDER) && ((di->item.slider.base_win == win) || (di->item.slider.knob_win == win))) || - ((di->type == DITEM_AREA) && - (di->item.area.area_win == win))) + ((di->type == DITEM_AREA) && (di->item.area.area_win == win))) { return di; } diff --git a/src/draw.c b/src/draw.c index e1399822..076076bd 100644 --- a/src/draw.c +++ b/src/draw.c @@ -98,7 +98,7 @@ HandleDrawQueue() for (i = 0; i < num; i++) { if ((lst[i]->d == dq->d) && (dq->d->item) && - /*(dq->d->item == dq->di) && */ (lst[i]->di == dq->di)) + /*(dq->d->item == dq->di) && */ (lst[i]->di == dq->di)) { if (dq->x < lst[i]->x) { @@ -200,8 +200,7 @@ HandleDrawQueue() else if (lst[i]->iclass) { IclassApply(lst[i]->iclass, lst[i]->win, lst[i]->w, lst[i]->h, - lst[i]->active, lst[i]->sticky, lst[i]->state, - 0); + lst[i]->active, lst[i]->sticky, lst[i]->state, 0); /* printf("I %x\n", lst[i]->win); */ } else if (lst[i]->pager) @@ -429,7 +428,8 @@ EBlendRemoveShape(EWin * ewin, Pixmap pmap, int x, int y) XFillRectangle(disp, mask, gcm, 0, 0, w, h); XSetForeground(disp, gcm, 0); for (i = 0; i < rn; i++) - XFillRectangle(disp, mask, gcm, rl[i].x, rl[i].y, rl[i].width, rl[i].height); + XFillRectangle(disp, mask, gcm, rl[i].x, rl[i].y, rl[i].width, + rl[i].height); XSetClipMask(disp, gc, mask); } XSetClipOrigin(disp, gc, x, y); @@ -437,7 +437,8 @@ EBlendRemoveShape(EWin * ewin, Pixmap pmap, int x, int y) } void -EBlendPixImg(EWin * ewin, PixImg * s1, PixImg * s2, PixImg * dst, int x, int y, int w, int h) +EBlendPixImg(EWin * ewin, PixImg * s1, PixImg * s2, PixImg * dst, int x, int y, + int w, int h) { int ox, oy; int i, j; @@ -521,7 +522,8 @@ EBlendPixImg(EWin * ewin, PixImg * s1, PixImg * s2, PixImg * dst, int x, int y, p1 = *ptr1++; p2 = *ptr2++; - *ptr3++ = ((p1 >> 1) & 0x7f7f7f7f) + ((p2 >> 1) & 0x7f7f7f7f) + + *ptr3++ = + ((p1 >> 1) & 0x7f7f7f7f) + ((p2 >> 1) & 0x7f7f7f7f) + (p1 & p2 & 0x01010101); } } @@ -570,12 +572,17 @@ EBlendPixImg(EWin * ewin, PixImg * s1, PixImg * s2, PixImg * dst, int x, int y, p1 = *ptr1++; p2 = *ptr2++; *ptr3++ = - ((p1 >> 1) & ((0x78 << 8) | (0x7c << 3) | (0x78 >> 3) | - (0x78 << 24) | (0x7c << 19) | (0x78 << 13))) + - ((p2 >> 1) & ((0x78 << 8) | (0x7c << 3) | (0x78 >> 3) | - (0x78 << 24) | (0x7c << 19) | (0x78 << 13))) + - (p1 & p2 & ((0x1 << 11) | (0x1 << 5) | (0x1) | - (0x1 << 27) | (0x1 << 21) | (0x1 << 16))); + ((p1 >> 1) & + ((0x78 << 8) | (0x7c << 3) | (0x78 >> 3) | + (0x78 << 24) | (0x7c << 19) | (0x78 << + 13))) + + ((p2 >> 1) & + ((0x78 << 8) | (0x7c << 3) | (0x78 >> 3) | + (0x78 << 24) | (0x7c << 19) | (0x78 << + 13))) + + (p1 & p2 & + ((0x1 << 11) | (0x1 << 5) | (0x1) | + (0x1 << 27) | (0x1 << 21) | (0x1 << 16))); } } else @@ -587,12 +594,17 @@ EBlendPixImg(EWin * ewin, PixImg * s1, PixImg * s2, PixImg * dst, int x, int y, p1 = *ptr1++; p2 = *ptr2++; *ptr3++ = - ((p1 >> 1) & ((0x78 << 8) | (0x7c << 3) | (0x78 >> 3) | - (0x78 << 24) | (0x7c << 19) | (0x78 << 13))) + - ((p2 >> 1) & ((0x78 << 8) | (0x7c << 3) | (0x78 >> 3) | - (0x78 << 24) | (0x7c << 19) | (0x78 << 13))) + - (p1 & p2 & ((0x1 << 11) | (0x1 << 5) | (0x1) | - (0x1 << 27) | (0x1 << 21) | (0x1 << 16))); + ((p1 >> 1) & + ((0x78 << 8) | (0x7c << 3) | (0x78 >> 3) | + (0x78 << 24) | (0x7c << 19) | (0x78 << + 13))) + + ((p2 >> 1) & + ((0x78 << 8) | (0x7c << 3) | (0x78 >> 3) | + (0x78 << 24) | (0x7c << 19) | (0x78 << + 13))) + + (p1 & p2 & + ((0x1 << 11) | (0x1 << 5) | (0x1) | + (0x1 << 27) | (0x1 << 21) | (0x1 << 16))); } { unsigned short *pptr1, *pptr2, *pptr3; @@ -603,9 +615,13 @@ EBlendPixImg(EWin * ewin, PixImg * s1, PixImg * s2, PixImg * dst, int x, int y, pptr3 = (unsigned short *)ptr3; pp1 = *pptr1; pp2 = *pptr2; - *pptr3 = ((pp1 >> 1) & ((0x78 << 8) | (0x7c << 3) | (0x78 >> 3))) + - ((pp2 >> 1) & ((0x78 << 8) | (0x7c << 3) | (0x78 >> 3))) + - (pp1 & pp2 & ((0x1 << 11) | (0x1 << 5) | (0x1))); + *pptr3 = + ((pp1 >> 1) & + ((0x78 << 8) | (0x7c << 3) | (0x78 >> 3))) + + ((pp2 >> 1) & + ((0x78 << 8) | (0x7c << 3) | (0x78 >> 3))) + + (pp1 & pp2 & ((0x1 << 11) | (0x1 << 5) | + (0x1))); } } } @@ -637,12 +653,17 @@ EBlendPixImg(EWin * ewin, PixImg * s1, PixImg * s2, PixImg * dst, int x, int y, p1 = *ptr1++; p2 = *ptr2++; *ptr3++ = - ((p1 >> 1) & ((0x78 << 7) | (0x78 << 2) | (0x78 >> 3) | - (0x78 << 23) | (0x78 << 18) | (0x78 << 13))) + - ((p2 >> 1) & ((0x78 << 7) | (0x78 << 2) | (0x78 >> 3) | - (0x78 << 23) | (0x78 << 18) | (0x78 << 13))) + - (p1 & p2 & ((0x1 << 10) | (0x1 << 5) | (0x1) | - (0x1 << 26) | (0x1 << 20) | (0x1 << 16))); + ((p1 >> 1) & + ((0x78 << 7) | (0x78 << 2) | (0x78 >> 3) | + (0x78 << 23) | (0x78 << 18) | (0x78 << + 13))) + + ((p2 >> 1) & + ((0x78 << 7) | (0x78 << 2) | (0x78 >> 3) | + (0x78 << 23) | (0x78 << 18) | (0x78 << + 13))) + + (p1 & p2 & + ((0x1 << 10) | (0x1 << 5) | (0x1) | + (0x1 << 26) | (0x1 << 20) | (0x1 << 16))); } } else @@ -654,12 +675,17 @@ EBlendPixImg(EWin * ewin, PixImg * s1, PixImg * s2, PixImg * dst, int x, int y, p1 = *ptr1++; p2 = *ptr2++; *ptr3++ = - ((p1 >> 1) & ((0x78 << 7) | (0x78 << 2) | (0x78 >> 3) | - (0x78 << 23) | (0x78 << 18) | (0x78 << 13))) + - ((p2 >> 1) & ((0x78 << 7) | (0x78 << 2) | (0x78 >> 3) | - (0x78 << 23) | (0x78 << 18) | (0x78 << 13))) + - (p1 & p2 & ((0x1 << 10) | (0x1 << 5) | (0x1) | - (0x1 << 26) | (0x1 << 20) | (0x1 << 16))); + ((p1 >> 1) & + ((0x78 << 7) | (0x78 << 2) | (0x78 >> 3) | + (0x78 << 23) | (0x78 << 18) | (0x78 << + 13))) + + ((p2 >> 1) & + ((0x78 << 7) | (0x78 << 2) | (0x78 >> 3) | + (0x78 << 23) | (0x78 << 18) | (0x78 << + 13))) + + (p1 & p2 & + ((0x1 << 10) | (0x1 << 5) | (0x1) | + (0x1 << 26) | (0x1 << 20) | (0x1 << 16))); } { unsigned short *pptr1, *pptr2, *pptr3; @@ -670,9 +696,13 @@ EBlendPixImg(EWin * ewin, PixImg * s1, PixImg * s2, PixImg * dst, int x, int y, pptr3 = (unsigned short *)ptr3; pp1 = *pptr1; pp2 = *pptr2; - *pptr3++ = ((pp1 >> 1) & ((0x78 << 7) | (0x78 << 2) | (0x78 >> 3))) + - ((pp2 >> 1) & ((0x78 << 7) | (0x78 << 2) | (0x78 >> 3))) + - (pp1 & pp2 & ((0x1 << 10) | (0x1 << 5) | (0x1))); + *pptr3++ = + ((pp1 >> 1) & + ((0x78 << 7) | (0x78 << 2) | (0x78 >> 3))) + + ((pp2 >> 1) & + ((0x78 << 7) | (0x78 << 2) | (0x78 >> 3))) + + (pp1 & pp2 & ((0x1 << 10) | (0x1 << 5) | + (0x1))); } } } @@ -800,8 +830,7 @@ DrawEwinShape(EWin * ewin, int md, int x, int y, int w, int h, char firstlast) } if ((mode.mode == MODE_RESIZE) || - (mode.mode == MODE_RESIZE_H) || - (mode.mode == MODE_RESIZE_V)) + (mode.mode == MODE_RESIZE_H) || (mode.mode == MODE_RESIZE_V)) { w1 = ewin->client.w; h1 = ewin->client.h; @@ -818,8 +847,7 @@ DrawEwinShape(EWin * ewin, int md, int x, int y, int w, int h, char firstlast) if ((md == 5) && ((mode.mode == MODE_RESIZE) || (mode.mode == MODE_RESIZE_H) || - (mode.mode == MODE_RESIZE_V) || - (ewin->groups && check_move))) + (mode.mode == MODE_RESIZE_V) || (ewin->groups && check_move))) md = 0; if (md == 5) { @@ -846,8 +874,10 @@ DrawEwinShape(EWin * ewin, int md, int x, int y, int w, int h, char firstlast) MoveResizeEwin(ewin, x, y, w, h); if (mode.mode != MODE_NONE) SetCoords(ewin->x, ewin->y, - (ewin->client.w - ewin->client.base_w) / ewin->client.w_inc, - (ewin->client.h - ewin->client.base_h) / ewin->client.h_inc); + (ewin->client.w - + ewin->client.base_w) / ewin->client.w_inc, + (ewin->client.h - + ewin->client.base_h) / ewin->client.h_inc); break; case 1: case 2: @@ -856,16 +886,13 @@ DrawEwinShape(EWin * ewin, int md, int x, int y, int w, int h, char firstlast) case 5: if (!b1) b1 = XCreateBitmapFromData(disp, root.win, flipped_gray_bits, - flipped_gray_width, - flipped_gray_height); + flipped_gray_width, flipped_gray_height); if (!b2) b2 = XCreateBitmapFromData(disp, root.win, gray_bits, - gray_width, - gray_height); + gray_width, gray_height); if (!b3) b3 = XCreateBitmapFromData(disp, root.win, gray3_bits, - gray3_width, - gray3_height); + gray3_width, gray3_height); x1 = ewin->x + desks.desk[ewin->desktop].x; y1 = ewin->y + desks.desk[ewin->desktop].y; w1 = ewin->w - (ewin->border->border.left + ewin->border->border.right); @@ -881,8 +908,12 @@ DrawEwinShape(EWin * ewin, int md, int x, int y, int w, int h, char firstlast) ewin->client.w = w; ewin->client.h = h; ICCCM_MatchSize(ewin); - ewin->w = ewin->client.w + ewin->border->border.left + ewin->border->border.right; - ewin->h = ewin->client.h + ewin->border->border.top + ewin->border->border.bottom; + ewin->w = + ewin->client.w + ewin->border->border.left + + ewin->border->border.right; + ewin->h = + ewin->client.h + ewin->border->border.top + + ewin->border->border.bottom; } w = ewin->w - (ewin->border->border.left + ewin->border->border.right); h = ewin->h - (ewin->border->border.top + ewin->border->border.bottom); @@ -893,7 +924,9 @@ DrawEwinShape(EWin * ewin, int md, int x, int y, int w, int h, char firstlast) if (gcv.foreground == 0) gcv.foreground = BlackPixel(disp, root.scr); gcv.subwindow_mode = IncludeInferiors; - gc = XCreateGC(disp, root.win, GCFunction | GCForeground | GCSubwindowMode, &gcv); + gc = + XCreateGC(disp, root.win, + GCFunction | GCForeground | GCSubwindowMode, &gcv); } #define DRAW_H_ARROW(x1, x2, y1) \ if (((x2) - (x1)) >= 12) \ @@ -1020,8 +1053,10 @@ DrawEwinShape(EWin * ewin, int md, int x, int y, int w, int h, char firstlast) if ((mode.mode != MODE_NONE) && (!ewin->groups || (ewin->groups && !check_move))) SetCoords(ewin->x, ewin->y, - (ewin->client.w - ewin->client.base_w) / ewin->client.w_inc, - (ewin->client.h - ewin->client.base_h) / ewin->client.h_inc); + (ewin->client.w - + ewin->client.base_w) / ewin->client.w_inc, + (ewin->client.h - + ewin->client.base_h) / ewin->client.h_inc); if (firstlast < 2) { DO_DRAW_MODE_1(x, y, w, h); @@ -1036,8 +1071,10 @@ DrawEwinShape(EWin * ewin, int md, int x, int y, int w, int h, char firstlast) if ((mode.mode != MODE_NONE) && (!ewin->groups || (ewin->groups && !check_move))) SetCoords(ewin->x, ewin->y, - (ewin->client.w - ewin->client.base_w) / ewin->client.w_inc, - (ewin->client.h - ewin->client.base_h) / ewin->client.h_inc); + (ewin->client.w - + ewin->client.base_w) / ewin->client.w_inc, + (ewin->client.h - + ewin->client.base_h) / ewin->client.h_inc); if (firstlast < 2) { DO_DRAW_MODE_2(x, y, w, h); @@ -1052,8 +1089,10 @@ DrawEwinShape(EWin * ewin, int md, int x, int y, int w, int h, char firstlast) if ((mode.mode != MODE_NONE) && (!ewin->groups || (ewin->groups && !check_move))) SetCoords(ewin->x, ewin->y, - (ewin->client.w - ewin->client.base_w) / ewin->client.w_inc, - (ewin->client.h - ewin->client.base_h) / ewin->client.h_inc); + (ewin->client.w - + ewin->client.base_w) / ewin->client.w_inc, + (ewin->client.h - + ewin->client.base_h) / ewin->client.h_inc); if (firstlast < 2) { DO_DRAW_MODE_3(x, y, w, h); @@ -1069,8 +1108,10 @@ DrawEwinShape(EWin * ewin, int md, int x, int y, int w, int h, char firstlast) if ((mode.mode != MODE_NONE) && (!ewin->groups || (ewin->groups && !check_move))) SetCoords(ewin->x, ewin->y, - (ewin->client.w - ewin->client.base_w) / ewin->client.w_inc, - (ewin->client.h - ewin->client.base_h) / ewin->client.h_inc); + (ewin->client.w - + ewin->client.base_w) / ewin->client.w_inc, + (ewin->client.h - + ewin->client.base_h) / ewin->client.h_inc); if (firstlast < 2) { DO_DRAW_MODE_4(x, y, w, h); @@ -1105,10 +1146,12 @@ DrawEwinShape(EWin * ewin, int md, int x, int y, int w, int h, char firstlast) { mode.movemode = 0; UngrabX(); - DrawEwinShape(ewin, mode.movemode, x, y, w, h, firstlast); + DrawEwinShape(ewin, mode.movemode, x, y, w, h, + firstlast); EDBUG_RETURN_; } - EFillPixmap(root.win, root_pi->pmap, x1, y1, ewin->w, ewin->h); + EFillPixmap(root.win, root_pi->pmap, x1, y1, ewin->w, + ewin->h); gc = XCreateGC(disp, root_pi->pmap, 0, &gcv); XCopyArea(disp, root_pi->pmap, ewin_pi->pmap, gc, x1, y1, ewin->w, ewin->h, 0, 0); @@ -1138,11 +1181,13 @@ DrawEwinShape(EWin * ewin, int md, int x, int y, int w, int h, char firstlast) if (dx < 0) EFillPixmap(root.win, root_pi->pmap, x, y, -dx, ht); else if (dx > 0) - EFillPixmap(root.win, root_pi->pmap, x + wt - dx, y, dx, ht); + EFillPixmap(root.win, root_pi->pmap, x + wt - dx, y, + dx, ht); if (dy < 0) EFillPixmap(root.win, root_pi->pmap, x, y, wt, -dy); else if (dy > 0) - EFillPixmap(root.win, root_pi->pmap, x, y + ht - dy, wt, dy); + EFillPixmap(root.win, root_pi->pmap, x, y + ht - dy, + wt, dy); } else EFillPixmap(root.win, root_pi->pmap, x, y, wt, ht); @@ -1153,11 +1198,13 @@ DrawEwinShape(EWin * ewin, int md, int x, int y, int w, int h, char firstlast) if (dx > 0) EPastePixmap(root.win, root_pi->pmap, x1, y1, dx, ht); else if (dx < 0) - EPastePixmap(root.win, root_pi->pmap, x1 + wt + dx, y1, -dx, ht); + EPastePixmap(root.win, root_pi->pmap, x1 + wt + dx, + y1, -dx, ht); if (dy > 0) EPastePixmap(root.win, root_pi->pmap, x1, y1, wt, dy); else if (dy < 0) - EPastePixmap(root.win, root_pi->pmap, x1, y1 + ht + dy, wt, -dy); + EPastePixmap(root.win, root_pi->pmap, x1, + y1 + ht + dy, wt, -dy); } else { @@ -1169,7 +1216,8 @@ DrawEwinShape(EWin * ewin, int md, int x, int y, int w, int h, char firstlast) } else if (firstlast == 2) { - EPastePixmap(root.win, root_pi->pmap, x1, y1, ewin->w, ewin->h); + EPastePixmap(root.win, root_pi->pmap, x1, y1, ewin->w, + ewin->h); if (ewin_pi) EDestroyPixImg(ewin_pi); if (root_pi) @@ -1208,14 +1256,17 @@ DrawEwinShape(EWin * ewin, int md, int x, int y, int w, int h, char firstlast) } if (mode.mode != MODE_NONE) SetCoords(ewin->x, ewin->y, - (ewin->client.w - ewin->client.base_w) / ewin->client.w_inc, - (ewin->client.h - ewin->client.base_h) / ewin->client.h_inc); + (ewin->client.w - + ewin->client.base_w) / ewin->client.w_inc, + (ewin->client.h - + ewin->client.base_h) / ewin->client.h_inc); } if (firstlast == 2) { /* If we're moving a group, don't do this, * otherwise we have a lot of garbage onscreen */ - if (!ewin->floating || !ewin->groups || (ewin->groups && !check_move)) + if (!ewin->floating || !ewin->groups + || (ewin->groups && !check_move)) { if (ewin->shaded) MoveEwin(ewin, ewin->x, ewin->y); @@ -1321,13 +1372,16 @@ PropagateShapes(Window win) if ((att.class == InputOutput) && (att.map_state != IsUnmapped)) { rl = NULL; - rl = EShapeGetRectangles(disp, list[i], ShapeBounding, &rn, &ord); + rl = + EShapeGetRectangles(disp, list[i], ShapeBounding, &rn, + &ord); if (rl) { num_rects += rn; if (rn > 0) { - rects = Erealloc(rects, num_rects * sizeof(XRectangle)); + rects = + Erealloc(rects, num_rects * sizeof(XRectangle)); /* go through all clip rects in thsi window's shape */ for (k = 0; k < rn; k++) { @@ -1335,7 +1389,8 @@ PropagateShapes(Window win) rects[num_rects - rn + k].x = x + rl[k].x; rects[num_rects - rn + k].y = y + rl[k].y; rects[num_rects - rn + k].width = rl[k].width; - rects[num_rects - rn + k].height = rl[k].height; + rects[num_rects - rn + k].height = + rl[k].height; } } Efree(rl); @@ -1355,8 +1410,8 @@ PropagateShapes(Window win) /* set the rects as the shape mask */ if (rects) { - EShapeCombineRectangles(disp, win, ShapeBounding, 0, 0, rects, num_rects, - ShapeSet, Unsorted); + EShapeCombineRectangles(disp, win, ShapeBounding, 0, 0, rects, + num_rects, ShapeSet, Unsorted); Efree(rects); rl = NULL; rl = EShapeGetRectangles(disp, win, ShapeBounding, &rn, &ord); @@ -1375,7 +1430,8 @@ PropagateShapes(Window win) Efree(rl); } else - EShapeCombineMask(disp, win, ShapeBounding, 0, 0, None, ShapeSet); + EShapeCombineMask(disp, win, ShapeBounding, 0, 0, None, + ShapeSet); } XFree(list); } diff --git a/src/events.c b/src/events.c index 3b688604..7470adcd 100644 --- a/src/events.c +++ b/src/events.c @@ -29,8 +29,7 @@ char throw_move_events_away = 0; void DeskAccountTimeout(int val, void *data); -HandleStruct HArray[] = -{ +HandleStruct HArray[] = { {DefaultFunc}, {DefaultFunc}, {HKeyPress}, @@ -277,7 +276,8 @@ HandleEvent(XEvent * ev) if (((ev->type == KeyPress) || (ev->type == KeyRelease)) && (ev->xkey.root != root.win)) { - XSetInputFocus(disp, ev->xkey.root, RevertToPointerRoot, CurrentTime); + XSetInputFocus(disp, ev->xkey.root, RevertToPointerRoot, + CurrentTime); XSync(disp, False); ev->xkey.time = CurrentTime; XSendEvent(disp, ev->xkey.root, False, 0, ev); @@ -346,8 +346,7 @@ WaitEvent() /* XEvent ev; */ fd_set fdset; struct timeval tval; - static struct timeval tval_last = - {0, 0}; + static struct timeval tval_last = { 0, 0 }; double time1, time2; Qentry *qe; int count, pcount; @@ -661,8 +660,7 @@ HLeaveNotify(XEvent * ev) if (ev->xcrossing.window == root.win) { if (ev->xcrossing.mode == NotifyNormal && - ev->xcrossing.detail != NotifyInferior && - mode.focuswin) + ev->xcrossing.detail != NotifyInferior && mode.focuswin) HandleFocusWindow(root.focuswin); else HandleFocusWindow(ev->xcrossing.window); diff --git a/src/evhandlers.c b/src/evhandlers.c index 83d04f41..59334836 100644 --- a/src/evhandlers.c +++ b/src/evhandlers.c @@ -43,11 +43,11 @@ static ToolTip *ttip = NULL; struct _mdata - { - Menu *m; - MenuItem *mi; - EWin *ewin; - }; +{ + Menu *m; + MenuItem *mi; + EWin *ewin; +}; static void ToolTipTimeout(int val, void *data); static void SubmenuShowTimeout(int val, void *dat); @@ -84,8 +84,7 @@ ToolTipTimeout(int val, void *data) EDBUG_RETURN_; if (!ttip) - ttip = FindItem("DEFAULT", 0, LIST_FINDBY_NAME, - LIST_TYPE_TOOLTIP); + ttip = FindItem("DEFAULT", 0, LIST_FINDBY_NAME, LIST_TYPE_TOOLTIP); if (ac->tooltipstring) { @@ -150,7 +149,8 @@ HandleClientMessage(XEvent * ev) } if (ev->xclient.message_type == a4) { - ewin = FindItem(NULL, ev->xclient.window, LIST_FINDBY_ID, LIST_TYPE_EWIN); + ewin = + FindItem(NULL, ev->xclient.window, LIST_FINDBY_ID, LIST_TYPE_EWIN); if (ewin) { ewin->layer = ev->xclient.data.l[0]; @@ -163,7 +163,8 @@ HandleClientMessage(XEvent * ev) } if (ev->xclient.message_type == a5) { - ewin = FindItem(NULL, ev->xclient.window, LIST_FINDBY_ID, LIST_TYPE_EWIN); + ewin = + FindItem(NULL, ev->xclient.window, LIST_FINDBY_ID, LIST_TYPE_EWIN); if (!ewin) EDBUG_RETURN_; if (ev->xclient.data.l[0] & WIN_STATE_FIXED_POSITION) @@ -180,7 +181,8 @@ HandleClientMessage(XEvent * ev) else ewin->ignorearrange = 0; } - if ((ev->xclient.data.l[0] & WIN_STATE_STICKY) && (!ewin->ignorearrange)) + if ((ev->xclient.data.l[0] & WIN_STATE_STICKY) + && (!ewin->ignorearrange)) { if (ev->xclient.data.l[1] & WIN_STATE_STICKY) { @@ -190,7 +192,8 @@ HandleClientMessage(XEvent * ev) RaiseEwin(ewin); DrawEwin(ewin); ApplySclass(FindItem("SOUND_WINDOW_STICK", 0, - LIST_FINDBY_NAME, LIST_TYPE_SCLASS)); + LIST_FINDBY_NAME, + LIST_TYPE_SCLASS)); } } else @@ -201,7 +204,8 @@ HandleClientMessage(XEvent * ev) RaiseEwin(ewin); DrawEwin(ewin); ApplySclass(FindItem("SOUND_WINDOW_UNSTICK", 0, - LIST_FINDBY_NAME, LIST_TYPE_SCLASS)); + LIST_FINDBY_NAME, + LIST_TYPE_SCLASS)); } } } @@ -217,9 +221,10 @@ HandleClientMessage(XEvent * ev) } if (ev->xclient.message_type == a6) { - ewin = FindItem(NULL, ev->xclient.window, LIST_FINDBY_ID, LIST_TYPE_EWIN); - if ((ewin) && (ev->xclient.data.l[0] == IconicState) && - (!(ewin->iconified))) + ewin = + FindItem(NULL, ev->xclient.window, LIST_FINDBY_ID, LIST_TYPE_EWIN); + if ((ewin) && (ev->xclient.data.l[0] == IconicState) + && (!(ewin->iconified))) { IconifyEwin(ewin); EDBUG_RETURN_; @@ -266,7 +271,8 @@ HandleFocusWindowIn(Window win) DrawEwin(mode.focuswin); if (mode.focusmode == FOCUS_CLICK) { - XUngrabButton(disp, AnyButton, AnyModifier, mode.focuswin->win_container); + XUngrabButton(disp, AnyButton, AnyModifier, + mode.focuswin->win_container); GrabButtonGrabs(mode.focuswin); } } @@ -354,8 +360,7 @@ HandleMotion(XEvent * ev) if ((!(ev->xmotion.state & (Button1Mask | Button2Mask | Button3Mask | Button4Mask | - Button5Mask)) && - (!mode.place))) + Button5Mask)) && (!mode.place))) { switch (mode.mode) { @@ -389,14 +394,17 @@ HandleMotion(XEvent * ev) int screen_snap_dist; ewin = mode.ewin; - gwins = ListWinGroupMembersForEwin(ewin, ACTION_MOVE, mode.nogroup, &num); + gwins = + ListWinGroupMembersForEwin(ewin, ACTION_MOVE, mode.nogroup, + &num); if ((mode.moveresize_pending_ewin) && (mode.ewin == mode.moveresize_pending_ewin)) { for (i = 0; i < num; i++) - DrawEwinShape(gwins[i], mode.movemode, gwins[i]->x, gwins[i]->y, - gwins[i]->client.w, gwins[i]->client.h, 0); + DrawEwinShape(gwins[i], mode.movemode, gwins[i]->x, + gwins[i]->y, gwins[i]->client.w, + gwins[i]->client.h, 0); mode.moveresize_pending_ewin = NULL; } dx = mode.x - mode.px; @@ -471,12 +479,23 @@ HandleMotion(XEvent * ev) /* jump out of snap horizontally */ if ((ndx != dx) && (((gwins[i]->x == 0) && - (!(IN_RANGE(gwins[i]->reqx, gwins[i]->x, screen_snap_dist)))) || - ((gwins[i]->x == (root.w - gwins[i]->w)) && - (!(IN_RANGE(gwins[i]->reqx, gwins[i]->x, screen_snap_dist)))) || - ((gwins[i]->x != 0) && - (gwins[i]->x != (root.w - gwins[i]->w) && - (!(IN_RANGE(gwins[i]->reqx, gwins[i]->x, mode.edge_snap_dist))))))) + (!(IN_RANGE + (gwins[i]->reqx, gwins[i]->x, screen_snap_dist)))) + || ((gwins[i]->x == (root.w - gwins[i]->w)) + && + (!(IN_RANGE + (gwins[i]->reqx, gwins[i]->x, + screen_snap_dist)))) || ((gwins[i]->x != 0) + && (gwins[i]->x != + (root.w - + gwins[i]->w) + && + (!(IN_RANGE + (gwins[i]-> + reqx, + gwins[i]->x, + mode. + edge_snap_dist))))))) { jumpx = 1; ndx = gwins[i]->reqx - gwins[i]->x + dx; @@ -484,12 +503,23 @@ HandleMotion(XEvent * ev) /* jump out of snap vertically */ if ((ndy != dy) && (((gwins[i]->y == 0) && - (!(IN_RANGE(gwins[i]->reqy, gwins[i]->y, screen_snap_dist)))) || - ((gwins[i]->y == (root.h - gwins[i]->h)) && - (!(IN_RANGE(gwins[i]->reqy, gwins[i]->y, screen_snap_dist)))) || - ((gwins[i]->y != 0) && - (gwins[i]->y != (root.h - gwins[i]->h) && - (!(IN_RANGE(gwins[i]->reqy, gwins[i]->y, mode.edge_snap_dist))))))) + (!(IN_RANGE + (gwins[i]->reqy, gwins[i]->y, screen_snap_dist)))) + || ((gwins[i]->y == (root.h - gwins[i]->h)) + && + (!(IN_RANGE + (gwins[i]->reqy, gwins[i]->y, + screen_snap_dist)))) || ((gwins[i]->y != 0) + && (gwins[i]->y != + (root.h - + gwins[i]->h) + && + (!(IN_RANGE + (gwins[i]-> + reqy, + gwins[i]->y, + mode. + edge_snap_dist))))))) { jumpy = 1; ndy = gwins[i]->reqy - gwins[i]->y + dy; @@ -547,7 +577,8 @@ HandleMotion(XEvent * ev) y = mode.win_y + mode.win_h - h; ewin->client.w = pw; ewin->client.h = ph; - DrawEwinShape(ewin, mode.resizemode, x, y, w, h, mode.firstlast); + DrawEwinShape(ewin, mode.resizemode, x, y, w, h, + mode.firstlast); break; case 1: ph = ewin->client.h; @@ -563,7 +594,8 @@ HandleMotion(XEvent * ev) else y = mode.win_y + mode.win_h - h; ewin->client.h = ph; - DrawEwinShape(ewin, mode.resizemode, x, y, w, h, mode.firstlast); + DrawEwinShape(ewin, mode.resizemode, x, y, w, h, + mode.firstlast); break; case 2: pw = ewin->client.w; @@ -579,14 +611,16 @@ HandleMotion(XEvent * ev) else x = mode.win_x + mode.win_w - w; ewin->client.w = pw; - DrawEwinShape(ewin, mode.resizemode, x, y, w, h, mode.firstlast); + DrawEwinShape(ewin, mode.resizemode, x, y, w, h, + mode.firstlast); break; case 3: w = mode.win_w + (mode.x - mode.start_x); h = mode.win_h + (mode.y - mode.start_y); x = ewin->x; y = ewin->y; - DrawEwinShape(ewin, mode.resizemode, x, y, w, h, mode.firstlast); + DrawEwinShape(ewin, mode.resizemode, x, y, w, h, + mode.firstlast); break; default: break; @@ -613,14 +647,16 @@ HandleMotion(XEvent * ev) else x = mode.win_x + mode.win_w - w; ewin->client.w = pw; - DrawEwinShape(ewin, mode.resizemode, x, y, w, h, mode.firstlast); + DrawEwinShape(ewin, mode.resizemode, x, y, w, h, + mode.firstlast); break; case 1: w = mode.win_w + (mode.x - mode.start_x); h = ewin->client.h; x = ewin->x; y = ewin->y; - DrawEwinShape(ewin, mode.resizemode, x, y, w, h, mode.firstlast); + DrawEwinShape(ewin, mode.resizemode, x, y, w, h, + mode.firstlast); break; default: break; @@ -647,14 +683,16 @@ HandleMotion(XEvent * ev) else y = mode.win_y + mode.win_h - h; ewin->client.h = ph; - DrawEwinShape(ewin, mode.resizemode, x, y, w, h, mode.firstlast); + DrawEwinShape(ewin, mode.resizemode, x, y, w, h, + mode.firstlast); break; case 1: w = ewin->client.w; h = mode.win_h + (mode.y - mode.start_y); x = ewin->x; y = ewin->y; - DrawEwinShape(ewin, mode.resizemode, x, y, w, h, mode.firstlast); + DrawEwinShape(ewin, mode.resizemode, x, y, w, h, + mode.firstlast); break; default: break; @@ -716,8 +754,7 @@ HandleMotion(XEvent * ev) if (mode.button) { MovebuttonToCoord(mode.button, - mode.button->x + dx, - mode.button->y + dy); + mode.button->x + dx, mode.button->y + dy); if (mode.deskmode == MODE_DESKRAY) { MoveDesktop(mode.deskdrag, desks.desk[mode.deskdrag].x, @@ -809,8 +846,9 @@ HandleMotion(XEvent * ev) ydist = offy; /* only if any active menus are partially off screen then scroll */ - if ((((xdist > 0) && (x1 < 0)) || ((xdist < 0) && (x2 >= root.w))) || - (((ydist > 0) && (y1 < 0)) || ((ydist < 0) && (y2 >= root.h)))) + if ((((xdist > 0) && (x1 < 0)) || ((xdist < 0) && (x2 >= root.w))) + || (((ydist > 0) && (y1 < 0)) + || ((ydist < 0) && (y2 >= root.h)))) { /* If we would scroll too far, limit scrolling to 2/3s of screen */ if (ydist < -root.h) @@ -839,7 +877,8 @@ HandleMotion(XEvent * ev) } } } - SlideEwinsTo(menus, fx, fy, tx, ty, mode.cur_menu_depth, mode.shadespeed); + SlideEwinsTo(menus, fx, fy, tx, ty, mode.cur_menu_depth, + mode.shadespeed); } } if ((xdist != 0) || (ydist != 0)) @@ -851,7 +890,8 @@ HandleMotion(XEvent * ev) p = FindPager(ev->xmotion.window); if (p) - PagerHandleMotion(p, ev->xmotion.window, ev->xmotion.x, ev->xmotion.y); + PagerHandleMotion(p, ev->xmotion.window, ev->xmotion.x, + ev->xmotion.y); else PagerHandleMotion(NULL, ev->xmotion.window, -99, -99); } @@ -885,13 +925,16 @@ HandleMotion(XEvent * ev) x += dx; y += dy; EMoveWindow(disp, p->hi_win, x, y); - XTranslateCoordinates(disp, p->win, root.win, 0, 0, &px, &py, &dw); + XTranslateCoordinates(disp, p->win, root.win, 0, 0, &px, &py, + &dw); x -= px + (cx * (p->w / ax)); y -= py + (cy * (p->h / ay)); MoveEwin(p->hi_ewin, (x * root.w * ax) / p->w, (y * root.h * ay) / p->h); } - gwins = ListWinGroupMembersForEwin(p->hi_ewin, ACTION_MOVE, mode.nogroup, &num); + gwins = + ListWinGroupMembersForEwin(p->hi_ewin, ACTION_MOVE, + mode.nogroup, &num); for (i = 0; i < num; i++) { if ((gwins[i] != p->hi_ewin) && (!gwins[i]->pager) && @@ -929,18 +972,23 @@ HandleMotion(XEvent * ev) di->item.slider.wanted_val += dx; di->item.slider.val = di->item.slider.lower + (((di->item.slider.wanted_val * - (di->item.slider.upper - di->item.slider.lower)) / - (di->item.slider.base_w - di->item.slider.knob_w)) / + (di->item.slider.upper - + di->item.slider.lower)) / + (di->item.slider.base_w - + di->item.slider.knob_w)) / di->item.slider.unit) * di->item.slider.unit; } else { di->item.slider.wanted_val += dy; di->item.slider.val = di->item.slider.lower + - ((((di->item.slider.base_h - di->item.slider.knob_h - + ((((di-> + item.slider.base_h - di->item.slider.knob_h - di->item.slider.wanted_val) * - (di->item.slider.upper - di->item.slider.lower)) / - (di->item.slider.base_h - di->item.slider.knob_h)) / + (di->item.slider.upper - + di->item.slider.lower)) / + (di->item.slider.base_h - + di->item.slider.knob_h)) / di->item.slider.unit) * di->item.slider.unit; } if (di->item.slider.val < di->item.slider.lower) @@ -1013,7 +1061,8 @@ HandleDestroy(XEvent * ev) } if (mode.doingslide) { - DrawEwinShape(ewin, mode.slidemode, ewin->x, ewin->y, ewin->client.w, ewin->client.h, 2); + DrawEwinShape(ewin, mode.slidemode, ewin->x, ewin->y, + ewin->client.w, ewin->client.h, 2); mode.doingslide = 0; } if (ewin == mode.focuswin) @@ -1179,7 +1228,9 @@ HandleReparent(XEvent * ev) Efree(lst); if (!found) { - ewin = RemoveItem(NULL, ev->xreparent.window, LIST_FINDBY_ID, LIST_TYPE_EWIN); + ewin = + RemoveItem(NULL, ev->xreparent.window, LIST_FINDBY_ID, + LIST_TYPE_EWIN); if (ewin) { if (ewin == mode.ewin) @@ -1274,8 +1325,7 @@ HandleConfigureRequest(XEvent * ev) ewin->client.height.max = h; MoveResizeEwin(ewin, x - ewin->border->border.left, - y - ewin->border->border.top, - w, h); + y - ewin->border->border.top, w, h); if (mode.mode == MODE_MOVE) ICCCM_Configure(ewin); { @@ -1334,7 +1384,8 @@ HandleResizeRequest(XEvent * ev) ReZoom(ewin); } else - EResizeWindow(disp, win, ev->xresizerequest.width, ev->xresizerequest.height); + EResizeWindow(disp, win, ev->xresizerequest.width, + ev->xresizerequest.height); EDBUG_RETURN_; } @@ -1440,7 +1491,8 @@ HandleMapRequest(XEvent * ev) { EWin *ewin; - ewin = FindItem(NULL, ev->xmap.window, LIST_FINDBY_ID, LIST_TYPE_EWIN); + ewin = + FindItem(NULL, ev->xmap.window, LIST_FINDBY_ID, LIST_TYPE_EWIN); KDE_NewWindow(ewin); } @@ -1565,7 +1617,8 @@ HandleMouseDown(XEvent * ev) unsigned int bmask = 0, evmask; evmask = ev->xbutton.state & - (Button1Mask | Button2Mask | Button3Mask | Button4Mask | Button5Mask); + (Button1Mask | Button2Mask | Button3Mask | Button4Mask | + Button5Mask); if (ev->xbutton.button == 1) bmask = Button1Mask; else if (ev->xbutton.button == 2) @@ -1589,8 +1642,8 @@ HandleMouseDown(XEvent * ev) if (mode.tooltips) DoIn("TOOLTIP_TIMEOUT", mode.tiptime, ToolTipTimeout, 0, NULL); - if ((((float)(ev->xbutton.time - last_time) / 1000) < mode_double_click_time) && - ((int)(ev->xbutton.button) == (int)(last_button))) + if ((((float)(ev->xbutton.time - last_time) / 1000) < mode_double_click_time) + && ((int)(ev->xbutton.button) == (int)(last_button))) double_click = 1; last_time = ev->xbutton.time; last_button = ev->xbutton.button; @@ -1615,8 +1668,7 @@ HandleMouseDown(XEvent * ev) XUngrabPointer(disp, CurrentTime); - ac = FindItem("DESKBINDINGS", 0, LIST_FINDBY_NAME, - LIST_TYPE_ACLASS); + ac = FindItem("DESKBINDINGS", 0, LIST_FINDBY_NAME, LIST_TYPE_ACLASS); if (ac) { if (!EventAclass(ev, ac)) @@ -1667,7 +1719,8 @@ HandleMouseDown(XEvent * ev) ewin2 = FindEwinByMenu(mi->child); if (ewin2) { - MoveEwin(ewin2, ewin->x + ewin->border->border.left + mx + mw, + MoveEwin(ewin2, + ewin->x + ewin->border->border.left + mx + mw, ewin->y + ewin->border->border.top + my - ewin2->border->border.top); RaiseEwin(ewin2); @@ -1702,7 +1755,8 @@ HandleMouseDown(XEvent * ev) mode.context_ewin = ewins[i]; mode.borderpartpress = 1; if (ewins[i]->border->part[j].aclass) - EventAclass(ev, ewins[i]->border->part[j].aclass); + EventAclass(ev, + ewins[i]->border->part[j].aclass); mode.borderpartpress = 0; } Efree(ewins); @@ -1721,7 +1775,8 @@ HandleMouseDown(XEvent * ev) { GrabThePointer(win); if (buttons[i]->inside_win) - XSendEvent(disp, buttons[i]->inside_win, False, ButtonPressMask, ev); + XSendEvent(disp, buttons[i]->inside_win, False, + ButtonPressMask, ev); mode.button = buttons[i]; buttons[i]->state = STATE_CLICKED; DrawButton(buttons[i]); @@ -1792,9 +1847,11 @@ HandleMouseDown(XEvent * ev) { di->item.slider.in_drag = 1; if (di->item.slider.horizontal) - di->item.slider.wanted_val = di->item.slider.knob_x; + di->item.slider.wanted_val = + di->item.slider.knob_x; else - di->item.slider.wanted_val = di->item.slider.knob_y; + di->item.slider.wanted_val = + di->item.slider.knob_y; } } di->clicked = 1; @@ -1808,8 +1865,7 @@ HandleMouseDown(XEvent * ev) ActionClass *ac; ac = (ActionClass *) FindItem("BUTTONBINDINGS", 0, - LIST_FINDBY_NAME, - LIST_TYPE_ACLASS); + LIST_FINDBY_NAME, LIST_TYPE_ACLASS); if (ac) { mode.ewin = ewin; @@ -1847,24 +1903,24 @@ HandleMouseDown(XEvent * ev) int hx, hy; Window dw; - XTranslateCoordinates(disp, p->hi_win, p->win, 0, 0, &hx, &hy, &dw); + XTranslateCoordinates(disp, p->hi_win, p->win, 0, 0, &hx, &hy, + &dw); ev->xbutton.x += hx; ev->xbutton.y += hy; } - if (ev->xbutton.button == 3) + if (ev->xbutton.button == mode.pager_menu_button) { if ((ev->xbutton.x >= 0) && (ev->xbutton.y >= 0) && (ev->xbutton.x < p->w) && (ev->xbutton.y < p->h)) PagerShowMenu(p, ev->xbutton.x, ev->xbutton.y); } - else if (ev->xbutton.button == 1) + else if (ev->xbutton.button == mode.pager_win_button) { ewin = EwinInPagerAt(p, ev->xbutton.x, ev->xbutton.y); if ((ewin) && (!ewin->pager)) { Window dw; - int wx, wy, ww, wh, ax, ay, cx, cy, - px, py; + int wx, wy, ww, wh, ax, ay, cx, cy, px, py; PagerHideHi(p); pwin_px = ewin->x; @@ -1876,9 +1932,12 @@ HandleMouseDown(XEvent * ev) wy = ((ewin->y + (cy * root.h)) * (p->h / ay)) / root.h; ww = ((ewin->w) * (p->w / ax)) / root.w; wh = ((ewin->h) * (p->h / ay)) / root.h; - XTranslateCoordinates(disp, p->win, root.win, 0, 0, &px, &py, &dw); - EMoveResizeWindow(disp, p->hi_win, px + wx, py + wy, ww, wh); - ESetWindowBackgroundPixmap(disp, p->hi_win, ewin->mini_pmap); + XTranslateCoordinates(disp, p->win, root.win, 0, 0, &px, + &py, &dw); + EMoveResizeWindow(disp, p->hi_win, px + wx, py + wy, ww, + wh); + ESetWindowBackgroundPixmap(disp, p->hi_win, + ewin->mini_pmap); EMapRaised(disp, p->hi_win); GrabThePointer(p->hi_win); p->hi_visible = 1; @@ -1936,7 +1995,9 @@ HandleMouseUp(XEvent * ev) ewin = GetEwin(); if (ewin) { - gwins = ListWinGroupMembersForEwin(ewin, ACTION_MOVE, mode.nogroup, &num); + gwins = + ListWinGroupMembersForEwin(ewin, ACTION_MOVE, mode.nogroup, + &num); if ((mode.movemode == 0) && (mode.mode == MODE_MOVE)) for (i = 0; i < num; i++) DetermineEwinFloat(gwins[i], 0, 0); @@ -1991,7 +2052,9 @@ HandleMouseUp(XEvent * ev) ewin = GetEwin(); if (ewin) { - gwins = ListWinGroupMembersForEwin(ewin, ACTION_MOVE, mode.nogroup, &num); + gwins = + ListWinGroupMembersForEwin(ewin, ACTION_MOVE, mode.nogroup, + &num); if ((mode.movemode == 0) && (mode.mode == MODE_MOVE)) for (i = 0; i < num; i++) DetermineEwinFloat(gwins[i], 0, 0); @@ -2149,8 +2212,9 @@ HandleMouseUp(XEvent * ev) if ((!ewins[i]->menu) && (!mode.cur_menu_mode)) mode.context_ewin = ewins[i]; mode.borderpartpress = 1; - if ((click_was_in == win2) && (ewins[i]->border->part[j].aclass) && - (!wasmovres)) + if ((click_was_in == win2) + && (ewins[i]->border->part[j].aclass) + && (!wasmovres)) EventAclass(ev, ewins[i]->border->part[j].aclass); mode.borderpartpress = 0; if ((mode.slideout) && (pslideout)) @@ -2170,7 +2234,8 @@ HandleMouseUp(XEvent * ev) buttons = (Button **) ListItemType(&num, LIST_TYPE_BUTTON); for (i = 0; i < num; i++) { - if ((click_was_in == buttons[i]->win) || (click_was_in == buttons[i]->event_win)) + if ((click_was_in == buttons[i]->win) + || (click_was_in == buttons[i]->event_win)) { if ((buttons[i]->inside_win) && (!wasmovres)) XSendEvent(disp, buttons[i]->inside_win, False, @@ -2269,8 +2334,7 @@ HandleMouseUp(XEvent * ev) ActionClass *ac; ac = (ActionClass *) FindItem("BUTTONBINDINGS", 0, - LIST_FINDBY_NAME, - LIST_TYPE_ACLASS); + LIST_FINDBY_NAME, LIST_TYPE_ACLASS); if (ac) { mode.borderpartpress = 1; @@ -2292,7 +2356,7 @@ HandleMouseUp(XEvent * ev) int pax, pay; p = FindPager(ev->xbutton.window); - if ((p) && (ev->xbutton.button == 2)) + if ((p) && (ev->xbutton.button == mode.pager_sel_button)) { PagerAreaAt(p, ev->xbutton.x, ev->xbutton.y, &pax, &pay); GotoDesktop(p->desktop); @@ -2302,14 +2366,15 @@ HandleMouseUp(XEvent * ev) } SetCurrentArea(pax, pay); } - else if ((p) && (ev->xbutton.button == 1)) + else if ((p) && (ev->xbutton.button == mode.pager_win_button)) { if (ev->xbutton.window == p->hi_win) { int hx, hy; Window dw; - XTranslateCoordinates(disp, p->hi_win, p->win, 0, 0, &hx, &hy, &dw); + XTranslateCoordinates(disp, p->hi_win, p->win, 0, 0, &hx, &hy, + &dw); ev->xbutton.x += hx; ev->xbutton.y += hy; } @@ -2325,13 +2390,18 @@ HandleMouseUp(XEvent * ev) ew = desks.desk[desks.current].list[i]; if (((ew->pager) || (ew->ibox)) && - ((ew->desktop == desks.current) || - (ew->sticky))) + ((ew->desktop == desks.current) || (ew->sticky))) { - if ((ev->xbutton.x_root >= (ew->x + ew->border->border.left)) && - (ev->xbutton.x_root < (ew->x + ew->w - ew->border->border.right)) && - (ev->xbutton.y_root >= (ew->y + ew->border->border.top)) && - (ev->xbutton.y_root < (ew->y + ew->h - ew->border->border.bottom))) + if ( + (ev->xbutton.x_root >= + (ew->x + ew->border->border.left)) + && (ev->xbutton.x_root < + (ew->x + ew->w - ew->border->border.right)) + && (ev->xbutton.y_root >= + (ew->y + ew->border->border.top)) + && (ev->xbutton.y_root < + (ew->y + ew->h - + ew->border->border.bottom))) { ewin = ew; i = desks.desk[desks.current].num; @@ -2342,13 +2412,13 @@ HandleMouseUp(XEvent * ev) if ((ewin) && (ewin->pager)) { Pager *pp; - int w, h, x, y, ax, ay, cx, cy, px, - py; + int w, h, x, y, ax, ay, cx, cy, px, py; int wx, wy, base_x = 0, base_y = 0; Window dw; - gwins = ListWinGroupMembersForEwin(p->hi_ewin, ACTION_MOVE, - mode.nogroup, &num); + gwins = + ListWinGroupMembersForEwin(p->hi_ewin, ACTION_MOVE, + mode.nogroup, &num); pp = ewin->pager; cx = desks.desk[pp->desktop].current_area_x; cy = desks.desk[pp->desktop].current_area_y; @@ -2363,8 +2433,7 @@ HandleMouseUp(XEvent * ev) (root.h / (pp->h / ay)); if (((x + w) <= px) || ((y + h) <= py) || - (x >= (px + pp->w)) || - (y >= (py + pp->h))) + (x >= (px + pp->w)) || (y >= (py + pp->h))) { int ndesk, nx, ny; @@ -2381,7 +2450,9 @@ HandleMouseUp(XEvent * ev) } else { - gwins = ListWinGroupMembersForEwin(p->hi_ewin, ACTION_MOVE, + gwins = + ListWinGroupMembersForEwin(p->hi_ewin, + ACTION_MOVE, mode.nogroup, &num); /* get get the location of the base win so we can move the */ /* rest of the windows in the group to the correct offset */ @@ -2395,25 +2466,29 @@ HandleMouseUp(XEvent * ev) { if (!gwins[i]->sticky) MoveEwinToDesktopAt(gwins[i], pp->desktop, - wx + (gwin_px[i] - base_x), - wy + (gwin_py[i] - base_y)); + wx + (gwin_px[i] - + base_x), + wy + (gwin_py[i] - + base_y)); else MoveEwin(gwins[i], - ((root.w * ax) + wx + (gwin_px[i] - base_x)) % root.w, - ((root.h * ay) + wy + (gwin_py[i] - base_y)) % root.h); + ((root.w * ax) + wx + + (gwin_px[i] - base_x)) % root.w, + ((root.h * ay) + wy + + (gwin_py[i] - base_y)) % root.h); } } } else if ((ewin) && (ewin->ibox) && (!((p->hi_ewin->ibox) || ((ewin->client.need_input) && - ((ewin->skiptask) || (ewin->skipwinlist))) - ))) + ((ewin->skiptask) || (ewin->skipwinlist)))))) { char was_shaded; - gwins = ListWinGroupMembersForEwin(p->hi_ewin, ACTION_MOVE, - mode.nogroup, &num); + gwins = + ListWinGroupMembersForEwin(p->hi_ewin, ACTION_MOVE, + mode.nogroup, &num); for (i = 0; i < num; i++) { if (!gwins[i]->pager) @@ -2424,13 +2499,19 @@ HandleMouseUp(XEvent * ev) if (ewin->ibox) { IB_Animate(1, gwins[i], ewin->ibox->ewin); - UpdateAppIcon(gwins[i], ewin->ibox->icon_mode); + UpdateAppIcon(gwins[i], + ewin->ibox->icon_mode); } HideEwin(gwins[i]); MoveEwin(gwins[i], gwin_px[i] + - ((desks.desk[gwins[i]->desktop].current_area_x) - - p->hi_ewin->area_x) * root.w, gwin_py[i] + - ((desks.desk[gwins[i]->desktop].current_area_y) - + ((desks. + desk[gwins[i]->desktop]. + current_area_x) - + p->hi_ewin->area_x) * root.w, + gwin_py[i] + + ((desks. + desk[gwins[i]->desktop]. + current_area_y) - p->hi_ewin->area_y) * root.h); if (was_shaded != gwins[i]->shaded) InstantShadeEwin(gwins[i]); @@ -2441,8 +2522,8 @@ HandleMouseUp(XEvent * ev) } else { - int ndesk, nx, ny, base_x = 0, base_y = 0, - ax, ay; + int ndesk, nx, ny, base_x = 0, base_y = + 0, ax, ay; ndesk = desks.current; nx = (int)ev->xbutton.x_root - @@ -2453,8 +2534,9 @@ HandleMouseUp(XEvent * ev) ((int)p->hi_ewin->h / 2); GetAreaSize(&ax, &ay); - gwins = ListWinGroupMembersForEwin(p->hi_ewin, ACTION_MOVE, - mode.nogroup, &num); + gwins = + ListWinGroupMembersForEwin(p->hi_ewin, ACTION_MOVE, + mode.nogroup, &num); for (i = 0; i < num; i++) if (gwins[i] == p->hi_ewin) { @@ -2468,8 +2550,10 @@ HandleMouseUp(XEvent * ev) ny + (gwin_py[i] - base_y)); else MoveEwin(gwins[i], - ((root.w * ax) + nx + (gwin_px[i] - base_x)) % root.w, - ((root.h * ay) + ny + (gwin_py[i] - base_y)) % root.h); + ((root.w * ax) + nx + + (gwin_px[i] - base_x)) % root.w, + ((root.h * ay) + ny + + (gwin_py[i] - base_y)) % root.h); if (!gwins[i]->sticky) MoveEwinToDesktop(gwins[i], ndesk); } @@ -2533,7 +2617,8 @@ SubmenuShowTimeout(int val, void *dat) ewin2 = FindEwinByMenu(data->mi->child); if (ewin2) { - MoveEwin(ewin2, data->ewin->x + data->ewin->border->border.left + mx + mw, + MoveEwin(ewin2, + data->ewin->x + data->ewin->border->border.left + mx + mw, data->ewin->y + data->ewin->border->border.top + my - ewin2->border->border.top); RaiseEwin(ewin2); @@ -2645,8 +2730,7 @@ HandleMouseIn(XEvent * ev) mdata.m = m; mdata.mi = mi; mdata.ewin = ewin; - DoIn("SUBMENU_SHOW", 0.2, SubmenuShowTimeout, - 0, &mdata); + DoIn("SUBMENU_SHOW", 0.2, SubmenuShowTimeout, 0, &mdata); } } EDBUG_RETURN_; @@ -2672,7 +2756,8 @@ HandleMouseIn(XEvent * ev) if ((!ewins[i]->menu) && (!mode.cur_menu_mode)) mode.context_ewin = ewins[i]; if (ewins[i]->border->part[j].aclass) - EventAclass(ev, ewins[i]->border->part[j].aclass); + EventAclass(ev, + ewins[i]->border->part[j].aclass); } } Efree(ewins); @@ -2797,7 +2882,8 @@ HandleMouseOut(XEvent * ev) if ((!ewins[i]->menu) && (!mode.cur_menu_mode)) mode.context_ewin = ewins[i]; if (ewins[i]->border->part[j].aclass) - EventAclass(ev, ewins[i]->border->part[j].aclass); + EventAclass(ev, + ewins[i]->border->part[j].aclass); } } Efree(ewins); diff --git a/src/file.c b/src/file.c index 17e824c2..b2c3792b 100644 --- a/src/file.c +++ b/src/file.c @@ -54,8 +54,7 @@ Etmp(char *s) n_calls = (unsigned long)time(NULL) + (unsigned long)getpid(); Esnprintf(s, 1024, "%s/TMP_%Xl", UserEDir(), n_calls); n_calls++; - EDBUG_RETURN_ -} +EDBUG_RETURN_} void md(char *s) @@ -263,8 +262,7 @@ cp(char *s, char *ss) EDBUG_RETURN_; } -time_t -moddate(char *s) +time_t moddate(char *s) { struct stat st; @@ -762,8 +760,7 @@ field(char *s, int field) fword(s, field + 1, buf); if (buf[0]) { - if ((!strcmp(buf, "NULL")) || - (!strcmp(buf, "(null)"))) + if ((!strcmp(buf, "NULL")) || (!strcmp(buf, "(null)"))) EDBUG_RETURN(NULL); EDBUG_RETURN(duplicate(buf)); } @@ -780,8 +777,7 @@ fillfield(char *s, int field, char *buf) fword(s, field + 1, buf); if (buf[0]) { - if ((!strcmp(buf, "NULL")) || - (!strcmp(buf, "(null)"))) + if ((!strcmp(buf, "NULL")) || (!strcmp(buf, "(null)"))) { buf[0] = 0; EDBUG_RETURN(0); diff --git a/src/finders.c b/src/finders.c index 700ddc6e..ebb3d5e3 100644 --- a/src/finders.c +++ b/src/finders.c @@ -249,7 +249,9 @@ ListWinGroups(EWin * ewin, char group_select, int *num) { case GROUP_SELECT_EWIN_ONLY: groups = (Group **) Emalloc(sizeof(Group *) * ewin->num_groups); - groups = (Group **) memcpy(groups, ewin->groups, sizeof(Group *) * ewin->num_groups); + groups = + (Group **) memcpy(groups, ewin->groups, + sizeof(Group *) * ewin->num_groups); *num = ewin->num_groups; break; case GROUP_SELECT_ALL_EXCEPT_EWIN: @@ -347,12 +349,16 @@ ListWinGroupMembersForEwin(EWin * ewin, int action, char nogroup, int *num) if (!daddy_says_no_no) { - gwins = Erealloc(gwins, sizeof(EWin *) * (*num + ewin->groups[i]->num_members)); + gwins = + Erealloc(gwins, + sizeof(EWin *) * (*num + + ewin->groups[i]->num_members)); /* Check if a window is not already in the group */ for (k = 0; k < ewin->groups[i]->num_members; k++) { /* To get consistent behaviour, limit groups to a single desktop for now: */ - if (ewin->groups[i]->members[k]->desktop == ewin->desktop) + if (ewin->groups[i]->members[k]->desktop == + ewin->desktop) { inlist = 0; for (j = 0; j < (*num); j++) diff --git a/src/focus.c b/src/focus.c index 6278e5e8..b379ad88 100644 --- a/src/focus.c +++ b/src/focus.c @@ -75,9 +75,9 @@ GetNextFocusEwin(void) if (((ewin->sticky) || (ewin->desktop == desks.current)) && ((ewin->area_x == ax) && (ewin->area_y == ay)) && (!ewin->skipfocus) && (!ewin->shaded) && - (!ewin->menu) && (!ewin->pager) && (!ewin->ibox) && - (!ewin->iconified) /*&& (ewin->client.mwm_decor_title) && - * (ewin->client.mwm_decor_border) */ ) + (!ewin->menu) && (!ewin->pager) && (!ewin->ibox) && (!ewin->iconified) /*&& (ewin->client.mwm_decor_title) && + * (ewin->client.mwm_decor_border) */ + ) { num++; lst = Erealloc(lst, sizeof(EWin *) * num); @@ -146,9 +146,9 @@ GetPrevFocusEwin(void) if (((ewin->sticky) || (ewin->desktop == desks.current)) && ((ewin->area_x == ax) && (ewin->area_y == ay)) && (!ewin->skipfocus) && (!ewin->shaded) && - (!ewin->menu) && (!ewin->pager) && (!ewin->ibox) && - (!ewin->iconified) /*&& (ewin->client.mwm_decor_title) && - * (ewin->client.mwm_decor_border) */ ) + (!ewin->menu) && (!ewin->pager) && (!ewin->ibox) && (!ewin->iconified) /*&& (ewin->client.mwm_decor_title) && + * (ewin->client.mwm_decor_border) */ + ) { num++; lst = Erealloc(lst, sizeof(EWin *) * num); @@ -207,13 +207,14 @@ FixFocus(void) if (mode.focusmode == FOCUS_CLICK) { if (!(ewin->active)) - XGrabButton(disp, AnyButton, AnyModifier, ewin->win_container, - False, ButtonPressMask, + XGrabButton(disp, AnyButton, AnyModifier, + ewin->win_container, False, ButtonPressMask, GrabModeSync, GrabModeAsync, None, None); } else { - XUngrabButton(disp, AnyButton, AnyModifier, ewin->win_container); + XUngrabButton(disp, AnyButton, AnyModifier, + ewin->win_container); GrabButtonGrabs(ewin); } } @@ -345,7 +346,8 @@ FocusToEWin(EWin * ewin) if ((ax != ewin->area_x) || (ay != ewin->area_y)) { if ((ewin->x >= root.w) || (ewin->y >= root.h) || - ((ewin->x + ewin->w) < 0) || ((ewin->y + ewin->h) < 0)) + ((ewin->x + ewin->w) < 0) + || ((ewin->y + ewin->h) < 0)) SetCurrentArea(ewin->area_x, ewin->area_y); } } @@ -379,8 +381,7 @@ BeginNewDeskFocus(void) FocusChangeMask | SubstructureNotifyMask | SubstructureRedirectMask | - PropertyChangeMask | - ResizeRedirectMask); + PropertyChangeMask | ResizeRedirectMask); if (ewin->pager) XSelectInput(disp, ewin->client.win, PropertyChangeMask | @@ -389,35 +390,29 @@ BeginNewDeskFocus(void) StructureNotifyMask | ColormapChangeMask | ButtonPressMask | - ButtonReleaseMask | - PointerMotionMask); + ButtonReleaseMask | PointerMotionMask); else if (ewin->dialog) XSelectInput(disp, ewin->client.win, PropertyChangeMask | FocusChangeMask | ResizeRedirectMask | StructureNotifyMask | - ColormapChangeMask | - ExposureMask | - KeyPressMask); + ColormapChangeMask | ExposureMask | KeyPressMask); else XSelectInput(disp, ewin->client.win, PropertyChangeMask | FocusChangeMask | ResizeRedirectMask | - StructureNotifyMask | - ColormapChangeMask); + StructureNotifyMask | ColormapChangeMask); for (j = 0; j < ewin->border->num_winparts; j++) { if (ewin->border->part[j].flags & FLAG_TITLE) XSelectInput(disp, ewin->bits[j].win, ExposureMask | - ButtonPressMask | - ButtonReleaseMask); + ButtonPressMask | ButtonReleaseMask); else XSelectInput(disp, ewin->bits[j].win, - ButtonPressMask | - ButtonReleaseMask); + ButtonPressMask | ButtonReleaseMask); } } Efree(lst); @@ -426,8 +421,7 @@ BeginNewDeskFocus(void) XSelectInput(disp, desks.desk[i].win, PropertyChangeMask | SubstructureRedirectMask | - ButtonPressMask | - ButtonReleaseMask); + ButtonPressMask | ButtonReleaseMask); } void @@ -454,8 +448,7 @@ NewDeskFocus(void) PointerMotionMask | PropertyChangeMask | ResizeRedirectMask | - ButtonPressMask | - ButtonReleaseMask); + ButtonPressMask | ButtonReleaseMask); if (ewin->pager) XSelectInput(disp, ewin->client.win, PropertyChangeMask | @@ -466,8 +459,7 @@ NewDeskFocus(void) StructureNotifyMask | ColormapChangeMask | ButtonPressMask | - ButtonReleaseMask | - PointerMotionMask); + ButtonReleaseMask | PointerMotionMask); else if (ewin->dialog) XSelectInput(disp, ewin->client.win, PropertyChangeMask | @@ -476,9 +468,7 @@ NewDeskFocus(void) FocusChangeMask | ResizeRedirectMask | StructureNotifyMask | - ColormapChangeMask | - ExposureMask | - KeyPressMask); + ColormapChangeMask | ExposureMask | KeyPressMask); else XSelectInput(disp, ewin->client.win, PropertyChangeMask | @@ -486,8 +476,7 @@ NewDeskFocus(void) LeaveWindowMask | FocusChangeMask | ResizeRedirectMask | - StructureNotifyMask | - ColormapChangeMask); + StructureNotifyMask | ColormapChangeMask); for (j = 0; j < ewin->border->num_winparts; j++) { if (ewin->border->part[j].flags & FLAG_TITLE) @@ -498,8 +487,7 @@ NewDeskFocus(void) ButtonPressMask | ButtonReleaseMask | EnterWindowMask | - LeaveWindowMask | - PointerMotionMask); + LeaveWindowMask | PointerMotionMask); else XSelectInput(disp, ewin->bits[j].win, KeyPressMask | @@ -507,8 +495,7 @@ NewDeskFocus(void) ButtonPressMask | ButtonReleaseMask | EnterWindowMask | - LeaveWindowMask | - PointerMotionMask); + LeaveWindowMask | PointerMotionMask); } } Efree(lst); @@ -523,11 +510,8 @@ NewDeskFocus(void) ButtonMotionMask | PropertyChangeMask | SubstructureRedirectMask | - KeyPressMask | - KeyReleaseMask | - PointerMotionMask); - if ((mode.focusmode == FOCUS_POINTER) || - (mode.focusmode == FOCUS_SLOPPY)) + KeyPressMask | KeyReleaseMask | PointerMotionMask); + if ((mode.focusmode == FOCUS_POINTER) || (mode.focusmode == FOCUS_SLOPPY)) { ewin = GetEwinPointerInClient(); if (ewin) diff --git a/src/fx.c b/src/fx.c index 1659257a..47438c0f 100644 --- a/src/fx.c +++ b/src/fx.c @@ -27,15 +27,15 @@ #endif typedef struct _fxhandler - { - char *name; - void (*init_func) (char *name); - void (*desk_func) (void); - void (*quit_func) (void); - void (*pause_func) (void); - char in_use; - char paused; - } +{ + char *name; + void (*init_func) (char *name); + void (*desk_func) (void); + void (*quit_func) (void); + void (*pause_func) (void); + char in_use; + char paused; +} FXHandler; void FX_Ripple_Init(char *name); @@ -56,19 +56,19 @@ void FX_ImageSpinner_Quit(void); void FX_ImageSpinner_Pause(void); static int num_fx_handlers = 4; -static FXHandler fx_handlers[] = -{ +static FXHandler fx_handlers[] = { {"ripples", FX_Ripple_Init, FX_Ripple_Desk, FX_Ripple_Quit, FX_Ripple_Pause, 0, 0}, {"raindrops", - FX_Raindrops_Init, FX_Raindrops_Desk, FX_Raindrops_Quit, FX_Raindrops_Pause, + FX_Raindrops_Init, FX_Raindrops_Desk, FX_Raindrops_Quit, FX_Raindrops_Pause, 0, 0}, {"waves", FX_Waves_Init, FX_Waves_Desk, FX_Waves_Quit, FX_Waves_Pause, 0, 0}, {"imagespinner", - FX_ImageSpinner_Init, FX_ImageSpinner_Desk, FX_ImageSpinner_Quit, FX_ImageSpinner_Pause, + FX_ImageSpinner_Init, FX_ImageSpinner_Desk, FX_ImageSpinner_Quit, + FX_ImageSpinner_Pause, 0, 0} }; @@ -250,24 +250,23 @@ FX_ripple_timeout(int val, void *data) gc = XCreateGC(disp, fx_ripple_win, GCSubwindowMode, &gcv); gc1 = XCreateGC(disp, fx_ripple_win, 0L, &gcv); if (!before) - DIALOG_OK("Starting up Ripples FX...", - "\n" - "You have just started the Ripples Effect.\n" - "\n" - "If you look closely on your desktop background, and if it\n" - "doesn't have a solid colour (ie has a background texture or\n" - "image), you will see a pool of water at the bottom of your\n" - "screen that reflects everything above it and \"ripples\".\n" - "\n" - "To disable this effect just select this option again to toggle\n" - "it off.\n"); + DIALOG_OK(gettext("Starting up Ripples FX..."), + gettext("\n" + "You have just started the Ripples Effect.\n" + "\n" + "If you look closely on your desktop background, and if it\n" + "doesn't have a solid colour (ie has a background texture or\n" + "image), you will see a pool of water at the bottom of your\n" + "screen that reflects everything above it and \"ripples\".\n" + "\n" + "To disable this effect just select this option again to toggle\n" + "it off.\n")); before = 1; } if (fx_ripple_count == 0) XCopyArea(disp, fx_ripple_win, fx_ripple_above, gc, 0, root.h - (fx_ripple_waterh * 3), - root.w, fx_ripple_waterh * 2, - 0, 0); + root.w, fx_ripple_waterh * 2, 0, 0); fx_ripple_count++; if (fx_ripple_count > 32) fx_ripple_count = 0; @@ -322,8 +321,7 @@ FX_Ripple_Quit(void) { RemoveTimerEvent("FX_RIPPLE_TIMEOUT"); XClearArea(disp, fx_ripple_win, - 0, root.h - fx_ripple_waterh, - root.w, fx_ripple_waterh, False); + 0, root.h - fx_ripple_waterh, root.w, fx_ripple_waterh, False); } void @@ -359,11 +357,11 @@ static PixImg *fx_raindrops_draw = NULL; void FX_raindrops_timeout(int val, void *data); typedef struct _drop_context - { - int x, y; - int count; - PixImg *buf; - } +{ + int x, y; + int count; + PixImg *buf; +} DropContext; static DropContext fx_raindrops[4]; @@ -385,53 +383,53 @@ FX_raindrops_timeout(int val, void *data) if (!id->x.shm) { - DIALOG_OK("Unable to display raindrops", - "\n" - "Enlightenment is unable to display raindrops on this\n" - "display because Shared memory is not available on this\n" - "X-Server.\n" - "\n" - "This may be due to Enlightenment being a remote client\n" - "running over the network, a MIT-SHM incapable X-server,\n" - "having run out of SHM ID's on the system or Shared\n" - "Memory support being turned off in Imlib\n" - "\n" - "You may correct this by either running `imlib_config'\n" - "or copying the system imrc (/usr/etc/imrc) to ~/.imrc\n" - "and editing it, enabling shared memory.\n" - "\n"); + DIALOG_OK(gettext("Unable to display raindrops"), + gettext("\n" + "Enlightenment is unable to display raindrops on this\n" + "display because Shared memory is not available on this\n" + "X-Server.\n" + "\n" + "This may be due to Enlightenment being a remote client\n" + "running over the network, a MIT-SHM incapable X-server,\n" + "having run out of SHM ID's on the system or Shared\n" + "Memory support being turned off in Imlib\n" + "\n" + "You may correct this by either running `imlib_config'\n" + "or copying the system imrc (/usr/etc/imrc) to ~/.imrc\n" + "and editing it, enabling shared memory.\n" + "\n")); return; } if (!id->x.shmp) { - DIALOG_OK("Unable to display raindrops", - "\n" - "Enlightenment is unable to display raindrops on this\n" - "display because shared pixmaps are not available on this\n" - "X-Server.\n" - "\n" - "This may be due to either the X-Server not implimenting\n" - "shared pixmaps, or shared pixmaps being disabled in\n" - "Imlib's configuration.\n" - "\n" - "You may correct this by either running `imlib_config'\n" - "or copying the system imrc (/usr/etc/imrc) to ~/.imrc\n" - "and editing it, enabling shared pixmaps.\n" - "\n"); + DIALOG_OK(gettext("Unable to display raindrops"), + gettext("\n" + "Enlightenment is unable to display raindrops on this\n" + "display because shared pixmaps are not available on this\n" + "X-Server.\n" + "\n" + "This may be due to either the X-Server not implimenting\n" + "shared pixmaps, or shared pixmaps being disabled in\n" + "Imlib's configuration.\n" + "\n" + "You may correct this by either running `imlib_config'\n" + "or copying the system imrc (/usr/etc/imrc) to ~/.imrc\n" + "and editing it, enabling shared pixmaps.\n" + "\n")); return; } if (!before) - DIALOG_OK("Starting up Raindrops FX...", - "\n" - "You have just started the Raindrops Effect.\n" - "\n" - "If you look closely on your desktop background, and if it\n" - "doesn't have a solid colour (ie has a background texture or\n" - "image), you will see \"raindrops\" hit the background and\n" - "make little splashes. This Effect can be VERY CPU intensive.\n" - "\n" - "To disable this effect just select this option again to toggle\n" - "it off.\n"); + DIALOG_OK(gettext("Starting up Raindrops FX..."), + gettext("\n" + "You have just started the Raindrops Effect.\n" + "\n" + "If you look closely on your desktop background, and if it\n" + "doesn't have a solid colour (ie has a background texture or\n" + "image), you will see \"raindrops\" hit the background and\n" + "make little splashes. This Effect can be VERY CPU intensive.\n" + "\n" + "To disable this effect just select this option again to toggle\n" + "it off.\n")); before = 1; if (first) { @@ -439,14 +437,16 @@ FX_raindrops_timeout(int val, void *data) first = 0; for (i = 0; i < 256; i++) - sintab[i] = (char)(sin(((double)i) * M_PI_2 * 4 / 256) * fx_amplitude); + sintab[i] = + (char)(sin(((double)i) * M_PI_2 * 4 / 256) * fx_amplitude); for (j = 0; j < fx_raindrop_size; j++) { for (i = 0; i < fx_raindrop_size; i++) { xx = i - fx_raindrop_size2; yy = j - fx_raindrop_size2; - disttab[i][j] = (unsigned char)sqrt((double)((xx * xx) + (yy * yy))); + disttab[i][j] = + (unsigned char)sqrt((double)((xx * xx) + (yy * yy))); } } } @@ -459,8 +459,7 @@ FX_raindrops_timeout(int val, void *data) gc = XCreateGC(disp, fx_raindrops_win, GCSubwindowMode, &gcv); gc1 = XCreateGC(disp, fx_raindrops_win, 0L, &gcv); fx_raindrops_draw = ECreatePixImg(fx_raindrops_win, - fx_raindrop_size, - fx_raindrop_size); + fx_raindrop_size, fx_raindrop_size); if (!fx_raindrops_draw) return; for (i = 0; i < fx_raindrops_number; i++) @@ -508,21 +507,35 @@ FX_raindrops_timeout(int val, void *data) if (i != j) { if (((fx_raindrops[i].x >= fx_raindrops[j].x) && - (fx_raindrops[i].x < fx_raindrops[j].x + fx_raindrop_size) && - (fx_raindrops[i].y >= fx_raindrops[j].y) && - (fx_raindrops[i].y < fx_raindrops[j].y + fx_raindrop_size)) || - ((fx_raindrops[i].x + fx_raindrop_size >= fx_raindrops[j].x) && - (fx_raindrops[i].x + fx_raindrop_size < fx_raindrops[j].x + fx_raindrop_size) && - (fx_raindrops[i].y >= fx_raindrops[j].y) && - (fx_raindrops[i].y < fx_raindrops[j].y + fx_raindrop_size)) || - ((fx_raindrops[i].x >= fx_raindrops[j].x) && - (fx_raindrops[i].x < fx_raindrops[j].x + fx_raindrop_size) && - (fx_raindrops[i].y + fx_raindrop_size >= fx_raindrops[j].y) && - (fx_raindrops[i].y + fx_raindrop_size < fx_raindrops[j].y + fx_raindrop_size)) || - ((fx_raindrops[i].x + fx_raindrop_size >= fx_raindrops[j].x) && - (fx_raindrops[i].x + fx_raindrop_size < fx_raindrops[j].x + fx_raindrop_size) && - (fx_raindrops[i].y + fx_raindrop_size >= fx_raindrops[j].y) && - (fx_raindrops[i].y + fx_raindrop_size < fx_raindrops[j].y + fx_raindrop_size))) + (fx_raindrops[i].x < + fx_raindrops[j].x + fx_raindrop_size) + && (fx_raindrops[i].y >= fx_raindrops[j].y) + && (fx_raindrops[i].y < + fx_raindrops[j].y + fx_raindrop_size)) + || + ((fx_raindrops + [i].x + fx_raindrop_size >= fx_raindrops[j].x) + && (fx_raindrops[i].x + fx_raindrop_size < + fx_raindrops[j].x + fx_raindrop_size) + && (fx_raindrops[i].y >= fx_raindrops[j].y) + && (fx_raindrops[i].y < + fx_raindrops[j].y + fx_raindrop_size)) + || ((fx_raindrops[i].x >= fx_raindrops[j].x) + && (fx_raindrops[i].x < + fx_raindrops[j].x + fx_raindrop_size) + && (fx_raindrops[i].y + fx_raindrop_size >= + fx_raindrops[j].y) + && (fx_raindrops[i].y + fx_raindrop_size < + fx_raindrops[j].y + fx_raindrop_size)) + || + ((fx_raindrops + [i].x + fx_raindrop_size >= fx_raindrops[j].x) + && (fx_raindrops[i].x + fx_raindrop_size < + fx_raindrops[j].x + fx_raindrop_size) + && (fx_raindrops[i].y + fx_raindrop_size >= + fx_raindrops[j].y) + && (fx_raindrops[i].y + fx_raindrop_size < + fx_raindrops[j].y + fx_raindrop_size))) intersect = 1; } } @@ -530,7 +543,8 @@ FX_raindrops_timeout(int val, void *data) XShmGetImage(disp, fx_raindrops_win, fx_raindrops[i].buf->xim, fx_raindrops[i].x, fx_raindrops[i].y, 0xffffffff); } - percent_done = 1 + ((fx_raindrops[i].count << 8) / fx_raindrop_duration); + percent_done = + 1 + ((fx_raindrops[i].count << 8) / fx_raindrop_duration); for (y = 0; y < fx_raindrop_size; y++) { for (x = 0; x < fx_raindrop_size; x++) @@ -554,11 +568,13 @@ FX_raindrops_timeout(int val, void *data) int varx, vary; int phase, divisor, multiplier; - phase = ((percent - percent_done) * fx_frequency) & 0xff; + phase = + ((percent - percent_done) * fx_frequency) & 0xff; xx = x - fx_raindrop_size2; yy = y - fx_raindrop_size2; divisor = 1 + (dist << 8); - multiplier = (int)sintab[phase] * (256 - percent_done); + multiplier = + (int)sintab[phase] * (256 - percent_done); varx = ((-xx) * multiplier) / divisor; vary = ((-yy) * multiplier) / divisor; xx = x + varx; @@ -572,7 +588,8 @@ FX_raindrops_timeout(int val, void *data) else if (yy >= fx_raindrop_size) yy = fx_raindrop_size - 1; XPutPixel(fx_raindrops_draw->xim, x, y, - XGetPixel(fx_raindrops[i].buf->xim, xx, yy)); + XGetPixel(fx_raindrops[i].buf->xim, xx, + yy)); } } } @@ -582,7 +599,8 @@ FX_raindrops_timeout(int val, void *data) fx_raindrop_size, fx_raindrop_size, False); XSync(disp, False); } - DoIn("FX_RAINDROPS_TIMEOUT", (0.066 /*/ (float)fx_raindrops_number */ ), FX_raindrops_timeout, 0, NULL); + DoIn("FX_RAINDROPS_TIMEOUT", (0.066 /*/ (float)fx_raindrops_number */ ), + FX_raindrops_timeout, 0, NULL); return; val = 0; data = NULL; @@ -696,17 +714,17 @@ FX_Wave_timeout(int val, void *data) gc = XCreateGC(disp, fx_wave_win, GCSubwindowMode, &gcv); gc1 = XCreateGC(disp, fx_wave_win, 0L, &gcv); if (!before) - DIALOG_OK("Starting up Waves FX...", - "\n" - "You have just started the Waves Effect.\n" - "\n" - "If you look closely on your desktop background, and if it\n" - "doesn't have a solid colour (ie has a background texture or\n" - "image), you will see a pool of water at the bottom of your\n" - "screen that reflects everything above it and \"waves\".\n" - "\n" - "To disable this effect just select this option again to toggle\n" - "it off.\n"); + DIALOG_OK(gettext("Starting up Waves FX..."), + gettext("\n" + "You have just started the Waves Effect.\n" + "\n" + "If you look closely on your desktop background, and if it\n" + "doesn't have a solid colour (ie has a background texture or\n" + "image), you will see a pool of water at the bottom of your\n" + "screen that reflects everything above it and \"waves\".\n" + "\n" + "To disable this effect just select this option again to toggle\n" + "it off.\n")); before = 1; } @@ -715,8 +733,7 @@ FX_Wave_timeout(int val, void *data) { XCopyArea(disp, fx_wave_win, fx_wave_above, gc, 0, root.h - (FX_WAVE_WATERH * 3), - root.w, FX_WAVE_WATERH * 2, - 0, 0); + root.w, FX_WAVE_WATERH * 2, 0, 0); } /* Increment and roll the counter */ @@ -742,8 +759,7 @@ FX_Wave_timeout(int val, void *data) { XCopyArea(disp, fx_wave_above, fx_wave_win, gc1, 0, root.h - FX_WAVE_GRABH, - root.w, FX_WAVE_DEPTH * 2, - 0, root.h - FX_WAVE_GRABH); + root.w, FX_WAVE_DEPTH * 2, 0, root.h - FX_WAVE_GRABH); } /* Go through the bottom couple (FX_WAVE_WATERH) lines of the window */ @@ -781,8 +797,7 @@ FX_Wave_timeout(int val, void *data) sx = (int)(sin(incx2) * FX_WAVE_DEPTH); /* Display this block */ - XCopyArea(disp, fx_wave_above, fx_wave_win, gc1, - x, yy, /* x, y */ + XCopyArea(disp, fx_wave_above, fx_wave_win, gc1, x, yy, /* x, y */ FX_WAVE_WATERW, 1, /* w, h */ off + x, root.h - FX_WAVE_WATERH + y + sx /* dx, dy */ ); @@ -821,8 +836,7 @@ FX_Waves_Quit(void) { RemoveTimerEvent("FX_WAVE_TIMEOUT"); XClearArea(disp, fx_wave_win, - 0, root.h - FX_WAVE_WATERH, - root.w, FX_WAVE_WATERH, False); + 0, root.h - FX_WAVE_WATERH, root.w, FX_WAVE_WATERH, False); } void @@ -850,8 +864,7 @@ static Window fx_imagespinner_win = 0; static int fx_imagespinner_count = 3; static ImlibData *fx_imagespinner_imd = NULL; static char *fx_imagespinner_params = NULL; -static -void FX_imagespinner_timeout(int val, void *data); +static void FX_imagespinner_timeout(int val, void *data); void FX_imagespinner_timeout(int val, void *data) @@ -867,12 +880,12 @@ FX_imagespinner_timeout(int val, void *data) else fx_imagespinner_imd = id; if (!before) - DIALOG_OK("Starting up imagespinners FX...", - "\n" - "You have just started the imagespinners Effect.\n" - "\n" - "To disable this effect just select this option again to toggle\n" - "it off.\n"); + DIALOG_OK(gettext("Starting up imagespinners FX..."), + gettext("\n" + "You have just started the imagespinners Effect.\n" + "\n" + "To disable this effect just select this option again to toggle\n" + "it off.\n")); before = 1; } /* do stuff here */ @@ -898,8 +911,7 @@ FX_imagespinner_timeout(int val, void *data) x = ((root.w * x) >> 10) - ((w * x) >> 10); y = ((root.h * y) >> 10) - ((h * y) >> 10); Imlib_paste_image(fx_imagespinner_imd, im, - fx_imagespinner_win, - x, y, w, h); + fx_imagespinner_win, x, y, w, h); Imlib_destroy_image(fx_imagespinner_imd, im); } Efree(string); @@ -933,10 +945,7 @@ void FX_ImageSpinner_Quit(void) { RemoveTimerEvent("FX_IMAGESPINNER_TIMEOUT"); - XClearArea(disp, fx_imagespinner_win, - 0, 0, - root.w, root.h, - False); + XClearArea(disp, fx_imagespinner_win, 0, 0, root.w, root.h, False); if (fx_imagespinner_params) Efree(fx_imagespinner_params); fx_imagespinner_params = NULL; diff --git a/src/gnome.c b/src/gnome.c index 78a5acd9..96bdb546 100644 --- a/src/gnome.c +++ b/src/gnome.c @@ -128,12 +128,12 @@ /* Preferences for behavior for app */ /* ONLY the client sets this */ -#define WIN_HINTS_SKIP_FOCUS (1<<0) /* "alt-tab" skips this win */ -#define WIN_HINTS_SKIP_WINLIST (1<<1) /* not in win list */ -#define WIN_HINTS_SKIP_TASKBAR (1<<2) /* not on taskbar */ -#define WIN_HINTS_GROUP_TRANSIENT (1<<3) /* ??????? */ -#define WIN_HINTS_FOCUS_ON_CLICK (1<<4) /* app only accepts focus when clicked */ -#define WIN_HINTS_DO_NOT_COVER (1<<5) /* attempt to not cover this window */ +#define WIN_HINTS_SKIP_FOCUS (1<<0) /* "alt-tab" skips this win */ +#define WIN_HINTS_SKIP_WINLIST (1<<1) /* not in win list */ +#define WIN_HINTS_SKIP_TASKBAR (1<<2) /* not on taskbar */ +#define WIN_HINTS_GROUP_TRANSIENT (1<<3) /* ??????? */ +#define WIN_HINTS_FOCUS_ON_CLICK (1<<4) /* app only accepts focus when clicked */ +#define WIN_HINTS_DO_NOT_COVER (1<<5) /* attempt to not cover this window */ #define XA_WIN_HINTS "_WIN_HINTS" /* WIN_HINTS = CARD32 */ @@ -720,8 +720,7 @@ GNOME_SetWMNameVer(void) void GNOME_DelHints(EWin * ewin) { - static Atom atom_get[7] = - {0, 0, 0, 0, 0, 0, 0}; + static Atom atom_get[7] = { 0, 0, 0, 0, 0, 0, 0 }; EDBUG(6, "GNOME_DelHints"); if (!atom_get[0]) diff --git a/src/grabs.c b/src/grabs.c index f8c4210f..14b22b9a 100644 --- a/src/grabs.c +++ b/src/grabs.c @@ -34,7 +34,8 @@ GrabActionKey(Action * a) if (a->anymodifier) { mod = AnyModifier; - XGrabKey(disp, a->key, mod, root.win, False, GrabModeAsync, GrabModeAsync); + XGrabKey(disp, a->key, mod, root.win, False, GrabModeAsync, + GrabModeAsync); } else { @@ -42,7 +43,8 @@ GrabActionKey(Action * a) /* grab the key even if locks are on or not */ for (i = 0; i < 8; i++) - XGrabKey(disp, a->key, mod | mask_mod_combos[i], root.win, False, GrabModeAsync, GrabModeAsync); + XGrabKey(disp, a->key, mod | mask_mod_combos[i], root.win, False, + GrabModeAsync, GrabModeAsync); } EDBUG_RETURN_; } diff --git a/src/groups.c b/src/groups.c index 6d650658..ccdb6afd 100644 --- a/src/groups.c +++ b/src/groups.c @@ -114,10 +114,11 @@ BuildWindowGroup(EWin ** ewins, int num) AddEwinToGroup(ewins[i], g); else { - DIALOG_OK("Cannot comply", - "Iconboxes and Pagers are disallowed from being\n" - "members of a group. You cannot add these windows\n" - "to a group.\n"); + DIALOG_OK(gettext("Cannot comply"), + gettext + ("Iconboxes and Pagers are disallowed from being\n" + "members of a group. You cannot add these windows\n" + "to a group.\n")); } } } @@ -136,7 +137,8 @@ AddEwinToGroup(EWin * ewin, Group * g) if (ewin->groups[i] == g) return; ewin->num_groups++; - ewin->groups = Erealloc(ewin->groups, sizeof(Group *) * ewin->num_groups); + ewin->groups = + Erealloc(ewin->groups, sizeof(Group *) * ewin->num_groups); ewin->groups[ewin->num_groups - 1] = g; g->num_members++; g->members = Erealloc(g->members, sizeof(EWin *) * g->num_members); @@ -145,10 +147,11 @@ AddEwinToGroup(EWin * ewin, Group * g) } else { - DIALOG_OK("Cannot comply", - "Iconboxes and Pagers are disallowed from being\n" - "members of a group. You cannot add these windows\n" - "to a group.\n"); + DIALOG_OK(gettext("Cannot comply"), + gettext + ("Iconboxes and Pagers are disallowed from being\n" + "members of a group. You cannot add these windows\n" + "to a group.\n")); } } } @@ -208,10 +211,15 @@ RemoveEwinFromGroup(EWin * ewin, Group * g) g->members[j] = g->members[j + 1]; g->num_members--; if (g->num_members > 0) - g->members = Erealloc(g->members, sizeof(EWin *) * g->num_members); + g->members = + Erealloc(g->members, + sizeof(EWin *) * + g->num_members); else { - RemoveItem((char *)g, 0, LIST_FINDBY_POINTER, LIST_TYPE_GROUP); + RemoveItem((char *)g, 0, + LIST_FINDBY_POINTER, + LIST_TYPE_GROUP); FreeGroup(g); } /* and remove the group from the groups that the window is in */ @@ -225,21 +233,30 @@ RemoveEwinFromGroup(EWin * ewin, Group * g) ewin->num_groups = 0; } else - ewin->groups = Erealloc(ewin->groups, sizeof(Group *) * ewin->num_groups); + ewin->groups = + Erealloc(ewin->groups, + sizeof(Group *) * + ewin->num_groups); SaveGroups(); x = ewin->x; y = ewin->y; - if ((ewin->x + ewin->border->border.left + 1) > root.w) + if ((ewin->x + ewin->border->border.left + 1) > + root.w) x = root.w - ewin->border->border.left - 1; else if ((ewin->x + ewin->w - ewin->border->border.right - 1) < 0) - x = 0 - ewin->w + ewin->border->border.right + 1; - if ((ewin->y + ewin->border->border.top + 1) > root.h) + x = + 0 - ewin->w + + ewin->border->border.right + 1; + if ((ewin->y + ewin->border->border.top + 1) > + root.h) y = root.h - ewin->border->border.top - 1; else if ((ewin->y + ewin->h - - ewin->border->border.bottom - 1) < 0) - y = 0 - ewin->h + ewin->border->border.bottom + 1; + ewin->border->border.bottom - 1) < 0) + y = + 0 - ewin->h + + ewin->border->border.bottom + 1; MoveEwin(ewin, x, y); @@ -266,7 +283,8 @@ GetWinGroupMemberNames(Group ** groups, int num) group_member_strings[i][0] = 0; for (j = 0; j < groups[i]->num_members; j++) { - strcat(group_member_strings[i], groups[i]->members[j]->client.title); + strcat(group_member_strings[i], + groups[i]->members[j]->client.title); strcat(group_member_strings[i], "\n"); } } @@ -305,8 +323,9 @@ ShowHideWinGroups(EWin * ewin, Group * g, char onoff) if (!gwins[i]->border->group_border_name) continue; - b = (Border *) FindItem(gwins[i]->border->group_border_name, 0, LIST_FINDBY_NAME, - LIST_TYPE_BORDER); + b = + (Border *) FindItem(gwins[i]->border->group_border_name, 0, + LIST_FINDBY_NAME, LIST_TYPE_BORDER); if (b) { gwins[i]->previous_border = gwins[i]->border; @@ -326,8 +345,9 @@ ShowHideWinGroups(EWin * ewin, Group * g, char onoff) if (!gwins[i]->border->group_border_name) continue; - b = (Border *) FindItem(gwins[i]->border->group_border_name, 0, LIST_FINDBY_NAME, - LIST_TYPE_BORDER); + b = + (Border *) FindItem(gwins[i]->border->group_border_name, 0, + LIST_FINDBY_NAME, LIST_TYPE_BORDER); if (b) { gwins[i]->previous_border = gwins[i]->border; @@ -352,8 +372,8 @@ ShowHideWinGroups(EWin * ewin, Group * g, char onoff) gwins[i]->border_new = 1; SetEwinToBorder(gwins[i], b); ICCCM_MatchSize(gwins[i]); - MoveResizeEwin(gwins[i], gwins[i]->x, gwins[i]->y, gwins[i]->client.w, - gwins[i]->client.h); + MoveResizeEwin(gwins[i], gwins[i]->x, gwins[i]->y, + gwins[i]->client.w, gwins[i]->client.h); RememberImportantInfoForEwin(gwins[i]); } } @@ -389,14 +409,20 @@ SaveGroups(void) if (groups[i]->members[0]->snap->num_groups) { fprintf(f, "NEW: %i\n", groups[i]->index); - fprintf(f, "ICONIFY: %i\n", groups[i]->cfg.iconify); + fprintf(f, "ICONIFY: %i\n", + groups[i]->cfg.iconify); fprintf(f, "KILL: %i\n", groups[i]->cfg.kill); fprintf(f, "MOVE: %i\n", groups[i]->cfg.move); - fprintf(f, "RAISE: %i\n", groups[i]->cfg.raise); - fprintf(f, "SET_BORDER: %i\n", groups[i]->cfg.set_border); - fprintf(f, "STICK: %i\n", groups[i]->cfg.stick); - fprintf(f, "SHADE: %i\n", groups[i]->cfg.shade); - fprintf(f, "MIRROR: %i\n", groups[i]->cfg.mirror); + fprintf(f, "RAISE: %i\n", + groups[i]->cfg.raise); + fprintf(f, "SET_BORDER: %i\n", + groups[i]->cfg.set_border); + fprintf(f, "STICK: %i\n", + groups[i]->cfg.stick); + fprintf(f, "SHADE: %i\n", + groups[i]->cfg.shade); + fprintf(f, "MIRROR: %i\n", + groups[i]->cfg.mirror); } } } @@ -571,25 +597,29 @@ ChooseGroupDialog(EWin * ewin, char *message, char group_select, int action) tmp_action = action; tmp_groups = ListWinGroups(ewin, group_select, &num_groups); - if ((num_groups == 0) && (action == ACTION_BREAK_GROUP || action == ACTION_REMOVE_FROM_GROUP)) + if ((num_groups == 0) + && (action == ACTION_BREAK_GROUP || action == ACTION_REMOVE_FROM_GROUP)) { - DIALOG_OK("Window Group Error", - "\n This window currently does not belong to any groups. \n" - " You can only destroy groups or remove windows from groups \n" - " through a window that actually belongs to at least one group. \n\n"); + DIALOG_OK(gettext("Window Group Error"), + gettext + ("\n This window currently does not belong to any groups. \n" + " You can only destroy groups or remove windows from groups \n" + " through a window that actually belongs to at least one group.\n\n")); return; } if ((num_groups == 0) && (group_select == GROUP_SELECT_ALL_EXCEPT_EWIN)) { - DIALOG_OK("Window Group Error", - "\n Currently, no groups exist or this window \n" - " already belongs to all existing groups. \n" - " You have to start other groups first. \n\n"); + DIALOG_OK(gettext("Window Group Error"), + gettext("\n Currently, no groups exist or this window \n" + " already belongs to all existing groups. \n" + " You have to start other groups first. \n\n")); return; } if (!tmp_groups) { - DIALOG_OK("Window Group Error", "\n Currently, no groups exist. You have to start a group first. \n\n"); + DIALOG_OK(gettext("Window Group Error"), + gettext + ("\n Currently, no groups exist. You have to start a group first.\n\n")); return; } @@ -604,7 +634,7 @@ ChooseGroupDialog(EWin * ewin, char *message, char group_select, int action) AUDIO_PLAY("SOUND_SETTINGS_GROUP"); d = CreateDialog("GROUP_SELECTION"); - DialogSetTitle(d, "Window Group Selection"); + DialogSetTitle(d, gettext("Window Group Selection")); table = DialogInitItem(d); DialogItemTableSetOptions(table, 2, 0, 0, 0); @@ -661,8 +691,8 @@ ChooseGroupDialog(EWin * ewin, char *message, char group_select, int action) DialogItemSetFill(di, 1, 0); DialogItemSeparatorSetOrientation(di, 0); - DialogAddButton(d, "OK", ChooseGroup, 1); - DialogAddButton(d, "Close", ChooseGroup, 1); + DialogAddButton(d, gettext("OK"), ChooseGroup, 1); + DialogAddButton(d, gettext("Close"), ChooseGroup, 1); DialogSetExitFunction(d, ChooseGroup, 2, d); DialogBindKey(d, "Escape", ChooseGroupEscape, 0, d); DialogBindKey(d, "Return", ChooseGroup, 0, d); diff --git a/src/handlers.c b/src/handlers.c index 17b20044..1a3c76d9 100644 --- a/src/handlers.c +++ b/src/handlers.c @@ -56,14 +56,14 @@ HandleSigIll(int num) num = 0; if (disp) UngrabX(); - DialogAlert("Enlightenment performed an Illegal Instruction.\n" - "\n" - "This most likely is due to you having installed an run a\n" - "binary of Enlightenment that was compiled for a make or model\n" - "of CPU not 100% identical or compatible with yours. Please\n" - "either obtain the correct package for your system, or\n" - "re-compile enlightenment and possibly any support libraries\n" - "that you got in binary format to run Enlightenment.\n"); + DialogAlert(gettext("Enlightenment performed an Illegal Instruction.\n" + "\n" + "This most likely is due to you having installed an run a\n" + "binary of Enlightenment that was compiled for a make or model\n" + "of CPU not 100% identical or compatible with yours. Please\n" + "either obtain the correct package for your system, or\n" + "re-compile enlightenment and possibly any support libraries\n" + "that you got in binary format to run Enlightenment.\n")); doExit("error"); EDBUG_RETURN_; } @@ -84,16 +84,16 @@ HandleSigFpe(int num) num = 0; if (disp) UngrabX(); - DialogAlert("Enlightenment caused a Floating Point Exception.\n" - "\n" - "This means that Enlightenment or support library routines it calls\n" - "have performed an illegal mathematical operation (most likely\n" - "dividing a number by zero). This is most likely a bug. It is\n" - "recommended to restart now. If you wish to help fix this please\n" - "compile Enlightenment with debugging symbols in and run\n" - "Enlightenment under gdb so you can backtrace for where it died and\n" - "send in a useful bug report with backtrace information and variable\n" - "dumps etc.\n"); + DialogAlert(gettext("Enlightenment caused a Floating Point Exception.\n" + "\n" + "This means that Enlightenment or support library routines it calls\n" + "have performed an illegal mathematical operation (most likely\n" + "dividing a number by zero). This is most likely a bug. It is\n" + "recommended to restart now. If you wish to help fix this please\n" + "compile Enlightenment with debugging symbols in and run\n" + "Enlightenment under gdb so you can backtrace for where it died and\n" + "send in a useful bug report with backtrace information and variable\n" + "dumps etc.\n")); doExit("error"); EDBUG_RETURN_; } @@ -109,16 +109,16 @@ HandleSigSegv(int num) loop_count++; if (disp) UngrabX(); - DialogAlert("Enlightenment caused Segment Violation (Segfault)\n" - "\n" - "This means that Enlightenment or support library routines it calls\n" - "have accessed areas of your system's memory that they are not\n" - "allowed access to. This is most likely a bug. It is recommended to\n" - "restart now. If you wish to help fix this please compile\n" - "Enlightenment with debugging symbols in and run Enlightenment\n" - "under gdb so you can backtrace for where it died and send in a\n" - "useful bug report with backtrace information and variable\n" - "dumps etc.\n"); + DialogAlert(gettext("Enlightenment caused Segment Violation (Segfault)\n" + "\n" + "This means that Enlightenment or support library routines it calls\n" + "have accessed areas of your system's memory that they are not\n" + "allowed access to. This is most likely a bug. It is recommended to\n" + "restart now. If you wish to help fix this please compile\n" + "Enlightenment with debugging symbols in and run Enlightenment\n" + "under gdb so you can backtrace for where it died and send in a\n" + "useful bug report with backtrace information and variable\n" + "dumps etc.\n")); abort(); num = 0; EDBUG_RETURN_; @@ -193,11 +193,11 @@ HandleSigBus(int num) num = 0; if (disp) UngrabX(); - DialogAlert("Enlightenment caused Bus Error.\n" - "\n" - "It is suggested you check your hardware and OS installation.\n" - "It is highly unusual to cause Bus Errors on operational\n" - "hardware.\n"); + DialogAlert(gettext("Enlightenment caused Bus Error.\n" + "\n" + "It is suggested you check your hardware and OS installation.\n" + "It is highly unusual to cause Bus Errors on operational\n" + "hardware.\n")); EDBUG_RETURN_; } @@ -212,39 +212,33 @@ EHandleXError(Display * d, XErrorEvent * ev) { if ((!no_overwrite) && (mode.xselect)) { - ASSIGN_ALERT("Another Window Manager is already running", - "OK (edit file)", - "", - "Cancel (do NOT edit)"); - Alert("Another Window Manager is already running.\n" - "\n" - "You will have to quit your current Window Manager first before\n" - "you can successfully run Enlightenment.\n" - "\n" - "If you haven't edited your user startup files, Enlightenment\n" - "can do that now for you, so when you log in again after\n" - "quitting your current window manager, you will have\n" - "Enlightenment running.\n" - "\n" - "If you want to do this, click OK, otherwise hit cancel\n" - "to abort this operation and edit the files by hand.\n" - "\n" - "WARNING WARNING WARNING WARNING!\n" - "\n" - "It is possible that this MAY not properly edit your files.\n" - ); - ASSIGN_ALERT("Are you sure?", - "YES (edit file)", - "", - "NO (do not edit)"); - Alert("Are you absolutely sure you want to have Enlightenment\n" - "edit your startup files for you?\n" - "\n" - "If your startup files are highly customised this may not\n" - "work.\n" - "\n" - "Are you ABSOLUTELY sure?\n" - ); + ASSIGN_ALERT(gettext("Another Window Manager is already running"), + gettext("OK (edit file)"), + "", gettext("Cancel (do NOT edit)")); + Alert(gettext("Another Window Manager is already running.\n" + "\n" + "You will have to quit your current Window Manager first before\n" + "you can successfully run Enlightenment.\n" + "\n" + "If you haven't edited your user startup files, Enlightenment\n" + "can do that now for you, so when you log in again after\n" + "quitting your current window manager, you will have\n" + "Enlightenment running.\n" + "\n" + "If you want to do this, click OK, otherwise hit cancel\n" + "to abort this operation and edit the files by hand.\n" + "\n" + "WARNING WARNING WARNING WARNING!\n" + "\n" + "It is possible that this MAY not properly edit your files.\n")); + ASSIGN_ALERT(gettext("Are you sure?"), + gettext("YES (edit file)"), + "", gettext("NO (do not edit)")); + Alert(gettext + ("Are you absolutely sure you want to have Enlightenment\n" + "edit your startup files for you?\n" "\n" + "If your startup files are highly customised this may not\n" + "work.\n" "\n" "Are you ABSOLUTELY sure?\n")); RESET_ALERT; AddE(); EExit((void *)1); diff --git a/src/icccm.c b/src/icccm.c index c202dd99..958130a3 100644 --- a/src/icccm.c +++ b/src/icccm.c @@ -139,8 +139,8 @@ ICCCM_Delete(EWin * ewin) del = 0; if (!XGetWMProtocols(disp, ewin->client.win, &prop, &num)) { - XGetWindowProperty(disp, ewin->client.win, a2, 0, 10, False, a2, &a3, &dummy, - &lnum, &ldummy, (unsigned char **)&prop); + XGetWindowProperty(disp, ewin->client.win, a2, 0, 10, False, a2, &a3, + &dummy, &lnum, &ldummy, (unsigned char **)&prop); num = (int)lnum; } if (prop) @@ -226,8 +226,7 @@ ICCCM_DeIconify(EWin * ewin) ewin->iconified = 0; XChangeProperty(disp, ewin->client.win, a, a, 32, PropModeReplace, (unsigned char *)c, 2); - RemoveItem("ICON", ewin->client.win, LIST_FINDBY_BOTH, - LIST_TYPE_ICONIFIEDS); + RemoveItem("ICON", ewin->client.win, LIST_FINDBY_BOTH, LIST_TYPE_ICONIFIEDS); EMapWindow(disp, ewin->client.win); EDBUG_RETURN_; } @@ -309,7 +308,8 @@ ICCCM_Configure(EWin * ewin) xwc.y = ewin->border->border.top; xwc.width = ewin->client.w; xwc.height = ewin->client.h; - XConfigureWindow(disp, ewin->win_container, CWX | CWY | CWWidth | CWHeight, &xwc); + XConfigureWindow(disp, ewin->win_container, + CWX | CWY | CWWidth | CWHeight, &xwc); } else { @@ -317,13 +317,15 @@ ICCCM_Configure(EWin * ewin) xwc.y = -30; xwc.width = 1; xwc.height = 1; - XConfigureWindow(disp, ewin->win_container, CWX | CWY | CWWidth | CWHeight, &xwc); + XConfigureWindow(disp, ewin->win_container, + CWX | CWY | CWWidth | CWHeight, &xwc); xwc.width = ewin->client.w; xwc.height = ewin->client.h; } xwc.x = 0; xwc.y = 0; - XConfigureWindow(disp, ewin->client.win, CWX | CWY | CWWidth | CWHeight, &xwc); + XConfigureWindow(disp, ewin->client.win, CWX | CWY | CWWidth | CWHeight, + &xwc); if ((ewin->menu) || (ewin->dialog)) EDBUG_RETURN_; ev.type = ConfigureNotify; @@ -382,8 +384,10 @@ ICCCM_Adopt(EWin * ewin, Window win) ewin->y = ewin->client.y; ewin->reqx = ewin->client.x; ewin->reqy = ewin->client.y; - ewin->w = ewin->client.w + ewin->border->border.left + ewin->border->border.right; - ewin->h = ewin->client.h + ewin->border->border.top + ewin->border->border.bottom; + ewin->w = + ewin->client.w + ewin->border->border.left + ewin->border->border.right; + ewin->h = + ewin->client.h + ewin->border->border.top + ewin->border->border.bottom; EDBUG_RETURN_; } @@ -405,7 +409,8 @@ ICCCM_Withdraw(EWin * ewin) */ c[0] = WithdrawnState; c[1] = 0; - XChangeProperty(disp, ewin->client.win, a, a, 32, PropModeReplace, (unsigned char *)c, 2); + XChangeProperty(disp, ewin->client.win, a, a, 32, PropModeReplace, + (unsigned char *)c, 2); EDBUG_RETURN_; } @@ -495,8 +500,8 @@ ICCCM_Focus(EWin * ewin) } if (!XGetWMProtocols(disp, ewin->client.win, &prop, &num)) { - XGetWindowProperty(disp, ewin->client.win, a2, 0, 10, False, a2, &a3, &dummy, - &lnum, &ldummy, (unsigned char **)&prop); + XGetWindowProperty(disp, ewin->client.win, a2, 0, 10, False, a2, &a3, + &dummy, &lnum, &ldummy, (unsigned char **)&prop); num = (int)lnum; } if (prop) @@ -527,7 +532,7 @@ ICCCM_GetGeoms(EWin * ewin, Atom atom_change) XSizeHints hint; Window ww; long mask; - unsigned int dummy, w, h; + unsigned int dummy, w, h, bw; int x, y; EDBUG(6, "ICCCM_GetGeoms"); @@ -540,17 +545,17 @@ ICCCM_GetGeoms(EWin * ewin, Atom atom_change) if (atom_change != atom) EDBUG_RETURN_; } - EGetGeometry(disp, ewin->client.win, &ww, &x, &y, &w, &h, &dummy, &dummy); + EGetGeometry(disp, ewin->client.win, &ww, &x, &y, &w, &h, &bw, &dummy); ewin->client.x = x; ewin->client.y = y; ewin->client.w = w; ewin->client.h = h; + ewin->client.bw = bw; if (XGetWMNormalHints(disp, ewin->client.win, &hint, &mask)) { if (!(ewin->client.already_placed)) { - if ((hint.flags & USPosition) || - ((hint.flags & PPosition))) + if ((hint.flags & USPosition) || ((hint.flags & PPosition))) { if (hint.flags & PWinGravity) ewin->client.grav = hint.win_gravity; @@ -972,7 +977,8 @@ ICCCM_GetHints(EWin * ewin, Atom atom_change) if (hint) { /* I have to make sure the thing i'm docking is a dock app */ - if ((hint->flags & StateHint) && (hint->initial_state == WithdrawnState)) + if ((hint->flags & StateHint) + && (hint->initial_state == WithdrawnState)) { if (hint->flags & (StateHint | IconWindowHint | IconPositionHint | WindowGroupHint)) @@ -1283,8 +1289,9 @@ ICCCM_GetEInfo(EWin * ewin) ewin->client.w = c[6]; ewin->client.h = c[7]; } - XGetWindowProperty(disp, ewin->client.win, aa, 0, 0xffff, True, XA_STRING, - &a2, &dummy, &lnum, &ldummy, (unsigned char **)&str); + XGetWindowProperty(disp, ewin->client.win, aa, 0, 0xffff, True, + XA_STRING, &a2, &dummy, &lnum, &ldummy, + (unsigned char **)&str); num = (int)lnum; if ((num > 0) && (str)) @@ -1292,8 +1299,7 @@ ICCCM_GetEInfo(EWin * ewin) Border *b = NULL; b = (Border *) FindItem(str, 0, - LIST_FINDBY_NAME, - LIST_TYPE_BORDER); + LIST_FINDBY_NAME, LIST_TYPE_BORDER); if ((ewin->border) && (strcmp(ewin->border->name, b->name))) b = NULL; if (b) diff --git a/src/iclass.c b/src/iclass.c index 97540079..16e0fa53 100644 --- a/src/iclass.c +++ b/src/iclass.c @@ -35,8 +35,7 @@ CreateIclass() i->name = NULL; i->external = 0; - i->norm.normal = i->norm.hilited = i->norm.clicked - = i->norm.disabled = NULL; + i->norm.normal = i->norm.hilited = i->norm.clicked = i->norm.disabled = NULL; i->active.normal = i->active.hilited = i->active.clicked = i->active.disabled = NULL; i->sticky.normal = i->sticky.hilited = i->sticky.clicked @@ -727,8 +726,8 @@ IclassApply(ImageClass * iclass, Window win, int w, int h, gcv.ts_y_origin = 0; tm = ECreatePixmap(disp, win, w, h, 1); gc = XCreateGC(disp, tm, GCFillStyle | GCTile | - GCTileStipXOrigin | GCTileStipYOrigin, - &gcv); + GCTileStipXOrigin | + GCTileStipYOrigin, &gcv); XFillRectangle(disp, tm, gc, 0, 0, w, h); XFreeGC(disp, gc); EShapeCombineMask(disp, win, ShapeBounding, @@ -1038,8 +1037,8 @@ IclassApplyCopy(ImageClass * iclass, Window win, int w, int h, int active, gcv.ts_x_origin = 0; gcv.ts_y_origin = 0; gc = XCreateGC(disp, tm, GCFillStyle | GCTile | - GCTileStipXOrigin | GCTileStipYOrigin, - &gcv); + GCTileStipXOrigin | + GCTileStipYOrigin, &gcv); XFillRectangle(disp, tm, gc, 0, 0, w, h); XFreeGC(disp, gc); } diff --git a/src/iconify.c b/src/iconify.c index 618a528e..3a2d0d2a 100644 --- a/src/iconify.c +++ b/src/iconify.c @@ -32,7 +32,7 @@ IB_Animate(char iconify, EWin * from, EWin * to) { double t1, t2, t, i, spd, ii; int x, y, x1, y1, x2, y2, x3, y3, x4, y4, w, h, fx, fy, - fw, fh, dx, dy, dw, dh; + fw, fh, dx, dy, dw, dh; GC gc; XGCValues gcv; @@ -231,8 +231,10 @@ IconifyEwin(EWin * ewin) } HideEwin(ewin); MoveEwin(ewin, - ewin->x + ((desks.desk[ewin->desktop].current_area_x) - ewin->area_x) * root.w, - ewin->y + ((desks.desk[ewin->desktop].current_area_y) - ewin->area_y) * root.h); + ewin->x + ((desks.desk[ewin->desktop].current_area_x) - + ewin->area_x) * root.w, + ewin->y + ((desks.desk[ewin->desktop].current_area_y) - + ewin->area_y) * root.h); if (was_shaded != ewin->shaded) InstantShadeEwin(ewin); MakeIcon(ewin); @@ -260,8 +262,14 @@ IconifyEwin(EWin * ewin) { HideEwin(lst[i]); MoveEwin(lst[i], - lst[i]->x + ((desks.desk[lst[i]->desktop].current_area_x) - lst[i]->area_x) * root.w, - lst[i]->y + ((desks.desk[lst[i]->desktop].current_area_y) - lst[i]->area_y) * root.h); + lst[i]->x + + ((desks. + desk[lst[i]->desktop].current_area_x) - + lst[i]->area_x) * root.w, + lst[i]->y + + ((desks. + desk[lst[i]->desktop].current_area_y) - + lst[i]->area_y) * root.h); lst[i]->iconified = 4; if (lst[i] == mode.focuswin) FocusToEWin(NULL); @@ -328,9 +336,12 @@ DeIconifyEwin(EWin * ewin) { if (!lst[i]->sticky) { - MoveEwinToDesktopAt(lst[i], desks.current, lst[i]->x, lst[i]->y); - lst[i]->area_x = desks.desk[desks.current].current_area_x; - lst[i]->area_y = desks.desk[desks.current].current_area_y; + MoveEwinToDesktopAt(lst[i], desks.current, + lst[i]->x, lst[i]->y); + lst[i]->area_x = + desks.desk[desks.current].current_area_x; + lst[i]->area_y = + desks.desk[desks.current].current_area_y; } else ConformEwinToDesktop(lst[i]); @@ -519,7 +530,9 @@ ShowIconbox(Iconbox * ib) ImageClass *ic; int extra = 0; - ic = FindItem("ICONBOX_VERTICAL", 0, LIST_FINDBY_NAME, LIST_TYPE_ICLASS); + ic = + FindItem("ICONBOX_VERTICAL", 0, LIST_FINDBY_NAME, + LIST_TYPE_ICLASS); if (ic) extra = ic->padding.left + ic->padding.right; ib->ewin->client.width.max = @@ -532,7 +545,9 @@ ShowIconbox(Iconbox * ib) ImageClass *ic; int extra = 0; - ic = FindItem("ICONBOX_HORIZONTAL", 0, LIST_FINDBY_NAME, LIST_TYPE_ICLASS); + ic = + FindItem("ICONBOX_HORIZONTAL", 0, LIST_FINDBY_NAME, + LIST_TYPE_ICLASS); if (ic) extra = ic->padding.left + ic->padding.right; ib->ewin->client.height.max = @@ -635,7 +650,9 @@ IB_SnapEWin(EWin * ewin) } if (ib->draw_icon_base) { - ic = FindItem("DEFAULT_ICON_BUTTON", 0, LIST_FINDBY_NAME, LIST_TYPE_ICLASS); + ic = + FindItem("DEFAULT_ICON_BUTTON", 0, LIST_FINDBY_NAME, + LIST_TYPE_ICLASS); if (ic) { w -= ic->padding.left + ic->padding.right; @@ -654,8 +671,7 @@ IB_SnapEWin(EWin * ewin) ewin->icon_pmap_h = h; ewin->icon_pmap = ECreatePixmap(disp, ewin->win, w, h, id->x.depth); PagerScaleRect(ewin->icon_pmap, ewin->win, - 0, 0, 0, 0, - ewin->w, ewin->h, w, h); + 0, 0, 0, 0, ewin->w, ewin->h, w, h); r = EShapeGetRectangles(disp, ewin->win, ShapeBounding, &rn, &ord); ewin->icon_mask = ECreatePixmap(disp, ewin->win, w, h, 1); gc = XCreateGC(disp, ewin->icon_mask, 0, &gcv); @@ -802,7 +818,9 @@ IB_GetEIcon(EWin * ewin) Icondef *idef; ImageClass *ic; - idef = IB_MatchIcondef(ewin->client.title, ewin->client.name, ewin->client.class); + idef = + IB_MatchIcondef(ewin->client.title, ewin->client.name, + ewin->client.class); if (!idef) return; @@ -1266,7 +1284,8 @@ IB_FindIcon(Iconbox * ib, int px, int py) if (ib->orientation) { - ic = FindItem("ICONBOX_VERTICAL", 0, LIST_FINDBY_NAME, LIST_TYPE_ICLASS); + ic = + FindItem("ICONBOX_VERTICAL", 0, LIST_FINDBY_NAME, LIST_TYPE_ICLASS); y = -ib->pos; x = 0; if (ic) @@ -1277,7 +1296,9 @@ IB_FindIcon(Iconbox * ib, int px, int py) } else { - ic = FindItem("ICONBOX_HORIZONTAL", 0, LIST_FINDBY_NAME, LIST_TYPE_ICLASS); + ic = + FindItem("ICONBOX_HORIZONTAL", 0, LIST_FINDBY_NAME, + LIST_TYPE_ICLASS); x = -ib->pos; y = 0; if (ic) @@ -1315,8 +1336,7 @@ IB_FindIcon(Iconbox * ib, int px, int py) yy += (ib->iconsize - h) / 2; } if ((px >= (xx - 1)) && (py >= (yy - 1)) && - (px < (xx + w + 1)) && - (py < (yy + h + 1))) + (px < (xx + w + 1)) && (py < (yy + h + 1))) return ewin; } if (ib->orientation) @@ -1347,7 +1367,9 @@ IB_DrawScroll(Iconbox * ib) { int bs, bw, bx; - ic = FindItem("ICONBOX_SCROLLBAR_BASE_VERTICAL", 0, LIST_FINDBY_NAME, LIST_TYPE_ICLASS); + ic = + FindItem("ICONBOX_SCROLLBAR_BASE_VERTICAL", 0, LIST_FINDBY_NAME, + LIST_TYPE_ICLASS); if (ib->arrow_side < 3) bs = ib->h - (ib->arrow_thickness * 2); else @@ -1370,15 +1392,16 @@ IB_DrawScroll(Iconbox * ib) bx += ic->padding.top; if ((ib->scrollbar_hide) && (bw == bs)) show_sb = 0; - ic = FindItem("ICONBOX_SCROLLKNOB_VERTICAL", 0, LIST_FINDBY_NAME, LIST_TYPE_ICLASS); + ic = + FindItem("ICONBOX_SCROLLKNOB_VERTICAL", 0, LIST_FINDBY_NAME, + LIST_TYPE_ICLASS); if ((ic) && (bw > ib->knob_length)) EMoveResizeWindow(disp, ib->scrollbarknob_win, 0, (bw - ib->knob_length) / 2, ib->bar_thickness, ib->knob_length); else EMoveResizeWindow(disp, ib->scrollbarknob_win, - -9999, -9999, - ib->bar_thickness, ib->knob_length); + -9999, -9999, ib->bar_thickness, ib->knob_length); if (show_sb) { /* fix this area */ @@ -1392,13 +1415,18 @@ IB_DrawScroll(Iconbox * ib) EMapWindow(disp, ib->arrow2_win); EMoveResizeWindow(disp, ib->arrow1_win, ib->w - ib->scroll_thickness, 0, - ib->scroll_thickness, ib->arrow_thickness); + ib->scroll_thickness, + ib->arrow_thickness); EMoveResizeWindow(disp, ib->arrow2_win, - ib->w - ib->scroll_thickness, ib->arrow_thickness, - ib->scroll_thickness, ib->arrow_thickness); + ib->w - ib->scroll_thickness, + ib->arrow_thickness, + ib->scroll_thickness, + ib->arrow_thickness); EMoveResizeWindow(disp, ib->scroll_win, - ib->w - ib->scroll_thickness, ib->arrow_thickness * 2, - ib->scroll_thickness, ib->h - (ib->arrow_thickness * 2)); + ib->w - ib->scroll_thickness, + ib->arrow_thickness * 2, + ib->scroll_thickness, + ib->h - (ib->arrow_thickness * 2)); } /* both ends */ else if (ib->arrow_side == 1) @@ -1407,13 +1435,18 @@ IB_DrawScroll(Iconbox * ib) EMapWindow(disp, ib->arrow2_win); EMoveResizeWindow(disp, ib->arrow1_win, ib->w - ib->scroll_thickness, 0, - ib->scroll_thickness, ib->arrow_thickness); + ib->scroll_thickness, + ib->arrow_thickness); EMoveResizeWindow(disp, ib->arrow2_win, - ib->w - ib->scroll_thickness, ib->h - ib->arrow_thickness, - ib->scroll_thickness, ib->arrow_thickness); + ib->w - ib->scroll_thickness, + ib->h - ib->arrow_thickness, + ib->scroll_thickness, + ib->arrow_thickness); EMoveResizeWindow(disp, ib->scroll_win, - ib->w - ib->scroll_thickness, ib->arrow_thickness, - ib->scroll_thickness, ib->h - (ib->arrow_thickness * 2)); + ib->w - ib->scroll_thickness, + ib->arrow_thickness, + ib->scroll_thickness, + ib->h - (ib->arrow_thickness * 2)); } /* end */ else if (ib->arrow_side == 2) @@ -1421,14 +1454,19 @@ IB_DrawScroll(Iconbox * ib) EMapWindow(disp, ib->arrow1_win); EMapWindow(disp, ib->arrow2_win); EMoveResizeWindow(disp, ib->arrow1_win, - ib->w - ib->scroll_thickness, ib->h - (ib->arrow_thickness * 2), - ib->scroll_thickness, ib->arrow_thickness); + ib->w - ib->scroll_thickness, + ib->h - (ib->arrow_thickness * 2), + ib->scroll_thickness, + ib->arrow_thickness); EMoveResizeWindow(disp, ib->arrow2_win, - ib->w - ib->scroll_thickness, ib->h - ib->arrow_thickness, - ib->scroll_thickness, ib->arrow_thickness); + ib->w - ib->scroll_thickness, + ib->h - ib->arrow_thickness, + ib->scroll_thickness, + ib->arrow_thickness); EMoveResizeWindow(disp, ib->scroll_win, ib->w - ib->scroll_thickness, 0, - ib->scroll_thickness, ib->h - (ib->arrow_thickness * 2)); + ib->scroll_thickness, + ib->h - (ib->arrow_thickness * 2)); } /* no arrows */ else @@ -1450,13 +1488,16 @@ IB_DrawScroll(Iconbox * ib) EMapWindow(disp, ib->arrow2_win); EMoveResizeWindow(disp, ib->arrow1_win, 0, 0, - ib->scroll_thickness, ib->arrow_thickness); - EMoveResizeWindow(disp, ib->arrow2_win, - 0, ib->arrow_thickness, - ib->scroll_thickness, ib->arrow_thickness); - EMoveResizeWindow(disp, ib->scroll_win, - 0, ib->arrow_thickness * 2, - ib->scroll_thickness, ib->h - (ib->arrow_thickness * 2)); + ib->scroll_thickness, + ib->arrow_thickness); + EMoveResizeWindow(disp, ib->arrow2_win, 0, + ib->arrow_thickness, + ib->scroll_thickness, + ib->arrow_thickness); + EMoveResizeWindow(disp, ib->scroll_win, 0, + ib->arrow_thickness * 2, + ib->scroll_thickness, + ib->h - (ib->arrow_thickness * 2)); } /* both ends */ else if (ib->arrow_side == 1) @@ -1465,13 +1506,16 @@ IB_DrawScroll(Iconbox * ib) EMapWindow(disp, ib->arrow2_win); EMoveResizeWindow(disp, ib->arrow1_win, 0, 0, - ib->scroll_thickness, ib->arrow_thickness); - EMoveResizeWindow(disp, ib->arrow2_win, - 0, ib->h - ib->arrow_thickness, - ib->scroll_thickness, ib->arrow_thickness); - EMoveResizeWindow(disp, ib->scroll_win, - 0, ib->arrow_thickness, - ib->scroll_thickness, ib->h - (ib->arrow_thickness * 2)); + ib->scroll_thickness, + ib->arrow_thickness); + EMoveResizeWindow(disp, ib->arrow2_win, 0, + ib->h - ib->arrow_thickness, + ib->scroll_thickness, + ib->arrow_thickness); + EMoveResizeWindow(disp, ib->scroll_win, 0, + ib->arrow_thickness, + ib->scroll_thickness, + ib->h - (ib->arrow_thickness * 2)); } /* end */ else if (ib->arrow_side == 2) @@ -1480,13 +1524,15 @@ IB_DrawScroll(Iconbox * ib) EMapWindow(disp, ib->arrow2_win); EMoveResizeWindow(disp, ib->arrow1_win, 0, ib->h - (ib->arrow_thickness * 2), - ib->scroll_thickness, ib->arrow_thickness); - EMoveResizeWindow(disp, ib->arrow2_win, - 0, ib->h - ib->arrow_thickness, - ib->scroll_thickness, ib->arrow_thickness); - EMoveResizeWindow(disp, ib->scroll_win, - 0, 0, - ib->scroll_thickness, ib->h - (ib->arrow_thickness * 2)); + ib->scroll_thickness, + ib->arrow_thickness); + EMoveResizeWindow(disp, ib->arrow2_win, 0, + ib->h - ib->arrow_thickness, + ib->scroll_thickness, + ib->arrow_thickness); + EMoveResizeWindow(disp, ib->scroll_win, 0, 0, + ib->scroll_thickness, + ib->h - (ib->arrow_thickness * 2)); } /* no arrows */ else @@ -1494,8 +1540,7 @@ IB_DrawScroll(Iconbox * ib) EUnmapWindow(disp, ib->arrow1_win); EUnmapWindow(disp, ib->arrow2_win); EMoveResizeWindow(disp, ib->scroll_win, - 0, 0, - ib->scroll_thickness, ib->h); + 0, 0, ib->scroll_thickness, ib->h); } } } @@ -1509,10 +1554,14 @@ IB_DrawScroll(Iconbox * ib) (ib->scroll_thickness - ib->bar_thickness) / 2, bx, ib->bar_thickness, bw); - ic = FindItem("ICONBOX_SCROLLBAR_BASE_VERTICAL", 0, LIST_FINDBY_NAME, LIST_TYPE_ICLASS); + ic = + FindItem("ICONBOX_SCROLLBAR_BASE_VERTICAL", 0, LIST_FINDBY_NAME, + LIST_TYPE_ICLASS); if (ic) IclassApply(ic, ib->scroll_win, -1, -1, 0, 0, STATE_NORMAL, 0); - ic = FindItem("ICONBOX_SCROLLBAR_KNOB_VERTICAL", 0, LIST_FINDBY_NAME, LIST_TYPE_ICLASS); + ic = + FindItem("ICONBOX_SCROLLBAR_KNOB_VERTICAL", 0, LIST_FINDBY_NAME, + LIST_TYPE_ICLASS); if (ic) { int state = STATE_NORMAL; @@ -1523,7 +1572,9 @@ IB_DrawScroll(Iconbox * ib) state = STATE_CLICKED; IclassApply(ic, ib->scrollbar_win, -1, -1, 0, 0, state, 0); } - ic = FindItem("ICONBOX_SCROLLKNOB_VERTICAL", 0, LIST_FINDBY_NAME, LIST_TYPE_ICLASS); + ic = + FindItem("ICONBOX_SCROLLKNOB_VERTICAL", 0, LIST_FINDBY_NAME, + LIST_TYPE_ICLASS); if (ic) { int state = STATE_NORMAL; @@ -1534,7 +1585,8 @@ IB_DrawScroll(Iconbox * ib) state = STATE_CLICKED; IclassApply(ic, ib->scrollbarknob_win, -1, -1, 0, 0, state, 0); } - ic = FindItem("ICONBOX_ARROW_UP", 0, LIST_FINDBY_NAME, LIST_TYPE_ICLASS); + ic = + FindItem("ICONBOX_ARROW_UP", 0, LIST_FINDBY_NAME, LIST_TYPE_ICLASS); if (ic) { int state = STATE_NORMAL; @@ -1545,7 +1597,9 @@ IB_DrawScroll(Iconbox * ib) state = STATE_CLICKED; IclassApply(ic, ib->arrow1_win, -1, -1, 0, 0, state, 0); } - ic = FindItem("ICONBOX_ARROW_DOWN", 0, LIST_FINDBY_NAME, LIST_TYPE_ICLASS); + ic = + FindItem("ICONBOX_ARROW_DOWN", 0, LIST_FINDBY_NAME, + LIST_TYPE_ICLASS); if (ic) { int state = STATE_NORMAL; @@ -1562,7 +1616,9 @@ IB_DrawScroll(Iconbox * ib) { int bs, bw, bx; - ic = FindItem("ICONBOX_SCROLLBAR_BASE_HORIZONTAL", 0, LIST_FINDBY_NAME, LIST_TYPE_ICLASS); + ic = + FindItem("ICONBOX_SCROLLBAR_BASE_HORIZONTAL", 0, LIST_FINDBY_NAME, + LIST_TYPE_ICLASS); if (ib->arrow_side < 3) bs = ib->w - (ib->arrow_thickness * 2); else @@ -1585,15 +1641,16 @@ IB_DrawScroll(Iconbox * ib) bx += ic->padding.left; if ((ib->scrollbar_hide) && (bw == bs)) show_sb = 0; - ic = FindItem("ICONBOX_SCROLLKNOB_HORIZONTAL", 0, LIST_FINDBY_NAME, LIST_TYPE_ICLASS); + ic = + FindItem("ICONBOX_SCROLLKNOB_HORIZONTAL", 0, LIST_FINDBY_NAME, + LIST_TYPE_ICLASS); if ((ic) && (bw > ib->knob_length)) EMoveResizeWindow(disp, ib->scrollbarknob_win, (bw - ib->knob_length) / 2, 0, ib->knob_length, ib->bar_thickness); else EMoveResizeWindow(disp, ib->scrollbarknob_win, - -9999, -9999, - ib->knob_length, ib->bar_thickness); + -9999, -9999, ib->knob_length, ib->bar_thickness); if (show_sb) { @@ -1607,13 +1664,18 @@ IB_DrawScroll(Iconbox * ib) EMapWindow(disp, ib->arrow2_win); EMoveResizeWindow(disp, ib->arrow1_win, 0, ib->h - ib->scroll_thickness, - ib->arrow_thickness, ib->scroll_thickness); + ib->arrow_thickness, + ib->scroll_thickness); EMoveResizeWindow(disp, ib->arrow2_win, - ib->arrow_thickness, ib->h - ib->scroll_thickness, - ib->arrow_thickness, ib->scroll_thickness); + ib->arrow_thickness, + ib->h - ib->scroll_thickness, + ib->arrow_thickness, + ib->scroll_thickness); EMoveResizeWindow(disp, ib->scroll_win, - ib->arrow_thickness * 2, ib->h - ib->scroll_thickness, - ib->w - (ib->arrow_thickness * 2), ib->scroll_thickness); + ib->arrow_thickness * 2, + ib->h - ib->scroll_thickness, + ib->w - (ib->arrow_thickness * 2), + ib->scroll_thickness); } /* both ends */ else if (ib->arrow_side == 1) @@ -1622,13 +1684,18 @@ IB_DrawScroll(Iconbox * ib) EMapWindow(disp, ib->arrow2_win); EMoveResizeWindow(disp, ib->arrow1_win, 0, ib->h - ib->scroll_thickness, - ib->arrow_thickness, ib->scroll_thickness); + ib->arrow_thickness, + ib->scroll_thickness); EMoveResizeWindow(disp, ib->arrow2_win, - ib->w - ib->arrow_thickness, ib->h - ib->scroll_thickness, - ib->arrow_thickness, ib->scroll_thickness); + ib->w - ib->arrow_thickness, + ib->h - ib->scroll_thickness, + ib->arrow_thickness, + ib->scroll_thickness); EMoveResizeWindow(disp, ib->scroll_win, - ib->arrow_thickness, ib->h - ib->scroll_thickness, - ib->w - (ib->arrow_thickness * 2), ib->scroll_thickness); + ib->arrow_thickness, + ib->h - ib->scroll_thickness, + ib->w - (ib->arrow_thickness * 2), + ib->scroll_thickness); } /* end */ else if (ib->arrow_side == 2) @@ -1636,14 +1703,19 @@ IB_DrawScroll(Iconbox * ib) EMapWindow(disp, ib->arrow1_win); EMapWindow(disp, ib->arrow2_win); EMoveResizeWindow(disp, ib->arrow1_win, - ib->w - (ib->arrow_thickness * 2), ib->h - ib->scroll_thickness, - ib->arrow_thickness, ib->scroll_thickness); + ib->w - (ib->arrow_thickness * 2), + ib->h - ib->scroll_thickness, + ib->arrow_thickness, + ib->scroll_thickness); EMoveResizeWindow(disp, ib->arrow2_win, - ib->w - ib->arrow_thickness, ib->h - ib->scroll_thickness, - ib->arrow_thickness, ib->scroll_thickness); - EMoveResizeWindow(disp, ib->scroll_win, - 0, ib->h - ib->scroll_thickness, - ib->w - (ib->arrow_thickness * 2), ib->scroll_thickness); + ib->w - ib->arrow_thickness, + ib->h - ib->scroll_thickness, + ib->arrow_thickness, + ib->scroll_thickness); + EMoveResizeWindow(disp, ib->scroll_win, 0, + ib->h - ib->scroll_thickness, + ib->w - (ib->arrow_thickness * 2), + ib->scroll_thickness); } /* no arrows */ else @@ -1665,13 +1737,16 @@ IB_DrawScroll(Iconbox * ib) EMapWindow(disp, ib->arrow2_win); EMoveResizeWindow(disp, ib->arrow1_win, 0, 0, - ib->arrow_thickness, ib->scroll_thickness); + ib->arrow_thickness, + ib->scroll_thickness); EMoveResizeWindow(disp, ib->arrow2_win, ib->arrow_thickness, 0, - ib->arrow_thickness, ib->scroll_thickness); + ib->arrow_thickness, + ib->scroll_thickness); EMoveResizeWindow(disp, ib->scroll_win, ib->arrow_thickness * 2, 0, - ib->w - (ib->arrow_thickness * 2), ib->scroll_thickness); + ib->w - (ib->arrow_thickness * 2), + ib->scroll_thickness); } /* both ends */ else if (ib->arrow_side == 1) @@ -1680,13 +1755,16 @@ IB_DrawScroll(Iconbox * ib) EMapWindow(disp, ib->arrow2_win); EMoveResizeWindow(disp, ib->arrow1_win, 0, 0, - ib->arrow_thickness, ib->scroll_thickness); + ib->arrow_thickness, + ib->scroll_thickness); EMoveResizeWindow(disp, ib->arrow2_win, ib->w - ib->arrow_thickness, 0, - ib->arrow_thickness, ib->scroll_thickness); + ib->arrow_thickness, + ib->scroll_thickness); EMoveResizeWindow(disp, ib->scroll_win, ib->arrow_thickness, 0, - ib->w - (ib->arrow_thickness * 2), ib->scroll_thickness); + ib->w - (ib->arrow_thickness * 2), + ib->scroll_thickness); } /* end */ else if (ib->arrow_side == 2) @@ -1695,13 +1773,15 @@ IB_DrawScroll(Iconbox * ib) EMapWindow(disp, ib->arrow2_win); EMoveResizeWindow(disp, ib->arrow1_win, ib->w - (ib->arrow_thickness * 2), 0, - ib->arrow_thickness, ib->scroll_thickness); + ib->arrow_thickness, + ib->scroll_thickness); EMoveResizeWindow(disp, ib->arrow2_win, ib->w - ib->arrow_thickness, 0, - ib->arrow_thickness, ib->scroll_thickness); - EMoveResizeWindow(disp, ib->scroll_win, - 0, 0, - ib->w - (ib->arrow_thickness * 2), ib->scroll_thickness); + ib->arrow_thickness, + ib->scroll_thickness); + EMoveResizeWindow(disp, ib->scroll_win, 0, 0, + ib->w - (ib->arrow_thickness * 2), + ib->scroll_thickness); } /* no arrows */ else @@ -1709,8 +1789,7 @@ IB_DrawScroll(Iconbox * ib) EUnmapWindow(disp, ib->arrow1_win); EUnmapWindow(disp, ib->arrow2_win); EMoveResizeWindow(disp, ib->scroll_win, - 0, 0, - ib->w, ib->scroll_thickness); + 0, 0, ib->w, ib->scroll_thickness); } } } @@ -1725,10 +1804,14 @@ IB_DrawScroll(Iconbox * ib) bx, (ib->scroll_thickness - ib->bar_thickness) / 2, bw, ib->bar_thickness); - ic = FindItem("ICONBOX_SCROLLBAR_BASE_HORIZONTAL", 0, LIST_FINDBY_NAME, LIST_TYPE_ICLASS); + ic = + FindItem("ICONBOX_SCROLLBAR_BASE_HORIZONTAL", 0, LIST_FINDBY_NAME, + LIST_TYPE_ICLASS); if (ic) IclassApply(ic, ib->scroll_win, -1, -1, 0, 0, STATE_NORMAL, 0); - ic = FindItem("ICONBOX_SCROLLBAR_KNOB_HORIZONTAL", 0, LIST_FINDBY_NAME, LIST_TYPE_ICLASS); + ic = + FindItem("ICONBOX_SCROLLBAR_KNOB_HORIZONTAL", 0, LIST_FINDBY_NAME, + LIST_TYPE_ICLASS); if (ic) { int state = STATE_NORMAL; @@ -1739,7 +1822,9 @@ IB_DrawScroll(Iconbox * ib) state = STATE_CLICKED; IclassApply(ic, ib->scrollbar_win, -1, -1, 0, 0, state, 0); } - ic = FindItem("ICONBOX_SCROLLKNOB_HORIZONTAL", 0, LIST_FINDBY_NAME, LIST_TYPE_ICLASS); + ic = + FindItem("ICONBOX_SCROLLKNOB_HORIZONTAL", 0, LIST_FINDBY_NAME, + LIST_TYPE_ICLASS); if (ic) { int state = STATE_NORMAL; @@ -1750,7 +1835,9 @@ IB_DrawScroll(Iconbox * ib) state = STATE_CLICKED; IclassApply(ic, ib->scrollbarknob_win, -1, -1, 0, 0, state, 0); } - ic = FindItem("ICONBOX_ARROW_LEFT", 0, LIST_FINDBY_NAME, LIST_TYPE_ICLASS); + ic = + FindItem("ICONBOX_ARROW_LEFT", 0, LIST_FINDBY_NAME, + LIST_TYPE_ICLASS); if (ic) { int state = STATE_NORMAL; @@ -1761,7 +1848,9 @@ IB_DrawScroll(Iconbox * ib) state = STATE_CLICKED; IclassApply(ic, ib->arrow1_win, -1, -1, 0, 0, state, 0); } - ic = FindItem("ICONBOX_ARROW_RIGHT", 0, LIST_FINDBY_NAME, LIST_TYPE_ICLASS); + ic = + FindItem("ICONBOX_ARROW_RIGHT", 0, LIST_FINDBY_NAME, + LIST_TYPE_ICLASS); if (ic) { int state = STATE_NORMAL; @@ -1793,7 +1882,9 @@ IB_FixPos(Iconbox * ib) ImageClass *ic; int v = 0; - ic = FindItem("ICONBOX_SCROLLBAR_BASE_VERTICAL", 0, LIST_FINDBY_NAME, LIST_TYPE_ICLASS); + ic = + FindItem("ICONBOX_SCROLLBAR_BASE_VERTICAL", 0, LIST_FINDBY_NAME, + LIST_TYPE_ICLASS); v = ib->max - ib->h; if (ic) v += ic->padding.top + ic->padding.bottom; @@ -1805,7 +1896,9 @@ IB_FixPos(Iconbox * ib) ImageClass *ic; int v = 0; - ic = FindItem("ICONBOX_SCROLLBAR_BASE_HORIZONTAL", 0, LIST_FINDBY_NAME, LIST_TYPE_ICLASS); + ic = + FindItem("ICONBOX_SCROLLBAR_BASE_HORIZONTAL", 0, LIST_FINDBY_NAME, + LIST_TYPE_ICLASS); v = ib->max - ib->w; if (ic) v += ic->padding.left + ic->padding.right; @@ -1844,14 +1937,15 @@ RedrawIconbox(Iconbox * ib) h = ib->ewin->client.h; if (ib->orientation) { - ic = FindItem("ICONBOX_VERTICAL", 0, LIST_FINDBY_NAME, LIST_TYPE_ICLASS); + ic = + FindItem("ICONBOX_VERTICAL", 0, LIST_FINDBY_NAME, + LIST_TYPE_ICLASS); if (ic) add = ic->padding.top + ic->padding.bottom; if (ib->ewin->border) { if ((ib->ewin->border->border.top + - ib->ewin->border->border.bottom + add) > - root.h) + ib->ewin->border->border.bottom + add) > root.h) add = root.h - (ib->ewin->border->border.top + ib->ewin->border->border.bottom); } @@ -1863,8 +1957,7 @@ RedrawIconbox(Iconbox * ib) if (ib->ewin->border) { if ((ib->ewin->y + ib->ewin->border->border.top + - ib->ewin->border->border.bottom + add) > - root.h) + ib->ewin->border->border.bottom + add) > root.h) { x = ib->ewin->x; y = root.h - (ib->ewin->border->border.top + @@ -1876,14 +1969,15 @@ RedrawIconbox(Iconbox * ib) } else { - ic = FindItem("ICONBOX_HORIZONTAL", 0, LIST_FINDBY_NAME, LIST_TYPE_ICLASS); + ic = + FindItem("ICONBOX_HORIZONTAL", 0, LIST_FINDBY_NAME, + LIST_TYPE_ICLASS); if (ic) add = ic->padding.left + ic->padding.right; if (ib->ewin->border) { if ((ib->ewin->border->border.left + - ib->ewin->border->border.right + add) > - root.w) + ib->ewin->border->border.right + add) > root.w) add = root.w - (ib->ewin->border->border.left + ib->ewin->border->border.right); } @@ -1895,8 +1989,7 @@ RedrawIconbox(Iconbox * ib) if (ib->ewin->border) { if ((ib->ewin->x + ib->ewin->border->border.left + - ib->ewin->border->border.right + add) > - root.w) + ib->ewin->border->border.right + add) > root.w) { x = root.w - (ib->ewin->border->border.left + ib->ewin->border->border.right + add); @@ -1927,15 +2020,16 @@ RedrawIconbox(Iconbox * ib) IB_CalcMax(ib); if (ib->orientation) { - ic = FindItem("ICONBOX_VERTICAL", 0, LIST_FINDBY_NAME, LIST_TYPE_ICLASS); + ic = + FindItem("ICONBOX_VERTICAL", 0, LIST_FINDBY_NAME, + LIST_TYPE_ICLASS); if (ic) add = ic->padding.top + ic->padding.bottom; add += ib->max; if (ib->ewin->border) { if ((ib->ewin->border->border.top + - ib->ewin->border->border.bottom + add) > - root.h) + ib->ewin->border->border.bottom + add) > root.h) add = root.h - (ib->ewin->border->border.top + ib->ewin->border->border.bottom); } @@ -1947,8 +2041,7 @@ RedrawIconbox(Iconbox * ib) if (ib->ewin->border) { if ((ib->ewin->y + ib->ewin->border->border.top + - ib->ewin->border->border.bottom + add) > - root.h) + ib->ewin->border->border.bottom + add) > root.h) { x = ib->ewin->x; y = root.h - (ib->ewin->border->border.top + @@ -1960,15 +2053,16 @@ RedrawIconbox(Iconbox * ib) } else { - ic = FindItem("ICONBOX_HORIZONTAL", 0, LIST_FINDBY_NAME, LIST_TYPE_ICLASS); + ic = + FindItem("ICONBOX_HORIZONTAL", 0, LIST_FINDBY_NAME, + LIST_TYPE_ICLASS); if (ic) add = ic->padding.left + ic->padding.right; add += ib->max; if (ib->ewin->border) { if ((ib->ewin->border->border.left + - ib->ewin->border->border.right + add) > - root.w) + ib->ewin->border->border.right + add) > root.w) add = root.w - (ib->ewin->border->border.left + ib->ewin->border->border.right); } @@ -1980,8 +2074,7 @@ RedrawIconbox(Iconbox * ib) if (ib->ewin->border) { if ((ib->ewin->x + ib->ewin->border->border.left + - ib->ewin->border->border.right + add) > - root.w) + ib->ewin->border->border.right + add) > root.w) { x = root.w - (ib->ewin->border->border.left + ib->ewin->border->border.right + add); @@ -2023,22 +2116,20 @@ RedrawIconbox(Iconbox * ib) { /* right */ EMoveResizeWindow(disp, ib->icon_win, - 0, 0, - ib->w - ib->scroll_thickness, ib->h); - if ((ic = FindItem("ICONBOX_COVER_VERTICAL", 0, LIST_FINDBY_NAME, LIST_TYPE_ICLASS)) - && (!(ib->cover_hide))) + 0, 0, ib->w - ib->scroll_thickness, ib->h); + if ( + (ic = + FindItem("ICONBOX_COVER_VERTICAL", 0, LIST_FINDBY_NAME, + LIST_TYPE_ICLASS)) && (!(ib->cover_hide))) { EMoveResizeWindow(disp, ib->cover_win, - 0, 0, - ib->w - ib->scroll_thickness, ib->h); + 0, 0, ib->w - ib->scroll_thickness, ib->h); EMapWindow(disp, ib->cover_win); IclassApply(ic, ib->cover_win, -1, -1, 0, 0, STATE_NORMAL, 0); } else { - EMoveResizeWindow(disp, ib->cover_win, - -30000, -30000, - 2, 2); + EMoveResizeWindow(disp, ib->cover_win, -30000, -30000, 2, 2); EUnmapWindow(disp, ib->cover_win); } } @@ -2048,8 +2139,10 @@ RedrawIconbox(Iconbox * ib) EMoveResizeWindow(disp, ib->icon_win, ib->scroll_thickness, 0, ib->w - ib->scroll_thickness, ib->h); - if ((ic = FindItem("ICONBOX_COVER_VERTICAL", 0, LIST_FINDBY_NAME, LIST_TYPE_ICLASS)) - && (!(ib->cover_hide))) + if ( + (ic = + FindItem("ICONBOX_COVER_VERTICAL", 0, LIST_FINDBY_NAME, + LIST_TYPE_ICLASS)) && (!(ib->cover_hide))) { EMoveResizeWindow(disp, ib->cover_win, ib->scroll_thickness, 0, @@ -2059,14 +2152,13 @@ RedrawIconbox(Iconbox * ib) } else { - EMoveResizeWindow(disp, ib->cover_win, - -30000, -30000, - 2, 2); + EMoveResizeWindow(disp, ib->cover_win, -30000, -30000, 2, 2); EUnmapWindow(disp, ib->cover_win); } } - ic = FindItem("ICONBOX_VERTICAL", 0, LIST_FINDBY_NAME, LIST_TYPE_ICLASS); + ic = + FindItem("ICONBOX_VERTICAL", 0, LIST_FINDBY_NAME, LIST_TYPE_ICLASS); if (!ib->nobg) { if (ic) @@ -2074,10 +2166,12 @@ RedrawIconbox(Iconbox * ib) Pixmap pmap = 0, mask = 0; int iw, ih; - GetWinWH(ib->icon_win, (unsigned int *)&iw, (unsigned int *)&ih); + GetWinWH(ib->icon_win, (unsigned int *)&iw, + (unsigned int *)&ih); IclassApplyCopy(ic, ib->icon_win, iw, ih, 0, 0, STATE_NORMAL, &pmap, &mask); - EShapeCombineMask(disp, ib->icon_win, ShapeBounding, 0, 0, mask, ShapeSet); + EShapeCombineMask(disp, ib->icon_win, ShapeBounding, 0, 0, + mask, ShapeSet); PastePixmap(disp, ib->pmap, pmap, mask, 0, 0); Imlib_free_pixmap(id, pmap); Imlib_free_pixmap(id, mask); @@ -2120,20 +2214,24 @@ RedrawIconbox(Iconbox * ib) h = ewin->icon_pmap_h; if (ib->draw_icon_base) { - IB_PasteDefaultBase(ib->pmap, x, y, ib->iconsize, ib->iconsize); + IB_PasteDefaultBase(ib->pmap, x, y, ib->iconsize, + ib->iconsize); if (ib->nobg) - IB_PasteDefaultBaseMask(m, x, y, ib->iconsize, ib->iconsize); + IB_PasteDefaultBaseMask(m, x, y, ib->iconsize, + ib->iconsize); } if (ib->draw_icon_base) PastePixmap(disp, ib->pmap, ewin->icon_pmap, - ewin->icon_mask, x + ((ib->iconsize - w) / 2), y + ((ib->iconsize - h) / 2)); + ewin->icon_mask, x + ((ib->iconsize - w) / 2), + y + ((ib->iconsize - h) / 2)); else - PastePixmap(disp, ib->pmap, - ewin->icon_pmap, - ewin->icon_mask, x + ((ib->iconsize - w) / 2), y); + PastePixmap(disp, ib->pmap, ewin->icon_pmap, + ewin->icon_mask, x + ((ib->iconsize - w) / 2), + y); if (ib->nobg) - PasteMask(disp, m, ewin->icon_mask, x + ((ib->iconsize - w) / 2), y, w, h); + PasteMask(disp, m, ewin->icon_mask, + x + ((ib->iconsize - w) / 2), y, w, h); } if (ib->draw_icon_base) y += ib->iconsize; @@ -2150,22 +2248,20 @@ RedrawIconbox(Iconbox * ib) { /* bottom */ EMoveResizeWindow(disp, ib->icon_win, - 0, 0, - ib->w, ib->h - ib->scroll_thickness); - if ((ic = FindItem("ICONBOX_COVER_HORIZONTAL", 0, LIST_FINDBY_NAME, LIST_TYPE_ICLASS)) - && (!(ib->cover_hide))) + 0, 0, ib->w, ib->h - ib->scroll_thickness); + if ( + (ic = + FindItem("ICONBOX_COVER_HORIZONTAL", 0, LIST_FINDBY_NAME, + LIST_TYPE_ICLASS)) && (!(ib->cover_hide))) { EMoveResizeWindow(disp, ib->cover_win, - 0, 0, - ib->w, ib->h - ib->scroll_thickness); + 0, 0, ib->w, ib->h - ib->scroll_thickness); EMapWindow(disp, ib->cover_win); IclassApply(ic, ib->cover_win, -1, -1, 0, 0, STATE_NORMAL, 0); } else { - EMoveResizeWindow(disp, ib->cover_win, - -30000, -30000, - 2, 2); + EMoveResizeWindow(disp, ib->cover_win, -30000, -30000, 2, 2); EUnmapWindow(disp, ib->cover_win); } } @@ -2175,8 +2271,10 @@ RedrawIconbox(Iconbox * ib) EMoveResizeWindow(disp, ib->icon_win, 0, ib->scroll_thickness, ib->w, ib->h - ib->scroll_thickness); - if ((ic = FindItem("ICONBOX_COVER_HORIZONTAL", 0, LIST_FINDBY_NAME, LIST_TYPE_ICLASS)) - && (!(ib->cover_hide))) + if ( + (ic = + FindItem("ICONBOX_COVER_HORIZONTAL", 0, LIST_FINDBY_NAME, + LIST_TYPE_ICLASS)) && (!(ib->cover_hide))) { EMoveResizeWindow(disp, ib->cover_win, 0, ib->scroll_thickness, @@ -2186,14 +2284,14 @@ RedrawIconbox(Iconbox * ib) } else { - EMoveResizeWindow(disp, ib->cover_win, - -30000, -30000, - 2, 2); + EMoveResizeWindow(disp, ib->cover_win, -30000, -30000, 2, 2); EUnmapWindow(disp, ib->cover_win); } } - ic = FindItem("ICONBOX_HORIZONTAL", 0, LIST_FINDBY_NAME, LIST_TYPE_ICLASS); + ic = + FindItem("ICONBOX_HORIZONTAL", 0, LIST_FINDBY_NAME, + LIST_TYPE_ICLASS); if (!ib->nobg) { if (ic) @@ -2201,10 +2299,12 @@ RedrawIconbox(Iconbox * ib) Pixmap pmap = 0, mask = 0; int iw, ih; - GetWinWH(ib->icon_win, (unsigned int *)&iw, (unsigned int *)&ih); + GetWinWH(ib->icon_win, (unsigned int *)&iw, + (unsigned int *)&ih); IclassApplyCopy(ic, ib->icon_win, iw, ih, 0, 0, STATE_NORMAL, &pmap, &mask); - EShapeCombineMask(disp, ib->icon_win, ShapeBounding, 0, 0, mask, ShapeSet); + EShapeCombineMask(disp, ib->icon_win, ShapeBounding, 0, 0, + mask, ShapeSet); PastePixmap(disp, ib->pmap, pmap, mask, 0, 0); Imlib_free_pixmap(id, pmap); Imlib_free_pixmap(id, mask); @@ -2247,20 +2347,24 @@ RedrawIconbox(Iconbox * ib) h = ewin->icon_pmap_h; if (ib->draw_icon_base) { - IB_PasteDefaultBase(ib->pmap, x, y, ib->iconsize, ib->iconsize); + IB_PasteDefaultBase(ib->pmap, x, y, ib->iconsize, + ib->iconsize); if (ib->nobg) - IB_PasteDefaultBaseMask(m, x, y, ib->iconsize, ib->iconsize); + IB_PasteDefaultBaseMask(m, x, y, ib->iconsize, + ib->iconsize); } if (ib->draw_icon_base) PastePixmap(disp, ib->pmap, ewin->icon_pmap, - ewin->icon_mask, x + ((ib->iconsize - w) / 2), y + ((ib->iconsize - h) / 2)); + ewin->icon_mask, x + ((ib->iconsize - w) / 2), + y + ((ib->iconsize - h) / 2)); else - PastePixmap(disp, ib->pmap, - ewin->icon_pmap, - ewin->icon_mask, x, y + ((ib->iconsize - h) / 2)); + PastePixmap(disp, ib->pmap, ewin->icon_pmap, + ewin->icon_mask, x, + y + ((ib->iconsize - h) / 2)); if (ib->nobg) - PasteMask(disp, m, ewin->icon_mask, x, y + ((ib->iconsize - h) / 2), w, h); + PasteMask(disp, m, ewin->icon_mask, x, + y + ((ib->iconsize - h) / 2), w, h); } if (ib->draw_icon_base) x += ib->iconsize; @@ -2273,8 +2377,7 @@ RedrawIconbox(Iconbox * ib) EShapeCombineMask(disp, ib->icon_win, ShapeBounding, 0, 0, m, ShapeSet); EFreePixmap(disp, m); if (ib->num_icons == 0) - EMoveWindow(disp, ib->icon_win, - -ib->w, -ib->h); + EMoveWindow(disp, ib->icon_win, -ib->w, -ib->h); } ESetWindowBackgroundPixmap(disp, ib->icon_win, ib->pmap); XClearWindow(disp, ib->icon_win); @@ -2319,15 +2422,20 @@ IB_ShowMenu(Iconbox * ib, int x, int y) DestroyMenu(p_menu); p_menu = CreateMenu(); - AddTitleToMenu(p_menu, "Iconbox Options"); + AddTitleToMenu(p_menu, gettext("Iconbox Options")); p_menu->name = duplicate("__IBOX_MENU"); - p_menu->style = FindItem("DEFAULT", 0, LIST_FINDBY_NAME, LIST_TYPE_MENU_STYLE); + p_menu->style = + FindItem("DEFAULT", 0, LIST_FINDBY_NAME, LIST_TYPE_MENU_STYLE); Esnprintf(s, sizeof(s), "iconbox %s", ib->name); - mi = CreateMenuItem("This Iconbox Settings...", NULL, ACTION_CONFIG, s, NULL); + mi = + CreateMenuItem(gettext("This Iconbox Settings..."), NULL, ACTION_CONFIG, + s, NULL); AddItemToMenu(p_menu, mi); - mi = CreateMenuItem("Close Iconbox", NULL, ACTION_KILL, NULL, NULL); + mi = CreateMenuItem(gettext("Close Iconbox"), NULL, ACTION_KILL, NULL, NULL); AddItemToMenu(p_menu, mi); - mi = CreateMenuItem("Create New Iconbox", NULL, ACTION_CREATE_ICONBOX, NULL, NULL); + mi = + CreateMenuItem(gettext("Create New Iconbox"), NULL, ACTION_CREATE_ICONBOX, + NULL, NULL); AddItemToMenu(p_menu, mi); AddItem(p_menu, p_menu->name, 0, LIST_TYPE_MENU); Esnprintf(s, sizeof(s), "named %s", p_menu->name); @@ -2350,7 +2458,8 @@ IB_CompleteRedraw(Iconbox * ib) ImageClass *ic; int extra = 0; - ic = FindItem("ICONBOX_VERTICAL", 0, LIST_FINDBY_NAME, LIST_TYPE_ICLASS); + ic = + FindItem("ICONBOX_VERTICAL", 0, LIST_FINDBY_NAME, LIST_TYPE_ICLASS); if (ic) extra = ic->padding.left + ic->padding.right; ib->ewin->client.width.max = @@ -2363,7 +2472,9 @@ IB_CompleteRedraw(Iconbox * ib) ImageClass *ic; int extra = 0; - ic = FindItem("ICONBOX_HORIZONTAL", 0, LIST_FINDBY_NAME, LIST_TYPE_ICLASS); + ic = + FindItem("ICONBOX_HORIZONTAL", 0, LIST_FINDBY_NAME, + LIST_TYPE_ICLASS); if (ic) extra = ic->padding.left + ic->padding.right; ib->ewin->client.height.max = @@ -2439,7 +2550,8 @@ IconboxHandleEvent(XEvent * ev) ib[i]->scrollbox_clicked = 0; GetWinXY(ib[i]->scrollbar_win, &x, &y); - GetWinWH(ib[i]->scrollbar_win, (unsigned int *)&w, (unsigned int *)&h); + GetWinWH(ib[i]->scrollbar_win, (unsigned int *)&w, + (unsigned int *)&h); if (ev->xbutton.x < x) IB_Scroll(ib[i], -8); if (ev->xbutton.x > (x + w)) @@ -2479,7 +2591,9 @@ IconboxHandleEvent(XEvent * ev) if (ib[i]->orientation) { - ic = FindItem("ICONBOX_SCROLLBAR_BASE_VERTICAL", 0, LIST_FINDBY_NAME, LIST_TYPE_ICLASS); + ic = + FindItem("ICONBOX_SCROLLBAR_BASE_VERTICAL", 0, + LIST_FINDBY_NAME, LIST_TYPE_ICLASS); GetWinXY(ib[i]->scrollbar_win, &x, &y); bs = ib[i]->h - (ib[i]->arrow_thickness * 2); if (ic) @@ -2495,7 +2609,9 @@ IconboxHandleEvent(XEvent * ev) } else { - ic = FindItem("ICONBOX_SCROLLBAR_BASE_HORIZONTAL", 0, LIST_FINDBY_NAME, LIST_TYPE_ICLASS); + ic = + FindItem("ICONBOX_SCROLLBAR_BASE_HORIZONTAL", 0, + LIST_FINDBY_NAME, LIST_TYPE_ICLASS); GetWinXY(ib[i]->scrollbar_win, &x, &y); bs = ib[i]->w - (ib[i]->arrow_thickness * 2); if (ic) @@ -2574,7 +2690,8 @@ IconboxHandleEvent(XEvent * ev) } else { - ewin = IB_FindIcon(ib[i], ev->xcrossing.x, ev->xcrossing.y); + ewin = + IB_FindIcon(ib[i], ev->xcrossing.x, ev->xcrossing.y); mode.x = ev->xcrossing.x_root; mode.y = ev->xcrossing.y_root; } @@ -2638,7 +2755,9 @@ IconboxHandleEvent(XEvent * ev) LIST_TYPE_TOOLTIP); if (tt) HideToolTip(tt); - gwins = ListWinGroupMembersForEwin(ewin, ACTION_ICONIFY, mode.nogroup, &num); + gwins = + ListWinGroupMembersForEwin(ewin, ACTION_ICONIFY, + mode.nogroup, &num); iconified = ewin->iconified; if (gwins) diff --git a/src/init.c b/src/init.c index 4ef21f06..38e25037 100644 --- a/src/init.c +++ b/src/init.c @@ -177,18 +177,14 @@ SetupFallbackClasses(void) b->border.top = 8; b->border.bottom = 8; AddBorderPart(b, ic, ac, NULL, NULL, 1, FLAG_BUTTON, 0, 8, 99999, 8, 99999, - -1, 0, 0, 0, 0, - -1, 1024, -1, 0, 7, 1); + -1, 0, 0, 0, 0, -1, 1024, -1, 0, 7, 1); AddBorderPart(b, ic, ac, NULL, NULL, 1, FLAG_BUTTON, 0, 8, 99999, 8, 99999, - -1, 0, 0, 1024, -8, - -1, 1024, -1, 1024, -1, 1); + -1, 0, 0, 1024, -8, -1, 1024, -1, 1024, -1, 1); AddBorderPart(b, ic, ac, NULL, NULL, 1, FLAG_BUTTON, 0, 8, 99999, 8, 99999, - -1, 0, 0, 0, 8, - -1, 0, 7, 1024, -9, 1); + -1, 0, 0, 0, 8, -1, 0, 7, 1024, -9, 1); AddBorderPart(b, ic, ac, NULL, NULL, 1, FLAG_BUTTON, 0, 8, 99999, 8, 99999, - -1, 1024, -8, 0, 8, - -1, 1024, -1, 1024, -9, 1); + -1, 1024, -8, 0, 8, -1, 1024, -1, 1024, -9, 1); AddItem(b, b->name, 0, LIST_TYPE_BORDER); /* create a fallback background in case no background is found */ @@ -200,7 +196,8 @@ SetupFallbackClasses(void) tc = CreateTclass(); tc->name = "__FALLBACK_TCLASS"; tc->norm.normal = CreateTextState(); - tc->norm.normal->fontname = duplicate("-*-helvetica-medium-r-*-*-12-*-*-*-*-*-*-*"); + tc->norm.normal->fontname = + duplicate("-*-helvetica-medium-r-*-*-12-*-*-*-*-*-*-*"); tc->norm.normal->fg_col.r = 0; tc->norm.normal->fg_col.g = 0; tc->norm.normal->fg_col.b = 0; diff --git a/src/ipc.c b/src/ipc.c index 3b378590..76e3d657 100644 --- a/src/ipc.c +++ b/src/ipc.c @@ -116,486 +116,424 @@ void IPC_Group(char *params, Client * c); * --Mandrake */ -IPCStruct IPCArray[] = -{ +IPCStruct IPCArray[] = { { - IPC_Help, - "help", - "gives you this help screen", - "Additional parameters will retrieve help on many topics - " - "\"help \".\nuse \"help all\" for a list of commands." - }, + IPC_Help, + "help", + "gives you this help screen", + "Additional parameters will retrieve help on many topics - " + "\"help \".\nuse \"help all\" for a list of commands."}, { - IPC_Version, - "version", - "displays the current version of Enlightenment running", - NULL - }, + IPC_Version, + "version", + "displays the current version of Enlightenment running", + NULL}, { - IPC_Nop, - "nop", - "IPC No-operation - returns nop", - NULL - }, + IPC_Nop, + "nop", + "IPC No-operation - returns nop", + NULL}, { - IPC_Copyright, - "copyright", - "displays copyright information for Enlightenment", - NULL - }, + IPC_Copyright, + "copyright", + "displays copyright information for Enlightenment", + NULL}, { - IPC_AutoSave, - "autosave", - "toggle the Automatic Saving Feature", - "Use \"autosave ?\" to list the current status\n" - "use \"autosave on\" or \"autosave off\" to toggle the status" - }, + IPC_AutoSave, + "autosave", + "toggle the Automatic Saving Feature", + "Use \"autosave ?\" to list the current status\n" + "use \"autosave on\" or \"autosave off\" to toggle the status"}, { - IPC_DefaultTheme, - "default_theme", - "toggle the default theme", - "Use \"default_theme ?\" to get the current default theme\n" - "use \"default_theme /path/to/theme\"\n" - "you can retrieve a list of available themes from the " - "\"list_themes\" command" - }, + IPC_DefaultTheme, + "default_theme", + "toggle the default theme", + "Use \"default_theme ?\" to get the current default theme\n" + "use \"default_theme /path/to/theme\"\n" + "you can retrieve a list of available themes from the " + "\"list_themes\" command"}, { - IPC_Restart, - "restart", - "Restart Enlightenment", - NULL - }, + IPC_Restart, + "restart", + "Restart Enlightenment", + NULL}, { - IPC_RestartWM, - "restart_wm", - "Restart another window manager", - "Use \"restart_wm \" to start another window manager.\n" - "Example: \"restart_wm fvwm\"" - }, + IPC_RestartWM, + "restart_wm", + "Restart another window manager", + "Use \"restart_wm \" to start another window manager.\n" + "Example: \"restart_wm fvwm\""}, { - IPC_RestartTheme, - "restart_theme", - "Restart with another theme", - "Use \"restart_theme \" to restart enlightenment " - "with another theme\nExample: \"restart_theme icE\"" - }, + IPC_RestartTheme, + "restart_theme", + "Restart with another theme", + "Use \"restart_theme \" to restart enlightenment " + "with another theme\nExample: \"restart_theme icE\""}, { - IPC_Exit, - "exit", - "Exit Enlightenment", - NULL - }, + IPC_Exit, + "exit", + "Exit Enlightenment", + NULL}, { - IPC_ForceSave, - "save_config", - "Force Enlightenment to save settings now", - NULL - }, + IPC_ForceSave, + "save_config", + "Force Enlightenment to save settings now", + NULL}, { - IPC_SMFile, - "sm_file", - "Change the default prefix used for session saves", - "Average users are encouraged not to touch this setting.\n" - "Use \"sm_file ?\" to retrieve the current session management " - "file prefix\nUse \"sm_file /path/to/prefix/filenameprefix\" " - "to change." - }, + IPC_SMFile, + "sm_file", + "Change the default prefix used for session saves", + "Average users are encouraged not to touch this setting.\n" + "Use \"sm_file ?\" to retrieve the current session management " + "file prefix\nUse \"sm_file /path/to/prefix/filenameprefix\" " + "to change."}, { - IPC_ListThemes, - "list_themes", - "List currently available themes", - NULL - }, + IPC_ListThemes, + "list_themes", + "List currently available themes", + NULL}, { - IPC_GotoDesktop, - "goto_desktop", - "Change currently active destkop", - "Use \"goto_desktop num\" to go to a specific desktop.\n" - "Use \"goto_desktop next\" and \"goto_desktop prev\" to go to " - "the next and\n previous desktop\n" - "Use \"goto_desktop ?\" to find out what desktop you are " - "currently on" - }, + IPC_GotoDesktop, + "goto_desktop", + "Change currently active destkop", + "Use \"goto_desktop num\" to go to a specific desktop.\n" + "Use \"goto_desktop next\" and \"goto_desktop prev\" to go to " + "the next and\n previous desktop\n" + "Use \"goto_desktop ?\" to find out what desktop you are " "currently on"}, { - IPC_GotoArea, - "goto_area", - "Change currently active area", - "Use \"goto_area \" to go to a specific desktop.\n" - "Use \"goto_desktop next \" and \"goto_desktop " - "prev \" to go to the next and\n " - "previous areas\nUse \"goto_area ?\" to find out what area " - "you are currently on" - }, + IPC_GotoArea, + "goto_area", + "Change currently active area", + "Use \"goto_area \" to go to a specific desktop.\n" + "Use \"goto_desktop next \" and \"goto_desktop " + "prev \" to go to the next and\n " + "previous areas\nUse \"goto_area ?\" to find out what area " + "you are currently on"}, { - IPC_ShowIcons, - "show_icons", - "Toggle the display of icons on the desktop", - "Use \"show_icons on\" and \"show_icons off\" to change this setting\n" - "Use \"show_icons ?\" to retrieve the current setting" - }, + IPC_ShowIcons, + "show_icons", + "Toggle the display of icons on the desktop", + "Use \"show_icons on\" and \"show_icons off\" to change this setting\n" + "Use \"show_icons ?\" to retrieve the current setting"}, { - IPC_FocusMode, - "focus_mode", - "Change the current focus mode setting", - "Use \"focus_mode \" to change the focus mode.\n" - "Use \"focus_mode ?\" to retrieve the current setting\n" - "Focus Types:\n" - "click: This is the traditional click-to-focus mode.\n" - "clicknograb: This is a similar focus mode, but without the " - "grabbing of the click\n " - "(you cannot click anywhere in a window to focus it)\n" - "pointer: The focus will follow the mouse pointer\n" - "sloppy: in sloppy-focus, the focus follows the mouse, " - "but when over\n " - "the desktop background the last window does not lose the focus" - }, + IPC_FocusMode, + "focus_mode", + "Change the current focus mode setting", + "Use \"focus_mode \" to change the focus mode.\n" + "Use \"focus_mode ?\" to retrieve the current setting\n" + "Focus Types:\n" + "click: This is the traditional click-to-focus mode.\n" + "clicknograb: This is a similar focus mode, but without the " + "grabbing of the click\n " + "(you cannot click anywhere in a window to focus it)\n" + "pointer: The focus will follow the mouse pointer\n" + "sloppy: in sloppy-focus, the focus follows the mouse, " + "but when over\n " + "the desktop background the last window does not lose the focus"}, { - IPC_AdvancedFocus, - "advanced_focus", - "Toggle Advanced Focus Settings", - "use \"advanced_focus